Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Mar 11, 2021
2 parents 084887d + 32cbd19 commit 79b2f8659634708a85e3ab98fddbc642694b609d
Showing with 1,950 additions and 1,633 deletions.
  1. +0 −9 src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
  2. +0 −10 src/hotspot/cpu/arm/sharedRuntime_arm.cpp
  3. +0 −11 src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
  4. +0 −10 src/hotspot/cpu/s390/sharedRuntime_s390.cpp
  5. +0 −8 src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
  6. +0 −8 src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
  7. +1 −11 src/hotspot/cpu/zero/sharedRuntime_zero.cpp
  8. +1 −7 src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.cpp
  9. +1 −7 src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp
  10. +1 −7 src/hotspot/os_cpu/linux_arm/thread_linux_arm.cpp
  11. +1 −7 src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp
  12. +0 −6 src/hotspot/os_cpu/windows_aarch64/thread_windows_aarch64.cpp
  13. +1 −7 src/hotspot/os_cpu/windows_x86/thread_windows_x86.cpp
  14. +2 −0 src/hotspot/share/ci/ciEnv.cpp
  15. +6 −1 src/hotspot/share/ci/ciStreams.hpp
  16. +22 −15 src/hotspot/share/ci/ciTypeFlow.cpp
  17. +4 −2 src/hotspot/share/classfile/classFileStream.cpp
  18. +5 −0 src/hotspot/share/classfile/javaClasses.cpp
  19. +2 −0 src/hotspot/share/classfile/javaClasses.hpp
  20. +1 −4 src/hotspot/share/classfile/klassFactory.cpp
  21. +38 −30 src/hotspot/share/classfile/resolutionErrors.cpp
  22. +14 −8 src/hotspot/share/classfile/resolutionErrors.hpp
  23. +20 −15 src/hotspot/share/classfile/systemDictionary.cpp
  24. +3 −3 src/hotspot/share/classfile/systemDictionary.hpp
  25. +3 −2 src/hotspot/share/classfile/vmSymbols.hpp
  26. +4 −4 src/hotspot/share/include/cds.h
  27. +1 −41 src/hotspot/share/interpreter/abstractInterpreter.cpp
  28. +0 −6 src/hotspot/share/interpreter/abstractInterpreter.hpp
  29. +2 −2 src/hotspot/share/interpreter/interpreterRuntime.cpp
  30. +1 −2 src/hotspot/share/interpreter/templateInterpreterGenerator.cpp
  31. +1 −1 src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
  32. +1 −1 src/hotspot/share/jvmci/vmStructs_jvmci.cpp
  33. +11 −145 src/hotspot/share/memory/archiveBuilder.cpp
  34. +7 −22 src/hotspot/share/memory/archiveBuilder.hpp
  35. +6 −3 src/hotspot/share/memory/cppVtables.cpp
  36. +3 −2 src/hotspot/share/memory/cppVtables.hpp
  37. +2 −7 src/hotspot/share/memory/dumpAllocStats.cpp
  38. +7 −1 src/hotspot/share/memory/dumpAllocStats.hpp
  39. +2 −6 src/hotspot/share/memory/dynamicArchive.cpp
  40. +24 −14 src/hotspot/share/memory/filemap.cpp
  41. +5 −18 src/hotspot/share/memory/filemap.hpp
  42. +11 −40 src/hotspot/share/memory/metaspaceShared.cpp
  43. +5 −13 src/hotspot/share/memory/metaspaceShared.hpp
  44. +1 −11 src/hotspot/share/oops/constMethod.cpp
  45. +1 −29 src/hotspot/share/oops/constMethod.hpp
  46. +77 −35 src/hotspot/share/oops/constantPool.cpp
  47. +2 −10 src/hotspot/share/oops/constantPool.hpp
  48. +6 −4 src/hotspot/share/oops/cpCache.cpp
  49. +4 −4 src/hotspot/share/oops/instanceKlass.cpp
  50. +13 −114 src/hotspot/share/oops/method.cpp
  51. +3 −10 src/hotspot/share/oops/method.hpp
  52. +2 −2 src/hotspot/share/opto/compile.cpp
  53. +1 −1 src/hotspot/share/opto/compile.hpp
  54. +8 −2 src/hotspot/share/opto/parse2.cpp
  55. +2 −2 src/hotspot/share/prims/jni.cpp
  56. +16 −23 src/hotspot/share/prims/jvm.cpp
  57. +1 −1 src/hotspot/share/prims/jvmtiEnv.cpp
  58. +3 −4 src/hotspot/share/prims/jvmtiEnvBase.cpp
  59. +7 −10 src/hotspot/share/prims/unsafe.cpp
  60. +1 −1 src/hotspot/share/runtime/deoptimization.cpp
  61. +249 −294 src/hotspot/share/runtime/objectMonitor.cpp
  62. +23 −24 src/hotspot/share/runtime/objectMonitor.hpp
  63. +5 −5 src/hotspot/share/runtime/objectMonitor.inline.hpp
  64. +2 −27 src/hotspot/share/runtime/sharedRuntime.cpp
  65. +0 −3 src/hotspot/share/runtime/sharedRuntime.hpp
  66. +138 −144 src/hotspot/share/runtime/synchronizer.cpp
  67. +24 −24 src/hotspot/share/runtime/synchronizer.hpp
  68. +7 −13 src/hotspot/share/utilities/globalDefinitions.hpp
  69. +11 −13 src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java
  70. +8 −0 src/java.base/share/classes/java/lang/Class.java
  71. +2 −0 src/java.base/share/classes/java/lang/Module.java
  72. +14 −14 src/java.base/share/classes/java/lang/invoke/VarHandles.java
  73. +5 −2 src/java.base/share/classes/java/lang/reflect/Constructor.java
  74. +2 −1 src/java.base/share/classes/java/lang/reflect/Executable.java
  75. +3 −0 src/java.base/share/classes/java/lang/reflect/Field.java
  76. +43 −5 src/java.base/share/classes/java/lang/reflect/Method.java
  77. +2 −3 src/java.base/share/classes/java/net/HttpConnectSocketImpl.java
  78. +2 −3 src/java.base/share/classes/java/net/HttpCookie.java
  79. +3 −5 src/java.base/share/classes/java/net/Inet6Address.java
  80. +4 −11 src/java.base/share/classes/java/net/InterfaceAddress.java
  81. +3 −5 src/java.base/share/classes/java/net/NetMulticastSocket.java
  82. +2 −3 src/java.base/share/classes/java/net/NetworkInterface.java
  83. +1 −2 src/java.base/share/classes/java/net/ServerSocket.java
  84. +1 −2 src/java.base/share/classes/java/net/Socket.java
  85. +5 −13 src/java.base/share/classes/java/net/SocketPermission.java
  86. +2 −3 src/java.base/share/classes/java/net/SocksSocketImpl.java
  87. +2 −3 src/java.base/share/classes/java/net/URI.java
  88. +1 −2 src/java.base/share/classes/java/net/URL.java
  89. +2 −3 src/java.base/share/classes/java/net/URLClassLoader.java
  90. +3 −6 src/java.base/share/classes/java/net/URLPermission.java
  91. +2 −3 src/java.base/share/classes/java/net/UnixDomainSocketAddress.java
  92. +2 −3 src/java.base/share/classes/java/nio/StringCharBuffer.java
  93. +2 −3 src/java.base/share/classes/java/nio/channels/Channels.java
  94. +29 −21 src/java.base/share/classes/java/nio/file/Files.java
  95. +4 −2 src/java.base/share/classes/java/security/AccessControlException.java
  96. +5 −2 src/java.base/share/classes/java/security/AllPermission.java
  97. +15 −3 src/java.base/share/classes/java/security/BasicPermission.java
  98. +10 −3 src/java.base/share/classes/java/security/CodeSigner.java
  99. +8 −1 src/java.base/share/classes/java/security/CodeSource.java
  100. +16 −4 src/java.base/share/classes/java/security/GuardedObject.java
  101. +4 −1 src/java.base/share/classes/java/security/KeyPair.java
  102. +4 −1 src/java.base/share/classes/java/security/Permission.java
  103. +6 −2 src/java.base/share/classes/java/security/PermissionCollection.java
  104. +9 −5 src/java.base/share/classes/java/security/Permissions.java
  105. +14 −6 src/java.base/share/classes/java/security/PrivilegedActionException.java
  106. +3 −1 src/java.base/share/classes/java/security/Provider.java
  107. +3 −3 src/java.base/share/classes/java/security/SecureRandom.java
  108. +20 −10 src/java.base/share/classes/java/security/SignedObject.java
  109. +9 −2 src/java.base/share/classes/java/security/Timestamp.java
  110. +8 −1 src/java.base/share/classes/java/security/UnresolvedPermission.java
  111. +9 −5 src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java
  112. +3 −2 src/java.base/share/classes/java/security/cert/CertPath.java
  113. +8 −1 src/java.base/share/classes/java/security/cert/CertPathValidatorException.java
  114. +6 −3 src/java.base/share/classes/java/security/cert/Certificate.java
  115. +8 −1 src/java.base/share/classes/java/security/cert/CertificateRevokedException.java
  116. +7 −2 src/java.base/share/classes/java/util/Formatter.java
  117. +7 −0 src/java.base/share/classes/java/util/Random.java
  118. +5 −2 src/java.base/share/classes/javax/crypto/SealedObject.java
  119. +7 −2 src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java
  120. +18 −1 src/java.base/share/classes/javax/security/auth/Subject.java
  121. +9 −1 src/java.base/share/classes/javax/security/auth/x500/X500Principal.java
  122. +2 −2 src/java.desktop/share/classes/javax/swing/ComboBoxModel.java
  123. +2 −4 src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
  124. +8 −1 src/java.security.jgss/share/classes/javax/security/auth/kerberos/DelegationPermission.java
  125. +8 −1 src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java
  126. +8 −1 src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java
  127. +17 −5 src/java.security.jgss/share/classes/javax/security/auth/kerberos/KeyImpl.java
  128. +8 −1 src/java.security.jgss/share/classes/javax/security/auth/kerberos/ServicePermission.java
  129. +5 −1 src/java.xml.crypto/share/classes/javax/xml/crypto/URIReferenceException.java
  130. +14 −14 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java
  131. +1 −1 ...e/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
  132. +3 −1 src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java
  133. +10 −2 src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java
  134. +9 −1 src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java
  135. +1 −1 test/hotspot/gtest/oops/test_markWord.cpp
  136. +197 −5 test/hotspot/jtreg/compiler/c2/TestJumpTable.java
  137. +24 −0 test/hotspot/jtreg/runtime/DefineClass/A.java
  138. +124 −0 test/hotspot/jtreg/runtime/DefineClass/NullClassBytesTest.java
  139. +39 −0 test/hotspot/jtreg/runtime/DefineClass/libNullClassBytesTest.c
  140. +176 −0 test/hotspot/jtreg/runtime/ParallelLoad/SaveResolutionErrorTest.java
  141. +4 −5 test/hotspot/jtreg/runtime/cds/SpaceUtilizationCheck.java
  142. +0 −1 test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
  143. +26 −3 test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java
  144. +9 −9 test/hotspot/jtreg/runtime/cds/appcds/VerifierTest.java
  145. +2 −2 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
  146. +1 −1 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveRelocationTest.java
  147. +49 −0 test/jdk/java/util/Formatter/HexFloatZeroPadding.java
  148. +7 −62 test/jdk/sun/security/ssl/SSLLogger/LoggingFormatConsistency.java
@@ -240,15 +240,6 @@ bool SharedRuntime::is_wide_vector(int size) {
return size > 8;
}

size_t SharedRuntime::trampoline_size() {
return 16;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
__ mov(rscratch1, destination);
__ br(rscratch1);
}

// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -251,16 +251,6 @@ bool SharedRuntime::is_wide_vector(int size) {
return false;
}

size_t SharedRuntime::trampoline_size() {
return 16;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
InlinedAddress dest(destination);
__ indirect_jump(dest, Rtemp);
__ bind_literal(dest);
}

int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
VMRegPair *regs,
VMRegPair *regs2,
@@ -564,17 +564,6 @@ bool SharedRuntime::is_wide_vector(int size) {
return size > 8;
}

size_t SharedRuntime::trampoline_size() {
return Assembler::load_const_size + 8;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
Register Rtemp = R12;
__ load_const(Rtemp, destination);
__ mtctr(Rtemp);
__ bctr();
}

static int reg2slot(VMReg r) {
return r->reg2stack() + SharedRuntime::out_preserve_stack_slots();
}
@@ -556,16 +556,6 @@ void RegisterSaver::restore_result_registers(MacroAssembler* masm) {
}
}

size_t SharedRuntime::trampoline_size() {
return MacroAssembler::load_const_size() + 2;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
// Think about using pc-relative branch.
__ load_const(Z_R1_scratch, destination);
__ z_br(Z_R1_scratch);
}

// ---------------------------------------------------------------------------
void SharedRuntime::save_native_result(MacroAssembler * masm,
BasicType ret_type,
@@ -371,14 +371,6 @@ bool SharedRuntime::is_wide_vector(int size) {
return size > 16;
}

size_t SharedRuntime::trampoline_size() {
return 16;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
__ jump(RuntimeAddress(destination));
}

// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -423,14 +423,6 @@ bool SharedRuntime::is_wide_vector(int size) {
return size > 16;
}

size_t SharedRuntime::trampoline_size() {
return 16;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
__ jump(RuntimeAddress(destination));
}

// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -119,16 +119,6 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
return generate_empty_runtime_stub("resolve_blob");
}

size_t SharedRuntime::trampoline_size() {
ShouldNotCallThis();
return 0;
}

void SharedRuntime::generate_trampoline(MacroAssembler *masm, address destination) {
ShouldNotCallThis();
return;
}

int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
VMRegPair *regs,
VMRegPair *regs2,
@@ -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
@@ -67,12 +67,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(addr)) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

frame ret_frame(ret_sp, ret_fp, addr);
if (!ret_frame.safe_for_sender(this)) {
#if COMPILER2_OR_JVMCI
@@ -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) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -68,12 +68,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(addr)) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

frame ret_frame(ret_sp, ret_fp, addr);
if (!ret_frame.safe_for_sender(this)) {
#ifdef COMPILER2
@@ -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
@@ -101,12 +101,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(addr)) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

frame ret_frame(ret_sp, ret_fp, addr);
if (!ret_frame.safe_for_sender(this)) {
#ifdef COMPILER2
@@ -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
@@ -68,12 +68,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(addr)) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

frame ret_frame(ret_sp, ret_fp, addr);
if (!ret_frame.safe_for_sender(this)) {
#if COMPILER2_OR_JVMCI
@@ -69,12 +69,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(ret_frame.pc())) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

if (!ret_frame.safe_for_sender(jt)) {
#if COMPILER2_OR_JVMCI
// C2 and JVMCI use ebp as a general register see if NULL fp helps
@@ -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
@@ -64,12 +64,6 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
return false;
}

if (MetaspaceShared::is_in_trampoline_frame(ret_frame.pc())) {
// In the middle of a trampoline call. Bail out for safety.
// This happens rarely so shouldn't affect profiling.
return false;
}

if (!ret_frame.safe_for_sender(this)) {
#if COMPILER2_OR_JVMCI
// C2 and JVMCI use ebp as a general register see if NULL fp helps
@@ -658,6 +658,8 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
assert (constant->is_instance(), "must be an instance, or not? ");
return ciConstant(T_OBJECT, constant);
}
} else if (tag.is_unresolved_klass_in_error()) {
return ciConstant();
} else if (tag.is_klass() || tag.is_unresolved_klass()) {
// 4881222: allow ldc to take a class type
ciKlass* klass = get_klass_by_index_impl(cpool, index, ignore_will_link, accessor);
@@ -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
@@ -233,6 +233,11 @@ class ciBytecodeStream : StackObj {
return tag.is_unresolved_klass();
}

bool is_unresolved_klass_in_error() const {
constantTag tag = get_constant_pool_tag(get_klass_index());
return tag.is_unresolved_klass_in_error();
}

// If this bytecode is one of get_field, get_static, put_field,
// or put_static, get the referenced field.
ciField* get_field(bool& will_link);
@@ -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
@@ -721,23 +721,28 @@ void ciTypeFlow::StateVector::do_jsr(ciBytecodeStream* str) {
// ciTypeFlow::StateVector::do_ldc
void ciTypeFlow::StateVector::do_ldc(ciBytecodeStream* str) {
ciConstant con = str->get_constant();
BasicType basic_type = con.basic_type();
if (basic_type == T_ILLEGAL) {
// OutOfMemoryError in the CI while loading constant
push_null();
outer()->record_failure("ldc did not link");
return;
}
if (is_reference_type(basic_type)) {
ciObject* obj = con.as_object();
if (obj->is_null_object()) {
push_null();
if (con.is_valid()) {
BasicType basic_type = con.basic_type();
if (is_reference_type(basic_type)) {
ciObject* obj = con.as_object();
if (obj->is_null_object()) {
push_null();
} else {
assert(obj->is_instance() || obj->is_array(), "must be java_mirror of klass");
push_object(obj->klass());
}
} else {
assert(obj->is_instance() || obj->is_array(), "must be java_mirror of klass");
push_object(obj->klass());
push_translate(ciType::make(basic_type));
}
} else {
push_translate(ciType::make(basic_type));
if (str->is_unresolved_klass_in_error()) {
trap(str, NULL, Deoptimization::make_trap_request(Deoptimization::Reason_unhandled,
Deoptimization::Action_none));
} else {
// OutOfMemoryError in the CI while loading constant
push_null();
outer()->record_failure("ldc did not link");
}
}
}

@@ -2168,6 +2173,8 @@ bool ciTypeFlow::can_trap(ciBytecodeStream& str) {
case Bytecodes::_ldc:
case Bytecodes::_ldc_w:
case Bytecodes::_ldc2_w:
return str.is_unresolved_klass_in_error();

case Bytecodes::_aload_0:
// These bytecodes can trap for rewriting. We need to assume that
// they do not throw exceptions to make the monitor analysis work.
@@ -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
@@ -45,7 +45,9 @@ ClassFileStream::ClassFileStream(const u1* buffer,
_current(buffer),
_source(source),
_need_verify(verify_stream),
_from_boot_loader_modules_image(from_boot_loader_modules_image) {}
_from_boot_loader_modules_image(from_boot_loader_modules_image) {
assert(buffer != NULL, "caller should throw NPE");
}

const u1* ClassFileStream::clone_buffer() const {
u1* const new_buffer_start = NEW_RESOURCE_ARRAY(u1, length());
@@ -1958,13 +1958,15 @@ int java_lang_Throwable::_backtrace_offset;
int java_lang_Throwable::_detailMessage_offset;
int java_lang_Throwable::_stackTrace_offset;
int java_lang_Throwable::_depth_offset;
int java_lang_Throwable::_cause_offset;
int java_lang_Throwable::_static_unassigned_stacktrace_offset;

#define THROWABLE_FIELDS_DO(macro) \
macro(_backtrace_offset, k, "backtrace", object_signature, false); \
macro(_detailMessage_offset, k, "detailMessage", string_signature, false); \
macro(_stackTrace_offset, k, "stackTrace", java_lang_StackTraceElement_array, false); \
macro(_depth_offset, k, "depth", int_signature, false); \
macro(_cause_offset, k, "cause", throwable_signature, false); \
macro(_static_unassigned_stacktrace_offset, k, "UNASSIGNED_STACK", java_lang_StackTraceElement_array, true)

void java_lang_Throwable::compute_offsets() {
@@ -2005,6 +2007,9 @@ oop java_lang_Throwable::message(oop throwable) {
return throwable->obj_field(_detailMessage_offset);
}

oop java_lang_Throwable::cause(oop throwable) {
return throwable->obj_field(_cause_offset);
}

// Return Symbol for detailed_message or NULL
Symbol* java_lang_Throwable::detail_message(oop throwable) {
@@ -499,6 +499,7 @@ class java_lang_Throwable: AllStatic {
static int _detailMessage_offset;
static int _stackTrace_offset;
static int _depth_offset;
static int _cause_offset;
static int _static_unassigned_stacktrace_offset;

// StackTrace (programmatic access, new since 1.4)
@@ -516,6 +517,7 @@ class java_lang_Throwable: AllStatic {
static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); }
// Message
static oop message(oop throwable);
static oop cause(oop throwable);
static void set_message(oop throwable, oop value);
static Symbol* detail_message(oop throwable);
static void print_stack_element(outputStream *st, Method* method, int bci);
@@ -205,10 +205,7 @@ InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream,

const ClassInstanceInfo* cl_inst_info = cl_info.class_hidden_info_ptr();
InstanceKlass* result = parser.create_instance_klass(old_stream != stream, *cl_inst_info, CHECK_NULL);

if (result == NULL) {
return NULL;
}
assert(result != NULL, "result cannot be null with no pending exception");

if (cached_class_file != NULL) {
// JVMTI: we have an InstanceKlass now, tell it about the cached bytes

0 comments on commit 79b2f86

Please sign in to comment.