Mercurial > people > andrew > aarch32 > hotspot
changeset 9065:5caf41da4f93 jdk8u201-b09-aarch32-190124
Merge
author | snazarki |
---|---|
date | Thu, 24 Jan 2019 16:10:27 +0300 |
parents | 98bef46a57ce (current diff) 48947e4db9f3 (diff) |
children | a017d5a49871 |
files | .hgtags src/share/vm/classfile/verifier.cpp src/share/vm/runtime/sharedRuntime.cpp src/share/vm/utilities/copy.hpp |
diffstat | 27 files changed, 715 insertions(+), 85 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Oct 25 14:53:52 2018 +0300 +++ b/.hgtags Thu Jan 24 16:10:27 2019 +0300 @@ -1208,6 +1208,7 @@ 891d70e93fb068360713bdb562151f8f253d1b92 jdk8u181-b13-aarch32-180802 eed8e846c982d7474dd07fc873ba02f83ad1f847 jdk8u181-b13 21a3fffc43418f4d75c2091bf03478330b8a9a98 jdk8u191-b01 +2bf8498a25ec87c92584a6542f8724644c8c5706 jdk8u201-b00 5aa3d728164a674d08ad847811be6bdd853e9bf8 jdk8u191-b02 dd79b482625361458b2b34e7d669ee982eee06a4 jdk8u191-b03 541c205d7fd15ab840f48aaeeaea3f63209d1687 jdk8u191-b04 @@ -1220,6 +1221,8 @@ 055e1c867479452dd5d8c08905f7475aab25fcc1 jdk8u191-b25 12e4de4b2499e9d9a1ae4fb0b63ca277cca150f4 jdk8u191-b11 f38b47a322eb8b8b6aec7e26e567be56ccefb987 jdk8u191-b12-aarch32-181022 +4fc288749a236f6dd235336a46855a3133f83bde jdk8u191-b12 +ab9258f7206ea8745908e19de159888067939945 jdk8u191-b26 c19c5b73704e3d188bedfe52a473b408ca39009f jdk8u182-b00 0341fa6dbb363ee4dc5dbf5bfc4f820523400a72 jdk8u192-b00 5792d995ed26eec0417d96a2423446bbcd6951a9 jdk8u192-b01 @@ -1235,3 +1238,24 @@ 338c85978b2283a975b762eead2fccc6d25a2bc2 jdk8u192-b25 8df818c645d6081a387cf4fe9b9c14c0b5b639b1 jdk8u192-b11 8b4e37a274de75faaec4592d001e0b31c7937291 jdk8u192-b12-aarch32-181022 +1f822ff877d1a250165d5d2d52faf6957f8fcd00 jdk8u192-b12 +e0e4c3a86ef0e4daf4fe96bd058045a2b13ebf84 jdk8u192-b26 +f7bd3ef62b03503c2abd2c877103fce4c41752ec jdk8u181-b31 +a2be8e761961b9aea1641593f2638406c8052bff jdk8u181-b32 +9d9f4c81eb3df5991f4409429a8eed5da385e138 jdk8u181-b33 +2ac6a4ff7b3c9c45bda2a449523f7f1babffd857 jdk8u181-b34 +f3eb9719e6961890add8af56c43a3273bedd3510 jdk8u181-b35 +5418d85b93ea93af1b75a700501cab9e53e282c5 jdk8u181-b36 +310a8a03be9363e47cc0856e43661cf71b516101 jdk8u181-b37 +cec91c1510a4f6b54f454f8a18c2ce19e1ef4002 jdk8u201-b01 +242132d678006ccd4139c33c1a188f09a09683c6 jdk8u201-b02 +68ee3b18354df0572de37bc04c3a7a8046d5a654 jdk8u201-b03 +f85cae50e04085dd498cc573cea5f829a6ab8d95 jdk8u201-b04 +2b490d8df3575cc40caf7f9ab54df2ff82ca1d6f jdk8u201-b74 +4b17023e0a3a168bd527b3a4cf2ca58fb77c691a jdk8u201-b05 +3f6c3bf8f0b17113a8b7d39962fc04db9cef360e jdk8u201-b75 +6ee55134973590878c9c922bdf76be9f1ac76940 jdk8u201-b06 +f53cabbd1a91af46b61230315e54df42c353b181 jdk8u201-b76 +dee6a1ce4a0c526c47d71ef402d10e4b8915c5cb jdk8u201-b07 +e4daab85ac15ae3c51f14ed8fba888e54e4c6830 jdk8u201-b77 +e2c2448a1ca75333879e055655f11525decc2c39 jdk8u201-b08
--- a/THIRD_PARTY_README Thu Oct 25 14:53:52 2018 +0300 +++ b/THIRD_PARTY_README Thu Jan 24 16:10:27 2019 +0300 @@ -1668,13 +1668,13 @@ ------------------------------------------------------------------------------- -%% This notice is provided with respect to Little CMS 2.7, which may be +%% This notice is provided with respect to Little CMS 2.9, which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- Little CMS -Copyright (c) 1998-2015 Marti Maria Saguer +Copyright (c) 1998-2011 Marti Maria Saguer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
--- a/make/aix/makefiles/mapfile-vers-debug Thu Oct 25 14:53:52 2018 +0300 +++ b/make/aix/makefiles/mapfile-vers-debug Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # 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 @@ JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; JVM_ConstantPoolGetUTF8At; + JVM_CopySwapMemory; JVM_CountStackFrames; JVM_CurrentClassLoader; JVM_CurrentLoadedClass;
--- a/make/aix/makefiles/mapfile-vers-product Thu Oct 25 14:53:52 2018 +0300 +++ b/make/aix/makefiles/mapfile-vers-product Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # 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 @@ JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; JVM_ConstantPoolGetUTF8At; + JVM_CopySwapMemory; JVM_CountStackFrames; JVM_CurrentClassLoader; JVM_CurrentLoadedClass;
--- a/make/bsd/makefiles/mapfile-vers-debug Thu Oct 25 14:53:52 2018 +0300 +++ b/make/bsd/makefiles/mapfile-vers-debug Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -61,6 +61,7 @@ _JVM_ConstantPoolGetSize _JVM_ConstantPoolGetStringAt _JVM_ConstantPoolGetUTF8At + _JVM_CopySwapMemory _JVM_CountStackFrames _JVM_CurrentClassLoader _JVM_CurrentLoadedClass
--- a/make/bsd/makefiles/mapfile-vers-product Thu Oct 25 14:53:52 2018 +0300 +++ b/make/bsd/makefiles/mapfile-vers-product Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -61,6 +61,7 @@ _JVM_ConstantPoolGetSize _JVM_ConstantPoolGetStringAt _JVM_ConstantPoolGetUTF8At + _JVM_CopySwapMemory _JVM_CountStackFrames _JVM_CurrentClassLoader _JVM_CurrentLoadedClass
--- a/make/linux/makefiles/mapfile-vers-debug Thu Oct 25 14:53:52 2018 +0300 +++ b/make/linux/makefiles/mapfile-vers-debug Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # 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 @@ JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; JVM_ConstantPoolGetUTF8At; + JVM_CopySwapMemory; JVM_CountStackFrames; JVM_CurrentClassLoader; JVM_CurrentLoadedClass;
--- a/make/linux/makefiles/mapfile-vers-product Thu Oct 25 14:53:52 2018 +0300 +++ b/make/linux/makefiles/mapfile-vers-product Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. # 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 @@ JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; JVM_ConstantPoolGetUTF8At; + JVM_CopySwapMemory; JVM_CountStackFrames; JVM_CurrentClassLoader; JVM_CurrentLoadedClass;
--- a/make/solaris/makefiles/mapfile-vers Thu Oct 25 14:53:52 2018 +0300 +++ b/make/solaris/makefiles/mapfile-vers Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. # 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,6 +64,7 @@ JVM_ConstantPoolGetStringAt; JVM_ConstantPoolGetUTF8At; JVM_CountStackFrames; + JVM_CopySwapMemory; JVM_CurrentClassLoader; JVM_CurrentLoadedClass; JVM_CurrentThread;
--- a/src/share/vm/classfile/classFileParser.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/classfile/classFileParser.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -4210,9 +4210,6 @@ this_klass(), &all_mirandas, CHECK_(nullHandle)); } - // Update the loader_data graph. - record_defined_class_dependencies(this_klass, CHECK_NULL); - ClassLoadingService::notify_class_loaded(InstanceKlass::cast(this_klass()), false /* not shared class */); @@ -4498,30 +4495,6 @@ } } -// Attach super classes and interface classes to class loader data -void ClassFileParser::record_defined_class_dependencies(instanceKlassHandle defined_klass, TRAPS) { - ClassLoaderData * defining_loader_data = defined_klass->class_loader_data(); - if (defining_loader_data->is_the_null_class_loader_data()) { - // Dependencies to null class loader data are implicit. - return; - } else { - // add super class dependency - Klass* super = defined_klass->super(); - if (super != NULL) { - defining_loader_data->record_dependency(super, CHECK); - } - - // add super interface dependencies - Array<Klass*>* local_interfaces = defined_klass->local_interfaces(); - if (local_interfaces != NULL) { - int length = local_interfaces->length(); - for (int i = 0; i < length; i++) { - defining_loader_data->record_dependency(local_interfaces->at(i), CHECK); - } - } - } -} - // utility methods for appending an array with check for duplicates void append_interfaces(GrowableArray<Klass*>* result, Array<Klass*>* ifs) {
--- a/src/share/vm/classfile/dictionary.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/classfile/dictionary.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -159,33 +159,9 @@ if (!is_strongly_reachable(loader_data, e)) { // Entry was not visited in phase1 (negated test from phase1) assert(!loader_data->is_the_null_class_loader_data(), "unloading entry with null class loader"); - ClassLoaderData* k_def_class_loader_data = ik->class_loader_data(); - - // Do we need to delete this system dictionary entry? - bool purge_entry = false; // Do we need to delete this system dictionary entry? if (loader_data->is_unloading()) { - // If the loader is not live this entry should always be - // removed (will never be looked up again). - purge_entry = true; - } else { - // The loader in this entry is alive. If the klass is dead, - // (determined by checking the defining class loader) - // the loader must be an initiating loader (rather than the - // defining loader). Remove this entry. - if (k_def_class_loader_data->is_unloading()) { - // If we get here, the class_loader_data must not be the defining - // loader, it must be an initiating one. - assert(k_def_class_loader_data != loader_data, - "cannot have live defining loader and unreachable klass"); - // Loader is live, but class and its defining loader are dead. - // Remove the entry. The class is going away. - purge_entry = true; - } - } - - if (purge_entry) { *p = probe->next(); if (probe == _current_class_entry) { _current_class_entry = NULL;
--- a/src/share/vm/classfile/systemDictionary.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/classfile/systemDictionary.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -816,7 +816,16 @@ check_constraints(d_index, d_hash, k, class_loader, false, THREAD); // Need to check for a PENDING_EXCEPTION again; check_constraints - // can throw and doesn't use the CHECK macro. + // can throw but we may have to remove entry from the placeholder table below. + if (!HAS_PENDING_EXCEPTION) { + // Record dependency for non-parent delegation. + // This recording keeps the defining class loader of the klass (k) found + // from being unloaded while the initiating class loader is loaded + // even if the reference to the defining class loader is dropped + // before references to the initiating class loader. + loader_data->record_dependency(k(), THREAD); + } + if (!HAS_PENDING_EXCEPTION) { { // Grabbing the Compile_lock prevents systemDictionary updates // during compilations.
--- a/src/share/vm/classfile/verificationType.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/classfile/verificationType.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); KlassHandle this_class(THREAD, obj); - klass->class_loader_data()->record_dependency(obj, CHECK_false); if (this_class->is_interface() && (!from_field_is_protected || from.name() != vmSymbols::java_lang_Object())) { @@ -75,7 +74,6 @@ Klass* from_class = SystemDictionary::resolve_or_fail( from.name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); - klass->class_loader_data()->record_dependency(from_class, CHECK_false); bool result = InstanceKlass::cast(from_class)->is_subclass_of(this_class()); if (result && DumpSharedSpaces) { if (klass()->is_subclass_of(from_class) && klass()->is_subclass_of(this_class())) {
--- a/src/share/vm/classfile/verifier.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/classfile/verifier.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1952,11 +1952,9 @@ oop loader = current_class()->class_loader(); oop protection_domain = current_class()->protection_domain(); - Klass* kls = SystemDictionary::resolve_or_fail( + return SystemDictionary::resolve_or_fail( name, Handle(THREAD, loader), Handle(THREAD, protection_domain), true, CHECK_NULL); - current_class()->class_loader_data()->record_dependency(kls, CHECK_NULL); - return kls; } bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
--- a/src/share/vm/oops/constantPool.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/oops/constantPool.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -339,8 +339,6 @@ // Only updated constant pool - if it is resolved. do_resolve = this_oop->tag_at(which).is_unresolved_klass(); if (do_resolve) { - ClassLoaderData* this_key = this_oop->pool_holder()->class_loader_data(); - this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM this_oop->klass_at_put(which, k()); } }
--- a/src/share/vm/oops/cpCache.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/oops/cpCache.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,12 +209,22 @@ if (byte_no == 1) { assert(invoke_code != Bytecodes::_invokevirtual && invoke_code != Bytecodes::_invokeinterface, ""); + bool do_resolve = true; // Don't mark invokespecial to method as resolved if sender is an interface. The receiver // has to be checked that it is a subclass of the current class every time this bytecode // is executed. - if (invoke_code != Bytecodes::_invokespecial || !sender_is_interface || - method->name() == vmSymbols::object_initializer_name()) { - set_bytecode_1(invoke_code); + if (invoke_code == Bytecodes::_invokespecial && sender_is_interface && + method->name() != vmSymbols::object_initializer_name()) { + do_resolve = false; + } + // Don't mark invokestatic to method as resolved if the holder class has not yet completed + // initialization. An invokestatic must only proceed if the class is initialized, but if + // we resolve it before then that class initialization check is skipped. + if (invoke_code == Bytecodes::_invokestatic && !method->method_holder()->is_initialized()) { + do_resolve = false; + } + if (do_resolve) { + set_bytecode_1(invoke_code); } } else if (byte_no == 2) { if (change_to_virtual) {
--- a/src/share/vm/prims/jvm.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/prims/jvm.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -759,6 +759,79 @@ JVM_END +// java.nio.Bits /////////////////////////////////////////////////////////////// + +#define MAX_OBJECT_SIZE \ + ( arrayOopDesc::header_size(T_DOUBLE) * HeapWordSize \ + + ((julong)max_jint * sizeof(double)) ) + +static inline jlong field_offset_to_byte_offset(jlong field_offset) { + return field_offset; +} + +static inline void assert_field_offset_sane(oop p, jlong field_offset) { +#ifdef ASSERT + jlong byte_offset = field_offset_to_byte_offset(field_offset); + + if (p != NULL) { + assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset"); + if (byte_offset == (jint)byte_offset) { + void* ptr_plus_disp = (address)p + byte_offset; + assert((void*)p->obj_field_addr<oop>((jint)byte_offset) == ptr_plus_disp, + "raw [ptr+disp] must be consistent with oop::field_base"); + } + jlong p_size = HeapWordSize * (jlong)(p->size()); + assert(byte_offset < p_size, err_msg("Unsafe access: offset " INT64_FORMAT + " > object's size " INT64_FORMAT, + (int64_t)byte_offset, (int64_t)p_size)); + } +#endif +} + +static inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) { + assert_field_offset_sane(p, field_offset); + jlong byte_offset = field_offset_to_byte_offset(field_offset); + + if (sizeof(char*) == sizeof(jint)) { // (this constant folds!) + return (address)p + (jint) byte_offset; + } else { + return (address)p + byte_offset; + } +} + +// This function is a leaf since if the source and destination are both in native memory +// the copy may potentially be very large, and we don't want to disable GC if we can avoid it. +// If either source or destination (or both) are on the heap, the function will enter VM using +// JVM_ENTRY_FROM_LEAF +JVM_LEAF(void, JVM_CopySwapMemory(JNIEnv *env, jobject srcObj, jlong srcOffset, + jobject dstObj, jlong dstOffset, jlong size, + jlong elemSize)) { + + size_t sz = (size_t)size; + size_t esz = (size_t)elemSize; + + if (srcObj == NULL && dstObj == NULL) { + // Both src & dst are in native memory + address src = (address)srcOffset; + address dst = (address)dstOffset; + + Copy::conjoint_swap(src, dst, sz, esz); + } else { + // At least one of src/dst are on heap, transition to VM to access raw pointers + + JVM_ENTRY_FROM_LEAF(env, void, JVM_CopySwapMemory) { + oop srcp = JNIHandles::resolve(srcObj); + oop dstp = JNIHandles::resolve(dstObj); + + address src = (address)index_oop_from_field_offset_long(srcp, srcOffset); + address dst = (address)index_oop_from_field_offset_long(dstp, dstOffset); + + Copy::conjoint_swap(src, dst, sz, esz); + } JVM_END + } +} JVM_END + + // Misc. class handling /////////////////////////////////////////////////////////// @@ -991,12 +1064,6 @@ Handle h_prot (THREAD, protection_domain); jclass result = find_class_from_class_loader(env, h_name, init, h_loader, h_prot, true, thread); - if (result != NULL) { - oop mirror = JNIHandles::resolve_non_null(result); - Klass* to_class = java_lang_Class::as_Klass(mirror); - ClassLoaderData* cld = ClassLoaderData::class_loader_data(h_loader()); - cld->record_dependency(to_class, CHECK_NULL); - } if (TraceClassResolution && result != NULL) { // this function is generally only used for class loading during verification.
--- a/src/share/vm/prims/jvm.h Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/prims/jvm.h Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * 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,6 +145,14 @@ JVM_OnExit(void (*func)(void)); /* + * java.nio.Bits + */ +JNIEXPORT void JNICALL +JVM_CopySwapMemory(JNIEnv *env, jobject srcObj, jlong srcOffset, + jobject dstObj, jlong dstOffset, jlong size, + jlong elemSize); + +/* * java.lang.Runtime */ JNIEXPORT void JNICALL
--- a/src/share/vm/runtime/interfaceSupport.hpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/runtime/interfaceSupport.hpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -431,6 +431,14 @@ os::verify_stack_alignment(); \ /* begin of body */ +#define VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread) \ + TRACE_CALL(result_type, header) \ + debug_only(ResetNoHandleMark __rnhm;) \ + HandleMarkCleaner __hm(thread); \ + Thread* THREAD = thread; \ + os::verify_stack_alignment(); \ + /* begin of body */ + // ENTRY routines may lock, GC and throw exceptions @@ -592,6 +600,14 @@ VM_LEAF_BASE(result_type, header) +#define JVM_ENTRY_FROM_LEAF(env, result_type, header) \ + { { \ + JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ + ThreadInVMfromNative __tiv(thread); \ + debug_only(VMNativeEntryWrapper __vew;) \ + VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread) + + #define JVM_END } } #endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
--- a/src/share/vm/runtime/sharedRuntime.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/runtime/sharedRuntime.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1236,6 +1236,14 @@ } #endif + // Do not patch call site for static call when the class is not + // fully initialized. + if (invoke_code == Bytecodes::_invokestatic && + !callee_method->method_holder()->is_initialized()) { + assert(callee_method->method_holder()->is_linked(), "must be"); + return callee_method; + } + // JSR 292 key invariant: // If the resolved method is a MethodHandle invoke target, the call // site must be a MethodHandle call site, because the lambda form might tail-call
--- a/src/share/vm/utilities/copy.cpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/utilities/copy.cpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,175 @@ } } +class CopySwap : AllStatic { +public: + /** + * Copy and byte swap elements + * + * @param src address of source + * @param dst address of destination + * @param byte_count number of bytes to copy + * @param elem_size size of the elements to copy-swap + */ + static void conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size) { + assert(src != NULL, "address must not be NULL"); + assert(dst != NULL, "address must not be NULL"); + assert(elem_size == 2 || elem_size == 4 || elem_size == 8, + err_msg("incorrect element size: " SIZE_FORMAT, elem_size)); + assert(is_size_aligned(byte_count, elem_size), + err_msg("byte_count " SIZE_FORMAT " must be multiple of element size " SIZE_FORMAT, byte_count, elem_size)); + + address src_end = src + byte_count; + + if (dst <= src || dst >= src_end) { + do_conjoint_swap<RIGHT>(src, dst, byte_count, elem_size); + } else { + do_conjoint_swap<LEFT>(src, dst, byte_count, elem_size); + } + } + +private: + /** + * Byte swap a 16-bit value + */ + static uint16_t byte_swap(uint16_t x) { + return (x << 8) | (x >> 8); + } + + /** + * Byte swap a 32-bit value + */ + static uint32_t byte_swap(uint32_t x) { + uint16_t lo = (uint16_t)x; + uint16_t hi = (uint16_t)(x >> 16); + + return ((uint32_t)byte_swap(lo) << 16) | (uint32_t)byte_swap(hi); + } + + /** + * Byte swap a 64-bit value + */ + static uint64_t byte_swap(uint64_t x) { + uint32_t lo = (uint32_t)x; + uint32_t hi = (uint32_t)(x >> 32); + + return ((uint64_t)byte_swap(lo) << 32) | (uint64_t)byte_swap(hi); + } + + enum CopyDirection { + RIGHT, // lower -> higher address + LEFT // higher -> lower address + }; + + /** + * Copy and byte swap elements + * + * <T> - type of element to copy + * <D> - copy direction + * <is_src_aligned> - true if src argument is aligned to element size + * <is_dst_aligned> - true if dst argument is aligned to element size + * + * @param src address of source + * @param dst address of destination + * @param byte_count number of bytes to copy + */ + template <typename T, CopyDirection D, bool is_src_aligned, bool is_dst_aligned> + static void do_conjoint_swap(address src, address dst, size_t byte_count) { + address cur_src, cur_dst; + + switch (D) { + case RIGHT: + cur_src = src; + cur_dst = dst; + break; + case LEFT: + cur_src = src + byte_count - sizeof(T); + cur_dst = dst + byte_count - sizeof(T); + break; + } + + for (size_t i = 0; i < byte_count / sizeof(T); i++) { + T tmp; + + if (is_src_aligned) { + tmp = *(T*)cur_src; + } else { + memcpy(&tmp, cur_src, sizeof(T)); + } + + tmp = byte_swap(tmp); + + if (is_dst_aligned) { + *(T*)cur_dst = tmp; + } else { + memcpy(cur_dst, &tmp, sizeof(T)); + } + + switch (D) { + case RIGHT: + cur_src += sizeof(T); + cur_dst += sizeof(T); + break; + case LEFT: + cur_src -= sizeof(T); + cur_dst -= sizeof(T); + break; + } + } + } + + /** + * Copy and byte swap elements + * + * <T> - type of element to copy + * <D> - copy direction + * + * @param src address of source + * @param dst address of destination + * @param byte_count number of bytes to copy + */ + template <typename T, CopyDirection direction> + static void do_conjoint_swap(address src, address dst, size_t byte_count) { + if (is_ptr_aligned(src, sizeof(T))) { + if (is_ptr_aligned(dst, sizeof(T))) { + do_conjoint_swap<T,direction,true,true>(src, dst, byte_count); + } else { + do_conjoint_swap<T,direction,true,false>(src, dst, byte_count); + } + } else { + if (is_ptr_aligned(dst, sizeof(T))) { + do_conjoint_swap<T,direction,false,true>(src, dst, byte_count); + } else { + do_conjoint_swap<T,direction,false,false>(src, dst, byte_count); + } + } + } + + + /** + * Copy and byte swap elements + * + * <D> - copy direction + * + * @param src address of source + * @param dst address of destination + * @param byte_count number of bytes to copy + * @param elem_size size of the elements to copy-swap + */ + template <CopyDirection D> + static void do_conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size) { + switch (elem_size) { + case 2: do_conjoint_swap<uint16_t,D>(src, dst, byte_count); break; + case 4: do_conjoint_swap<uint32_t,D>(src, dst, byte_count); break; + case 8: do_conjoint_swap<uint64_t,D>(src, dst, byte_count); break; + default: guarantee(false, err_msg("do_conjoint_swap: Invalid elem_size %zd\n", elem_size)); + } + } +}; + +void Copy::conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size) { + CopySwap::conjoint_swap(src, dst, byte_count, elem_size); +} // Fill bytes; larger units are filled atomically if everything is aligned. void Copy::fill_to_memory_atomic(void* to, size_t size, jubyte value) {
--- a/src/share/vm/utilities/copy.hpp Thu Oct 25 14:53:52 2018 +0300 +++ b/src/share/vm/utilities/copy.hpp Thu Jan 24 16:10:27 2019 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -227,6 +227,16 @@ } } + /** + * Copy and *unconditionally* byte swap elements + * + * @param src address of source + * @param dst address of destination + * @param byte_count number of bytes to copy + * @param elem_size size of the elements to copy-swap + */ + static void conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size); + // Fill methods // Fill word-aligned words, not atomic on each word
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/ClassUnload/ConstantPoolDependsTest.java Thu Jan 24 16:10:27 2019 +0300 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 ConstantPoolDependsTest + * @bug 8210094 + * @summary Create ClassLoader dependency from initiating loader to class loader through constant pool reference + * @modules java.base/jdk.internal.misc + * java.compiler + * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary + * @build sun.hotspot.WhiteBox + * @compile p2/c2.java MyDiffClassLoader.java + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ConstantPoolDependsTest + */ + +import sun.hotspot.WhiteBox; + + +public class ConstantPoolDependsTest { + public static WhiteBox wb = WhiteBox.getWhiteBox(); + public static final String MY_TEST = "ConstantPoolDependsTest$c1c"; + + public static class c1c { + private void test() throws Exception { + // ConstantPool.klass_at_impl loads through constant pool and creates dependency + p2.c2 c2_obj = new p2.c2(); + c2_obj.method2(); + } + + public c1c () throws Exception { + test(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + test(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + } + } + + static void test() throws Throwable { + + // now use the same loader to load class MyTest + Class MyTest_class = new MyDiffClassLoader(MY_TEST).loadClass(MY_TEST); + + try { + // Call MyTest to load p2.c2 twice and call p2.c2.method2 + MyTest_class.newInstance(); + } catch (Exception e) { + throw new RuntimeException("Test FAILED if NoSuchMethodException is thrown"); + } + ClassUnloadCommon.triggerUnloading(); // should not unload anything + ClassUnloadCommon.failIf(!wb.isClassAlive(MY_TEST), "should not be unloaded"); + ClassUnloadCommon.failIf(!wb.isClassAlive("p2.c2"), "should not be unloaded"); + // Unless MyTest_class is referenced here, the compiler can unload it. + System.out.println("Should not unload anything before here because " + MyTest_class + " is still alive."); + } + + public static void main(String args[]) throws Throwable { + test(); + ClassUnloadCommon.triggerUnloading(); // should unload + System.gc(); + System.out.println("Should unload p2.c2 just now"); + ClassUnloadCommon.failIf(wb.isClassAlive(MY_TEST), "should be unloaded"); + ClassUnloadCommon.failIf(wb.isClassAlive("p2.c2"), "should be unloaded"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/ClassUnload/DictionaryDependsTest.java Thu Jan 24 16:10:27 2019 +0300 @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 DictionaryDependsTest + * @bug 8210094 + * @summary Create ClassLoader dependency from initiating loader to class loader through reflection + * @modules java.base/jdk.internal.misc + * java.compiler + * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary + * @build sun.hotspot.WhiteBox + * @compile p2/c2.java MyDiffClassLoader.java + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DictionaryDependsTest + */ +import sun.hotspot.WhiteBox; +import java.lang.reflect.Method; + +public class DictionaryDependsTest { + public static WhiteBox wb = WhiteBox.getWhiteBox(); + public static final String MY_TEST = "DictionaryDependsTest$c1r"; + + static public class c1r { + + private void test() throws Exception { + // forName loads through reflection and doesn't create dependency + Class<?> x = Class.forName("p2.c2", true, c1r.class.getClassLoader()); + Method m = x.getMethod("method2"); + java.lang.Object t = x.newInstance(); + m.invoke(t); + } + + public c1r () throws Exception { + test(); + ClassUnloadCommon.triggerUnloading(); // should unload p2.c2 + test(); + ClassUnloadCommon.triggerUnloading(); // should unload p2.c2 + } + } + + public void test() throws Throwable { + + // now use the same loader to load class MyTest + Class MyTest_class = new MyDiffClassLoader(MY_TEST).loadClass(MY_TEST); + + try { + // Call MyTest to load p2.c2 twice and call p2.c2.method2 + MyTest_class.newInstance(); + } catch (Exception e) { + System.out.println("Not expected NSME"); + throw new RuntimeException("Not expecting NSME"); + } + ClassUnloadCommon.triggerUnloading(); // should not unload anything + ClassUnloadCommon.failIf(!wb.isClassAlive(MY_TEST), "should not be unloaded"); + ClassUnloadCommon.failIf(!wb.isClassAlive("p2.c2"), "should not be unloaded"); + // Unless MyTest_class is referenced here, the compiler can unload it. + System.out.println("Should not unload anything before here because " + MyTest_class + " is still alive."); + } + + public static void main(String args[]) throws Throwable { + DictionaryDependsTest d = new DictionaryDependsTest(); + d.test(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + System.out.println("Should unload MyTest and p2.c2 just now"); + ClassUnloadCommon.failIf(wb.isClassAlive(MY_TEST), "should be unloaded"); + ClassUnloadCommon.failIf(wb.isClassAlive("p2.c2"), "should be unloaded"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/ClassUnload/MyDiffClassLoader.java Thu Jan 24 16:10:27 2019 +0300 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.*; +import com.oracle.java.testlibrary.InMemoryJavaCompiler; + +public class MyDiffClassLoader extends ClassLoader { + + public String loaderName; + public static boolean switchClassData = false; + + MyDiffClassLoader(String name) { + this.loaderName = name; + } + + public Class loadClass(String name) throws ClassNotFoundException { + if (!name.contains("c1r") && + !name.contains("c1c") && + !name.contains("c1s") && + !name.equals("p2.c2")) { + return super.loadClass(name); + } + + // new loader loads p2.c2 + if (name.equals("p2.c2") && !loaderName.equals("C2Loader")) { + Class<?> c = new MyDiffClassLoader("C2Loader").loadClass(name); + switchClassData = true; + return c; + } + + byte[] data = switchClassData ? getNewClassData(name) : getClassData(name); + System.out.println("name is " + name); + return defineClass(name, data, 0, data.length); + } + byte[] getClassData(String name) { + try { + String TempName = name.replaceAll("\\.", "/"); + String currentDir = System.getProperty("test.classes"); + String filename = currentDir + File.separator + TempName + ".class"; + FileInputStream fis = new FileInputStream(filename); + byte[] b = new byte[5000]; + int cnt = fis.read(b, 0, 5000); + byte[] c = new byte[cnt]; + for (int i=0; i<cnt; i++) c[i] = b[i]; + return c; + } catch (IOException e) { + return null; + } + } + + // Return p2.c2 with everything removed + byte[] getNewClassData(String name) { + return InMemoryJavaCompiler.compile("p2.c2", "package p2; public class c2 { }"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/ClassUnload/SuperDependsTest.java Thu Jan 24 16:10:27 2019 +0300 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 SuperDependsTest + * @bug 8210094 + * @summary Create ClassLoader dependency from initiating loader to class loader through subclassing + * @modules java.base/jdk.internal.misc + * java.compiler + * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary + * @build sun.hotspot.WhiteBox + * @compile p2/c2.java MyDiffClassLoader.java + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -Xmn8m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SuperDependsTest + */ +import sun.hotspot.WhiteBox; +import p2.*; + +public class SuperDependsTest { + public static WhiteBox wb = WhiteBox.getWhiteBox(); + public static final String MY_TEST = "SuperDependsTest$c1s"; + + + // p2.c2 loads through super class and creates dependency + public static class c1s extends p2.c2 { + + private void test() throws Exception { + method2(); + } + + public c1s () throws Exception { + test(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + test(); + } + } + + public void test() throws Throwable { + + // now use the same loader to load class MyTest + Class MyTest_class = new MyDiffClassLoader(MY_TEST).loadClass(MY_TEST); + + // Call MyTest to load p2.c2 twice and call p2.c2.method2 + MyTest_class.newInstance(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + ClassUnloadCommon.failIf(!wb.isClassAlive(MY_TEST), "should not be unloaded"); + ClassUnloadCommon.failIf(!wb.isClassAlive("p2.c2"), "should not be unloaded"); + // Unless MyTest_class is referenced here, the compiler can unload it. + System.out.println("Should not unload anything before here because " + MyTest_class + " is still alive."); + } + + public static void main(String args[]) throws Throwable { + SuperDependsTest d = new SuperDependsTest(); + d.test(); + ClassUnloadCommon.triggerUnloading(); // should not unload anything + System.out.println("Should unload MyTest and p2.c2 just now"); + ClassUnloadCommon.failIf(wb.isClassAlive(MY_TEST), "should be unloaded"); + ClassUnloadCommon.failIf(wb.isClassAlive("p2.c2"), "should be unloaded"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/ClassUnload/p2/c2.java Thu Jan 24 16:10:27 2019 +0300 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 p2; + +public class c2 { + int i; + public void method2() { i = 5; System.out.println("c2 method2 called"); } +}