Skip to content
Permalink
Browse files

Merge

  • Loading branch information
prsadhuk committed Feb 11, 2020
2 parents 0b3cf5e + a59e8a7 commit 5f44b6ca1bc3955a455b07dee7dcc8e7d0db09da
Showing with 3,465 additions and 1,104 deletions.
  1. +1 −0 .hgtags
  2. +1 −0 make/GenerateLinkOptData.gmk
  3. +38 −6 make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
  4. +8 −5 src/hotspot/cpu/x86/vm_version_x86.cpp
  5. +4 −1 src/hotspot/cpu/x86/vm_version_x86.hpp
  6. +22 −5 src/hotspot/os/bsd/osThread_bsd.cpp
  7. +2 −4 src/hotspot/os/bsd/osThread_bsd.hpp
  8. +14 −28 src/hotspot/os/bsd/os_bsd.cpp
  9. +21 −15 src/hotspot/share/ci/ciInstanceKlass.cpp
  10. +2 −4 src/hotspot/share/ci/ciInstanceKlass.hpp
  11. +164 −162 src/hotspot/share/classfile/classFileParser.cpp
  12. +36 −5 src/hotspot/share/classfile/classFileParser.hpp
  13. +780 −0 src/hotspot/share/classfile/fieldLayoutBuilder.cpp
  14. +267 −0 src/hotspot/share/classfile/fieldLayoutBuilder.hpp
  15. +3 −0 src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
  16. +43 −20 src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
  17. +6 −6 src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
  18. +2 −2 src/hotspot/share/jvmci/vmStructs_jvmci.cpp
  19. +2 −2 src/hotspot/share/oops/fieldStreams.hpp
  20. +4 −0 src/hotspot/share/oops/instanceKlass.cpp
  21. +42 −8 src/hotspot/share/oops/instanceKlass.hpp
  22. +1 −7 src/hotspot/share/oops/instanceOop.hpp
  23. +2 −0 src/hotspot/share/runtime/arguments.cpp
  24. +10 −10 src/hotspot/share/runtime/deoptimization.cpp
  25. +10 −2 src/hotspot/share/runtime/globals.hpp
  26. +1 −1 src/hotspot/share/runtime/vmStructs.cpp
  27. +2 −1 src/java.base/share/classes/java/lang/Module.java
  28. +41 −17 src/java.base/share/classes/java/lang/Record.java
  29. +2 −2 src/java.base/share/classes/java/lang/module/ResolvedModule.java
  30. +14 −0 src/java.base/share/classes/java/util/ImmutableCollections.java
  31. +67 −11 src/java.base/share/classes/java/util/regex/Pattern.java
  32. +19 −29 src/java.base/share/classes/jdk/internal/module/ArchivedModuleGraph.java
  33. +14 −9 src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
  34. +68 −41 src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
  35. +2 −1 src/java.base/share/classes/module-info.java
  36. +1 −1 src/java.base/share/legal/cldr.md
  37. +2 −1 src/java.base/unix/native/libjava/childproc.c
  38. +2 −2 src/java.base/unix/native/libjava/childproc.h
  39. +72 −32 src/java.naming/share/classes/javax/naming/spi/NamingManager.java
  40. +1 −3 src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyTab.java
  41. +25 −11 ...al.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
  42. +2 −2 src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
  43. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
  44. +1 −1 ...jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
  45. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
  46. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
  47. +27 −13 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
  48. +10 −10 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
  49. +19 −30 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java
  50. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
  51. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java
  52. +6 −6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
  53. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
  54. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java
  55. +9 −9 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
  56. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java
  57. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
  58. +12 −16 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java
  59. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java
  60. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/CommentUtils.java
  61. +15 −5 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java
  62. +0 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java
  63. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java
  64. +1 −1 ...dk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
  65. +3 −13 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java
  66. +10 −0 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java
  67. +3 −3 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ParamTaglet.java
  68. +2 −9 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/PropertyGetterTaglet.java
  69. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/PropertySetterTaglet.java
  70. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ReturnTaglet.java
  71. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SeeTaglet.java
  72. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SimpleTaglet.java
  73. +19 −20 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/Taglet.java
  74. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
  75. +23 −25 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ThrowsTaglet.java
  76. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java
  77. +87 −87 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/CommentHelper.java
  78. +2 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java
  79. +4 −4 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Group.java
  80. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/MetaKeywords.java
  81. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/StandardDocFileFactory.java
  82. +50 −89 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
  83. +9 −30 src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
  84. +17 −66 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java
  85. +1 −1 src/jdk.localedata/share/legal/cldr.md
  86. +1 −0 test/hotspot/jtreg/TEST.groups
  87. +3 −3 test/hotspot/jtreg/applications/ctw/modules/jdk_localedata.java
  88. +39 −0 test/hotspot/jtreg/applications/ctw/modules/jdk_localedata_2.java
  89. +16 −13 test/hotspot/jtreg/containers/docker/TestJFREvents.java
  90. +51 −0 test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java
  91. +91 −0 test/hotspot/jtreg/gc/shenandoah/compiler/FoldIfAfterExpansion.java
  92. +3 −1 test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
  93. +157 −0 test/hotspot/jtreg/runtime/FieldLayout/FieldDensityTest.java
  94. +5 −3 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
  95. +3 −0 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
  96. +2 −2 test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java
  97. +0 −3 test/jdk/ProblemList.txt
  98. +15 −5 test/jdk/com/sun/jdi/JdwpAttachTest.java
  99. +17 −6 test/jdk/com/sun/jdi/JdwpListenTest.java
  100. +231 −0 test/jdk/java/net/httpclient/ssltest/Cert.java
  101. +45 −35 test/jdk/java/net/httpclient/ssltest/CertificateTest.java
  102. +8 −26 test/jdk/java/net/httpclient/ssltest/Server.java
  103. BIN test/jdk/java/net/httpclient/ssltest/bad.keystore
  104. +53 −0 test/jdk/java/net/httpclient/ssltest/gen-certs.sh
  105. BIN test/jdk/java/net/httpclient/ssltest/good.keystore
  106. BIN test/jdk/java/net/httpclient/ssltest/loopback.keystore
  107. +7 −2 test/jdk/java/nio/channels/DatagramChannel/Loopback.java
  108. +81 −1 test/jdk/java/util/regex/RegExTest.java
  109. +139 −0 test/jdk/javax/naming/spi/DummyContextFactory.java
  110. +55 −0 test/jdk/javax/naming/spi/DummyContextFactory2.java
  111. +91 −0 test/jdk/javax/naming/spi/FactoryCacheTest.java
  112. +3 −19 test/jdk/tools/jlink/plugins/GenerateJLIClassesPluginTest.java
  113. +63 −12 test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java
  114. +100 −50 test/langtools/jdk/javadoc/tool/testLocaleOption/TestLocaleOption.java
  115. +10 −0 test/micro/org/openjdk/bench/java/util/ImmutableColls.java
@@ -618,3 +618,4 @@ a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34
c7d4f2849dbfb755fc5860b362a4044ea0c9e082 jdk-15+8
4a87bb7ebfd7f6a25ec59a5982fe3607242777f8 jdk-14+35
62b5bfef8d618e08e6f3a56cf1fb0e67e89e9cc2 jdk-15+9
bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14+36
@@ -75,6 +75,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
-Duser.language=en -Duser.country=US \
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist \
2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \
@@ -31,6 +31,9 @@
*/
package build.tools.classlist;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.net.InetAddress;
import java.nio.file.FileSystems;
import java.time.LocalDateTime;
@@ -55,19 +58,20 @@

private static final Logger LOGGER = Logger.getLogger("Hello");

public static void main(String ... args) {
public static void main(String ... args) throws Throwable {

FileSystems.getDefault();

List<String> strings = Arrays.asList("Hello", "World!", "From: ",
InetAddress.getLoopbackAddress().toString());
InetAddress.getLoopbackAddress().toString());

String helloWorld = strings.parallelStream()
.map(s -> s.toLowerCase(Locale.ROOT))
.collect(joining(","));
.map(s -> s.toLowerCase(Locale.ROOT))
.collect(joining(","));

Stream.of(helloWorld.split(","))
.forEach(System.out::println);
Stream.of(helloWorld.split("([,x-z]{1,3})([\\s]*)"))
.map(String::toString)
.forEach(System.out::println);

// Common concatenation patterns
String SS = String.valueOf(args.length) + String.valueOf(args.length);
@@ -83,6 +87,10 @@ public static void main(String ... args) {
String SCSCS = String.valueOf(args.length) + "string" + String.valueOf(args.length) + "string" + String.valueOf(args.length);
String CI = "string" + args.length;
String IC = args.length + "string";
String SI = String.valueOf(args.length) + args.length;
String IS = args.length + String.valueOf(args.length);
String CIS = "string" + args.length + String.valueOf(args.length);
String CSCI = "string" + String.valueOf(args.length) + "string" + args.length;
String CIC = "string" + args.length + "string";
String CICI = "string" + args.length + "string" + args.length;
String CJ = "string" + System.currentTimeMillis();
@@ -99,7 +107,31 @@ public static void main(String ... args) {
DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ROOT)
.format(new Date()));

// A selection of trivial and relatively common MH operations
invoke(MethodHandles.identity(double.class), 1.0);
invoke(MethodHandles.identity(int.class), 1);
invoke(MethodHandles.identity(String.class), "x");

invoke(handle("staticMethod_V", MethodType.methodType(void.class)));

LOGGER.log(Level.FINE, "New Date: " + newDate + " - old: " + oldDate);
}

public static void staticMethod_V() {}

private static MethodHandle handle(String name, MethodType type) throws Throwable {
return MethodHandles.lookup().findStatic(HelloClasslist.class, name, type);
}

private static Object invoke(MethodHandle mh, Object ... args) throws Throwable {
try {
for (Object o : args) {
mh = MethodHandles.insertArguments(mh, 0, o);
}
return mh.invoke();
} catch (Throwable t) {
LOGGER.warning("Failed to find, link and/or invoke " + mh.toString() + ": " + t.getMessage());
throw t;
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@@ -672,11 +672,14 @@ void VM_Version::get_processor_features() {
}
}
if (FLAG_IS_DEFAULT(UseAVX)) {
FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
if (is_intel_family_core() && _model == CPU_MODEL_SKYLAKE && _stepping < 5) {
FLAG_SET_DEFAULT(UseAVX, 2); //Set UseAVX=2 for Skylake
// Don't use AVX-512 on older Skylakes unless explicitly requested.
if (use_avx_limit > 2 && is_intel_skylake() && _stepping < 5) {
FLAG_SET_DEFAULT(UseAVX, 2);
} else {
FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
}
} else if (UseAVX > use_avx_limit) {
}
if (UseAVX > use_avx_limit) {
warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit);
FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
} else if (UseAVX < 0) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@@ -868,6 +868,9 @@ enum Extended_Family {
static bool is_intel_family_core() { return is_intel() &&
extended_cpu_family() == CPU_FAMILY_INTEL_CORE; }

static bool is_intel_skylake() { return is_intel_family_core() &&
extended_cpu_model() == CPU_MODEL_SKYLAKE; }

static bool is_intel_tsc_synched_at_init() {
if (is_intel_family_core()) {
uint32_t ext_model = extended_cpu_model();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -36,11 +36,12 @@ void OSThread::pd_initialize() {
#else
_thread_id = NULL;
#endif
_unique_thread_id = 0;
_pthread_id = NULL;
_siginfo = NULL;
_ucontext = NULL;
_expanding_stack = 0;
_alt_sig_stack = NULL;
_siginfo = NULL;
_ucontext = NULL;
_expanding_stack = 0;
_alt_sig_stack = NULL;

sigemptyset(&_caller_sigmask);

@@ -49,6 +50,22 @@ void OSThread::pd_initialize() {
assert(_startThread_lock !=NULL, "check");
}

// Additional thread_id used to correlate threads in SA
void OSThread::set_unique_thread_id() {
#ifdef __APPLE__
thread_identifier_info_data_t m_ident_info;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;

mach_port_t mach_thread_port = mach_thread_self();
guarantee(mach_thread_port != 0, "just checking");
thread_info(mach_thread_port, THREAD_IDENTIFIER_INFO,
(thread_info_t) &m_ident_info, &count);
mach_port_deallocate(mach_task_self(), mach_thread_port);

_unique_thread_id = m_ident_info.thread_id;
#endif
}

void OSThread::pd_destroy() {
delete _startThread_lock;
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -82,9 +82,7 @@
_pthread_id = tid;
}

void set_unique_thread_id(uint64_t id) {
_unique_thread_id = id;
}
void set_unique_thread_id();

// ***************************************************************
// suspension support.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -634,19 +634,6 @@ extern "C" objc_registerThreadWithCollector_t objc_registerThreadWithCollectorFu
objc_registerThreadWithCollector_t objc_registerThreadWithCollectorFunction = NULL;
#endif

#ifdef __APPLE__
static uint64_t locate_unique_thread_id(mach_port_t mach_thread_port) {
// Additional thread_id used to correlate threads in SA
thread_identifier_info_data_t m_ident_info;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;

thread_info(mach_thread_port, THREAD_IDENTIFIER_INFO,
(thread_info_t) &m_ident_info, &count);

return m_ident_info.thread_id;
}
#endif

// Thread start routine for all newly created threads
static void *thread_native_entry(Thread *thread) {

@@ -672,10 +659,10 @@ static void *thread_native_entry(Thread *thread) {
os::current_thread_id(), (uintx) pthread_self());

#ifdef __APPLE__
uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id());
guarantee(unique_thread_id != 0, "unique thread id was not found");
osthread->set_unique_thread_id(unique_thread_id);
// Store unique OS X thread id used by SA
osthread->set_unique_thread_id();
#endif

// initialize signal mask for this thread
os::Bsd::hotspot_sigmask(thread);

@@ -823,12 +810,12 @@ bool os::create_attached_thread(JavaThread* thread) {

osthread->set_thread_id(os::Bsd::gettid());

// Store pthread info into the OSThread
#ifdef __APPLE__
uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id());
guarantee(unique_thread_id != 0, "just checking");
osthread->set_unique_thread_id(unique_thread_id);
// Store unique OS X thread id used by SA
osthread->set_unique_thread_id();
#endif

// Store pthread info into the OSThread
osthread->set_pthread_id(::pthread_self());

// initialize floating point control register
@@ -1100,12 +1087,11 @@ void os::die() {
pid_t os::Bsd::gettid() {
int retval = -1;

#ifdef __APPLE__ //XNU kernel
// despite the fact mach port is actually not a thread id use it
// instead of syscall(SYS_thread_selfid) as it certainly fits to u4
retval = ::pthread_mach_thread_np(::pthread_self());
guarantee(retval != 0, "just checking");
return retval;
#ifdef __APPLE__ // XNU kernel
mach_port_t port = mach_thread_self();
guarantee(MACH_PORT_VALID(port), "just checking");
mach_port_deallocate(mach_task_self(), port);
return (pid_t)port;

#else
#ifdef __FreeBSD__
@@ -1128,7 +1114,7 @@ pid_t os::Bsd::gettid() {

intx os::current_thread_id() {
#ifdef __APPLE__
return (intx)::pthread_mach_thread_np(::pthread_self());
return (intx)os::Bsd::gettid();
#else
return (intx)::pthread_self();
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -213,14 +213,19 @@ ciInstanceKlass* ciInstanceKlass::get_canonical_holder(int offset) {
}

ciInstanceKlass* self = this;
for (;;) {
assert(self->is_loaded(), "must be loaded to have size");
ciInstanceKlass* super = self->super();
if (super == NULL || super->nof_nonstatic_fields() == 0 ||
!super->contains_field_offset(offset)) {
return self;
} else {
self = super; // return super->get_canonical_holder(offset)
assert(self->is_loaded(), "must be loaded to access field info");
ciField* field = self->get_field_by_offset(offset, false);
if (field != NULL) {
return field->holder();
} else {
for (;;) {
assert(self->is_loaded(), "must be loaded to have size");
ciInstanceKlass* super = self->super();
if (super == NULL || super->nof_nonstatic_fields() == 0) {
return self;
} else {
self = super; // return super->get_canonical_holder(offset)
}
}
}
}
@@ -391,6 +396,13 @@ bool ciInstanceKlass::has_finalizable_subclass() {
return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL;
}

// ------------------------------------------------------------------
// ciInstanceKlass::contains_field_offset
bool ciInstanceKlass::contains_field_offset(int offset) {
VM_ENTRY_MARK;
return get_instanceKlass()->contains_field_offset(offset);
}

// ------------------------------------------------------------------
// ciInstanceKlass::get_field_by_offset
ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) {
@@ -457,15 +469,9 @@ int ciInstanceKlass::compute_nonstatic_fields() {
ciInstanceKlass* super = this->super();
GrowableArray<ciField*>* super_fields = NULL;
if (super != NULL && super->has_nonstatic_fields()) {
int super_fsize = super->nonstatic_field_size() * heapOopSize;
int super_flen = super->nof_nonstatic_fields();
super_fields = super->_nonstatic_fields;
assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");
// See if I am no larger than my super; if so, I can use his fields.
if (fsize == super_fsize) {
_nonstatic_fields = super_fields;
return super_fields->length();
}
}

GrowableArray<ciField*>* fields = NULL;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -225,9 +225,7 @@ class ciInstanceKlass : public ciKlass {
ciInstanceKlass* unique_concrete_subklass();
bool has_finalizable_subclass();

bool contains_field_offset(int offset) {
return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
}
bool contains_field_offset(int offset);

// Get the instance of java.lang.Class corresponding to
// this klass. This instance is used for locking of

0 comments on commit 5f44b6c

Please sign in to comment.