diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 519f598b86e..fe5540a5d8e 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -267,3 +267,4 @@ ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24 +aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25 diff --git a/corba/.hgtags b/corba/.hgtags index 25bbe5d05c0..80f38489230 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -267,3 +267,4 @@ eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19 ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22 57735d66face054440a63ce99789eac5a5ee1dfd jdk9-b23 8a44142bb7fc8118f70f91a1b97c12dfc50563ee jdk9-b24 +da08cca6b97f41b7081a3e176dcb400af6e4bb26 jdk9-b25 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 63e06453ec9..a39d162f8d8 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -427,3 +427,4 @@ c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20 518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24 +6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java index c3f7b8cb88b..3fe93b7fc6b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java @@ -55,7 +55,10 @@ public class Klass extends Metadata implements ClassConstants { layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0); name = type.getAddressField("_name"); accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); - traceIDField = type.getField("_trace_id"); + try { + traceIDField = type.getField("_trace_id"); + } catch(Exception e) { + } subklass = new MetadataField(type.getAddressField("_subklass"), 0); nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0); @@ -108,7 +111,11 @@ public class Klass extends Metadata implements ClassConstants { public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); } public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); } public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); } - public long traceID() { return traceIDField.getJLong(addr); } + + public long traceID() { + if (traceIDField == null) return 0; + return traceIDField.getJLong(addr); + } // computed access flags - takes care of inner classes etc. // This is closer to actual source level than getAccessFlags() etc. diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index 22c7b05ad6d..a6ff452c2ce 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -126,7 +126,7 @@ jprt.my.solaris.sparcv9.test.targets= \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.solaris.sparcv9}-product-c2-runThese, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese8, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ @@ -150,8 +150,9 @@ jprt.my.solaris.x64.test.targets= \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.solaris.x64}-product-c2-runThese, \ - ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.solaris.x64}-product-c2-runThese8, \ + ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_lang, \ + ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_vm, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ @@ -175,9 +176,11 @@ jprt.my.linux.i586.test.targets = \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \ - ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \ - ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \ + ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_lang, \ + ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_vm, \ + ${jprt.my.linux.i586}-fastdebug-c1-runThese8_Xshare, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_lang, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_vm, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ @@ -243,9 +246,10 @@ jprt.my.windows.i586.test.targets = \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ ${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \ - ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \ - ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_lang, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_vm, \ + ${jprt.my.windows.i586}-fastdebug-c1-runThese8_Xshare, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ @@ -269,8 +273,9 @@ jprt.my.windows.x64.test.targets = \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.windows.x64}-product-c2-runThese, \ - ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.windows.x64}-product-c2-runThese8, \ + ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_lang, \ + ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_vm, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index ff177e6231a..496197e9290 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -36,7 +36,6 @@ #include "runtime/signature.hpp" #include "runtime/stubCodeGenerator.hpp" #include "runtime/stubRoutines.hpp" -#include "vmreg_ppc.inline.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #include "runtime/vframeArray.hpp" @@ -155,15 +154,6 @@ void frame::patch_pc(Thread* thread, address pc) { } } -void frame::pd_gc_epilog() { - if (is_interpreted_frame()) { - // Set constant pool cache entry for interpreter. - Method* m = interpreter_frame_method(); - - *interpreter_frame_cpoolcache_addr() = m->constants()->cache(); - } -} - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // Is there anything to do? assert(is_interpreted_frame(), "Not an interpreted frame"); diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 6186906a860..457b9cb59d9 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for ppc64 frames: @@ -134,12 +135,12 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**)&istate->_locals; } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*)&istate->_bcp; } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*)&istate->_mdx; } @@ -209,10 +210,10 @@ inline frame::ijava_state* frame::get_ijava_state() const { inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) &(get_ijava_state()->locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) &(get_ijava_state()->bcp); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { return (intptr_t*) &(get_ijava_state()->mdx); } // Pointer beyond the "oldest/deepest" BasicObjectLock on stack. diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp index 20b11455bf6..641841b9463 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp @@ -68,7 +68,6 @@ int ICache::ppc64_flush_icache(address start, int lines, int magic) { } void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) { - StubCodeMark mark(this, "ICache", "flush_icache_stub"); *flush_icache_stub = (ICache::flush_icache_stub_t)ICache::ppc64_flush_icache; diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp index 144ef50bfa8..da98715a102 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #ifndef CPU_PPC_VM_INTERPRETERRT_PPC_HPP #define CPU_PPC_VM_INTERPRETERRT_PPC_HPP +#include "asm/macroAssembler.hpp" #include "memory/allocation.hpp" // native method calls diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index a35b1ebb7a1..96814188f03 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index ce10145ed90..4366af19626 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -32,6 +32,7 @@ #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 9087959fe1e..18870359ad9 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -267,7 +267,7 @@ register %{ // It's worth about 1% on SPEC geomean to get this right. // Chunk0, chunk1, and chunk2 form the MachRegisterNumbers enumeration -// in adGlobals_ppc64.hpp which defines the _num values, e.g. +// in adGlobals_ppc.hpp which defines the _num values, e.g. // R3_num. Therefore, R3_num may not be (and in reality is not) // the same as R3->encoding()! Furthermore, we cannot make any // assumptions on ordering, e.g. R3_num may be less than R2_num. @@ -1632,7 +1632,7 @@ enum RC { rc_bad, rc_int, rc_float, rc_stack }; static enum RC rc_class(OptoReg::Name reg) { // Return the register class for the given register. The given register // reg is a _num value, which is an index into the MachRegisterNumbers - // enumeration in adGlobals_ppc64.hpp. + // enumeration in adGlobals_ppc.hpp. if (reg == OptoReg::Bad) return rc_bad; diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 107c5bab8b8..9dc765ab4a2 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define CPU_PPC_VM_REGISTER_PPC_HPP #include "asm/register.hpp" -#include "vm_version_ppc.hpp" // forward declaration class Address; @@ -92,8 +91,8 @@ class RegisterImpl: public AbstractRegisterImpl { inline friend Register as_Register(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); Register successor() const { return as_Register(encoding() + 1); } // testers @@ -208,8 +207,8 @@ class ConditionRegisterImpl: public AbstractRegisterImpl { inline friend ConditionRegister as_ConditionRegister(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); // testers bool is_valid() const { return (0 <= value() && value() < number_of_registers); } @@ -264,7 +263,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // testers @@ -365,7 +364,7 @@ class SpecialRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); // testers bool is_valid() const { return 0 <= value() && value() < number_of_registers; } diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index 0e5898381c2..404df938777 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "classfile/systemDictionary.hpp" #include "code/vmreg.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "nativeInst_ppc.hpp" #include "opto/runtime.hpp" #include "runtime/interfaceSupport.hpp" @@ -37,7 +38,6 @@ #include "runtime/stubRoutines.hpp" #include "runtime/vframeArray.hpp" #include "utilities/globalDefinitions.hpp" -#include "vmreg_ppc.inline.hpp" #endif #define __ masm-> diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 15a5812e881..68dda7d3e2b 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,16 +29,17 @@ #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "oops/compiledICHolder.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/vframeArray.hpp" #include "vmreg_ppc.inline.hpp" -#include "adfiles/ad_ppc_64.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif #ifdef COMPILER2 +#include "adfiles/ad_ppc_64.hpp" #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index d452b27038c..290a4be01b0 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -401,11 +401,11 @@ class StubGenerator: public StubCodeGenerator { __ load_const(exception_file, (void*)__FILE__); __ load_const(exception_line, (void*)__LINE__); - __ std(R3_ARG1, thread_(pending_exception)); + __ std(R3_ARG1, in_bytes(JavaThread::pending_exception_offset()), R16_thread); // store into `char *' - __ std(exception_file, thread_(exception_file)); + __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread); // store into `int' - __ stw(exception_line, thread_(exception_line)); + __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread); // complete return to VM assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before"); @@ -524,8 +524,6 @@ class StubGenerator: public StubCodeGenerator { int frame_size_in_bytes = frame::abi_reg_args_size; OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); - StubCodeMark mark(this, "StubRoutines", "throw_exception"); - address start = __ pc(); __ save_LR_CR(R11_scratch1); @@ -846,8 +844,6 @@ class StubGenerator: public StubCodeGenerator { // // Don't generate, rather use C++ code. address generate_verify_oop() { - StubCodeMark mark(this, "StubRoutines", "verify_oop"); - // this is actually a `FunctionDescriptor*'. address start = 0; diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 8a9fae04770..b787fecc7d5 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 367e8fef7d7..0b375da582e 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -27,6 +27,7 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp index 92c4d088de8..4fe7bdb62e1 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp @@ -26,10 +26,28 @@ #ifndef CPU_PPC_VM_VMREG_PPC_HPP #define CPU_PPC_VM_VMREG_PPC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { + return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; +} - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; +} + +inline Register as_Register() { + assert(is_Register() && is_even(value()), "even-aligned GPR name"); + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert(is_FloatRegister() && is_even(value()), "must be"); + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + return is_even(value()); +} #endif // CPU_PPC_VM_VMREG_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp index d097c5bc5cb..16e5e5d8fd7 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp @@ -44,28 +44,5 @@ inline VMReg SpecialRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding()) + ConcreteRegisterImpl::max_cnd); } -inline bool VMRegImpl::is_Register() { - return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; -} - -inline Register VMRegImpl::as_Register() { - assert(is_Register() && is_even(value()), "even-aligned GPR name"); - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert(is_FloatRegister() && is_even(value()), "must be"); - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - return is_even(value()); -} #endif // CPU_PPC_VM_VMREG_PPC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 1eeca870804..9f9fc75bd1b 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ #include "oops/compiledICHolder.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" -#include "register_sparc.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/vframeArray.hpp" diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 17b4d9e05ac..2b3bd2dc108 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" @@ -593,17 +594,6 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { return this->fp() == fp; } - -void frame::pd_gc_epilog() { - if (is_interpreted_frame()) { - // set constant pool cache entry for interpreter - Method* m = interpreter_frame_method(); - - *interpreter_frame_cpoolcache_addr() = m->constants()->cache(); - } -} - - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { #ifdef CC_INTERP // Is there anything to do? @@ -641,10 +631,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { return false; } - // validate bci/bcx + // validate bci/bcp - intptr_t bcx = interpreter_frame_bcx(); - if (m->validate_bci_from_bcx(bcx) < 0) { + address bcp = interpreter_frame_bcp(); + if (m->validate_bci_from_bcp(bcp) < 0) { return false; } diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp index 51a014872d5..5c0c7492509 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,6 @@ // Lesp first free element of expression stack // (which grows towards __higher__ addresses) // Lbcp is set to address of bytecode to execute -// It is accessed in the frame under the name "bcx". // It may at times (during GC) be an index instead. // Lmethod the method being interpreted // Llocals the base pointer for accessing the locals array diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 8aa0105bf0d..72346c6ded6 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP #include "asm/macroAssembler.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for SPARC frames: @@ -98,12 +99,12 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) &istate->_locals; } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*) &istate->_bcp; } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*) &istate->_mdx; } @@ -165,12 +166,11 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) sp_addr_at( Llocals->sp_offset_in_saved_window()); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - // %%%%% reinterpreting Lbcp as a bcx +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) sp_addr_at( Lbcp->sp_offset_in_saved_window()); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { // %%%%% reinterpreting ImethodDataPtr as a mdx return (intptr_t*) sp_addr_at( ImethodDataPtr->sp_offset_in_saved_window()); } diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp index 41bdd88f7f5..8cbe422a4af 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 132c5292a06..debdaeae7a4 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index e43d77665ac..79ca56aecd3 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "asm/assembler.inline.hpp" +#include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index f03dc8e5e72..5fc0dd0632c 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,8 +186,7 @@ REGISTER_DECLARATION(Register, ImethodDataPtr , I2); // Pointer to the current // the interpreter to work right // (These assignments must be compatible with L7_thread_cache; see above.) -// Since Lbcp points into the middle of the method object, -// it is temporarily converted into a "bcx" during GC. +// Lbcp points into the middle of the method object. // Exception processing // These registers are passed into exception handlers. diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index af2e4e1e96c..4cd5b2a93c3 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 7d0096ccf59..22cb0283825 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define CPU_SPARC_VM_REGISTER_SPARC_HPP #include "asm/register.hpp" -#include "vm_version_sparc.hpp" // forward declaration class Address; @@ -65,7 +64,7 @@ class RegisterImpl: public AbstractRegisterImpl { friend Register as_oRegister(int number); friend Register as_gRegister(int number); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } @@ -234,7 +233,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { }; // construction - VMReg as_VMReg( ); + inline VMReg as_VMReg( ); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index ca1d7137db5..c261900003b 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -9728,7 +9728,7 @@ instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flag size(4); ins_cost(BRANCH_COST); - format %{ "CWB$cmp $op1,op2,$labl\t! compressed ptr" %} + format %{ "CWB$cmp $op1,$op2,$labl\t! compressed ptr" %} ins_encode %{ Label* L = $labl$$label; assert(__ use_cbcond(*L), "back to back cbcond"); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index c281e3bc005..1f8503161cc 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -1785,7 +1786,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { __ verify_thread(); // expression stack is undefined here // O0: exception, i.e. Oexception - // Lbcp: exception bcx + // Lbcp: exception bcp __ verify_oop(Oexception); diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index d4eb74f3204..f85864df878 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp index ce8cb4c3d3a..29f38a8d8ca 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp @@ -25,10 +25,35 @@ #ifndef CPU_SPARC_VM_VMREG_SPARC_HPP #define CPU_SPARC_VM_VMREG_SPARC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } +inline bool is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; } +inline Register as_Register() { - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); + assert( is_Register() && is_even(value()), "even-aligned GPR name" ); + // Yuk + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister(), "must be" ); + // Yuk + return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + int v = value(); + if ( v < ConcreteRegisterImpl::max_gpr ) { + return is_even(v); + } + // F0..F31 + if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; + if ( v < ConcreteRegisterImpl::max_fpr) { + return is_even(v); + } + assert(false, "what register?"); + return false; +} #endif // CPU_SPARC_VM_VMREG_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp index 993216fc12d..936d39db68b 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp @@ -33,35 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() { inline VMReg FloatRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg( ConcreteRegisterImpl::max_gpr + encoding() ); } -inline bool VMRegImpl::is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } -inline bool VMRegImpl::is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; } -inline Register VMRegImpl::as_Register() { - - assert( is_Register() && is_even(value()), "even-aligned GPR name" ); - // Yuk - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister(), "must be" ); - // Yuk - return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - int v = value(); - if ( v < ConcreteRegisterImpl::max_gpr ) { - return is_even(v); - } - // F0..F31 - if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; - if ( v < ConcreteRegisterImpl::max_fpr) { - return is_even(v); - } - assert(false, "what register?"); - return false; -} #endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 1b16153e255..ad15c864453 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -537,10 +537,6 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { return _fp == (fp - diff); } -void frame::pd_gc_epilog() { - // nothing done here now -} - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // QQQ #ifdef CC_INTERP @@ -577,10 +573,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { return false; } - // validate bci/bcx + // validate bci/bcp - intptr_t bcx = interpreter_frame_bcx(); - if (m->validate_bci_from_bcx(bcx) < 0) { + address bcp = interpreter_frame_bcp(); + if (m->validate_bci_from_bcp(bcp) < 0) { return false; } @@ -692,10 +688,10 @@ void frame::describe_pd(FrameValues& values, int frame_no) { DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); DESCRIBE_FP_OFFSET(interpreter_frame_method); - DESCRIBE_FP_OFFSET(interpreter_frame_mdx); + DESCRIBE_FP_OFFSET(interpreter_frame_mdp); DESCRIBE_FP_OFFSET(interpreter_frame_cache); DESCRIBE_FP_OFFSET(interpreter_frame_locals); - DESCRIBE_FP_OFFSET(interpreter_frame_bcx); + DESCRIBE_FP_OFFSET(interpreter_frame_bcp); DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp); #endif } diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 8c6a72c2e97..890e1d1aa05 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ // ... | monitor block size // [monitors ] / // [monitor block size ] -// [byte code index/pointr] = bcx() bcx_offset +// [byte code pointer ] = bcp() bcp_offset // [pointer to locals ] = locals() locals_offset // [constant pool cache ] = cache() cache_offset // [methodData ] = mdp() mdx_offset @@ -111,11 +111,11 @@ // outgoing sp before a call to an invoked method interpreter_frame_last_sp_offset = interpreter_frame_sender_sp_offset - 1, interpreter_frame_method_offset = interpreter_frame_last_sp_offset - 1, - interpreter_frame_mdx_offset = interpreter_frame_method_offset - 1, - interpreter_frame_cache_offset = interpreter_frame_mdx_offset - 1, + interpreter_frame_mdp_offset = interpreter_frame_method_offset - 1, + interpreter_frame_cache_offset = interpreter_frame_mdp_offset - 1, interpreter_frame_locals_offset = interpreter_frame_cache_offset - 1, - interpreter_frame_bcx_offset = interpreter_frame_locals_offset - 1, - interpreter_frame_initial_sp_offset = interpreter_frame_bcx_offset - 1, + interpreter_frame_bcp_offset = interpreter_frame_locals_offset - 1, + interpreter_frame_initial_sp_offset = interpreter_frame_bcp_offset - 1, interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 9b875b83499..a3f44363a17 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #define CPU_X86_VM_FRAME_X86_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for Intel frames: @@ -168,7 +169,7 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return &(get_interpreterState()->_locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { assert(is_interpreted_frame(), "must be interpreted"); return (intptr_t*) &(get_interpreterState()->_bcp); } @@ -188,7 +189,7 @@ inline Method** frame::interpreter_frame_method_addr() const { return &(get_interpreterState()->_method); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { assert(is_interpreted_frame(), "must be interpreted"); return (intptr_t*) &(get_interpreterState()->_mdx); } @@ -210,13 +211,13 @@ inline intptr_t* frame::interpreter_frame_last_sp() const { return *(intptr_t**)addr_at(interpreter_frame_last_sp_offset); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - return (intptr_t*)addr_at(interpreter_frame_bcx_offset); +inline intptr_t* frame::interpreter_frame_bcp_addr() const { + return (intptr_t*)addr_at(interpreter_frame_bcp_offset); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { - return (intptr_t*)addr_at(interpreter_frame_mdx_offset); +inline intptr_t* frame::interpreter_frame_mdp_addr() const { + return (intptr_t*)addr_at(interpreter_frame_mdp_offset); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index 42a826d7710..34d0d8061d0 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -134,7 +134,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca shll(tmp, exact_log2(DataLayout::cell_size)); addptr(mdp, tmp); } - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp); } else { assert(MethodData::profile_return(), "either profile call args or call ret"); update_mdp_by_constant(mdp, in_bytes(TypeEntriesAtCall::return_only_size())); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index d9ba3389967..181ee15251b 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -826,7 +826,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { // Test ImethodDataPtr. If it is null, continue at the specified label void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); - movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize)); + movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize)); testptr(mdp, mdp); jcc(Assembler::zero, zero_continue); } @@ -853,7 +853,7 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { addptr(rbx, in_bytes(MethodData::data_offset())); addptr(rax, rbx); bind(set_mdp); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax); pop(rbx); pop(rax); } @@ -975,7 +975,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, int offset assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, offset_of_disp); addptr(mdp_in,disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -983,14 +983,14 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, Register r assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in, int constant) { assert(ProfileInterpreter, "must be profiling interpreter"); addptr(mdp_in, constant); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index 88f01fc5852..e4d61364de4 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,8 +61,8 @@ #else - void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); } - void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); } + void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), rsi); } + void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize)); } void restore_locals() { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); } // Helpers for runtime call arguments/results diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index c5969601333..23e3b973041 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -841,7 +841,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); - movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize)); + movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize)); testptr(mdp, mdp); jcc(Assembler::zero, zero_continue); } @@ -868,7 +868,7 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { addptr(rbx, in_bytes(MethodData::data_offset())); addptr(rax, rbx); bind(set_mdp); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax); pop(rbx); pop(rax); } @@ -991,7 +991,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -1001,7 +1001,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -1009,7 +1009,7 @@ void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in, int constant) { assert(ProfileInterpreter, "must be profiling interpreter"); addptr(mdp_in, constant); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index 9186009fa9a..a1cd4466bb9 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,11 +58,11 @@ // Interpreter-specific registers void save_bcp() { - movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), r13); + movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), r13); } void restore_bcp() { - movptr(r13, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); + movptr(r13, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize)); } void restore_locals() { diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index 3c66bf4fb45..abe354360ff 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index e9c1ef782d8..65ffc6d2e97 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp index 680dd900a48..b5e6989d5d9 100644 --- a/hotspot/src/cpu/x86/vm/register_x86.hpp +++ b/hotspot/src/cpu/x86/vm/register_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define CPU_X86_VM_REGISTER_X86_HPP #include "asm/register.hpp" -#include "vm_version_x86.hpp" class VMRegImpl; typedef VMRegImpl* VMReg; @@ -59,7 +58,7 @@ class RegisterImpl: public AbstractRegisterImpl { // construction inline friend Register as_Register(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return (intptr_t)this; } @@ -110,9 +109,10 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // construction inline friend FloatRegister as_FloatRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses + FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // accessors @@ -152,7 +152,7 @@ class XMMRegisterImpl: public AbstractRegisterImpl { // construction friend XMMRegister as_XMMRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses XMMRegister successor() const { return as_XMMRegister(encoding() + 1); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 1e49ce1c6a4..e705dfbe0ce 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -51,7 +52,7 @@ #ifndef CC_INTERP const int method_offset = frame::interpreter_frame_method_offset * wordSize; -const int bci_offset = frame::interpreter_frame_bcx_offset * wordSize; +const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; //------------------------------------------------------------------------------------------------------------------------ diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 12b0d0568f9..9c81d6787a1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -51,7 +52,7 @@ #ifndef CC_INTERP const int method_offset = frame::interpreter_frame_method_offset * wordSize; -const int bci_offset = frame::interpreter_frame_bcx_offset * wordSize; +const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; //----------------------------------------------------------------------------- diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 7fc8d33c42f..da56c1449cd 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 60f62077e55..00d2d58cdfb 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp index 38d47dccfc3..f31e1c5c9fd 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp @@ -25,13 +25,49 @@ #ifndef CPU_X86_VM_VMREG_X86_HPP #define CPU_X86_VM_VMREG_X86_HPP - bool is_Register(); - Register as_Register(); - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); - bool is_XMMRegister(); - XMMRegister as_XMMRegister(); +inline bool is_Register() { + return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; +} + +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; +} + +inline bool is_XMMRegister() { + return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; +} + +inline Register as_Register() { + + assert( is_Register(), "must be"); + // Yuk +#ifdef AMD64 + return ::as_Register(value() >> 1); +#else + return ::as_Register(value()); +#endif // AMD64 +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline XMMRegister as_XMMRegister() { + assert( is_XMMRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); +#ifndef AMD64 + if (is_Register()) return true; +#endif // AMD64 + return is_even(value()); +} #endif // CPU_X86_VM_VMREG_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp index 0608d3edbff..bc94e4839af 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp @@ -42,48 +42,4 @@ inline VMReg XMMRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr); } - -inline bool VMRegImpl::is_Register() { - return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -} - -inline bool VMRegImpl::is_XMMRegister() { - return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; -} - -inline Register VMRegImpl::as_Register() { - - assert( is_Register(), "must be"); - // Yuk -#ifdef AMD64 - return ::as_Register(value() >> 1); -#else - return ::as_Register(value()); -#endif // AMD64 -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline XMMRegister VMRegImpl::as_XMMRegister() { - assert( is_XMMRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); -#ifndef AMD64 - if (is_Register()) return true; -#endif // AMD64 - return is_even(value()); -} - #endif // CPU_X86_VM_VMREG_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index b575a98a816..42cc708a610 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -487,6 +487,8 @@ source_hpp %{ // To keep related declarations/definitions/uses close together, // we switch between source %{ }% and source_hpp %{ }% freely as needed. +class NativeJump; + class CallStubImpl { //-------------------------------------------------------------- diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index 4be75fdc3b3..a1be88d81c8 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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,9 +119,6 @@ bool frame::safe_for_sender(JavaThread *thread) { return false; } -void frame::pd_gc_epilog() { -} - bool frame::is_interpreted_frame_valid(JavaThread *thread) const { ShouldNotCallThis(); return false; diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 8c968599864..64e7f5fdf1f 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -101,7 +101,7 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return &(get_interpreterState()->_locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) &(get_interpreterState()->_bcp); } @@ -113,7 +113,7 @@ inline Method** frame::interpreter_frame_method_addr() const { return &(get_interpreterState()->_method); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { return (intptr_t*) &(get_interpreterState()->_mdx); } diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index d0888881639..70ca91a62ce 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -66,6 +66,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/runtimeService.hpp" #include "utilities/decoder.hpp" @@ -1213,10 +1214,6 @@ void os::die() { ::abort(); } -// Unused on Aix for now. -void os::set_error_file(const char *logfile) {} - - // This method is a copy of JDK's sysGetLastErrorString // from src/solaris/hpi/src/system_md.c diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 85d8bd87810..b6a20fedd14 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -36,9 +36,6 @@ #include #include -// Defined in the system headers included above. -#undef rem_size - inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); } diff --git a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp index 21d979f3efb..4912e8e36a5 100644 --- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -202,11 +202,11 @@ int generateJvmOffsets(GEN_variant gen_variant) { GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size); /* L2 in saved window */ GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */ // Fake value for consistency. It is not going to be used. - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF); #elif defined(i386) || defined(__i386) || defined(__amd64) GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size); GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size); - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size); #endif GEN_OFFS(Klass, _name); diff --git a/hotspot/src/os/bsd/dtrace/libjvm_db.c b/hotspot/src/os/bsd/dtrace/libjvm_db.c index c51441e59ff..cf133b4589a 100644 --- a/hotspot/src/os/bsd/dtrace/libjvm_db.c +++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -164,7 +164,7 @@ struct jvm_agent { int32_t SIZE_CodeCache_log2_segment; uint64_t methodPtr; - uint64_t bcx; + uint64_t bcp; Nmethod_t *N; /*Inlined methods support */ Frame_t prev_fr; @@ -260,6 +260,9 @@ static int parse_vmstructs(jvm_agent_t* J) { uint64_t base; int err; + /* Clear *vmp now in case we jump to fail: */ + memset(vmp, 0, sizeof(VMStructEntry)); + err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr); CHECK_FAIL(err); err = read_pointer(J, sym_addr, &gHotSpotVMStructs); @@ -1068,19 +1071,9 @@ name_for_nmethod(jvm_agent_t* J, return err; } -int is_bci(intptr_t bcx) { - switch (DATA_MODEL) { - case PR_MODEL_LP64: - return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ; - case PR_MODEL_ILP32: - default: - return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE; - } -} - static int name_for_imethod(jvm_agent_t* J, - uint64_t bcx, + uint64_t bcp, uint64_t method, char *result, size_t size, @@ -1095,7 +1088,7 @@ name_for_imethod(jvm_agent_t* J, err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod); CHECK_FAIL(err); - bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod); + bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod); if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method); @@ -1169,7 +1162,7 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result, if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) { *is_interpreted = 1; if (is_method(J, J->methodPtr)) { - return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe); + return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe); } } @@ -1326,7 +1319,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, /* arguments given to read_pointer need to be worst case sized */ uint64_t methodPtr = 0; uint64_t sender_sp; - uint64_t bcx = 0; + uint64_t bcp = 0; int is_interpreted = 0; int result = PS_OK; int err = PS_OK; @@ -1357,7 +1350,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, * regs[R_PC] contains a CALL instruction pc offset. */ pc += 8; - bcx = (uintptr_t) regs[R_L1]; + bcp = (uintptr_t) regs[R_L1]; methodPtr = (uintptr_t) regs[R_L2]; sender_sp = regs[R_I5]; if (debug > 2) { @@ -1385,13 +1378,13 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) { sender_sp = 0; } - if (read_pointer(J, fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) { - bcx = 0; + if (read_pointer(J, fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) { + bcp = 0; } #endif /* i386 */ J->methodPtr = methodPtr; - J->bcx = bcx; + J->bcp = bcp; /* On x86 with C2 JVM: native frame may have wrong regs[R_FP] * For example: JVM_SuspendThread frame poins to the top interpreted frame. @@ -1402,7 +1395,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, */ #ifndef X86_COMPILER2 if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { @@ -1416,7 +1409,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, } #ifdef X86_COMPILER2 else if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index 3fb13e5e97c..c5e8b3461e8 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -197,11 +197,11 @@ int generateJvmOffsets(GEN_variant gen_variant) { GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size); /* L2 in saved window */ GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */ // Fake value for consistency. It is not going to be used. - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF); #elif defined(i386) || defined(__i386) || defined(__amd64) GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size); GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size); - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size); #endif GEN_OFFS(Klass, _name); diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index b15c187da76..40dada151eb 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -164,7 +164,7 @@ struct jvm_agent { int32_t SIZE_CodeCache_log2_segment; uint64_t methodPtr; - uint64_t bcx; + uint64_t bcp; Nmethod_t *N; /*Inlined methods support */ Frame_t prev_fr; @@ -260,6 +260,9 @@ static int parse_vmstructs(jvm_agent_t* J) { uint64_t base; int err; + /* Clear *vmp now in case we jump to fail: */ + memset(vmp, 0, sizeof(VMStructEntry)); + err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr); CHECK_FAIL(err); err = read_pointer(J, sym_addr, &gHotSpotVMStructs); @@ -1068,19 +1071,9 @@ name_for_nmethod(jvm_agent_t* J, return err; } -int is_bci(intptr_t bcx) { - switch (DATA_MODEL) { - case PR_MODEL_LP64: - return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ; - case PR_MODEL_ILP32: - default: - return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE; - } -} - static int name_for_imethod(jvm_agent_t* J, - uint64_t bcx, + uint64_t bcp, uint64_t method, char *result, size_t size, @@ -1095,7 +1088,7 @@ name_for_imethod(jvm_agent_t* J, err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod); CHECK_FAIL(err); - bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod); + bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod); if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method); @@ -1169,7 +1162,7 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result, if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) { *is_interpreted = 1; if (is_method(J, J->methodPtr)) { - return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe); + return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe); } } @@ -1326,7 +1319,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, /* arguments given to read_pointer need to be worst case sized */ uint64_t methodPtr = 0; uint64_t sender_sp; - uint64_t bcx = 0; + uint64_t bcp = 0; int is_interpreted = 0; int result = PS_OK; int err = PS_OK; @@ -1357,7 +1350,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, * regs[R_PC] contains a CALL instruction pc offset. */ pc += 8; - bcx = (uintptr_t) regs[R_L1]; + bcp = (uintptr_t) regs[R_L1]; methodPtr = (uintptr_t) regs[R_L2]; sender_sp = regs[R_I5]; if (debug > 2) { @@ -1385,13 +1378,13 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) { sender_sp = 0; } - if (read_pointer(J, fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) { - bcx = 0; + if (read_pointer(J, fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) { + bcp = 0; } #endif /* i386 */ J->methodPtr = methodPtr; - J->bcx = bcx; + J->bcp = bcp; /* On x86 with C2 JVM: native frame may have wrong regs[R_FP] * For example: JVM_SuspendThread frame poins to the top interpreted frame. @@ -1402,7 +1395,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, */ #ifndef X86_COMPILER2 if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { @@ -1416,7 +1409,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, } #ifdef X86_COMPILER2 else if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 29d8154ece2..21cb27a3c0e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index c8a15526f7e..d312b975abc 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -62,6 +62,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index 744bb7c38d4..046912a2c24 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef _LP64 #error "Atomic currently only impleneted for PPC64" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp index 93e5ed159cd..36ca820a6bd 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp index ab7fab3dd13..0a9feddfec4 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp index c7459d5a514..834efd2bbf7 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp index 4ed2934463b..60969caa962 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp index 7f8e78bbff8..ecc4c752777 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index c8fcf1f64d2..39ed85ea361 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "Atomic currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp index dcc2375f878..dff21c6bf6a 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "OrderAccess currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index 331eed7a67f..29b51d70f7f 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp index 6833c1f4e61..f5215f187e8 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index 6e364f4087a..14194e44947 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -118,7 +118,7 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid, *ret_sp = os::Linux::ucontext_get_sp(uc); } if (ret_fp) { - *ret_fp = os::Linux::ucontext_get_fp(uc); + *ret_fp = (intptr_t*)NULL; } } else { // construct empty ExtendedPC for return value checking @@ -136,18 +136,15 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid, frame os::fetch_frame_from_context(void* ucVoid) { intptr_t* sp; - intptr_t* fp; - ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); - return frame(sp, fp, epc.pc()); + ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, NULL); + return frame(sp, frame::unpatchable, epc.pc()); } frame os::get_sender_for_C_frame(frame* fr) { - return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); + return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); } frame os::current_frame() { - fprintf(stderr, "current_frame()"); - intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()(); frame myframe(sp, frame::unpatchable, CAST_FROM_FN_PTR(address, os::current_frame)); diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp index 2d0d5197344..679dd614523 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index 10240a0b1c2..a71a53cfa8c 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp index 33ce50dc73f..d9df41034d4 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp index 773fd643ab7..e15041e76a7 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp index 7d17fdf39cd..83a07ce3fe5 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 7e633fd95cb..f9321f2bac2 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index ed7b2538280..f22bdcb923e 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -27,6 +27,7 @@ #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp index 27c0d396b72..e00d5be1ff0 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index e7238c27549..e211c060552 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp index 7ba00f7aaeb..072b61f07d3 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // The following alternative implementations are needed because // Windows 95 doesn't support (some of) the corresponding Windows NT diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index ea0ed143e98..37e5126e066 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp index 614f0d43f10..6c4553f4b8f 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,7 +213,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); AD.addInclude(AD._CPP_file, "asm/macroAssembler.inline.hpp"); AD.addInclude(AD._CPP_file, "code/compiledIC.hpp"); - AD.addInclude(AD._CPP_file, "code/vmreg.hpp"); + AD.addInclude(AD._CPP_file, "code/nativeInst.hpp"); + AD.addInclude(AD._CPP_file, "code/vmreg.inline.hpp"); AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp"); AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp"); AD.addInclude(AD._CPP_file, "oops/markOop.hpp"); @@ -230,23 +231,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp"); AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp"); AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp"); -#ifdef TARGET_ARCH_x86 - AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); -#endif -#ifdef TARGET_ARCH_sparc - AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp"); -#endif -#ifdef TARGET_ARCH_arm - AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp"); -#endif -#ifdef TARGET_ARCH_ppc - AD.addInclude(AD._CPP_file, "nativeInst_ppc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_ppc.inline.hpp"); -#endif AD.addInclude(AD._HPP_file, "memory/allocation.hpp"); + AD.addInclude(AD._HPP_file, "code/nativeInst.hpp"); AD.addInclude(AD._HPP_file, "opto/machnode.hpp"); AD.addInclude(AD._HPP_file, "opto/node.hpp"); AD.addInclude(AD._HPP_file, "opto/regalloc.hpp"); diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index ec8ec5eb435..3b9c012e02f 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,34 +26,15 @@ #define SHARE_VM_ASM_ASSEMBLER_HPP #include "asm/codeBuffer.hpp" +#include "asm/register.hpp" #include "code/oopRecorder.hpp" #include "code/relocInfo.hpp" #include "memory/allocation.hpp" +#include "runtime/vm_version.hpp" #include "utilities/debug.hpp" #include "utilities/growableArray.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -# include "vm_version_ppc.hpp" -#endif - // This file contains platform-independent assembler declarations. class MacroAssembler; diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 60d405b35f4..9c4bc206158 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -28,6 +28,7 @@ #include "memory/gcLocker.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" +#include "runtime/icache.hpp" #include "utilities/copy.hpp" #include "utilities/xmlstream.hpp" diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index 2d0c31e2afe..e3a4f4d5680 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "c1/c1_Instruction.hpp" #include "c1/c1_LIR.hpp" #include "c1/c1_Runtime1.hpp" +#include "code/nativeInst.hpp" #include "utilities/array.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp index bebb3b0bebe..7504bbf7ce7 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,7 @@ #define SHARE_VM_C1_C1_DEFS_HPP #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif +#include "asm/register.hpp" // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index f9e46f30132..a164d8ccb00 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,24 +25,8 @@ #include "precompiled.hpp" #include "c1/c1_FrameMap.hpp" #include "c1/c1_LIR.hpp" +#include "code/vmreg.inline.hpp" #include "runtime/sharedRuntime.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - - //----------------------------------------------------- diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 838e08d799c..351e410aa15 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ #include "interpreter/bytecode.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/compilationPolicy.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" class BlockListBuilder VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 5697e9046aa..48b560840e3 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,27 +30,6 @@ #include "c1/c1_MacroAssembler.hpp" #include "c1/c1_ValueStack.hpp" #include "ci/ciInstance.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif - void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { // we must have enough patching space so that call can be inserted diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index bf0b6f2f1ea..57b76803b42 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "ci/ciObjArray.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 91bef59ef17..afed1de995f 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,23 +31,8 @@ #include "c1/c1_LIRGenerator.hpp" #include "c1/c1_LinearScan.hpp" #include "c1/c1_ValueStack.hpp" +#include "code/vmreg.inline.hpp" #include "utilities/bitMap.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - #ifndef PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 00696f15542..b8dd1bbfb83 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -56,6 +56,7 @@ #include "runtime/threadCritical.hpp" #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +#include "runtime/vm_version.hpp" #include "utilities/copy.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp index cd04c9ff135..7eb2119444e 100644 --- a/hotspot/src/share/vm/ci/ciField.cpp +++ b/hotspot/src/share/vm/ci/ciField.cpp @@ -138,6 +138,17 @@ ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NUL return; } + // Access check based on declared_holder. canonical_holder should not be used + // to check access because it can erroneously succeed. If this check fails, + // propagate the declared holder to will_link() which in turn will bail out + // compilation for this field access. + if (!Reflection::verify_field_access(klass->get_Klass(), declared_holder->get_Klass(), canonical_holder, field_desc.access_flags(), true)) { + _holder = declared_holder; + _offset = -1; + _is_constant = false; + return; + } + assert(canonical_holder == field_desc.field_holder(), "just checking"); initialize_from(&field_desc); } diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp index cbf3baf7945..0d8cfc7878a 100644 --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,22 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/oopFactory.hpp" #include "oops/constantPool.hpp" - -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) { u2 index; diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index 691ed808fec..de392e7fa13 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -25,22 +25,8 @@ #ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP #define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP +#include "utilities/bytes.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Input stream for reading .class file // diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index cd313d27757..cfd3a68356c 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1639,9 +1639,9 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met if (fr.is_first_frame()) break; address pc = fr.pc(); if (fr.is_interpreted_frame()) { - intptr_t bcx = fr.interpreter_frame_bcx(); + address bcp = fr.interpreter_frame_bcp(); method = fr.interpreter_frame_method(); - bci = fr.is_bci(bcx) ? bcx : method->bci_from((address)bcx); + bci = method->bci_from(bcp); fr = fr.sender(&map); } else { CodeBlob* cb = fr.cb(); diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp index ee8b33f6219..385aef3a7e6 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,22 +30,8 @@ #include "memory/allocation.hpp" #include "oops/constantPool.hpp" #include "oops/method.hpp" +#include "utilities/bytes.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif class StackMapReader; diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index c0183cfe1cc..6fc9ed239af 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -45,21 +45,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #define NOFAILOVER_MAJOR_VERSION 51 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51 @@ -439,7 +425,7 @@ void ErrorContext::location_details(outputStream* ss, const Method* method) cons if (_bci != -1 && method != NULL) { streamIndentor si(ss); const char* bytecode_name = ""; - if (method->validate_bci_from_bcx(_bci) != -1) { + if (method->validate_bci(_bci) != -1) { Bytecodes::Code code = Bytecodes::code_or_bp_at(method->bcp_from(_bci)); if (Bytecodes::is_defined(code)) { bytecode_name = Bytecodes::name(code); diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index f9e78bfb9e2..710ca948ddc 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -39,21 +39,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/vframe.hpp" #include "services/memoryService.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index f2207cc2ec1..d1e9b9a2bce 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,23 +25,9 @@ #ifndef SHARE_VM_CODE_COMPILEDIC_HPP #define SHARE_VM_CODE_COMPILEDIC_HPP +#include "code/nativeInst.hpp" #include "interpreter/linkResolver.hpp" #include "oops/compiledICHolder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff --git a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java b/hotspot/src/share/vm/code/nativeInst.hpp similarity index 62% rename from jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java rename to hotspot/src/share/vm/code/nativeInst.hpp index ed174c0f3a1..6e4ece7d01a 100644 --- a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java +++ b/hotspot/src/share/vm/code/nativeInst.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -21,10 +19,26 @@ * Please 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.audio; +#ifndef SHARE_VM_CODE_NATIVEINST_HPP +#define SHARE_VM_CODE_NATIVEINST_HPP -public interface AudioSecurityExceptionAction { - Object run() throws Exception; -} +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif + +#endif // SHARE_VM_CODE_NATIVEINST_HPP diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 5ea2ca8891d..10fe4d8e575 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -69,7 +69,12 @@ class PcDescCache VALUE_OBJ_CLASS_SPEC { friend class VMStructs; private: enum { cache_size = 4 }; - PcDesc* _pc_descs[cache_size]; // last cache_size pc_descs found + // The array elements MUST be volatile! Several threads may modify + // and read from the cache concurrently. find_pc_desc_internal has + // returned wrong results. C++ compiler (namely xlC12) may duplicate + // C++ field accesses if the elements are not volatile. + typedef PcDesc* PcDescPtr; + volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found public: PcDescCache() { debug_only(_pc_descs[0] = NULL); } void reset_to(PcDesc* initial_pc_desc); diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 1ef07ec199c..0b2edd19fd9 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,34 +25,13 @@ #ifndef SHARE_VM_CODE_VMREG_HPP #define SHARE_VM_CODE_VMREG_HPP +#include "asm/register.hpp" #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" -#include "asm/register.hpp" #ifdef COMPILER2 #include "opto/adlcVMDeps.hpp" #include "utilities/ostream.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif //------------------------------VMReg------------------------------------------ @@ -107,7 +86,7 @@ public: // also a register you could use in the assembler. On machines with // 64bit registers only one half of the VMReg (and OptoReg) is considered // concrete. - bool is_concrete(); + // bool is_concrete(); // VMRegs are 4 bytes wide on all platforms static const int stack_slot_size; diff --git a/hotspot/src/share/vm/code/vmreg.inline.hpp b/hotspot/src/share/vm/code/vmreg.inline.hpp new file mode 100644 index 00000000000..6204f9df39f --- /dev/null +++ b/hotspot/src/share/vm/code/vmreg.inline.hpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_CODE_VMREG_INLINE_HPP +#define SHARE_VM_CODE_VMREG_INLINE_HPP + +#include "asm/register.hpp" +#include "code/vmreg.hpp" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.inline.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif + +#endif // SHARE_VM_CODE_VMREG_INLINE_HPP diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp index f2c04b6e4ff..340251f3265 100644 --- a/hotspot/src/share/vm/compiler/compileLog.cpp +++ b/hotspot/src/share/vm/compiler/compileLog.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "ci/ciMethod.hpp" +#include "code/codeCache.hpp" #include "compiler/compileLog.hpp" #include "memory/allocation.inline.hpp" #include "oops/method.hpp" diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 5e1801584c2..556966bc9bf 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -36,6 +36,9 @@ #ifdef COMPILER1 #include "c1/c1_Defs.hpp" #endif +#ifdef COMPILER2 +#include "opto/optoreg.hpp" +#endif // OopMapStream diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 640265fbf56..2164628a77f 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -1904,12 +1904,12 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk, assert(size > new_size, "Split from a smaller block?"); assert(is_aligned(chunk), "alignment problem"); assert(size == adjustObjectSize(size), "alignment problem"); - size_t rem_size = size - new_size; - assert(rem_size == adjustObjectSize(rem_size), "alignment problem"); - assert(rem_size >= MinChunkSize, "Free chunk smaller than minimum"); + size_t rem_sz = size - new_size; + assert(rem_sz == adjustObjectSize(rem_sz), "alignment problem"); + assert(rem_sz >= MinChunkSize, "Free chunk smaller than minimum"); FreeChunk* ffc = (FreeChunk*)((HeapWord*)chunk + new_size); assert(is_aligned(ffc), "alignment problem"); - ffc->set_size(rem_size); + ffc->set_size(rem_sz); ffc->link_next(NULL); ffc->link_prev(NULL); // Mark as a free block for other (parallel) GC threads. // Above must occur before BOT is updated below. @@ -1917,18 +1917,18 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk, OrderAccess::storestore(); assert(chunk->is_free() && ffc->is_free(), "Error"); _bt.split_block((HeapWord*)chunk, chunk->size(), new_size); - if (rem_size < SmallForDictionary) { + if (rem_sz < SmallForDictionary) { bool is_par = (SharedHeap::heap()->n_par_threads() > 0); - if (is_par) _indexedFreeListParLocks[rem_size]->lock(); + if (is_par) _indexedFreeListParLocks[rem_sz]->lock(); assert(!is_par || (SharedHeap::heap()->n_par_threads() == SharedHeap::heap()->workers()->active_workers()), "Mismatch"); returnChunkToFreeList(ffc); - split(size, rem_size); - if (is_par) _indexedFreeListParLocks[rem_size]->unlock(); + split(size, rem_sz); + if (is_par) _indexedFreeListParLocks[rem_sz]->unlock(); } else { returnChunkToDictionary(ffc); - split(size ,rem_size); + split(size, rem_sz); } chunk->set_size(new_size); return chunk; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 74c079d8ccf..3b9c0aa1906 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -891,6 +891,10 @@ void ConcurrentMark::clearNextBitmap() { guarantee(!g1h->mark_in_progress(), "invariant"); } +bool ConcurrentMark::nextMarkBitmapIsClear() { + return _nextMarkBitMap->getNextMarkedWordAddress(_heap_start, _heap_end) == _heap_end; +} + class NoteStartOfMarkHRClosure: public HeapRegionClosure { public: bool doHeapRegion(HeapRegion* r) { @@ -3358,7 +3362,8 @@ void ConcurrentMark::print_stats() { // abandon current marking iteration due to a Full GC void ConcurrentMark::abort() { - // Clear all marks to force marking thread to do nothing + // Clear all marks in the next bitmap for the next marking cycle. This will allow us to skip the next + // concurrent bitmap clearing. _nextMarkBitMap->clearAll(); // Note we cannot clear the previous marking bitmap here diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp index d0b67b39f97..a564855277b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -736,6 +736,9 @@ public: // Clear the next marking bitmap (will be called concurrently). void clearNextBitmap(); + // Return whether the next mark bitmap has no marks set. + bool nextMarkBitmapIsClear(); + // These two do the work that needs to be done before and after the // initial root checkpoint. Since this checkpoint can be done at two // different points (i.e. an explicit pause or piggy-backed on a diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index f8392143db8..1f9f0661779 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -277,9 +277,13 @@ void ConcurrentMarkThread::run() { // We now want to allow clearing of the marking bitmap to be // suspended by a collection pause. - { + // We may have aborted just before the remark. Do not bother clearing the + // bitmap then, as it has been done during mark abort. + if (!cm()->has_aborted()) { SuspendibleThreadSetJoiner sts; _cm->clearNextBitmap(); + } else { + assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear"); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index aca5699351b..db56c33b91a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2950,11 +2950,18 @@ void G1CollectedHeap::collection_set_iterate_from(HeapRegion* r, } } -CompactibleSpace* G1CollectedHeap::first_compactible_space() { - return n_regions() > 0 ? region_at(0) : NULL; +HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { + // We're not using an iterator given that it will wrap around when + // it reaches the last region and this is not what we want here. + for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { + HeapRegion* hr = region_at(index); + if (!hr->isHumongous()) { + return hr; + } + } + return NULL; } - Space* G1CollectedHeap::space_containing(const void* addr) const { return heap_region_containing(addr); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 30a3d7ebcb8..9f51eafa1ed 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1158,19 +1158,19 @@ public: } // The total number of regions in the heap. - uint n_regions() { return _hrs.length(); } + uint n_regions() const { return _hrs.length(); } // The max number of regions in the heap. - uint max_regions() { return _hrs.max_length(); } + uint max_regions() const { return _hrs.max_length(); } // The number of regions that are completely free. - uint free_regions() { return _free_list.length(); } + uint free_regions() const { return _free_list.length(); } // The number of regions that are not completely free. - uint used_regions() { return n_regions() - free_regions(); } + uint used_regions() const { return n_regions() - free_regions(); } // The number of regions available for "regular" expansion. - uint expansion_regions() { return _expansion_regions; } + uint expansion_regions() const { return _expansion_regions; } // Factory method for HeapRegion instances. It will return NULL if // the allocation fails. @@ -1392,8 +1392,7 @@ public: // As above but starting from region r void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); - // Returns the first (lowest address) compactible space in the heap. - virtual CompactibleSpace* first_compactible_space(); + HeapRegion* next_compaction_region(const HeapRegion* from) const; // A CollectedHeap will contain some number of spaces. This finds the // space containing a given address, or else returns NULL. diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 1c805c634b3..eba482046fd 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -1047,7 +1047,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua bool new_in_marking_window = _in_marking_window; bool new_in_marking_window_im = false; - if (during_initial_mark_pause()) { + if (last_pause_included_initial_mark) { new_in_marking_window = true; new_in_marking_window_im = true; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 6a2627d10fc..dbd9e523ba6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -76,7 +76,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, // When collecting the permanent generation Method*s may be moving, // so we either have to flush all bcp data or convert it into bci. CodeCache::gc_prologue(); - Threads::gc_prologue(); bool marked_for_unloading = false; @@ -106,7 +105,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, // Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity()); // Universe::set_heap_used_at_last_gc(Universe::heap()->used()); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); @@ -201,6 +199,23 @@ class G1PrepareCompactClosure: public HeapRegionClosure { CompactPoint _cp; HeapRegionSetCount _humongous_regions_removed; + bool is_cp_initialized() const { + return _cp.space != NULL; + } + + void prepare_for_compaction(HeapRegion* hr, HeapWord* end) { + // If this is the first live region that we came across which we can compact, + // initialize the CompactPoint. + if (!is_cp_initialized()) { + _cp.space = hr; + _cp.threshold = hr->initialize_threshold(); + } + hr->prepare_for_compaction(&_cp); + // Also clear the part of the card table that will be unused after + // compaction. + _mrbs->clear(MemRegion(hr->compaction_top(), end)); + } + void free_humongous_region(HeapRegion* hr) { HeapWord* end = hr->end(); FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep"); @@ -212,18 +227,15 @@ class G1PrepareCompactClosure: public HeapRegionClosure { _humongous_regions_removed.increment(1u, hr->capacity()); _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */); - hr->prepare_for_compaction(&_cp); - // Also clear the part of the card table that will be unused after - // compaction. - _mrbs->clear(MemRegion(hr->compaction_top(), end)); + prepare_for_compaction(hr, end); dummy_free_list.remove_all(); } public: - G1PrepareCompactClosure(CompactibleSpace* cs) + G1PrepareCompactClosure() : _g1h(G1CollectedHeap::heap()), _mrbs(_g1h->g1_barrier_set()), - _cp(NULL, cs, cs->initialize_threshold()), + _cp(NULL), _humongous_regions_removed() { } void update_sets() { @@ -246,10 +258,7 @@ public: assert(hr->continuesHumongous(), "Invalid humongous."); } } else { - hr->prepare_for_compaction(&_cp); - // Also clear the part of the card table that will be unused after - // compaction. - _mrbs->clear(MemRegion(hr->compaction_top(), hr->end())); + prepare_for_compaction(hr, hr->end()); } return false; } @@ -267,14 +276,7 @@ void G1MarkSweep::mark_sweep_phase2() { GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); GenMarkSweep::trace("2"); - // find the first region - HeapRegion* r = g1h->region_at(0); - CompactibleSpace* sp = r; - if (r->isHumongous() && oop(r->bottom())->is_gc_marked()) { - sp = r->next_compaction_space(); - } - - G1PrepareCompactClosure blk(sp); + G1PrepareCompactClosure blk; g1h->heap_region_iterate(&blk); blk.update_sets(); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index cecf891306a..524f2f315fb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -381,18 +381,7 @@ HeapRegion::HeapRegion(uint hrs_index, } CompactibleSpace* HeapRegion::next_compaction_space() const { - // We're not using an iterator given that it will wrap around when - // it reaches the last region and this is not what we want here. - G1CollectedHeap* g1h = G1CollectedHeap::heap(); - uint index = hrs_index() + 1; - while (index < g1h->n_regions()) { - HeapRegion* hr = g1h->region_at(index); - if (!hr->isHumongous()) { - return hr; - } - index += 1; - } - return NULL; + return G1CollectedHeap::heap()->next_compaction_region(this); } void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark, diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp index 222fc694f4c..8502763ccf1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp @@ -119,7 +119,7 @@ protected: public: const char* name() { return _name; } - uint length() { return _count.length(); } + uint length() const { return _count.length(); } bool is_empty() { return _count.length() == 0; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp index 647ed85ecdb..a0b2cb96048 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @@ -180,7 +180,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { size_policy->major_collection_begin(); CodeCache::gc_prologue(); - Threads::gc_prologue(); BiasedLocking::preserve_marks(); // Capture heap size before collection for printing. @@ -251,7 +250,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { MetaspaceAux::verify_metrics(); BiasedLocking::restore_marks(); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index 7246a61b634..1a2fd30c6ce 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -1066,7 +1066,6 @@ void PSParallelCompact::post_compact() ClassLoaderDataGraph::purge(); MetaspaceAux::verify_metrics(); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); @@ -2068,7 +2067,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { size_policy->major_collection_begin(); CodeCache::gc_prologue(); - Threads::gc_prologue(); COMPILER2_PRESENT(DerivedPointerTable::clear()); diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index d5d1b150134..783066e0adb 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,12 @@ #ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP +#include "asm/macroAssembler.hpp" #include "code/stubs.hpp" #include "interpreter/bytecodes.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vmThread.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif // This file contains the platform-independent parts // of the abstract interpreter and the abstract interpreter generator. @@ -75,6 +58,8 @@ //------------------------------------------------------------------------------------------------------------------------ // The C++ interface to the bytecode interpreter(s). +class InterpreterMacroAssembler; + class AbstractInterpreter: AllStatic { friend class VMStructs; friend class Interpreter; diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index 10b5a567b24..0708816ff51 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,21 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" class ciBytecodeStream; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index b2a1c49683f..49fc1703d50 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,21 +32,6 @@ #include "runtime/frame.hpp" #include "runtime/globals.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif #ifdef CC_INTERP @@ -56,6 +41,8 @@ // CVM definitions find hotspot equivalents... +class InterpreterMacroAssembler; + union VMJavaVal64 { jlong l; jdouble d; diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index cf5500a7e33..1f657b98bc2 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,21 +29,7 @@ #include "memory/allocation.hpp" #include "oops/method.hpp" #include "runtime/handles.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // A BytecodeStream is used for fast iteration over the bytecodes // of a Method*. diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 5c26a4a751f..7fcd6543984 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600)) diff --git a/jdk/src/share/classes/sun/audio/AudioDataStream.java b/hotspot/src/share/vm/interpreter/interp_masm.hpp similarity index 57% rename from jdk/src/share/classes/sun/audio/AudioDataStream.java rename to hotspot/src/share/vm/interpreter/interp_masm.hpp index dcc21a88233..6e647835448 100644 --- a/jdk/src/share/classes/sun/audio/AudioDataStream.java +++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -21,34 +19,31 @@ * Please 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.audio; - -import java.io.*; - -/** - * An input stream to play AudioData. * - * @see AudioPlayer - * @see AudioData - * @author Arthur van Hoff - * @author Kara Kytle */ -public class AudioDataStream extends ByteArrayInputStream { - private final AudioData ad; +#ifndef SHARE_VM_INTERPRETER_INTERP_MASM_HPP +#define SHARE_VM_INTERPRETER_INTERP_MASM_HPP - /** - * Constructor - */ - public AudioDataStream(final AudioData data) { +#include "asm/macroAssembler.hpp" - super(data.buffer); - this.ad = data; - } +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "interp_masm_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "interp_masm_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "interp_masm_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "interp_masm_ppc_64.hpp" +#endif - final AudioData getAudioData() { - return ad; - } -} +#endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 7ce4bdbb3ec..4807cd08398 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -30,6 +30,7 @@ #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" @@ -80,9 +81,35 @@ void InterpreterCodelet::print_on(outputStream* st) const { } } +CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode) : + _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), + _cb(_clet->code_begin(), _clet->code_size()) { + // Request all space (add some slack for Codelet data). + assert(_clet != NULL, "we checked not enough space already"); + + // Initialize Codelet attributes. + _clet->initialize(description, bytecode); + // Create assembler for code generation. + masm = new InterpreterMacroAssembler(&_cb); + _masm = &masm; +} + +CodeletMark::~CodeletMark() { + // Align so printing shows nop's instead of random code at the end (Codelets are aligned). + (*_masm)->align(wordSize); + // Make sure all code is in code buffer. + (*_masm)->flush(); + + // Commit Codelet. + AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); + // Make sure nobody can use _masm outside a CodeletMark lifespan. + *_masm = NULL; +} //------------------------------------------------------------------------------------------------------------------------ -// Implementation of platform independent aspects of Interpreter +// Implementation of platform independent aspects of Interpreter void AbstractInterpreter::initialize() { if (_code != NULL) return; diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index cc26b378d73..2a81daf205d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,8 @@ // This file contains the platform-independent parts // of the interpreter and the interpreter generator. +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // An InterpreterCodelet is a piece of interpreter code. All // interpreter code is generated into little codelets which @@ -99,42 +101,17 @@ class CodeletMark: ResourceMark { int codelet_size = AbstractInterpreter::code()->available_space() - 2*K; // Guarantee there's a little bit of code space left. - guarantee (codelet_size > 0 && (size_t)codelet_size > 2*K, - "not enough space for interpreter generation"); + guarantee(codelet_size > 0 && (size_t)codelet_size > 2*K, + "not enough space for interpreter generation"); return codelet_size; } public: - CodeletMark( - InterpreterMacroAssembler*& masm, - const char* description, - Bytecodes::Code bytecode = Bytecodes::_illegal): - _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), - _cb(_clet->code_begin(), _clet->code_size()) - - { // request all space (add some slack for Codelet data) - assert (_clet != NULL, "we checked not enough space already"); - - // initialize Codelet attributes - _clet->initialize(description, bytecode); - // create assembler for code generation - masm = new InterpreterMacroAssembler(&_cb); - _masm = &masm; - } - - ~CodeletMark() { - // align so printing shows nop's instead of random code at the end (Codelets are aligned) - (*_masm)->align(wordSize); - // make sure all code is in code buffer - (*_masm)->flush(); - - - // commit Codelet - AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); - // make sure nobody can use _masm outside a CodeletMark lifespan - *_masm = NULL; - } + CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode = Bytecodes::_illegal); + ~CodeletMark(); }; // Wrapper classes to produce Interpreter/InterpreterGenerator from either @@ -142,9 +119,10 @@ class CodeletMark: ResourceMark { class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) { - public: + public: // Debugging/printing - static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + #ifdef TARGET_ARCH_x86 # include "interpreter_x86.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 5f1894033de..23d4bddca1b 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -48,6 +48,7 @@ #include "runtime/deoptimization.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" #include "runtime/jfieldIDWorkaround.hpp" @@ -57,21 +58,6 @@ #include "runtime/synchronizer.hpp" #include "runtime/threadCritical.hpp" #include "utilities/events.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #ifdef COMPILER2 #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 66eb63eafb6..9f28e20f9b7 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -26,6 +26,8 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #ifndef CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 48e0e217091..c72fafdbada 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ #ifndef CC_INTERP +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // A little wrapper class to group tosca-specific entry points into a unit. // (tosca = Top-Of-Stack CAche) diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp index 05b8a069691..8449321d9f3 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.cpp +++ b/hotspot/src/share/vm/interpreter/templateTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "runtime/timer.hpp" diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index c6ea51537a2..e6d334005e1 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,24 +28,6 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "runtime/frame.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif #ifndef CC_INTERP // All the necessary definitions used for (bytecode) template generation. Instead of @@ -53,6 +35,7 @@ // and the snippet generator, a template is assigned to each bytecode which can be // used to generate the bytecode's implementation if needed. +class InterpreterMacroAssembler; // A Template describes the properties of a code template for a given bytecode // and provides a generator to generate the code template. diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index 47527f21e9f..2f5c0165893 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -30,6 +30,7 @@ #include "runtime/arguments.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index bbca44a36f6..4b5deb03c05 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -1088,7 +1088,7 @@ void GenCollectedHeap::prepare_for_compaction() { guarantee(_n_gens = 2, "Wrong number of generations"); Generation* old_gen = _gens[1]; // Start by compacting into same gen. - CompactPoint cp(old_gen, NULL, NULL); + CompactPoint cp(old_gen); old_gen->prepare_for_compaction(&cp); Generation* young_gen = _gens[0]; young_gen->prepare_for_compaction(&cp); diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp index 5faab645408..823b0a196bf 100644 --- a/hotspot/src/share/vm/memory/genMarkSweep.cpp +++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c // When collecting the permanent generation Method*s may be moving, // so we either have to flush all bcp data or convert it into bci. CodeCache::gc_prologue(); - Threads::gc_prologue(); // Increment the invocation count _total_invocations++; @@ -132,7 +131,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c rs->invalidate_or_clear(old_gen); } - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp index 4c2974dcdab..0653884e043 100644 --- a/hotspot/src/share/vm/memory/space.hpp +++ b/hotspot/src/share/vm/memory/space.hpp @@ -330,9 +330,9 @@ public: Generation* gen; CompactibleSpace* space; HeapWord* threshold; - CompactPoint(Generation* _gen, CompactibleSpace* _space, - HeapWord* _threshold) : - gen(_gen), space(_space), threshold(_threshold) {} + + CompactPoint(Generation* _gen) : + gen(_gen), space(NULL), threshold(0) {} }; diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp index e0dc61a73f6..a54de2bf0a3 100644 --- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "gc_implementation/shared/gcUtil.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/perfData.hpp" +#include "runtime/vm_version.hpp" class GlobalTLABStats; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 5c5ea1c76e2..5e26ec5e622 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -31,22 +31,8 @@ #include "oops/symbol.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/handles.hpp" +#include "utilities/bytes.hpp" #include "utilities/constantTag.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // A ConstantPool is an array containing class constants as described in the // class file. diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 83ac9591aa2..54fa43a7212 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -240,6 +240,9 @@ void Method::mask_for(int bci, InterpreterOopMap* mask) { 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) || is_error_reported(), @@ -250,24 +253,23 @@ int Method::bci_from(address bcp) const { } -// Return (int)bcx if it appears to be a valid BCI. -// Return bci_from((address)bcx) if it appears to be a valid BCP. +int Method::validate_bci(int bci) const { + return (bci == 0 || bci < code_size()) ? bci : -1; +} + +// Return bci if it appears to be a valid bcp // Return -1 otherwise. // Used by profiling code, when invalid data is a possibility. // The caller is responsible for validating the Method* itself. -int Method::validate_bci_from_bcx(intptr_t bcx) const { +int Method::validate_bci_from_bcp(address bcp) const { // keep bci as -1 if not a valid bci int bci = -1; - if (bcx == 0 || (address)bcx == code_base()) { + if (bcp == 0 || bcp == code_base()) { // code_size() may return 0 and we allow 0 here // the method may be native bci = 0; - } else if (frame::is_bci(bcx)) { - if (bcx < code_size()) { - bci = (int)bcx; - } - } else if (contains((address)bcx)) { - bci = (address)bcx - code_base(); + } else if (contains(bcp)) { + bci = bcp - code_base(); } // Assert that if we have dodged any asserts, bci is negative. assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0"); diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index a2c36db39f4..23752b4f8f5 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -649,7 +649,8 @@ class Method : public Metadata { // Returns the byte code index from the byte code pointer int bci_from(address bcp) const; address bcp_from(int bci) const; - int validate_bci_from_bcx(intptr_t bcx) const; + int validate_bci_from_bcp(address bcp) const; + int validate_bci(int bci) const; // Returns the line number for a bci if debugging information for the method is prowided, // -1 is returned otherwise. diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 1c88ac55ffa..ad290402d90 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2338,10 +2338,6 @@ public: return dp - ((address)_data); } - address di_to_dp(int di) { - return (address)data_layout_at(di); - } - // bci to di/dp conversion. address bci_to_dp(int bci); int bci_to_di(int bci) { diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 0dc0db8e946..08839267e01 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -42,21 +42,6 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff --git a/hotspot/src/share/vm/opto/ad.hpp b/hotspot/src/share/vm/opto/ad.hpp new file mode 100644 index 00000000000..29308f8b10c --- /dev/null +++ b/hotspot/src/share/vm/opto/ad.hpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_OPTO_AD_HPP +#define SHARE_VM_OPTO_AD_HPP + +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/ad_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/ad_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/ad_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/ad_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/ad_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/ad_ppc_64.hpp" +#endif + +#endif // SHARE_VM_OPTO_AD_HPP diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 9f2dd674e2f..1fa98978f26 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/oopMap.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" @@ -32,21 +33,6 @@ #include "opto/phase.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif // The functions in this file builds OopMaps after all scheduling is done. // diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index dced2e00f34..795b0ec1fe5 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,28 +24,8 @@ #include "precompiled.hpp" #include "opto/c2compiler.hpp" +#include "opto/optoreg.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // register information defined by ADLC extern const char register_save_policy[]; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index bd122ddb139..585f9315241 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -69,27 +69,6 @@ #include "runtime/timer.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // -------------------- Compile::mach_constant_base_node ----------------------- diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 4aa770d5af5..0486bf6885b 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -35,28 +35,6 @@ #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "runtime/deoptimization.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif - // Portions of code courtesy of Clifford Click diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 10daf5694f9..a601752d4cd 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,33 +24,13 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/c2compiler.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/machnode.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // Optimization - Graph Style diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index e0a09d27ff1..8e01709fcda 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 8bd6f35afd8..515a40c4663 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,27 +28,9 @@ #include "opto/node.hpp" #include "opto/opcodes.hpp" #include "opto/subnode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif + +class BiasedLockingCounters; +class RTMLockingCounters; //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index a8321b07753..cce4a739473 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/idealGraphPrinter.hpp" @@ -37,27 +38,6 @@ #include "opto/type.hpp" #include "opto/vectornode.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif OptoReg::Name OptoReg::c_frame_pointer; diff --git a/hotspot/src/share/vm/opto/optoreg.hpp b/hotspot/src/share/vm/opto/optoreg.hpp index 0d45c7a50ab..cc383393946 100644 --- a/hotspot/src/share/vm/opto/optoreg.hpp +++ b/hotspot/src/share/vm/opto/optoreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,30 @@ #ifndef SHARE_VM_OPTO_OPTOREG_HPP #define SHARE_VM_OPTO_OPTOREG_HPP +// AdGlobals contains c2 specific register handling code as specified +// in the .ad files. +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/adGlobals_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/adGlobals_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/adGlobals_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/adGlobals_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/adGlobals_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/adGlobals_ppc_64.hpp" +#endif + //------------------------------OptoReg---------------------------------------- // We eventually need Registers for the Real World. Registers are essentially // non-SSA names. A Register is represented as a number. Non-regular values diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index c8e6b9736c2..15bf30b393a 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -30,10 +30,12 @@ #include "compiler/compileBroker.hpp" #include "compiler/oopMap.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/locknode.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/output.hpp" #include "opto/regalloc.hpp" #include "opto/runtime.hpp" diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp index 298de0fec67..ab3c1a30457 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,9 @@ #ifndef SHARE_VM_OPTO_OUTPUT_HPP #define SHARE_VM_OPTO_OUTPUT_HPP +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/node.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif class Arena; class Bundle; diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 5b2771e83ef..b4470dcef53 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1089,7 +1089,7 @@ Node *PhaseIterGVN::transform_old(Node* n) { #endif while (i != NULL) { -#ifndef PRODUCT +#ifdef ASSERT if (loop_count >= K) { dump_infinite_loop_info(i); } diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp index a30678dadf2..06a245a12f0 100644 --- a/hotspot/src/share/vm/opto/regmask.cpp +++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -23,29 +23,9 @@ */ #include "precompiled.hpp" +#include "opto/ad.hpp" #include "opto/compile.hpp" #include "opto/regmask.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp index ff0d0b96dc2..15f687ac38e 100644 --- a/hotspot/src/share/vm/opto/regmask.hpp +++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,27 +27,6 @@ #include "code/vmreg.hpp" #include "opto/optoreg.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif // Some fun naming (textual) substitutions: // diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index dba4f047b5a..2a2fb131dfd 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/icBuffer.hpp" #include "code/nmethod.hpp" @@ -45,6 +46,7 @@ #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" @@ -68,27 +70,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/copy.hpp" #include "utilities/preserveException.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // For debugging purposes: diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index b8ad0105dfc..b5e8bc34d98 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -27,6 +27,7 @@ #include "code/codeBlob.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/type.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/rtmLocking.hpp" diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index e8d014430df..be70cfffd6e 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -70,6 +70,7 @@ # include "code/exceptionHandlerTable.hpp" # include "code/jvmticmlr.h" # include "code/location.hpp" +# include "code/nativeInst.hpp" # include "code/nmethod.hpp" # include "code/oopRecorder.hpp" # include "code/pcDesc.hpp" @@ -106,6 +107,7 @@ # include "interpreter/bytecodes.hpp" # include "interpreter/cppInterpreter.hpp" # include "interpreter/interpreter.hpp" +# include "interpreter/interp_masm.hpp" # include "interpreter/invocationCounter.hpp" # include "interpreter/linkResolver.hpp" # include "interpreter/templateInterpreter.hpp" @@ -228,6 +230,7 @@ # include "utilities/array.hpp" # include "utilities/bitMap.hpp" # include "utilities/bitMap.inline.hpp" +# include "utilities/bytes.hpp" # include "utilities/constantTag.hpp" # include "utilities/copy.hpp" # include "utilities/debug.hpp" @@ -250,6 +253,7 @@ # include "libadt/dict.hpp" # include "libadt/set.hpp" # include "libadt/vectset.hpp" +# include "opto/ad.hpp" # include "opto/addnode.hpp" # include "opto/adlcVMDeps.hpp" # include "opto/block.hpp" diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index f6af607c4ee..eee24dfc999 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -234,9 +234,8 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread, *method_p = method; if (!method->is_valid_method()) return false; - intptr_t bcx = fr->interpreter_frame_bcx(); - - int bci = method->validate_bci_from_bcx(bcx); + address bcp = fr->interpreter_frame_bcp(); + int bci = method->validate_bci_from_bcp(bcp); // note: bci is set to -1 if not a valid bci *bci_p = bci; diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index 4ffa3d491d0..1de4f021017 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -37,21 +37,6 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/jfieldIDWorkaround.hpp" #include "runtime/thread.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 4f292216473..1970d715ebc 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index 92ff86fcd6d..c6633bf34a9 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,21 +28,8 @@ #include "oops/fieldStreams.hpp" #include "prims/jvmtiClassFileReconstituter.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" + // FIXME: add Deprecated attribute // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index eca5cc1eb1f..89680d13ea6 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "jvmtifiles/jvmtiEnv.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/objArrayKlass.hpp" diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 955e34d5034..c0e4f30d2a2 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -38,6 +38,7 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/reflection.hpp" #include "runtime/synchronizer.hpp" +#include "runtime/vm_version.hpp" #include "services/threadService.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 694ecbd685d..e6805b12e5b 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "memory/metadataFactory.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" @@ -38,6 +39,7 @@ #include "runtime/arguments.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/array.hpp" #include "utilities/debug.hpp" diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index 1b97c18b7f7..5c765ec21b8 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "runtime/advancedThresholdPolicy.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7accd0c0b18..3f0bff025ec 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -38,6 +38,7 @@ #include "runtime/globals_extension.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" @@ -1537,8 +1538,10 @@ void Arguments::set_conservative_max_heap_alignment() { heap_alignment = G1CollectedHeap::conservative_max_heap_alignment(); } #endif // INCLUDE_ALL_GCS - _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(), - CollectorPolicy::compute_heap_alignment()); + _conservative_max_heap_alignment = MAX4(heap_alignment, + (size_t)os::vm_allocation_granularity(), + os::max_page_size(), + CollectorPolicy::compute_heap_alignment()); } void Arguments::set_ergonomics_flags() { diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index b15664f4b52..a7ad943cf7c 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" #include "code/debugInfoRec.hpp" #include "code/nmethod.hpp" #include "code/pcDesc.hpp" @@ -50,44 +51,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/events.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif -#endif // COMPILER2 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp index 1a5f4fe5286..51ae25d0c34 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "code/codeBlob.hpp" +#include "code/nativeInst.hpp" #include "memory/allocation.hpp" #include "prims/jvm.h" #include "runtime/dtraceJSDT.hpp" diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp index 67b766ae944..7e7592a5406 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,6 @@ #define SHARE_VM_RUNTIME_DTRACEJSDT_HPP #include "code/nmethod.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif class RegisteredProbes; typedef jlong OpaqueProbes; diff --git a/hotspot/src/share/vm/runtime/fprofiler.cpp b/hotspot/src/share/vm/runtime/fprofiler.cpp index 58cb6e89daa..aec76268824 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.cpp +++ b/hotspot/src/share/vm/runtime/fprofiler.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" +#include "code/codeCache.hpp" #include "code/vtableStubs.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 0e6d22eb01f..d076896f0aa 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -23,6 +23,8 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/abstractCompiler.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" @@ -48,21 +50,6 @@ #include "runtime/thread.inline.hpp" #include "utilities/decoder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC @@ -412,91 +399,32 @@ void frame::interpreter_frame_set_method(Method* method) { *interpreter_frame_method_addr() = method; } -void frame::interpreter_frame_set_bcx(intptr_t bcx) { - assert(is_interpreted_frame(), "Not an interpreted frame"); - if (ProfileInterpreter) { - bool formerly_bci = is_bci(interpreter_frame_bcx()); - bool is_now_bci = is_bci(bcx); - *interpreter_frame_bcx_addr() = bcx; - - intptr_t mdx = interpreter_frame_mdx(); - - if (mdx != 0) { - if (formerly_bci) { - if (!is_now_bci) { - // The bcx was just converted from bci to bcp. - // Convert the mdx in parallel. - MethodData* mdo = interpreter_frame_method()->method_data(); - assert(mdo != NULL, ""); - int mdi = mdx - 1; // We distinguish valid mdi from zero by adding one. - address mdp = mdo->di_to_dp(mdi); - interpreter_frame_set_mdx((intptr_t)mdp); - } - } else { - if (is_now_bci) { - // The bcx was just converted from bcp to bci. - // Convert the mdx in parallel. - MethodData* mdo = interpreter_frame_method()->method_data(); - assert(mdo != NULL, ""); - int mdi = mdo->dp_to_di((address)mdx); - interpreter_frame_set_mdx((intptr_t)mdi + 1); // distinguish valid from 0. - } - } - } - } else { - *interpreter_frame_bcx_addr() = bcx; - } -} - jint frame::interpreter_frame_bci() const { assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - return is_bci(bcx) ? bcx : interpreter_frame_method()->bci_from((address)bcx); -} - -void frame::interpreter_frame_set_bci(jint bci) { - assert(is_interpreted_frame(), "interpreted frame expected"); - assert(!is_bci(interpreter_frame_bcx()), "should not set bci during GC"); - interpreter_frame_set_bcx((intptr_t)interpreter_frame_method()->bcp_from(bci)); + address bcp = interpreter_frame_bcp(); + return interpreter_frame_method()->bci_from(bcp); } address frame::interpreter_frame_bcp() const { assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - return is_bci(bcx) ? interpreter_frame_method()->bcp_from(bcx) : (address)bcx; + return (address)*interpreter_frame_bcp_addr(); } void frame::interpreter_frame_set_bcp(address bcp) { assert(is_interpreted_frame(), "interpreted frame expected"); - assert(!is_bci(interpreter_frame_bcx()), "should not set bcp during GC"); - interpreter_frame_set_bcx((intptr_t)bcp); -} - -void frame::interpreter_frame_set_mdx(intptr_t mdx) { - assert(is_interpreted_frame(), "Not an interpreted frame"); - assert(ProfileInterpreter, "must be profiling interpreter"); - *interpreter_frame_mdx_addr() = mdx; + *interpreter_frame_bcp_addr() = (intptr_t)bcp; } address frame::interpreter_frame_mdp() const { assert(ProfileInterpreter, "must be profiling interpreter"); assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - intptr_t mdx = interpreter_frame_mdx(); - - assert(!is_bci(bcx), "should not access mdp during GC"); - return (address)mdx; + return (address)*interpreter_frame_mdp_addr(); } void frame::interpreter_frame_set_mdp(address mdp) { assert(is_interpreted_frame(), "interpreted frame expected"); - if (mdp == NULL) { - // Always allow the mdp to be cleared. - interpreter_frame_set_mdx((intptr_t)mdp); - } - intptr_t bcx = interpreter_frame_bcx(); - assert(!is_bci(bcx), "should not set mdp during GC"); - interpreter_frame_set_mdx((intptr_t)mdp); + assert(ProfileInterpreter, "must be profiling interpreter"); + *interpreter_frame_mdp_addr() = (intptr_t)mdp; } BasicObjectLock* frame::next_monitor_in_interpreter_frame(BasicObjectLock* current) const { @@ -1182,24 +1110,6 @@ void frame::metadata_do(void f(Metadata*)) { } } -void frame::gc_prologue() { - if (is_interpreted_frame()) { - // set bcx to bci to become Method* position independent during GC - interpreter_frame_set_bcx(interpreter_frame_bci()); - } -} - - -void frame::gc_epilogue() { - if (is_interpreted_frame()) { - // set bcx back to bcp for interpreter - interpreter_frame_set_bcx((intptr_t)interpreter_frame_bcp()); - } - // call processor specific epilog function - pd_gc_epilog(); -} - - # ifdef ENABLE_ZAP_DEAD_LOCALS void frame::CheckValueClosure::do_oop(oop* p) { diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index f715f68b52d..9cdb256eea5 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,29 +30,6 @@ #include "runtime/monitorChunk.hpp" #include "runtime/registerMap.hpp" #include "utilities/top.hpp" -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif -#endif // COMPILER2 #ifdef ZERO #ifdef TARGET_ARCH_zero # include "stack_zero.hpp" @@ -241,8 +218,8 @@ class frame VALUE_OBJ_CLASS_SPEC { private: intptr_t** interpreter_frame_locals_addr() const; - intptr_t* interpreter_frame_bcx_addr() const; - intptr_t* interpreter_frame_mdx_addr() const; + intptr_t* interpreter_frame_bcp_addr() const; + intptr_t* interpreter_frame_mdp_addr() const; public: // Locals @@ -252,23 +229,13 @@ class frame VALUE_OBJ_CLASS_SPEC { void interpreter_frame_set_locals(intptr_t* locs); - // byte code index/pointer (use these functions for unchecked frame access only!) - intptr_t interpreter_frame_bcx() const { return *interpreter_frame_bcx_addr(); } - void interpreter_frame_set_bcx(intptr_t bcx); - // byte code index jint interpreter_frame_bci() const; - void interpreter_frame_set_bci(jint bci); // byte code pointer address interpreter_frame_bcp() const; void interpreter_frame_set_bcp(address bcp); - // Unchecked access to the method data index/pointer. - // Only use this if you know what you are doing. - intptr_t interpreter_frame_mdx() const { return *interpreter_frame_mdx_addr(); } - void interpreter_frame_set_mdx(intptr_t mdx); - // method data pointer address interpreter_frame_mdp() const; void interpreter_frame_set_mdp(address dp); @@ -437,10 +404,6 @@ class frame VALUE_OBJ_CLASS_SPEC { // RedefineClasses support for finding live interpreted methods on the stack void metadata_do(void f(Metadata*)); - void gc_prologue(); - void gc_epilogue(); - void pd_gc_epilog(); - # ifdef ENABLE_ZAP_DEAD_LOCALS private: class CheckValueClosure: public OopClosure { @@ -477,7 +440,6 @@ class frame VALUE_OBJ_CLASS_SPEC { // Verification void verify(const RegisterMap* map); static bool verify_return_pc(address x); - static bool is_bci(intptr_t bcx); // Usage: // assert(frame::verify_return_pc(return_address), "must be a return pc"); diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index ce725956dee..c17c4f4ac60 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,21 +31,6 @@ #include "oops/method.hpp" #include "runtime/frame.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif #ifdef ZERO #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" @@ -55,26 +40,6 @@ #endif #endif -// This file holds platform-independent bodies of inline functions for frames. - -// Note: The bcx usually contains the bcp; however during GC it contains the bci -// (changed by gc_prologue() and gc_epilogue()) to be Method* position -// independent. These accessors make sure the correct value is returned -// by testing the range of the bcx value. bcp's are guaranteed to be above -// max_method_code_size, since methods are always allocated in OldSpace and -// Eden is allocated before OldSpace. -// -// The bcp is accessed sometimes during GC for ArgumentDescriptors; than -// the correct translation has to be performed (was bug). - -inline bool frame::is_bci(intptr_t bcx) { -#ifdef _LP64 - return ((uintptr_t) bcx) <= ((uintptr_t) max_method_code_size) ; -#else - return 0 <= bcx && bcx <= max_method_code_size; -#endif -} - inline bool frame::is_entry_frame() const { return StubRoutines::returns_to_call_stub(pc()); } diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 3a075117afe..cfecf0a5d57 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -65,21 +65,6 @@ #include "utilities/histogram.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 86bf1d6ba4d..d24c688bf13 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" @@ -49,6 +50,7 @@ #include "runtime/os.inline.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp index b0f536fb95c..e27b745ff7c 100644 --- a/hotspot/src/share/vm/runtime/registerMap.hpp +++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,6 @@ #include "code/vmreg.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif class JavaThread; diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp index bbc0600f739..6ea9ab4c819 100644 --- a/hotspot/src/share/vm/runtime/relocator.hpp +++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,7 @@ #include "interpreter/bytecodes.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff --git a/hotspot/src/share/vm/runtime/rframe.cpp b/hotspot/src/share/vm/runtime/rframe.cpp index c52d16ff3d5..f3ef5504b37 100644 --- a/hotspot/src/share/vm/runtime/rframe.cpp +++ b/hotspot/src/share/vm/runtime/rframe.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 8d5ed4cb233..4b16f6b04a8 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -56,26 +56,6 @@ #include "services/runtimeService.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 917f6d257b4..8ccee76cdb6 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/scopeDesc.hpp" #include "code/vtableStubs.hpp" @@ -59,26 +60,6 @@ #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp index 3794f64d78c..fdf448b3718 100644 --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -24,21 +24,6 @@ #include "precompiled.hpp" #include "runtime/stackValueCollection.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp index 082cc4ec45e..55fda6fb3f9 100644 --- a/hotspot/src/share/vm/runtime/statSampler.cpp +++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,21 +33,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" #include "runtime/statSampler.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" // -------------------------------------------------------- // StatSamplerTask diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 78381168fc4..46d93a52916 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -31,21 +31,6 @@ #include "runtime/mutexLocker.hpp" #include "runtime/stubCodeGenerator.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 984c7522580..08785805729 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" #include "interpreter/interpreter.hpp" @@ -74,6 +75,7 @@ #include "runtime/vframe_hp.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" @@ -2647,20 +2649,6 @@ void JavaThread::deoptimized_wrt_marked_nmethods() { } -// GC support -static void frame_gc_epilogue(frame* f, const RegisterMap* map) { f->gc_epilogue(); } - -void JavaThread::gc_epilogue() { - frames_do(frame_gc_epilogue); -} - - -static void frame_gc_prologue(frame* f, const RegisterMap* map) { f->gc_prologue(); } - -void JavaThread::gc_prologue() { - frames_do(frame_gc_prologue); -} - // If the caller is a NamedThread, then remember, in the current scope, // the given JavaThread in its _processed_thread field. class RememberProcessedThread: public StackObj { @@ -4149,18 +4137,6 @@ void Threads::metadata_do(void f(Metadata*)) { } } -void Threads::gc_epilogue() { - ALL_JAVA_THREADS(p) { - p->gc_epilogue(); - } -} - -void Threads::gc_prologue() { - ALL_JAVA_THREADS(p) { - p->gc_prologue(); - } -} - void Threads::deoptimized_wrt_marked_nmethods() { ALL_JAVA_THREADS(p) { p->deoptimized_wrt_marked_nmethods(); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 715e50a552f..7df1c0f3cbc 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1416,10 +1416,6 @@ class JavaThread: public Thread { // RedefineClasses Support void metadata_do(void f(Metadata*)); - // Memory management operations - void gc_epilogue(); - void gc_prologue(); - // Misc. operations char* name() const { return (char*)get_thread_name(); } void print_on(outputStream* st) const; @@ -1899,8 +1895,6 @@ class Threads: AllStatic { // RedefineClasses support static void metadata_do(void f(Metadata*)); - static void gc_epilogue(); - static void gc_prologue(); #ifdef ASSERT static bool is_vm_complete() { return _vm_complete; } #endif diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 70f31b14c51..17ead61b782 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -511,8 +511,8 @@ inline bool vframeStreamCommon::fill_from_frame() { inline void vframeStreamCommon::fill_from_interpreter_frame() { Method* method = _frame.interpreter_frame_method(); - intptr_t bcx = _frame.interpreter_frame_bcx(); - int bci = method->validate_bci_from_bcx(bcx); + address bcp = _frame.interpreter_frame_bcp(); + int bci = method->validate_bci_from_bcp(bcp); // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. if (bci < 0) { found_bad_method_frame(); diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 72e2e8717cb..6a3652c0ea1 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" +#include "code/vmreg.inline.hpp" #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" @@ -296,9 +297,9 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, src->lock()->move_to(src->obj(), top->lock()); } if (ProfileInterpreter) { - iframe()->interpreter_frame_set_mdx(0); // clear out the mdp. + iframe()->interpreter_frame_set_mdp(0); // clear out the mdp. } - iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet + iframe()->interpreter_frame_set_bcp(bcp); if (ProfileInterpreter) { MethodData* mdo = method()->method_data(); if (mdo != NULL) { diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 33fe915e7fe..3ff41705843 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -193,33 +193,13 @@ #include "opto/movenode.hpp" #include "opto/narrowptrnode.hpp" #include "opto/opaquenode.hpp" +#include "opto/optoreg.hpp" #include "opto/phaseX.hpp" #include "opto/parse.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" #include "opto/subnode.hpp" #include "opto/vectornode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif // COMPILER2 // Note: the cross-product of (c1, c2, product, nonproduct, ...), diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index 6f27fe3fecc..2e913c5015f 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compilerOracle.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index bbebb4157be..c20e9a548cc 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -26,21 +26,7 @@ #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index fcd7b229348..a4fd05a31e7 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -128,4 +128,20 @@ class Abstract_VM_Version: AllStatic { static unsigned int calc_parallel_worker_threads(); }; +#ifdef TARGET_ARCH_x86 +# include "vm_version_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vm_version_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vm_version_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif + #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 7a6d3402809..73e8673dddb 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,17 +25,16 @@ #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP -#include "runtime/arguments.hpp" #include "classfile/vmSymbols.hpp" -#include "utilities/ostream.hpp" -#include "runtime/vm_version.hpp" -#include "runtime/vmThread.hpp" +#include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vmThread.hpp" #include "services/diagnosticArgument.hpp" #include "services/diagnosticCommand.hpp" -#include "services/diagnosticFramework.hpp" #include "services/diagnosticCommand_ext.hpp" +#include "services/diagnosticFramework.hpp" #include "utilities/macros.hpp" +#include "utilities/ostream.hpp" class HelpDCmd : public DCmdWithParser { protected: diff --git a/hotspot/src/share/vm/services/diagnosticFramework.hpp b/hotspot/src/share/vm/services/diagnosticFramework.hpp index ca60f53ebc8..4c9fe98da9d 100644 --- a/hotspot/src/share/vm/services/diagnosticFramework.hpp +++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ #include "memory/allocation.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" -#include "runtime/vm_version.hpp" #include "runtime/vmThread.hpp" #include "utilities/ostream.hpp" diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch b/hotspot/src/share/vm/utilities/bytes.hpp similarity index 64% rename from jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch rename to hotspot/src/share/vm/utilities/bytes.hpp index c44e81dac57..7da269a4775 100644 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch +++ b/hotspot/src/share/vm/utilities/bytes.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -21,12 +19,26 @@ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. + * */ -// -// Prefix header for all source files of the 'JavaAppLauncher' target in the 'JavaAppLauncher' project -// +#ifndef SHARE_VM_UTILITIES_BYTES_HPP +#define SHARE_VM_UTILITIES_BYTES_HPP -#ifdef __OBJC__ - #import +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" #endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif + +#endif // SHARE_VM_UTILITIES_BYTES_HPP diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 0fc7d6af3a1..58e84e23a16 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -48,6 +48,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "runtime/vm_version.hpp" #include "services/heapDumper.hpp" #include "utilities/defaultStream.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index 4a807a0662d..59943c4b161 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -28,6 +28,7 @@ #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/defaultStream.hpp" #include "utilities/ostream.hpp" #include "utilities/top.hpp" diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index f6b55cc99f0..2bff5f5c824 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "gc_interface/collectedHeap.hpp" #include "prims/whitebox.hpp" diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 6a89ec446d3..b88243644c0 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -117,15 +117,6 @@ compact3 = \ # Tests that require compact3 API's # needs_compact3 = \ - compiler/8009761/Test8009761.java \ - compiler/whitebox/DeoptimizeMethodTest.java \ - compiler/whitebox/SetForceInlineMethodTest.java \ - compiler/whitebox/SetDontInlineMethodTest.java \ - compiler/whitebox/DeoptimizeAllTest.java \ - compiler/whitebox/MakeMethodNotCompilableTest.java \ - compiler/whitebox/ClearMethodStateTest.java \ - compiler/whitebox/EnqueueMethodForCompilationTest.java \ - compiler/whitebox/IsMethodCompilableTest.java \ gc/6581734/Test6581734.java \ gc/7072527/TestFullGCCount.java \ gc/g1/TestHumongousAllocInitialMark.java \ @@ -138,11 +129,7 @@ needs_compact3 = \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ serviceability/threads/TestFalseDeadLock.java \ serviceability/jvmti/GetObjectSizeOverflow.java \ - serviceability/jvmti/TestRedefineWithUnresolvedClass.java \ - compiler/tiered/NonTieredLevelsTest.java \ - compiler/tiered/TieredLevelsTest.java \ - compiler/intrinsics/bmi/verifycode \ - runtime/whitebox/WBStackSize.java + serviceability/jvmti/TestRedefineWithUnresolvedClass.java # Compact 2 adds full VM tests compact2 = \ @@ -199,8 +186,7 @@ compact2_minimal = \ # Tests that require compact2 API's # -needs_compact2 = \ - compiler/6589834/Test_ia32.java +needs_compact2 = # All tests that run on the most minimal configuration: Minimal VM on Compact 1 compact1_minimal = \ diff --git a/hotspot/test/compiler/5091921/Test6890943.java b/hotspot/test/compiler/5091921/Test6890943.java index 6dee78a593c..9752b1d0c2b 100644 --- a/hotspot/test/compiler/5091921/Test6890943.java +++ b/hotspot/test/compiler/5091921/Test6890943.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,163 +27,195 @@ * @bug 6890943 * @summary JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode. * - * @run shell/timeout=240 Test6890943.sh + * @run main/othervm/timeout=240 Test6890943 */ -import java.util.*; + import java.io.*; -import java.util.regex.*; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; public class Test6890943 { - public static final boolean AIR = true, ROCK = false; - public static void main(String[] args) { - new Test6890943().go(); - } + public static final boolean AIR = true, ROCK = false; + private static final Path PATH = Paths.get(System.getProperty("test.src", ".")); + private static final Path INPUT_FILE = PATH.resolve("input6890943.txt"); + private static final Path GOLDEN_FILE = PATH.resolve("output6890943.txt"); - int r, c, f, t; - boolean[][] grid; - - public void go() { - Scanner s = new Scanner(System.in); - s.useDelimiter("\\s+"); - int T = s.nextInt(); - for (t = 0 ; t < T ; t++) { - r = s.nextInt(); c = s.nextInt(); f = s.nextInt(); - grid = new boolean[r][c]; - for (int x = 0 ; x < r ; x++) { - String line = s.next(); - for (int y = 0 ; y < c ; y++) grid[x][y] = line.charAt(y) == '.'; - } - int digs = solve(); - String res = digs == -1 ? "No" : "Yes " + digs; - System.out.printf("Case #%d: %s\n", t+1, res); + public static void main(String[] args) { + new Test6890943().go(); } - } - Map M = new HashMap(); + int r, c, f, t; + boolean[][] grid; - private int solve() { - M = new HashMap(); - M.put(calcWalkingRange(0, 0), 0); - for (int digDown = 0 ; digDown < r ; digDown++) { - Map tries = new HashMap(); - for (Map.Entry m : M.entrySet()) { - int q = m.getKey(); - if (depth(q) != (digDown)) continue; - if (stuck(q)) continue; - tries.put(q, m.getValue()); - } - - for (Map.Entry m : tries.entrySet()) { - int q = m.getKey(); - int fallLeftDelta = 0, fallRightDelta = 0; - //fall left - int fallLeft = fall(digDown, start(q)); - if (fallLeft > 0) { - fallLeftDelta = 1; - if (fallLeft <= f) addToM(calcWalkingRange(digDown+fallLeft, start(q)), m.getValue()); + public void go() { + Scanner in, golden; + try { + in = new Scanner(new FileInputStream(INPUT_FILE.toFile())); + golden = new Scanner(new FileInputStream(GOLDEN_FILE.toFile())); + } catch (FileNotFoundException e) { + throw new RuntimeException("TEST failure: can't open test file", e); } + in.useDelimiter("\\s+"); + golden.useDelimiter("\\s+"); - //fall right - int fallRight = fall(digDown, end(q)); - if (fallRight > 0) { - fallRightDelta = 1; - - if (fallRight <= f) addToM(calcWalkingRange(digDown+fallRight, end(q)), m.getValue()); - } - - for (int p = start(q) + fallLeftDelta ; p <= end(q) - fallRightDelta ; p++) { - //goLeft - for (int digSpot = p ; digSpot > start(q) +fallLeftDelta ; digSpot--) { - int fallDown = 1+fall(digDown+1, digSpot); - if (fallDown <= f) { - if (fallDown == 1) { - addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p), m.getValue() + Math.abs(digSpot-p)+1); - } else { - addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } + int T = in.nextInt(); + for (t = 0; t < T; t++) { + r = in.nextInt(); + c = in.nextInt(); + f = in.nextInt(); + grid = new boolean[r][c]; + for (int x = 0; x < r; x++) { + String line = in.next(); + for (int y = 0; y < c; y++) { + grid[x][y] = line.charAt(y) == '.'; + } } - } - - //goRight - for (int digSpot = p ; digSpot < end(q)-fallRightDelta ;digSpot++) { - int fallDown = 1+fall(digDown+1, digSpot); - if (fallDown <= f) { - if (fallDown == 1) { - addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } else { - addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } + int digs = solve(); + String result = "Case #" + (t + 1) + ": " + (digs == -1 ? "No" : "Yes " + digs); + System.out.println(result); + // Compare with golden string from the file + String goldenStr = golden.nextLine(); + if (!result.equals(goldenStr)) { + System.err.println("FAIL: strings are not equal\n" + + "-- Result: " + result + "\n" + + "-- Golden: " + goldenStr); + throw new RuntimeException("FAIL: Result string is not equal to the golden"); } - } } - } } - int result = Integer.MAX_VALUE; - for (Map.Entry m : M.entrySet()) { - if (depth(m.getKey()) == r-1) result = Math.min(m.getValue(), result); + Map M = new HashMap(); + + private int solve() { + M = new HashMap(); + M.put(calcWalkingRange(0, 0), 0); + for (int digDown = 0; digDown < r; digDown++) { + Map tries = new HashMap(); + for (Map.Entry m : M.entrySet()) { + int q = m.getKey(); + if (depth(q) != (digDown)) continue; + if (stuck(q)) continue; + tries.put(q, m.getValue()); + } + + for (Map.Entry m : tries.entrySet()) { + int q = m.getKey(); + int fallLeftDelta = 0, fallRightDelta = 0; + //fall left + int fallLeft = fall(digDown, start(q)); + if (fallLeft > 0) { + fallLeftDelta = 1; + if (fallLeft <= f) addToM(calcWalkingRange(digDown + fallLeft, start(q)), m.getValue()); + } + + //fall right + int fallRight = fall(digDown, end(q)); + if (fallRight > 0) { + fallRightDelta = 1; + + if (fallRight <= f) addToM(calcWalkingRange(digDown + fallRight, end(q)), m.getValue()); + } + + for (int p = start(q) + fallLeftDelta; p <= end(q) - fallRightDelta; p++) { + //goLeft + for (int digSpot = p; digSpot > start(q) + fallLeftDelta; digSpot--) { + int fallDown = 1 + fall(digDown + 1, digSpot); + if (fallDown <= f) { + if (fallDown == 1) { + addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p), + m.getValue() + Math.abs(digSpot - p) + 1); + } else { + addToM(calcWalkingRange(digDown + fallDown, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } + } + } + + //goRight + for (int digSpot = p; digSpot < end(q) - fallRightDelta; digSpot++) { + int fallDown = 1 + fall(digDown + 1, digSpot); + if (fallDown <= f) { + if (fallDown == 1) { + addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } else { + addToM(calcWalkingRange(digDown + fallDown, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } + } + } + } + } + } + + int result = Integer.MAX_VALUE; + for (Map.Entry m : M.entrySet()) { + if (depth(m.getKey()) == r - 1) result = Math.min(m.getValue(), result); + } + + if (result == Integer.MAX_VALUE) return -1; + return result; } - if (result == Integer.MAX_VALUE) return -1; - return result; - } - - private void addToM(int q, int i) { - Integer original = M.get(q); - if ( original == null ) M.put(q, i); - else M.put(q, Math.min(original, i)); - } - - private int fall(int row, int column) { - int res = 0; - for ( int p = row+1 ; p < r ; p++) { - if (grid[p][column] == AIR) res++; - else break; - } - return res; - } - - private boolean stuck(int q) { - return start(q) == end(q); - } - - private int depth(int q) { - return q % 50; - } - - private int start(int q) { - return q / (50*50); - } - - private int end(int q) { - return (q / 50) % 50; - } - - private int calcWalkingRange(int depth, int pos) { - return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE); - } - - private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) { - int left = pos, right = pos; - if (depth >= r) return (c-1)*50 + depth; - - while (left > 0) { - if (grid[depth][left-1] == ROCK && (left-1 < airOverrideStart || left-1 > airOverrideEnd)) break; - if (depth < r-1 && grid[depth+1][left-1] == AIR) { - left--; - break; - } - left--; - } - while (right < c-1) { - if (grid[depth][right+1] == ROCK && (right+1 < airOverrideStart || right+1 > airOverrideEnd)) break; - if (depth < r-1 && grid[depth+1][right+1] == AIR) { - right++; - break; - } - right++; + private void addToM(int q, int i) { + Integer original = M.get(q); + if (original == null) M.put(q, i); + else M.put(q, Math.min(original, i)); } - return left *50*50 + right*50 + depth; - } + private int fall(int row, int column) { + int res = 0; + for (int p = row + 1; p < r; p++) { + if (grid[p][column] == AIR) res++; + else break; + } + return res; + } + + private boolean stuck(int q) { + return start(q) == end(q); + } + + private int depth(int q) { + return q % 50; + } + + private int start(int q) { + return q / (50 * 50); + } + + private int end(int q) { + return (q / 50) % 50; + } + + private int calcWalkingRange(int depth, int pos) { + return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE); + } + + private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) { + int left = pos, right = pos; + if (depth >= r) return (c - 1) * 50 + depth; + + while (left > 0) { + if (grid[depth][left - 1] == ROCK && (left - 1 < airOverrideStart || left - 1 > airOverrideEnd)) break; + if (depth < r - 1 && grid[depth + 1][left - 1] == AIR) { + left--; + break; + } + left--; + } + while (right < c - 1) { + if (grid[depth][right + 1] == ROCK && (right + 1 < airOverrideStart || right + 1 > airOverrideEnd)) break; + if (depth < r - 1 && grid[depth + 1][right + 1] == AIR) { + right++; + break; + } + right++; + } + + return left * 50 * 50 + right * 50 + depth; + } } diff --git a/hotspot/test/compiler/5091921/Test6890943.sh b/hotspot/test/compiler/5091921/Test6890943.sh deleted file mode 100644 index 755f56890f1..00000000000 --- a/hotspot/test/compiler/5091921/Test6890943.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -## some tests require path to find test source dir -if [ "${TESTSRC}" = "" ] -then - TESTSRC=${PWD} - echo "TESTSRC not set. Using "${TESTSRC}" as default" -fi -echo "TESTSRC=${TESTSRC}" -## Adding common setup Variables for running shell tests. -. ${TESTSRC}/../../test_env.sh - - -set -x - -cp ${TESTSRC}/Test6890943.java . -cp ${TESTSRC}/input6890943.txt . -cp ${TESTSRC}/output6890943.txt . -cp ${TESTSRC}/Test6890943.sh . - -${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java - -${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1 - -# This test sometimes tickles an unrelated performance warning that interferes with diff. -grep -v 'warning: Performance bug: SystemDictionary' pretest.out > test.out - -diff output6890943.txt test.out - -result=$? -if [ $result -eq 0 ] -then - echo "Passed" - exit 0 -else - echo "Failed" - exit 1 -fi diff --git a/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java new file mode 100644 index 00000000000..aadc1056323 --- /dev/null +++ b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class InlinedArrayCloneTestCase implements Runnable { + private Test_ia32 executionController; + + public InlinedArrayCloneTestCase(Test_ia32 executionController) { + this.executionController = executionController; + } + + /* + * Please leave following two methods (invokeArrayClone and verifyArguments) + * static. + * + * It does not really matter if these methods are static or instance, + * original issue could be reproduced in both cases, but if these methods + * are static then it is much easier to understand that reproduced issue + * is actually interpreter's stack corruption. + * + * If these methods are non-static, then interpreter's stack will contain + * invalid 'this' pointer required for instance's method call and + * verifyArguments' call may throw NullPointerException. There was another + * issue w/ NPE after deoptimization addressed by JDK-6833129, so NPE looks + * a little bit confusing. + * + * If these methods are static then after deptimization we'll get incorrect + * arguments values in verifyArguments. + * Something like "2, -1289936896, 3, 4" instead of "1, 2, 3, 4". + * This information tells much more about actual issue comparing to NPE, + * so it's preferable to leave these methods static. + */ + private static int verifyArguments(int i1, int i2, LoadedClass[] arr, + int i3, int i4) { + if (!(i1==1 && i2==2 && i3==3 && i4==4)) { + throw new RuntimeException(String.format( + "Arguments have unexpected values: %d, %d, %d, %d", + i1, i2, i3, i4)); + } + return arr.length; + } + + private static int invokeArrayClone(LoadedClass[] a) { + return InlinedArrayCloneTestCase.verifyArguments(1, 2, a.clone(), 3, 4); + } + + @Override + public void run() { + LoadedClass[] array = executionController.getArray(); + int length; + + while (executionController.continueExecution()) { + try { + length = InlinedArrayCloneTestCase.invokeArrayClone(array); + } catch (Throwable e) { + e.printStackTrace(); + executionController.setTestFailed(); + return; + } + if (length != array.length) { + System.out.println(String.format("f(array) returned %d " + + "instead of %d.", length, array.length)); + executionController.setTestFailed(); + } + } + } +} diff --git a/hotspot/test/compiler/6589834/Test_ia32.java b/hotspot/test/compiler/6589834/Test_ia32.java index f9c2f524b26..aed3198320d 100644 --- a/hotspot/test/compiler/6589834/Test_ia32.java +++ b/hotspot/test/compiler/6589834/Test_ia32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,103 +24,116 @@ /** * @test * @bug 6589834 - * @summary deoptimization problem with -XX:+DeoptimizeALot - * - * @run main Test_ia32 + * @summary Safepoint placed between stack pointer increment and decrement leads + * to interpreter's stack corruption after deoptimization. + * @library /testlibrary /testlibrary/whitebox + * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.* + * Test_ia32 InlinedArrayCloneTestCase + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileOnly=InlinedArrayCloneTestCase + * -XX:CompileCommand=dontinline,InlinedArrayCloneTestCase.invokeArrayClone + * -XX:CompileCommand=inline,InlinedArrayCloneTestCase.verifyArguments + * -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack Test_ia32 */ -/*************************************************************************************** -NOTE: The bug shows up (with several "Bug!" message) even without the - flag -XX:+DeoptimizeALot. In a debug build, you may want to try - the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information. -****************************************************************************************/ -import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +import com.oracle.java.testlibrary.Asserts; +import sun.hotspot.WhiteBox; public class Test_ia32 { + private static final int NUM_THREADS + = Math.min(100, 2 * Runtime.getRuntime().availableProcessors()); + private static final int CLONE_LENGTH = 1000; - public static int NUM_THREADS = 100; + private static WhiteBox wb = WhiteBox.getWhiteBox(); - public static int CLONE_LENGTH = 1000; + private final LoadedClass[] ARRAY = new LoadedClass[Test_ia32.CLONE_LENGTH]; + private volatile boolean doSpin = true; + private volatile boolean testFailed = false; - public static void main(String[] args) throws InterruptedException, ClassNotFoundException { + public boolean continueExecution() { + return doSpin; + } + + public void stopExecution() { + doSpin = false; + } + + public boolean isTestFailed() { + return testFailed; + } + + public void setTestFailed() { + this.testFailed = true; + stopExecution(); + } + + public LoadedClass[] getArray() { + return ARRAY; + } + + public void runTest() { + Thread[] threads = new Thread[Test_ia32.NUM_THREADS]; + Method method; + + try { + method = InlinedArrayCloneTestCase.class.getDeclaredMethod( + "invokeArrayClone", LoadedClass[].class); + } catch (NoSuchMethodException e) { + throw new Error("Tested method not found", e); + } + + Asserts.assertTrue(wb.isMethodCompilable(method), + "Method " + method.getName() + " should be compilable."); - Reflector[] threads = new Reflector[NUM_THREADS]; for (int i = 0; i < threads.length; i++) { - threads[i] = new Reflector(); + threads[i] = new Thread(new InlinedArrayCloneTestCase(this)); threads[i].start(); } - System.out.println("Give Reflector.run() some time to compile..."); - Thread.sleep(5000); + /* + * Wait until InlinedArrayCloneTestCase::invokeArrayClone is compiled. + */ + while (!wb.isMethodCompiled(method)) { + Thread.yield(); + } - System.out.println("Load RMISecurityException causing run() deoptimization"); - ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException"); + /* + * Load NotLoadedClass to cause deoptimization of + * InlinedArrayCloneTestCase::invokeArrayClone due to invalidated + * dependency. + */ + try { + Class.forName("NotLoadedClass"); + } catch (ClassNotFoundException e) { + throw new Error("Unable to load class that invalidates " + + "CHA-dependency for method " + method.getName(), e); + } - for (Reflector thread : threads) - thread.requestStop(); + stopExecution(); - for (Reflector thread : threads) + for (Thread thread : threads) { try { thread.join(); } catch (InterruptedException e) { - System.out.println(e); + throw new Error("Fail to join thread " + thread, e); } + } + Asserts.assertFalse(isTestFailed(), "Test failed."); } + public static void main(String[] args) { + new Test_ia32().runTest(); + } } -class Reflector extends Thread { - - volatile boolean _doSpin = true; - - Test_ia32[] _tests; - - Reflector() { - _tests = new Test_ia32[Test_ia32.CLONE_LENGTH]; - for (int i = 0; i < _tests.length; i++) { - _tests[i] = new Test_ia32(); - } - } - - static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) { - - if (!(i1==1 && i2==2 && i3==3 && i4==4)) { - System.out.println("Bug!"); - } - - return arr.length; - } - - static int f(Test_ia32[] arr) { - return g(1, 2, arr.clone(), 3, 4); - } - - @Override - public void run() { - Constructor[] ctrs = null; - Class klass = Test_ia32.class; - try { - ctrs = klass.getConstructors(); - } catch (SecurityException e) { - System.out.println(e); - } - - try { - while (_doSpin) { - if (f(_tests) < 0) - System.out.println("return value usage"); - } - } catch (NullPointerException e) { - e.printStackTrace(); - } - - System.out.println(this + " - stopped."); - } - - public void requestStop() { - System.out.println(this + " - stop requested."); - _doSpin = false; - } - +class LoadedClass { +} + +@SuppressWarnings("unused") +class NotLoadedClass extends LoadedClass { } diff --git a/hotspot/test/compiler/8004051/Test8004051.java b/hotspot/test/compiler/8004051/Test8004051.java index 97073e96b1e..981effb2089 100644 --- a/hotspot/test/compiler/8004051/Test8004051.java +++ b/hotspot/test/compiler/8004051/Test8004051.java @@ -28,7 +28,7 @@ * @bug 8005722 * @summary assert(_oprs_len[mode] < maxNumberOfOperands) failed: array overflow * - * @run main/othervm -Xcomp -client Test8004051 + * @run main/othervm -Xcomp Test8004051 */ public class Test8004051 { diff --git a/hotspot/test/compiler/ciReplay/TestSA.sh b/hotspot/test/compiler/ciReplay/TestSA.sh index 61d93652f25..56736c7807e 100644 --- a/hotspot/test/compiler/ciReplay/TestSA.sh +++ b/hotspot/test/compiler/ciReplay/TestSA.sh @@ -26,7 +26,7 @@ ## ## @test ## @bug 8011675 -## @ignore 8032226, 8031978 +## @ignore 8031978 ## @summary testing of ciReplay with using generated by SA replay.txt ## @author igor.ignatyev@oracle.com ## @run shell TestSA.sh diff --git a/hotspot/test/compiler/ciReplay/TestVM.sh b/hotspot/test/compiler/ciReplay/TestVM.sh index c972c607947..e58d63e16fa 100644 --- a/hotspot/test/compiler/ciReplay/TestVM.sh +++ b/hotspot/test/compiler/ciReplay/TestVM.sh @@ -26,7 +26,6 @@ ## ## @test ## @bug 8011675 -## @ignore 8031978 ## @summary testing of ciReplay with using generated by VM replay.txt ## @author igor.ignatyev@oracle.com ## @run shell TestVM.sh diff --git a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh index 4d0ee773c44..d961d42541d 100644 --- a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh +++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh @@ -26,7 +26,6 @@ ## ## @test ## @bug 8011675 -## @ignore 8031978 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level ## @author igor.ignatyev@oracle.com ## @run shell TestVM_no_comp_level.sh diff --git a/hotspot/test/compiler/ciReplay/common.sh b/hotspot/test/compiler/ciReplay/common.sh index cf17febc4f7..b7c5b7b4292 100644 --- a/hotspot/test/compiler/ciReplay/common.sh +++ b/hotspot/test/compiler/ciReplay/common.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -223,21 +223,29 @@ generate_replay() { -XX:CICrashAt=1 \ -XX:+CreateMinidumpOnCrash \ -XX:+DumpReplayDataOnError \ + -XX:-TransmitErrorReport \ + -XX:+PreferInterpreterNativeStubs \ + -XX:+PrintCompilation \ -XX:ReplayDataFile=${replay_data} \ -version" echo GENERATION OF REPLAY.TXT: echo $cmd ${cmd} > crash.out 2>&1 - + + exit_code=$? + if [ ${exit_code} -eq 0 ] + then + cat crash.out + test_fail 3 "CHECK :: CRASH" "JVM exits gracefully" + fi + core_locations=`grep -i core crash.out | grep "location:" | \ sed -e 's/.*location: //'` - echo CRASH OUTPUT: - cat crash.out - - if [ "${core_locations}" = "" ] + + if [ -z "${core_locations}" ] then - test_fail 2 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out" + test_fail 4 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out" fi rm crash.out @@ -245,16 +253,19 @@ generate_replay() { # processing core locations for *nix if [ $VM_OS != "windows" ] then - # remove 'or' between '/core.' and 'core' + # remove 'or' between '/core.' and 'core' + # and the rest of line -- ' (max size ...) . To ensure a full core ...' core_locations=`echo $core_locations | \ - sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` - # add /core. core. + sed -e 's/\([^ ]*\) or \([^ ]*\).*/\1 \2/'` core_with_dir=`echo $core_locations | awk '{print $1}'` - dir=`dirname $core_with_dir` core_with_pid=`echo $core_locations | awk '{print $2}'` - if [ -n ${core_with_pid} ] + dir=`dirname $core_with_dir` + file=`basename $core_with_dir` + # add /core. core + core_locations="'$core_with_dir' '$file'" + if [ -n "${core_with_pid}" ] then - core_locations="$core_locations $dir${FS}$core_with_pid $core_with_pid" + core_locations="$core_locations '$core_with_pid' '$dir${FS}$core_with_pid'" fi fi diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java index 0425bafc4a0..49efda1215b 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java @@ -146,6 +146,10 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest { } protected int countCpuInstructions(byte[] nativeCode) { + return countCpuInstructions(nativeCode, instrMask, instrPattern); + } + + public static int countCpuInstructions(byte[] nativeCode, byte[] instrMask, byte[] instrPattern) { int count = 0; int patternSize = Math.min(instrMask.length, instrPattern.length); boolean found; @@ -183,4 +187,21 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest { return "UseBMI1Instructions"; } } + + abstract static class BmiTestCase_x64 extends BmiTestCase { + protected byte[] instrMask_x64; + protected byte[] instrPattern_x64; + + protected BmiTestCase_x64(Method method) { + super(method); + } + + protected int countCpuInstructions(byte[] nativeCode) { + int cnt = super.countCpuInstructions(nativeCode); + if (Platform.isX64()) { // on x64 platform the instruction we search for can be encoded in 2 different ways + cnt += countCpuInstructions(nativeCode, instrMask_x64, instrPattern_x64); + } + return cnt; + } + } } diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java index 0ba76e69bc5..62c8642833b 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java @@ -33,12 +33,15 @@ import java.lang.reflect.Method; -public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase { +public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 { protected LZcntTestI(Method method) { super(method); instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD}; + + instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; + instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD}; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java index 5ecfb96d637..16caae2b0d9 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java @@ -31,8 +31,6 @@ * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL */ -import com.oracle.java.testlibrary.Platform; - import java.lang.reflect.Method; public class LZcntTestL extends LZcntTestI { @@ -40,10 +38,6 @@ public class LZcntTestL extends LZcntTestI { protected LZcntTestL(Method method) { super(method); isLongOperation = true; - if (Platform.isX64()) { - instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; - instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD}; - } } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java index ad2af2c615a..2502641e8da 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java @@ -33,12 +33,15 @@ import java.lang.reflect.Method; -public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase { +public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 { protected TZcntTestI(Method method) { super(method); instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBC}; + + instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; + instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC}; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java index 0a856dfa9e2..c08dbcc1fc9 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java @@ -31,8 +31,6 @@ * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL */ -import com.oracle.java.testlibrary.Platform; - import java.lang.reflect.Method; public class TZcntTestL extends TZcntTestI { @@ -40,11 +38,6 @@ public class TZcntTestL extends TZcntTestI { protected TZcntTestL(Method method) { super(method); isLongOperation = true; - if (Platform.isX64()) { - instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; - instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC}; - } - isLongOperation = true; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java index 08321b87266..ab975e4bdb7 100644 --- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java @@ -25,8 +25,8 @@ import java.util.function.IntPredicate; /** * @test NonTieredLevelsTest - * @ignore 8046268 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @ignore 8046268 * @build NonTieredLevelsTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java index 4b9a0a4a906..d862f50e904 100644 --- a/hotspot/test/compiler/tiered/TieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java @@ -23,8 +23,8 @@ /** * @test TieredLevelsTest - * @ignore 8046268 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @ignore 8046268 * @build TieredLevelsTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java index 195221658cf..8adbf2075a9 100644 --- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java +++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,9 @@ import java.util.function.Function; /* * @test ClearMethodStateTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build ClearMethodStateTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* ClearMethodStateTest diff --git a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java index 5f353998061..ea673d6b862 100644 --- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java @@ -21,11 +21,8 @@ * questions. */ -import com.sun.management.HotSpotDiagnosticMXBean; -import com.sun.management.VMOption; import sun.hotspot.WhiteBox; import sun.hotspot.code.NMethod; -import sun.management.ManagementFactoryHelper; import java.lang.reflect.Constructor; import java.lang.reflect.Executable; @@ -98,15 +95,7 @@ public abstract class CompilerWhiteBoxTest { */ protected static String getVMOption(String name) { Objects.requireNonNull(name); - HotSpotDiagnosticMXBean diagnostic - = ManagementFactoryHelper.getDiagnosticMXBean(); - VMOption tmp; - try { - tmp = diagnostic.getVMOption(name); - } catch (IllegalArgumentException e) { - tmp = null; - } - return (tmp == null ? null : tmp.getValue()); + return Objects.toString(WHITE_BOX.getVMFlag(name), null); } /** @@ -174,7 +163,7 @@ public abstract class CompilerWhiteBoxTest { * @see #test() */ protected final void runTest() { - if (ManagementFactoryHelper.getCompilationMXBean() == null) { + if (CompilerWhiteBoxTest.MODE.startsWith("interpreted ")) { System.err.println( "Warning: test is not applicable in interpreted mode"); return; diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index a5b9d794c66..1a297ae350e 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -23,9 +23,9 @@ /* * @test DeoptimizeAllTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build DeoptimizeAllTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeAllTest diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index e257a1e5e25..bee232d2cb0 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -23,9 +23,9 @@ /* * @test DeoptimizeMethodTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build DeoptimizeMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeMethodTest diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java index 4acebb2b123..5c6c4f39690 100644 --- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,9 +23,9 @@ /* * @test EnqueueMethodForCompilationTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build EnqueueMethodForCompilationTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* EnqueueMethodForCompilationTest diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java index 9800f3a3eb3..14bc76278dd 100644 --- a/hotspot/test/compiler/whitebox/GetNMethodTest.java +++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java @@ -26,9 +26,9 @@ import sun.hotspot.code.NMethod; /* * @test GetNMethodTest - * @ignore 8046268 * @bug 8038240 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build GetNMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* GetNMethodTest diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index 604175c38ef..651002d078e 100644 --- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -23,9 +23,9 @@ /* * @test MakeMethodNotCompilableTest - * @ignore 8046268 * @bug 8012322 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build MakeMethodNotCompilableTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest diff --git a/hotspot/test/runtime/whitebox/WBStackSize.java b/hotspot/test/runtime/whitebox/WBStackSize.java index 2a0216082d7..ff1a4dcca25 100644 --- a/hotspot/test/runtime/whitebox/WBStackSize.java +++ b/hotspot/test/runtime/whitebox/WBStackSize.java @@ -39,7 +39,6 @@ * Please file a test bug, if this is a problem. */ -import com.sun.management.HotSpotDiagnosticMXBean; import sun.hotspot.WhiteBox; public class WBStackSize { @@ -81,8 +80,7 @@ public class WBStackSize { } public static void main(String[] args) { - HotSpotDiagnosticMXBean bean = sun.management.ManagementFactoryHelper.getDiagnosticMXBean(); - long configStackSize = Long.valueOf(bean.getVMOption("ThreadStackSize").getValue()) * K; + long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K; System.out.println("ThreadStackSize VM option: " + configStackSize); diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index bc38438285e..bb58361ffda 100644 --- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -25,6 +25,10 @@ package sun.hotspot; import java.lang.reflect.Executable; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Stream; import java.security.BasicPermission; import sun.hotspot.parser.DiagnosticCommand; @@ -171,4 +175,15 @@ public class WhiteBox { public native Long getUint64VMFlag(String name); public native String getStringVMFlag(String name); public native Double getDoubleVMFlag(String name); + private final List> flagsGetters = Arrays.asList( + this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag, + this::getUint64VMFlag, this::getStringVMFlag, this::getDoubleVMFlag); + + public Object getVMFlag(String name) { + return flagsGetters.stream() + .map(f -> f.apply(name)) + .filter(x -> x != null) + .findAny() + .orElse(null); + } } diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java index 0818f21f1c0..6c98889e6ae 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java @@ -91,16 +91,20 @@ public final class VmFlagTest { } private void testPositive(T value, T expected) { - Asserts.assertEQ(getVMOptionAsString(), asString(getValue())); + String oldValue = getVMOptionAsString(); + Asserts.assertEQ(oldValue, asString(getValue())); + Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName))); setNewValue(value); String newValue = getVMOptionAsString(); Asserts.assertEQ(newValue, asString(expected)); - Asserts.assertEQ(getVMOptionAsString(), asString(getValue())); + Asserts.assertEQ(newValue, asString(getValue())); + Asserts.assertEQ(newValue, asString(WHITE_BOX.getVMFlag(flagName))); } private void testNegative(T value, T expected) { String oldValue = getVMOptionAsString(); Asserts.assertEQ(oldValue, asString(getValue())); + Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName))); setNewValue(value); String newValue = getVMOptionAsString(); Asserts.assertEQ(oldValue, newValue); diff --git a/jdk/.hgtags b/jdk/.hgtags index 0718a4f34ab..d5928939618 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -267,3 +267,4 @@ f87c5be90e01a7ffb47947108eb3e0b0b1920880 jdk9-b20 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24 +a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25 diff --git a/jdk/make/CopyFiles.gmk b/jdk/make/CopyFiles.gmk index acab2541256..7666fcd2dd5 100644 --- a/jdk/make/CopyFiles.gmk +++ b/jdk/make/CopyFiles.gmk @@ -122,7 +122,7 @@ COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES) ########################################################################################## # -# Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR +# Copy cursor.properties and cursors gif files to LIBDIR # ifneq ($(OPENJDK_TARGET_OS), macosx) OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib @@ -130,11 +130,6 @@ else OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib endif -$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties - $(call install-file) - -COPY_FILES += $(LIBDIR)/flavormap.properties - CURSORS_DEST_DIR = $(LIBDIR)/images/cursors CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib/images/cursors diff --git a/jdk/make/CopyIntoClasses.gmk b/jdk/make/CopyIntoClasses.gmk index fdf2a173aca..a80c661ace9 100644 --- a/jdk/make/CopyIntoClasses.gmk +++ b/jdk/make/CopyIntoClasses.gmk @@ -163,6 +163,19 @@ $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R))) ################################################################################ +ifneq ($(OPENJDK_TARGET_OS), macosx) + OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/awt/datatransfer/flavormap.properties +else + OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/macosx/classes/sun/awt/datatransfer/flavormap.properties +endif + +$(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties: $(OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES) + $(install-file) + +COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties + +################################################################################ + CLEAN_FILES := $(wildcard \ $(JDK_TOPDIR)/src/share/classes/com/sun/imageio/plugins/common/*.properties \ $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/*.properties \ diff --git a/jdk/make/Setup.gmk b/jdk/make/Setup.gmk index 485c3b72b13..c4f204cf6af 100644 --- a/jdk/make/Setup.gmk +++ b/jdk/make/Setup.gmk @@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,- # To build with all warnings enabled, do the following: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:all,-deprecation,-rawtypes,-unchecked -Werror +JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror # Any java code executed during a JDK build to build other parts of the JDK must be # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this diff --git a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template index 1bfe54530e2..9c1a133f67f 100644 --- a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template +++ b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import sun.swing.BeanInfoUtils; */ public class @(BeanClassName)BeanInfo extends javax.swing.SwingBeanInfoBase { - private static final Class class@(BeanClassName) = @(BeanClassObject); + private static final Class class@(BeanClassName) = @(BeanClassObject); /** * @return a @(BeanClassName) BeanDescriptor diff --git a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java index 08e55122f5f..d6167b448e5 100644 --- a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java +++ b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,7 @@ public class SwingBeanInfoBase extends SimpleBeanInfo * its PropertyDescriptors will be included. */ public BeanInfo[] getAdditionalBeanInfo() { - Class superClass = getBeanDescriptor().getBeanClass().getSuperclass(); + Class superClass = getBeanDescriptor().getBeanClass().getSuperclass(); BeanInfo superBeanInfo = null; try { superBeanInfo = Introspector.getBeanInfo(superClass); diff --git a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java index fbcc2995dd5..037615ad63a 100644 --- a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java +++ b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,7 @@ public class BeanInfoUtils * @see java.beans#PropertyDescriptor * @see java.beans#FeatureDescriptor */ - public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args) + public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args) { PropertyDescriptor pd = null; try { @@ -156,7 +156,7 @@ public class BeanInfoUtils String methodName = (String)value; Method method; try { - method = cls.getMethod(methodName, new Class[0]); + method = cls.getMethod(methodName, new Class[0]); pd.setReadMethod(method); } catch(Exception e) { @@ -168,8 +168,8 @@ public class BeanInfoUtils String methodName = (String)value; Method method; try { - Class type = pd.getPropertyType(); - method = cls.getMethod(methodName, new Class[]{type}); + Class type = pd.getPropertyType(); + method = cls.getMethod(methodName, new Class[]{type}); pd.setWriteMethod(method); } catch(Exception e) { @@ -215,9 +215,9 @@ public class BeanInfoUtils * @see java.beans#BeanInfo * @see java.beans#PropertyDescriptor */ - public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args) + public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args) { - Class customizerClass = null; + Class customizerClass = null; /* For reasons I don't understand, customizerClass is a * readOnly property. So we have to find it and pass it @@ -242,11 +242,11 @@ public class BeanInfoUtils } static private PropertyDescriptor createReadOnlyPropertyDescriptor( - String name, Class cls) throws IntrospectionException { + String name, Class cls) throws IntrospectionException { Method readMethod = null; String base = capitalize(name); - Class[] parameters = new Class[0]; + Class[] parameters = new Class[0]; // Is it a boolean? try { @@ -264,7 +264,7 @@ public class BeanInfoUtils try { // Try indexed accessor pattern. - parameters = new Class[1]; + parameters = new Class[1]; parameters[0] = int.class; readMethod = cls.getMethod("get" + base, parameters); } catch (NoSuchMethodException nsme) { diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk index e3fc71c4bf9..3f0a408fab7 100644 --- a/jdk/make/lib/PlatformLibraries.gmk +++ b/jdk/make/lib/PlatformLibraries.gmk @@ -90,8 +90,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) LIBOSX_DIRS := \ $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \ $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \ - $(JDK_TOPDIR)/src/macosx/native/apple/security \ - $(JDK_TOPDIR)/src/macosx/native/apple/launcher + $(JDK_TOPDIR)/src/macosx/native/apple/security $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \ LIBRARY := osx, \ diff --git a/jdk/make/mapfiles/libawt/mapfile-mawt-vers b/jdk/make/mapfiles/libawt/mapfile-mawt-vers index b8ea1636c88..06d3ff802e1 100644 --- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers +++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers @@ -204,6 +204,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; diff --git a/jdk/make/mapfiles/libawt_headless/mapfile-vers b/jdk/make/mapfiles/libawt_headless/mapfile-vers index c12d07d80fa..df24e4505db 100644 --- a/jdk/make/mapfiles/libawt_headless/mapfile-vers +++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers @@ -76,6 +76,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; # libfontmanager entry points AWTIsHeadless; diff --git a/jdk/make/mapfiles/libawt_xawt/mapfile-vers b/jdk/make/mapfiles/libawt_xawt/mapfile-vers index 3ae8af3ddbf..4a891077b76 100644 --- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers +++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers @@ -442,6 +442,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; awt_GetDrawingSurface; awt_FreeDrawingSurface; diff --git a/jdk/make/profile-includes.txt b/jdk/make/profile-includes.txt index e252ace094a..fe069c37034 100644 --- a/jdk/make/profile-includes.txt +++ b/jdk/make/profile-includes.txt @@ -177,7 +177,6 @@ FULL_JRE_LIB_FILES := \ ext/dnsns.jar \ ext/nashorn.jar \ ext/zipfs.jar \ - flavormap.properties \ fontconfig.RedHat.5.bfc \ fontconfig.RedHat.5.properties.src \ fontconfig.RedHat.6.bfc \ diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj b/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj deleted file mode 100644 index b51cbefbd9b..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj +++ /dev/null @@ -1,318 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */ = {isa = PBXBuildFile; fileRef = 2C483E04143512EB00F2AEFD /* 1.7.0.jre */; }; - 89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD29142EEB2200A08AED /* InfoPlist.strings */; }; - 89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD2B142EEB2200A08AED /* GenericApp.icns */; }; - 89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD30142EEB2200A08AED /* JVMArgs.m */; }; - 89D3CD36142EEB2200A08AED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD31142EEB2200A08AED /* main.m */; }; - 89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3D364143041F000A08AED /* JavaAppLauncher.m */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 2C48F06614350F0F00F2AEFD /* Copy PlugIns */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - 2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */, - ); - name = "Copy PlugIns"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 2C483E04143512EB00F2AEFD /* 1.7.0.jre */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jre; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/1.7.0.jre"; sourceTree = SOURCE_ROOT; }; - 2C48F06714350F8300F2AEFD /* 1.7.0.jdk */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jdk; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk"; sourceTree = SOURCE_ROOT; }; - 2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classfile_constants.h; sourceTree = ""; }; - 2CB5DA6014355FCA00D3A656 /* jawt_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt_md.h; sourceTree = ""; }; - 2CB5DA6114355FCA00D3A656 /* jni_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni_md.h; sourceTree = ""; }; - 2CB5DA6214355FCA00D3A656 /* jawt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt.h; sourceTree = ""; }; - 2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jdwpTransport.h; sourceTree = ""; }; - 2CB5DA6414355FCA00D3A656 /* jni.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni.h; sourceTree = ""; }; - 2CB5DA6514355FCA00D3A656 /* jvmti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmti.h; sourceTree = ""; }; - 2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmticmlr.h; sourceTree = ""; }; - 89D3CD2A142EEB2200A08AED /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 89D3CD2B142EEB2200A08AED /* GenericApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = GenericApp.icns; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/GenericApp.icns; sourceTree = ""; }; - 89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "JavaAppLauncher-Info.plist"; sourceTree = ""; }; - 89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher_Prefix.pch; sourceTree = ""; }; - 89D3CD2F142EEB2200A08AED /* JVMArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JVMArgs.h; sourceTree = ""; }; - 89D3CD30142EEB2200A08AED /* JVMArgs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JVMArgs.m; sourceTree = ""; }; - 89D3CD31142EEB2200A08AED /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 89D3D363143041F000A08AED /* JavaAppLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher.h; sourceTree = ""; }; - 89D3D364143041F000A08AED /* JavaAppLauncher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavaAppLauncher.m; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* JavaAppLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JavaAppLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A0FEA54F0111CA2CBB /* frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = frameworks; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* JavaAppLauncher.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* JavaAppLauncher */ = { - isa = PBXGroup; - children = ( - 89D3CD2D142EEB2200A08AED /* src */, - 89D3CD28142EEB2200A08AED /* resources */, - 29B97323FDCFA39411CA2CEA /* linking */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = JavaAppLauncher; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* linking */ = { - isa = PBXGroup; - children = ( - 2C48F06714350F8300F2AEFD /* 1.7.0.jdk */, - 2C483E04143512EB00F2AEFD /* 1.7.0.jre */, - 2CB5DA5D14355FCA00D3A656 /* include */, - 1058C7A0FEA54F0111CA2CBB /* frameworks */, - ); - name = linking; - sourceTree = ""; - }; - 2CB5DA5D14355FCA00D3A656 /* include */ = { - isa = PBXGroup; - children = ( - 2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */, - 2CB5DA5F14355FCA00D3A656 /* darwin */, - 2CB5DA6214355FCA00D3A656 /* jawt.h */, - 2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */, - 2CB5DA6414355FCA00D3A656 /* jni.h */, - 2CB5DA6514355FCA00D3A656 /* jvmti.h */, - 2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */, - ); - name = include; - path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/include"; - sourceTree = ""; - }; - 2CB5DA5F14355FCA00D3A656 /* darwin */ = { - isa = PBXGroup; - children = ( - 2CB5DA6014355FCA00D3A656 /* jawt_md.h */, - 2CB5DA6114355FCA00D3A656 /* jni_md.h */, - ); - path = darwin; - sourceTree = ""; - }; - 89D3CD28142EEB2200A08AED /* resources */ = { - isa = PBXGroup; - children = ( - 89D3CD29142EEB2200A08AED /* InfoPlist.strings */, - 89D3CD2B142EEB2200A08AED /* GenericApp.icns */, - 89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */, - ); - path = resources; - sourceTree = ""; - }; - 89D3CD2D142EEB2200A08AED /* src */ = { - isa = PBXGroup; - children = ( - 89D3CD31142EEB2200A08AED /* main.m */, - 89D3D363143041F000A08AED /* JavaAppLauncher.h */, - 89D3D364143041F000A08AED /* JavaAppLauncher.m */, - 89D3CD2F142EEB2200A08AED /* JVMArgs.h */, - 89D3CD30142EEB2200A08AED /* JVMArgs.m */, - 89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */, - ); - path = src; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* JavaAppLauncher */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 2C48F06614350F0F00F2AEFD /* Copy PlugIns */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = JavaAppLauncher; - productInstallPath = "$(HOME)/Applications"; - productName = JavaAppLauncher; - productReference = 8D1107320486CEB800E47090 /* JavaAppLauncher.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - en, - English, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* JavaAppLauncher */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* JavaAppLauncher */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */, - 89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */, - 89D3CD36142EEB2200A08AED /* main.m in Sources */, - 89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 89D3CD29142EEB2200A08AED /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 89D3CD2A142EEB2200A08AED /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch; - INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = JavaAppLauncher; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch; - INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = JavaAppLauncher; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SDKROOT = ""; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings b/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f8..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist b/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist deleted file mode 100644 index a3268bb9f89..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist +++ /dev/null @@ -1,48 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - GenericApp.icns - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} - CFBundleDisplayName - Your Cool App - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2011 Your Company Inc. All Rights Reserved. - JVMInfo - - JRE - 1.7.0.jre - ClassPath - - Properties - - apple.laf.useScreenMenuBar - true - - MainClass - com.yourcompany.yourapp.mainclass - Arguments - - - - diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h deleted file mode 100644 index cceb88d6e7c..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 - -#import "jni.h" - - -@interface JVMArgs : NSObject { -@public - NSBundle *jreBundle; - char *preferredJVMLib; - JavaVMInitArgs vm_args; - BOOL startOnFirstThread; - BOOL debug; - - NSDictionary *appInfo; - NSMutableDictionary *jvmInfo; - - NSString *userHome; - NSString *appPackage; - NSString *javaRoot; -} - -@property (retain, nonatomic) NSBundle *jreBundle; -@property (nonatomic) char *preferredJVMLib; -@property (nonatomic) JavaVMInitArgs vm_args; -@property (nonatomic) BOOL startOnFirstThread; -@property (nonatomic) BOOL debug; - -@property (retain, nonatomic) NSDictionary *appInfo; -@property (retain, nonatomic) NSMutableDictionary *jvmInfo; - -@property (retain, nonatomic) NSString *userHome; -@property (retain, nonatomic) NSString *appPackage; -@property (retain, nonatomic) NSString *javaRoot; - -+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv; - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m deleted file mode 100644 index 1f4af016080..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 "JVMArgs.h" - - -#define kArgsFailure "JVMArgsFailure" - -NSString *kArgumentsKey = @"Arguments"; - -NSString *kClassPathKey = @"ClassPath"; -#ifdef __i386__ -NSString *kArchClassPathKey = @"ClassPath.i386"; -#elif __x86_64__ -NSString *kArchClassPathKey = @"ClassPath.x86_64"; -#endif - -NSString *kVMOptionsKey = @"VMOptions"; -#ifdef __i386__ -NSString *kArchVMOptionsKey = @"VMOptions.i386"; -#elif __x86_64__ -NSString *kArchVMOptionsKey = @"VMOptions.x86_64"; -#endif - - -@implementation JVMArgs - -@synthesize jreBundle; -@synthesize preferredJVMLib; -@synthesize vm_args; -@synthesize startOnFirstThread; -@synthesize debug; - -@synthesize appInfo; -@synthesize jvmInfo; - -@synthesize userHome; -@synthesize appPackage; -@synthesize javaRoot; - -- (void) dealloc { - self.jreBundle = nil; - if (self.preferredJVMLib) free(self.preferredJVMLib); - - self.appInfo = nil; - self.jvmInfo = nil; - - self.userHome = nil; - self.appPackage = nil; - self.javaRoot = nil; - - [super dealloc]; -} - - -NSString *GetJavaRoot(NSDictionary *jvmInfoDict) { - NSObject *javaRoot = [jvmInfoDict objectForKey:@"$JAVAROOT"]; - if (![javaRoot isKindOfClass:[NSString class]]) return @"$APP_PACKAGE/Contents/Java"; - return (NSString *)javaRoot; -} - -// Replaces occurances of $JAVAROOT, $APP_PACKAGE, and $USER_HOME -- (NSString *) expandMacros:(NSString *)str { - if ([str rangeOfString:@"$JAVAROOT"].length == 0 && [str rangeOfString:@"$APP_PACKAGE"].length == 0 && [str rangeOfString:@"$USER_HOME"].length == 0) return str; - - // expand $JAVAROOT first, because it can contain $APP_PACKAGE - NSMutableString *mutable = [str mutableCopy]; - [mutable replaceOccurrencesOfString:@"$JAVAROOT" withString:javaRoot options:0 range:NSMakeRange(0, [str length])]; - [mutable replaceOccurrencesOfString:@"$APP_PACKAGE" withString:appPackage options:0 range:NSMakeRange(0, [str length])]; - [mutable replaceOccurrencesOfString:@"$USER_HOME" withString:userHome options:0 range:NSMakeRange(0, [str length])]; - return mutable; -} - -- (NSArray *) arrayFrom:(id) obj delimitedBy:(NSString *)delimiter withErrKey:(NSString *)key { - if (obj == nil) return nil; - if ([obj isKindOfClass:[NSArray class]]) return obj; - if (![obj isKindOfClass:[NSString class]]) { - [NSException raise:@kArgsFailure format:@"%@", [NSString stringWithFormat:@"Failed to find '%@' array in JVMInfo Info.plist"]]; - } - - // split - return [(NSString *)obj componentsSeparatedByString:delimiter]; -} - -- (void) buildArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv { - // for verbose logging - self.debug = NULL != getenv("JAVA_LAUNCHER_VERBOSE"); - - self.appInfo = [appBundle infoDictionary]; - - // all apps must have a JVMInfo dictionary inside their Info.plist - self.jvmInfo = [[self.appInfo objectForKey:@"JVMInfo"] mutableCopy]; - if (![jvmInfo isKindOfClass:[NSDictionary class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'JVMInfo' dictionary in Info.plist"]; - } - - // initialize macro expansion values - self.userHome = NSHomeDirectory(); - self.appPackage = [appBundle bundlePath]; - self.javaRoot = GetJavaRoot(jvmInfo); - self.javaRoot = [self expandMacros:self.javaRoot]; // dereference $APP_PACKAGE - - // if the 'Arguments' key is defined, those override the ones that came into main() - NSArray *jvmInfoArgs = [jvmInfo valueForKey:kArgumentsKey]; - if (jvmInfoArgs != nil) { - // substitute all the variables in the 'Arguments' array/string - jvmInfoArgs = [self arrayFrom:jvmInfoArgs delimitedBy:@" " withErrKey:kArgumentsKey]; - NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:[jvmInfoArgs count]]; - [jvmInfoArgs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [arguments replaceObjectAtIndex:idx withObject:[self expandMacros:[obj description]]]; - }]; - [jvmInfo setObject:arguments forKey:kArgumentsKey]; - } else if (argc != 0) { - // put the (macro expanded) args to main() in an NSArray - NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:argc]; - for (int i = 0; i < argc; i++) { - [arguments addObject:[self expandMacros:[NSString stringWithUTF8String:(argv[i])]]]; - } - [jvmInfo setObject:arguments forKey:kArgumentsKey]; - } - - // all JVMInfo's must have a JRE or JDK key - NSString *jreBundleName = [jvmInfo objectForKey:@"JRE"]; - if (!jreBundleName) jreBundleName = [jvmInfo objectForKey:@"JDK"]; - if (![jreBundleName isKindOfClass:[NSString class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'JRE' or 'JDK' string in Info.plist JVMInfo"]; - } - - // the JRE/JDK must be loadable from the ($APP_PACKAGE)/Contents/PlugIns/ directory - NSURL *jreBundleURL = [[appBundle builtInPlugInsURL] URLByAppendingPathComponent:jreBundleName]; - self.jreBundle = [NSBundle bundleWithURL:jreBundleURL]; - if (!self.jreBundle) { - [NSException raise:@kArgsFailure format:@"Failed to find JRE/JDK at: %@", jreBundleURL]; - } - - // if the app prefers 'client' or 'server', use the JVM key - NSString *JVMLib = [jvmInfo objectForKey:@"JVM"]; - if (JVMLib != nil) self.preferredJVMLib = strdup([JVMLib UTF8String]); - - // sniff for StartOnFirstThread - if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) { - self.startOnFirstThread = YES; - } else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) { - // for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary - self.startOnFirstThread = YES; - } - - // add $JAVAROOT directory to the JNI library search path - setenv("JAVA_LIBRARY_PATH", [javaRoot UTF8String], 1); - - // 'WorkingDirectory' key changes current working directory - NSString *javaWorkingDir = [jvmInfo objectForKey:@"WorkingDirectory"]; - if (javaWorkingDir == nil) javaWorkingDir = @"$APP_PACKAGE/.."; - javaWorkingDir = [self expandMacros:javaWorkingDir]; - if (chdir([javaWorkingDir UTF8String]) == -1) { - NSLog(@kArgsFailure " chdir() failed, could not change the current working directory to %s\n", [javaWorkingDir UTF8String]); - } - - NSMutableArray *classpath = [NSMutableArray array]; - - // 'Jar' key sets exactly one classpath entry - NSString *jarFile = [jvmInfo objectForKey:@"Jar"]; - if (jarFile != nil) { - [jvmInfo setObject:[self expandMacros:jarFile] forKey:@"Jar"]; - [classpath addObject:jarFile]; - } - - // 'ClassPath' key allows arbitrary classpath - [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kClassPathKey] delimitedBy:@":" withErrKey:kClassPathKey]]; - [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchClassPathKey] delimitedBy:@":" withErrKey:kArchClassPathKey]]; - - // Sum up all the classpath entries into one big JVM arg - NSMutableString *classpathOption = [NSMutableString stringWithString:@"-Djava.class.path="]; - [classpath enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if (idx > 1) [classpathOption appendString:@":"]; - [classpathOption appendString:obj]; - }]; - - NSMutableArray *jvmOptions = [NSMutableArray arrayWithObject:classpathOption]; - - // 'VMOptions' key allows arbitary VM start up options - [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kVMOptionsKey] delimitedBy:@" " withErrKey:kVMOptionsKey]]; - [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchVMOptionsKey] delimitedBy:@" " withErrKey:kArchVMOptionsKey]]; - - // 'Properties' key is a sub-dictionary transfered to initial System.properties - NSDictionary *properties = [jvmInfo objectForKey:@"Properties"]; - if (properties != nil) { - if (![properties isKindOfClass:[NSDictionary class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'Properties' dictionary in Info.plist JVMInfo"]; - } - - [properties enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [jvmOptions addObject:[NSString stringWithFormat:@"-D%@=%@", key, obj]]; - }]; - } - - // build the real JVM init args struct - vm_args.version = JNI_VERSION_1_6; - vm_args.ignoreUnrecognized = JNI_TRUE; - vm_args.nOptions = [jvmOptions count]; - vm_args.options = calloc(vm_args.nOptions, sizeof(JavaVMOption)); - [jvmOptions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - NSString *expanded = [self expandMacros:[obj description]]; // turn everything into a string, and expand macros - vm_args.options[idx].optionString = strdup([expanded UTF8String]); - }]; -} - -+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv { - JVMArgs *args = [JVMArgs new]; - [args buildArgsForBundle:appBundle argc:argc argv:argv]; - return [args autorelease]; -} - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m deleted file mode 100644 index db44ab3fee7..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 "JavaAppLauncher.h" - -#import - -#import "jni.h" - -#define kLaunchFailure "JavaAppLauncherFailure" - - -typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args); -typedef void (JNICALL *SetPreferredJVM_t)(const char *prefJVM); - - -@implementation JavaAppLauncher - -@synthesize args; - -- (void) findAndLoadJVM { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - - @try { - // load the libjli.dylib of the embedded JRE (or JDK) bundle - NSURL *jreBundleURL = [args.jreBundle bundleURL]; - CFBundleRef jreBundle = CFBundleCreate(NULL, (CFURLRef)jreBundleURL); - - NSError *err = nil; - Boolean jreBundleLoaded = CFBundleLoadExecutableAndReturnError(jreBundle, (CFErrorRef *)&err); - if (err != nil || !jreBundleLoaded) { - [NSException raise:@kLaunchFailure format:@"could not load the JRE/JDK: %@", err]; - } - - // if there is a preferred libjvm to load, set it here - if (args.preferredJVMLib != NULL) { - SetPreferredJVM_t setPrefJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JLI_SetPreferredJVM")); - if (setPrefJVMFxnPtr != NULL) { - setPrefJVMFxnPtr(args.preferredJVMLib); - } else { - NSLog(@"No JLI_SetPreferredJVM in JRE/JDK primary executable, failed to set preferred JVM library to: %s", args->preferredJVMLib); - } - } - - // pull the JNI_CreateJavaVM function pointer out of the primary executable of the JRE/JDK bundle - CreateJavaVM_t createJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JNI_CreateJavaVM")); - if (createJVMFxnPtr == NULL) { - [NSException raise:@kLaunchFailure format:@"null JNI_CreateJavaVM fxn ptr from: %@", jreBundle]; - } - - // instantiate the JVM - JNIEnv *env; - jint createJVMStatus = createJVMFxnPtr(&jvm, (void **)&env, &(args->vm_args)); - if (createJVMStatus != JNI_OK) { - [NSException raise:@kLaunchFailure format:@"failed to JNI_CreateJavaVM (%d): %@", createJVMStatus, jreBundle]; - } - - // check the app needs to run the Java main() on the main thread - if (args.startOnFirstThread) { - dispatch_sync(dispatch_get_main_queue(), ^(void) { - JNIEnv *mainThreadEnv; - (*jvm)->AttachCurrentThread(jvm, (void **)&mainThreadEnv, NULL); - [self invokeBundledAppJavaLauncherWithEnv:mainThreadEnv]; - (*jvm)->DetachCurrentThread(jvm); - }); - } else { - [self invokeBundledAppJavaLauncherWithEnv:env]; - } - - } @catch (NSException *e) { - NSLog(@"%@: %@", e, [e callStackSymbols]); - } - - if (jvm) { - (*jvm)->DetachCurrentThread(jvm); - (*jvm)->DestroyJavaVM(jvm); - } - - [pool drain]; -} - -static const char kLauncherClassName[] = "apple/launcher/JavaAppLauncher"; - -- (void) invokeBundledAppJavaLauncherWithEnv:(JNIEnv *)env { - // hand off control to the apple.launcher.JavaAppLauncher class - - jclass mainClass = (*env)->FindClass(env, kLauncherClassName); - if (mainClass == NULL) { - fprintf(stderr, kLaunchFailure " FindClass() failed for class %s:\n", kLauncherClassName); - (*env)->ExceptionDescribe(env); - return; - } - - jmethodID mainMethod = (*env)->GetStaticMethodID(env, mainClass, "launch", "(JZ)V"); - if ((mainMethod == NULL) || (*env)->ExceptionOccurred(env)) { - fprintf(stderr, kLaunchFailure " GetStaticMethodID() failed for launch() method"); - (*env)->ExceptionDescribe(env); - return; - } - - CFDictionaryRef jvmInfo = CFRetain(args.jvmInfo); - - (*env)->CallStaticVoidMethod(env, mainClass, mainMethod, (jlong)jvmInfo, (jboolean)args.debug); - if ((*env)->ExceptionOccurred(env)) { - fprintf(stderr, kLaunchFailure " CallStaticVoidMethod() threw an exception\n"); - (*env)->ExceptionDescribe(env); - return; - } -} - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m deleted file mode 100644 index 019e78a7d48..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 - -#import "JVMArgs.h" -#import "JavaAppLauncher.h" - - -static void dummyTimer(CFRunLoopTimerRef timer, void *info) {} -static void ParkEventLoop() { - // RunLoop needs at least one source, and 1e20 is pretty far into the future - CFRunLoopTimerRef t = CFRunLoopTimerCreate(kCFAllocatorDefault, 1.0e20, 0.0, 0, 0, dummyTimer, NULL); - CFRunLoopAddTimer(CFRunLoopGetCurrent(), t, kCFRunLoopDefaultMode); - CFRelease(t); - - // Park this thread in the main run loop. - int32_t result; - do { - result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0e20, false); - } while (result != kCFRunLoopRunFinished); -} - -int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - - @try { - NSBundle *mainBundle = [NSBundle mainBundle]; - - // pick apart the Info.plist, and release all the temporary objects - NSAutoreleasePool *argParsingPool = [NSAutoreleasePool new]; - JVMArgs *args = [JVMArgs jvmArgsForBundle:mainBundle argc:argc argv:argv]; - JavaAppLauncher *launcher = [JavaAppLauncher new]; - launcher.args = args; - [argParsingPool drain]; - - // kick off a new thread to instantiate the JVM on - NSThread *thread = [[NSThread alloc] initWithTarget:launcher selector:@selector(findAndLoadJVM) object:nil]; - struct rlimit limit; - int err = getrlimit(RLIMIT_STACK, &limit); - if (err == 0 && limit.rlim_cur != 0LL) { - [thread setStackSize:limit.rlim_cur]; - } - [thread start]; - [thread release]; - - [launcher release]; - - ParkEventLoop(); - - } @catch (NSException *e) { - NSLog(@"%@: %@", e, [e callStackSymbols]); - } - - [pool drain]; - - return 0; -} diff --git a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java b/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java deleted file mode 100644 index c701b1be63e..00000000000 --- a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 apple.launcher; - -import java.io.*; -import java.lang.reflect.*; -import java.text.MessageFormat; -import java.util.*; -import java.util.jar.*; - -import javax.swing.*; - -class JavaAppLauncher implements Runnable { - static { - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Void run() { - System.loadLibrary("osx"); - return null; - } - }); - } - - private static native T nativeConvertAndRelease(final long ptr); - private static native void nativeInvokeNonPublic(Class cls, Method m, String[] args); - - // entry point from native - static void launch(final long javaDictionaryPtr, final boolean verbose) { - final Map javaDictionary = nativeConvertAndRelease(javaDictionaryPtr); - (new JavaAppLauncher(javaDictionary, verbose)).run(); - } - - // these are the values for the enumeration JavaFailureMode - static final String kJavaFailureMainClassNotSpecified = "MainClassNotSpecified"; - static final String kJavaFailureMainClassNotFound = "CannotLoadMainClass"; - static final String kJavaFailureMainClassHasNoMain = "NoMainMethod"; - static final String kJavaFailureMainClassMainNotStatic = "MainNotStatic"; - static final String kJavaFailureMainThrewException = "MainThrewException"; - static final String kJavaFailureMainInitializerException = "MainInitializerException"; - - final boolean verbose; // Normally set by environment variable JAVA_LAUNCHER_VERBOSE. - final Map javaDictionary; - - JavaAppLauncher(final Map javaDictionary, final boolean verbose) { - this.verbose = verbose; - this.javaDictionary = javaDictionary; - } - - @Override - public void run() { - final Method m = loadMainMethod(getMainMethod()); - final String methodName = m.getDeclaringClass().getName() + ".main(String[])"; - try { - log("Calling " + methodName + " method"); - m.invoke(null, new Object[] { getArguments() }); - log(methodName + " has returned"); - } catch (final IllegalAccessException x) { - try { - nativeInvokeNonPublic(m.getClass(), m, getArguments()); - } catch (final Throwable excpt) { - logError(methodName + " threw an exception:"); - if ((excpt instanceof UnsatisfiedLinkError) && excpt.getMessage().equals("nativeInvokeNonPublic")) { - showFailureAlertAndKill(kJavaFailureMainThrewException, "nativeInvokeNonPublic not registered"); - } else { - excpt.printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainThrewException, excpt.toString()); - } - } - } catch (final InvocationTargetException invokeExcpt) { - logError(methodName + " threw an exception:"); - invokeExcpt.getTargetException().printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainThrewException, invokeExcpt.getTargetException().toString()); - } - } - - Method loadMainMethod(final String mainClassName) { - try { - final Class mainClass = Class.forName(mainClassName, true, sun.misc.Launcher.getLauncher().getClassLoader()); - final Method mainMethod = mainClass.getDeclaredMethod("main", new Class[] { String[].class }); - if ((mainMethod.getModifiers() & Modifier.STATIC) == 0) { - logError("The main(String[]) method of class " + mainClassName + " is not static!"); - showFailureAlertAndKill(kJavaFailureMainClassMainNotStatic, mainClassName); - } - return mainMethod; - } catch (final ExceptionInInitializerError x) { - logError("The main class \"" + mainClassName + "\" had a static initializer throw an exception."); - x.getException().printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainInitializerException, x.getException().toString()); - } catch (final ClassNotFoundException x) { - logError("The main class \"" + mainClassName + "\" could not be found."); - showFailureAlertAndKill(kJavaFailureMainClassNotFound, mainClassName); - } catch (final NoSuchMethodException x) { - logError("The main class \"" + mainClassName + "\" has no static main(String[]) method."); - showFailureAlertAndKill(kJavaFailureMainClassHasNoMain, mainClassName); - } catch (final NullPointerException x) { - logError("No main class specified"); - showFailureAlertAndKill(kJavaFailureMainClassNotSpecified, null); - } - - return null; - } - - // get main class name from 'Jar' key, or 'MainClass' key - String getMainMethod() { - final Object javaJar = javaDictionary.get("Jar"); - if (javaJar != null) { - if (!(javaJar instanceof String)) { - logError("'Jar' key in 'Java' sub-dictionary of Info.plist requires a string value"); - return null; - } - - final String jarPath = (String)javaJar; - if (jarPath.length() == 0) { - log("'Jar' key of sub-dictionary 'Java' of Info.plist key is empty"); - } else { - // extract main class from manifest of this jar - final String main = getMainFromManifest(jarPath); - if (main == null) { - logError("jar file '" + jarPath + "' does not have Main-Class: attribute in its manifest"); - return null; - } - - log("Main class " + main + " found in jar manifest"); - return main; - } - } - - final Object javaMain = javaDictionary.get("MainClass"); - if (!(javaMain instanceof String)) { - logError("'MainClass' key in 'Java' sub-dictionary of Info.plist requires a string value"); - return null; - } - - final String main = (String)javaMain; - if (main.length() == 0) { - log("'MainClass' key of sub-dictionary 'Java' of Info.plist key is empty"); - return null; - } - - log("Main class " + (String)javaMain + " found via 'MainClass' key of sub-dictionary 'Java' of Info.plist key"); - return (String)javaMain; - } - - // get arguments for main(String[]) out of Info.plist and command line - String[] getArguments() { - // check for 'Arguments' key, which contains the main() args if not defined in Info.plist - final Object javaArguments = javaDictionary.get("Arguments"); - if (javaArguments == null) { - // no arguments - log("No arguments for main(String[]) specified"); - return new String[0]; - } - - if (javaArguments instanceof List) { - final List args = (List)javaArguments; - final int count = args.size(); - log("Arguments to main(String[" + count + "]):"); - - final String[] result = new String[count]; - for (int i = 0; i < count; ++i) { - final Object element = args.get(i); - if (element instanceof String) { - result[i] = (String)element; - } else { - logError("Found non-string in array"); - } - log(" arg[" + i + "]=" + result[i]); - } - return result; - } - - logError("'Arguments' key in 'Java' sub-dictionary of Info.plist requires a string value or an array of strings"); - return new String[0]; - } - - // returns name of main class, or null - String getMainFromManifest(final String jarpath) { - JarFile jar = null; - try { - jar = new JarFile(jarpath); - final Manifest man = jar.getManifest(); - final Attributes attr = man.getMainAttributes(); - return attr.getValue("Main-Class"); - } catch (final IOException x) { - // shrug - } finally { - if (jar != null) { - try { - jar.close(); - } catch (final IOException x) { } - } - } - return null; - } - - void log(final String s) { - if (!verbose) return; - System.out.println("[LaunchRunner] " + s); - } - - static void logError(final String s) { - System.err.println("[LaunchRunner Error] " + s); - } - - // This kills the app and does not return! - static void showFailureAlertAndKill(final String msg, String arg) { - if (arg == null) arg = "<>"; - JOptionPane.showMessageDialog(null, getMessage(msg, arg), "", JOptionPane.ERROR_MESSAGE); - System.exit(-1); - } - - static String getMessage(final String msgKey, final Object ... args) { - final String msg = ResourceBundle.getBundle("appLauncherErrors").getString(msgKey); - return MessageFormat.format(msg, args); - } -} diff --git a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties b/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties deleted file mode 100644 index 9f880b7a075..00000000000 --- a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties +++ /dev/null @@ -1,6 +0,0 @@ -MainClassNotSpecified=No main class specified. -CannotLoadMainClass=The main class \u201C{0}\u201D could not be loaded. -NoMainMethod=The main class \u201C{0}\u201D has no \u201Cvoid main(String[])\u201D method. -MainNotStatic=The \u201Cmain(String[])\u201D method of class \u201C{0}\u201D is not static. -MainThrewException=Uncaught exception in main method: {0} -MainInitializerException=A static initializer of the main class threw an exception: {0} diff --git a/jdk/src/macosx/classes/apple/security/KeychainStore.java b/jdk/src/macosx/classes/apple/security/KeychainStore.java index 8df45d7bea7..8d04ee976f6 100644 --- a/jdk/src/macosx/classes/apple/security/KeychainStore.java +++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java @@ -74,19 +74,19 @@ public final class KeychainStore extends KeyStoreSpi { * Entries that have been deleted. When something calls engineStore we'll * remove them from the keychain. */ - private Hashtable deletedEntries = new Hashtable(); + private Hashtable deletedEntries = new Hashtable<>(); /** * Entries that have been added. When something calls engineStore we'll * add them to the keychain. */ - private Hashtable addedEntries = new Hashtable(); + private Hashtable addedEntries = new Hashtable<>(); /** * Private keys and certificates are stored in a hashtable. * Hash entries are keyed by alias names. */ - private Hashtable entries = new Hashtable(); + private Hashtable entries = new Hashtable<>(); /** * Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain. @@ -471,7 +471,7 @@ public final class KeychainStore extends KeyStoreSpi { // This will be slow, but necessary. Enumerate the values and then see if the cert matches the one in the trusted cert entry. // Security framework doesn't support the same certificate twice in a keychain. - Collection allValues = entries.values(); + Collection allValues = entries.values(); for (Object value : allValues) { if (value instanceof TrustedCertEntry) { @@ -517,7 +517,7 @@ public final class KeychainStore extends KeyStoreSpi { * * @return enumeration of the alias names */ - public Enumeration engineAliases() { + public Enumeration engineAliases() { permissionCheck(); return entries.keys(); } @@ -598,8 +598,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); Certificate certElem; - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { certElem = ((TrustedCertEntry)entry).cert; @@ -634,8 +634,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); // Delete items that do have a keychain item ref. - for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = deletedEntries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -664,8 +664,8 @@ public final class KeychainStore extends KeyStoreSpi { // Add all of the certs or keys in the added entries. // No need to check for 0 refs, as they are in the added list. - for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = addedEntries.get(alias); if (entry instanceof TrustedCertEntry) { TrustedCertEntry tce = (TrustedCertEntry)entry; @@ -730,8 +730,8 @@ public final class KeychainStore extends KeyStoreSpi { // Release any stray keychain references before clearing out the entries. synchronized(entries) { - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -816,7 +816,7 @@ public final class KeychainStore extends KeyStoreSpi { // Next, create X.509 Certificate objects from the raw data. This is complicated // because a certificate's public key may be too long for Java's default encryption strength. - List createdCerts = new ArrayList(); + List createdCerts = new ArrayList<>(); try { CertificateFactory cf = CertificateFactory.getInstance("X.509"); @@ -842,12 +842,12 @@ public final class KeychainStore extends KeyStoreSpi { // We have our certificates in the List, so now extract them into an array of // Certificates and SecCertificateRefs. - Object[] objArray = createdCerts.toArray(); + CertKeychainItemPair[] objArray = createdCerts.toArray(new CertKeychainItemPair[0]); Certificate[] certArray = new Certificate[objArray.length]; long[] certRefArray = new long[objArray.length]; for (int i = 0; i < objArray.length; i++) { - CertKeychainItemPair addedItem = (CertKeychainItemPair)objArray[i]; + CertKeychainItemPair addedItem = objArray[i]; certArray[i] = addedItem.mCert; certRefArray[i] = addedItem.mCertificateRef; } diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java index e91efeaa009..76dea3a7ed3 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java @@ -95,7 +95,7 @@ class _AppDockIconHandler { static Creator getCImageCreator() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java index dfb6fddd5ce..e9eda68094c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java @@ -75,7 +75,7 @@ public abstract class AquaBorder implements Border, UIResource { protected AquaBorder deriveBorderForSize(final Size size) { try { final Class clazz = getClass(); - final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); + final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); border.setSize(size); return border; } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java index 2867245ee1e..c87bcb78c04 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java @@ -35,8 +35,8 @@ import apple.laf.JRSUIConstants.*; @SuppressWarnings("serial") // Superclass is not serializable across versions class AquaComboBoxButton extends JButton { - final protected JComboBox comboBox; - final protected JList list; + final protected JComboBox comboBox; + final protected JList list; final protected CellRendererPane rendererPane; final protected AquaComboBoxUI ui; @@ -45,7 +45,10 @@ class AquaComboBoxButton extends JButton { boolean isSquare; @SuppressWarnings("serial") // anonymous class - protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) { + protected AquaComboBoxButton(final AquaComboBoxUI ui, + final JComboBox comboBox, + final CellRendererPane rendererPane, + final JList list) { super(""); putClientProperty("JButton.buttonType", "comboboxInternal"); @@ -163,7 +166,7 @@ class AquaComboBoxButton extends JButton { } protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) { - final ListCellRenderer renderer = comboBox.getRenderer(); + final ListCellRenderer renderer = comboBox.getRenderer(); // fake it out! not renderPressed final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java index dde9b1be337..0f466e188e6 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java @@ -43,7 +43,7 @@ class AquaComboBoxPopup extends BasicComboPopup { protected Component bottomStrut; protected boolean isPopDown = false; - public AquaComboBoxPopup(final JComboBox cBox) { + public AquaComboBoxPopup(final JComboBox cBox) { super(cBox); } @@ -93,7 +93,7 @@ class AquaComboBoxPopup extends BasicComboPopup { final int rowCount = Math.min(maxRowCount, currentElementCount); final Dimension popupSize = new Dimension(); - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); for (int i = 0; i < rowCount; i++) { final Object value = list.getModel().getElementAt(i); @@ -149,8 +149,8 @@ class AquaComboBoxPopup extends BasicComboPopup { @Override @SuppressWarnings("serial") // anonymous class - protected JList createList() { - return new JList(comboBox.getModel()) { + protected JList createList() { + return new JList(comboBox.getModel()) { @Override public void processMouseEvent(MouseEvent e) { if (e.isMetaDown()) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java index 6161eb6447c..f4d4225efe0 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java @@ -29,8 +29,8 @@ import javax.swing.*; import javax.swing.plaf.UIResource; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { - public AquaComboBoxRenderer(final JComboBox comboBox) { +class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { + public AquaComboBoxRenderer(final JComboBox comboBox) { super(comboBox); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java index 2ed6dcfcf70..cf1025f6a85 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java @@ -31,8 +31,8 @@ import javax.swing.*; import java.awt.*; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { - final JComboBox fComboBox; +class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { + final JComboBox fComboBox; boolean fSelected; boolean fChecked; boolean fInList; @@ -40,7 +40,7 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { boolean fDrawCheckedItem = true; // Provides space for a checkbox, and is translucent - public AquaComboBoxRendererInternal(final JComboBox comboBox) { + public AquaComboBoxRendererInternal(final JComboBox comboBox) { super(); fComboBox = comboBox; } @@ -72,7 +72,10 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { } // Really means is the one with the mouse over it - public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { + public Component getListCellRendererComponent(final JList list, + final E value, int index, + final boolean isSelected, + final boolean cellHasFocus) { fInList = (index >= 0); // When the button wants the item painted, it passes in -1 fSelected = isSelected; if (index < 0) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 75c7babb58a..80ca6ff5b49 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -102,13 +102,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { if (now - 1000 < lastBlink) return; lastBlink = now; - final JList itemList = popup.getList(); + final JList itemList = popup.getList(); final ListUI listUI = itemList.getUI(); if (!(listUI instanceof AquaListUI)) return; final AquaListUI aquaListUI = (AquaListUI)listUI; final int selectedIndex = comboBox.getSelectedIndex(); - final ListModel dataModel = itemList.getModel(); + final ListModel dataModel = itemList.getModel(); if (dataModel == null) return; final Object value = dataModel.getElementAt(selectedIndex); @@ -125,7 +125,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { // this space intentionally left blank } - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { return new AquaComboBoxRenderer(comboBox); } @@ -185,7 +185,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { final Object text = editor.getText(); - final ListModel model = listBox.getModel(); + final ListModel model = listBox.getModel(); final int items = model.getSize(); for (int i = 0; i < items; i++) { final Object element = model.getElementAt(i); @@ -423,7 +423,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return; } - final JComboBox cb = (JComboBox)parent; + final JComboBox cb = (JComboBox) parent; final int width = cb.getWidth(); final int height = cb.getHeight(); @@ -450,11 +450,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.IS_TABLE_CELL_EDITOR)); } - protected static boolean isPopdown(final JComboBox c) { + protected static boolean isPopdown(final JComboBox c) { return c.isEditable() || Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.POPDOWN_CLIENT_PROPERTY_KEY)); } - protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { + protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { if (!comboBox.isEnabled()) return; final AquaComboBoxUI aquaUi = (AquaComboBoxUI)comboBox.getUI(); @@ -505,7 +505,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { @SuppressWarnings("serial") // anonymous class private static final Action toggleSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); if (!comboBox.isEnabled()) return; if (comboBox.isEditable()) return; @@ -525,7 +525,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { private final Action hideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); comboBox.firePopupMenuCanceled(); comboBox.setPopupVisible(false); } @@ -588,10 +588,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } @SuppressWarnings("unchecked") - static final RecyclableSingleton> APPLICATOR = new RecyclableSingleton>() { + static final RecyclableSingleton, AquaComboBoxUI>> APPLICATOR = new + RecyclableSingleton, AquaComboBoxUI>>() { @Override - protected ClientPropertyApplicator getInstance() { - return new ClientPropertyApplicator( + protected ClientPropertyApplicator, AquaComboBoxUI> getInstance() { + return new ClientPropertyApplicator, AquaComboBoxUI>( new Property(AquaFocusHandler.FRAME_ACTIVE_PROPERTY) { public void applyProperty(final AquaComboBoxUI target, final Object value) { if (Boolean.FALSE.equals(value)) { @@ -633,7 +634,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } } ) { - public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { + public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { final ComboBoxUI comboUI = combo.getUI(); if (comboUI instanceof AquaComboBoxUI) return (AquaComboBoxUI)comboUI; return null; @@ -641,7 +642,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { }; } }; - static ClientPropertyApplicator getApplicator() { + static ClientPropertyApplicator, AquaComboBoxUI> getApplicator() { return APPLICATOR.get(); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java index 3fae5e20310..ebb3b4b6433 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -724,6 +724,7 @@ public class AquaFileChooserUI extends FileChooserUI { final Transferable transferable = dtde.getTransferable(); try { + @SuppressWarnings("unchecked") final java.util.List fileList = (java.util.List)transferable.getTransferData(DataFlavor.javaFileListFlavor); dropFiles(fileList.toArray(new File[fileList.size()])); dtde.dropComplete(true); @@ -1144,11 +1145,14 @@ public class AquaFileChooserUI extends FileChooserUI { } @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { - return new AquaComboBoxRendererInternal(directoryComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final File directory = (File)value; + protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { + return new AquaComboBoxRendererInternal(directoryComboBox) { + public Component getListCellRendererComponent(final JList list, + final File directory, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, directory, index, isSelected, cellHasFocus); if (directory == null) { setText(""); return this; @@ -1173,7 +1177,7 @@ public class AquaFileChooserUI extends FileChooserUI { * Data model for a type-face selection combo-box. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { + protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector fDirectories = new Vector(); int topIndex = -1; int fPathCount = 0; @@ -1248,7 +1252,7 @@ public class AquaFileChooserUI extends FileChooserUI { return fDirectories.size(); } - public Object getElementAt(final int index) { + public File getElementAt(final int index) { return fDirectories.elementAt(index); } } @@ -1257,11 +1261,14 @@ public class AquaFileChooserUI extends FileChooserUI { // Renderer for Types ComboBox // @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createFilterComboBoxRenderer() { - return new AquaComboBoxRendererInternal(filterComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final FileFilter filter = (FileFilter)value; + protected ListCellRenderer createFilterComboBoxRenderer() { + return new AquaComboBoxRendererInternal(filterComboBox) { + public Component getListCellRendererComponent(final JList list, + final FileFilter filter, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, filter, index, isSelected, cellHasFocus); if (filter != null) setText(filter.getDescription()); return this; } @@ -1356,7 +1363,7 @@ public class AquaFileChooserUI extends FileChooserUI { } public void actionPerformed(final ActionEvent e) { - getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem()); + getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem()); } } @@ -1503,7 +1510,7 @@ public class AquaFileChooserUI extends FileChooserUI { fTextfieldPanel.add(tPanel, BorderLayout.CENTER); // DirectoryComboBox, left-justified, 200x20 not including drop shadow - directoryComboBox = new JComboBox(); + directoryComboBox = new JComboBox<>(); directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight"); fDirectoryComboBoxModel = createDirectoryComboBoxModel(fc); directoryComboBox.setModel(fDirectoryComboBoxModel); @@ -1551,7 +1558,7 @@ public class AquaFileChooserUI extends FileChooserUI { // Combobox filterComboBoxModel = createFilterComboBoxModel(); fc.addPropertyChangeListener(filterComboBoxModel); - filterComboBox = new JComboBox(filterComboBoxModel); + filterComboBox = new JComboBox<>(filterComboBoxModel); formatLabel.setLabelFor(filterComboBox); filterComboBox.setRenderer(createFilterComboBoxRenderer()); d = new Dimension(220, (int)filterComboBox.getMinimumSize().getHeight()); @@ -1788,7 +1795,7 @@ public class AquaFileChooserUI extends FileChooserUI { } } - JComboBox directoryComboBox; + JComboBox directoryComboBox; DirectoryComboBoxModel fDirectoryComboBoxModel; private final Action directoryComboBoxAction = new DirectoryComboBoxAction(); @@ -1797,7 +1804,7 @@ public class AquaFileChooserUI extends FileChooserUI { JTableExtension fFileList; private FilterComboBoxModel filterComboBoxModel; - JComboBox filterComboBox; + JComboBox filterComboBox; private final Action filterComboBoxAction = new FilterComboBoxAction(); private static final Dimension hstrut10 = new Dimension(10, 1); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java index d5fec4e292c..1438d2c118c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java @@ -131,7 +131,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { c.setSelectionBackground(UIManager.getColor(bgName)); } - static void swapSelectionColors(final String prefix, final JList c, final Object value) { + static void swapSelectionColors(final String prefix, final JList c, final Object value) { if (!isComponentValid(c)) return; final Color bg = c.getSelectionBackground(); @@ -149,7 +149,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { } } - static void setSelectionColors(final JList c, final String fgName, final String bgName) { + static void setSelectionColors(final JList c, final String fgName, final String bgName) { c.setSelectionForeground(UIManager.getColor(fgName)); c.setSelectionBackground(UIManager.getColor(bgName)); } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java index 85d06468912..24217af311c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java @@ -79,7 +79,7 @@ public class AquaListUI extends BasicListUI { * For a Home action, scrolls to the top. Otherwise, scroll to the end. */ public void actionPerformed(final ActionEvent e) { - final JList list = (JList)e.getSource(); + final JList list = (JList)e.getSource(); if (fHomeAction) { list.ensureIndexIsVisible(0); @@ -135,7 +135,7 @@ public class AquaListUI extends BasicListUI { }*/ } - JList getComponent() { + JList getComponent() { return list; } @@ -144,7 +144,7 @@ public class AquaListUI extends BasicListUI { final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex); if (rowBounds == null) return; - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); if (renderer == null) return; final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index dd65433283f..8dd4fa60d2d 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3820,7 +3820,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing _loader = null; final Class klass = (Class)loader; try { - final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); + final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (final NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + klass; diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java index 5d847e98ef2..dbc8c8c86ad 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java @@ -69,6 +69,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { final static RecyclableSingleton> TABLE_HEADER_APPLICATORS = new RecyclableSingleton>() { @Override + @SuppressWarnings("unchecked") protected ClientPropertyApplicator getInstance() { return new ClientPropertyApplicator( new Property("JTableHeader.selectedColumn") { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java index b64595f4245..17b372af858 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java @@ -121,7 +121,7 @@ public class AquaUtilControlSize { try { // see if this component has a "getUI" method final Class clazz = c.getClass(); - final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); + final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); // see if that UI is one of ours that understands sizing final Object ui = getUIMethod.invoke(c, new Object[0]); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index 078435b161b..faa670345c7 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -82,7 +82,8 @@ final class AquaUtils { @Override public Creator run() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod( + "getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Exception ignored) { @@ -383,7 +384,8 @@ final class AquaUtils { @Override public Method run() { try { - final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class }); + final Method method = JComponent.class.getDeclaredMethod( + "getFlag", new Class[] { int.class }); method.setAccessible(true); return method; } catch (final Throwable ignored) { diff --git a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java index 665c9319cc1..908c63c2c3e 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java +++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java @@ -33,6 +33,7 @@ import javax.swing.JComponent; public class ClientPropertyApplicator implements PropertyChangeListener { private final Map> properties = new HashMap>(); + @SuppressWarnings("unchecked") public ClientPropertyApplicator(final Property... propertyList) { for (final Property p : propertyList) { properties.put(p.name, p); diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java index 1735b444ea5..2d56499ebb3 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java @@ -25,6 +25,9 @@ package com.apple.laf; +import sun.awt.AWTAccessor; +import sun.lwawt.macosx.CMenuBar; + import java.awt.*; import java.awt.event.*; import java.lang.reflect.*; @@ -243,54 +246,25 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM fSubmenus.remove(menu); } - private static Field[] stolenFields = null; - - static { - stolenFields = AccessController.doPrivileged(new PrivilegedAction() { - public Field[] run() { - try { - final Field[] localFields = new Field[2]; - localFields[0] = MenuBar.class.getDeclaredField("menus"); - localFields[1] = MenuComponent.class.getDeclaredField("parent"); - AccessibleObject.setAccessible(localFields, true); - return localFields; - } catch (final NoSuchFieldException nsf) { - // If this happens, Sun changed the definition of MenuBar and MenuComponent! - nsf.printStackTrace(System.err); - return null; - } - } - }); - }; - public Menu add(final Menu m, final int index) { synchronized (getTreeLock()) { if (m.getParent() != null) { m.getParent().remove(m); } - // Use nasty reflection to get at the menus array and parent fields. - try { - if (stolenFields == null) return m; + final Vector menus = AWTAccessor.getMenuBarAccessor().getMenus(this); + menus.insertElementAt(m, index); + AWTAccessor.getMenuComponentAccessor().setParent(m, this); - final Vector menus = (Vector)stolenFields[0].get(this); - menus.insertElementAt(m, index); + final CMenuBar peer = (CMenuBar)getPeer(); + if (peer == null) return m; - stolenFields[1].set(m, this); - - final sun.lwawt.macosx.CMenuBar peer = (sun.lwawt.macosx.CMenuBar)getPeer(); - if (peer == null) return m; - - peer.setNextInsertionIndex(index); - if (m.getPeer() == null) { - m.addNotify(); - } - - peer.setNextInsertionIndex(-1); - } catch (final IllegalAccessException iae) { - iae.printStackTrace(System.err); + peer.setNextInsertionIndex(index); + if (m.getPeer() == null) { + m.addNotify(); } + peer.setNextInsertionIndex(-1); return m; } } diff --git a/jdk/src/macosx/lib/flavormap.properties b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties similarity index 86% rename from jdk/src/macosx/lib/flavormap.properties rename to jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties index 8f17d95fa20..b50c523279e 100644 --- a/jdk/src/macosx/lib/flavormap.properties +++ b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties @@ -2,19 +2,12 @@ # This properties file is used to initialize the default # java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific, # default mappings between common Mac OS X selection atoms and platform-independent -# MIME type strings, which will be converted into +# MIME type strings, which will be converted into # java.awt.datatransfer.DataFlavors. # -# These default mappings may be augmented by specifying the -# -# AWT.DnD.flavorMapFileURL -# -# property in the appropriate awt.properties file. The specified properties URL -# will be loaded into the SystemFlavorMap. -# # The standard format is: # -# = +# =,, ... # # should be a string identifier that the native platform will # recognize as a valid data format. should specify both a MIME @@ -23,9 +16,9 @@ # where each parameter to the MIME type is separated by a ';'. # # Because SystemFlavorMap implements FlavorTable, developers are free to -# duplicate both native keys and DataFlavor values. If a mapping contains a -# duplicate key or value, earlier mappings which included this key or value -# will be preferred. +# duplicate DataFlavor values and set multiple values for a single native by +# separating them with ",". If a mapping contains a duplicate key or value, +# earlier mappings which included this key or value will be preferred. # # Mappings whose values specify DataFlavors with primary MIME types of # "text", and which support the charset parameter, should specify the exact @@ -79,5 +72,5 @@ JFIF=image/x-java-image;class=java.awt.Image TIFF=image/x-java-image;class=java.awt.Image RICH_TEXT=text/rtf HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1 -URL=application/x-java-url;class=java.net.URL -URL=text/uri-list;eoln="\r\n";terminators=1 +URL=application/x-java-url;class=java.net.URL,\ + text/uri-list;eoln="\r\n";terminators=1 diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java index 67570c18a6f..c6c75bc82c6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java @@ -88,7 +88,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { super.startDrag(dsc, cursor, dragImage, dragImageOffset); } - protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { + protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { DragGestureEvent trigger = getTrigger(); InputEvent triggerEvent = trigger.getTriggerEvent(); @@ -311,7 +311,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { } } - private void setDefaultDragImage(JList component) { + private void setDefaultDragImage(JList component) { Rectangle selectedOutline = null; // This code actually works, even under the (non-existant) multiple-selections, because we only draw a union outline @@ -485,7 +485,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable, InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp, long nsDragImagePtr, int dragImageOffsetX, int dragImageOffsetY, - int sourceActions, long[] formats, Map formatMap); + int sourceActions, long[] formats, Map formatMap); private native void doDragging(long nativeDragSource); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index eef5284175b..077b156d806 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -44,13 +44,14 @@ import sun.lwawt.*; public class CInputMethod extends InputMethodAdapter { private InputMethodContext fIMContext; private Component fAwtFocussedComponent; - private LWComponentPeer fAwtFocussedComponentPeer; + private LWComponentPeer fAwtFocussedComponentPeer; private boolean isActive; private static Map[] sHighlightStyles; // Intitalize highlight mapping table and its mapper. static { + @SuppressWarnings({"rawtypes", "unchecked"}) Map styles[] = new Map[4]; HashMap map; @@ -242,7 +243,7 @@ public class CInputMethod extends InputMethodAdapter { public void hideWindows() { } - long getNativeViewPtr(LWComponentPeer peer) { + long getNativeViewPtr(LWComponentPeer peer) { if (peer.getPlatformWindow() instanceof CPlatformWindow) { CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow(); CPlatformView platformView = platformWindow.getContentView(); @@ -272,7 +273,7 @@ public class CInputMethod extends InputMethodAdapter { * to talk to when responding to key events. */ protected void setAWTFocussedComponent(Component component) { - LWComponentPeer peer = null; + LWComponentPeer peer = null; long modelPtr = 0; CInputMethod imInstance = this; @@ -305,7 +306,7 @@ public class CInputMethod extends InputMethodAdapter { /** * @see java.awt.Toolkit#mapInputMethodHighlight */ - public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { int index; int state = highlight.getState(); if (state == InputMethodHighlight.RAW_TEXT) { @@ -384,7 +385,7 @@ public class CInputMethod extends InputMethodAdapter { // java.awt.Toolkit#getNativeContainer() is not available // from this package - private LWComponentPeer getNearestNativePeer(Component comp) { + private LWComponentPeer getNearestNativePeer(Component comp) { if (comp==null) return null; @@ -796,7 +797,7 @@ public class CInputMethod extends InputMethodAdapter { // these calls will be ignored. private native void nativeNotifyPeer(long nativePeer, CInputMethod imInstance); private native void nativeEndComposition(long nativePeer); - private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); + private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); // Returns the locale of the active input method. static native Locale getNativeLocale(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java index d922d029b33..3deba1e33f9 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java @@ -57,7 +57,7 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } static Object[] getAvailableLocalesInternal() { - List workList = nativeGetAvailableLocales(); + List workList = nativeGetAvailableLocales(); if (workList != null) { return workList.toArray(); @@ -119,5 +119,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } private static native void nativeInit(); - private static native List nativeGetAvailableLocales(); + private static native List nativeGetAvailableLocales(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 534cf0dd744..5af2cdfe1d0 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -151,7 +151,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return (bits & mask) != 0; } - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "rawtypes"}) static ClientPropertyApplicator CLIENT_PROPERTY_APPLICATOR = new ClientPropertyApplicator(new Property[] { new Property(WINDOW_DOCUMENT_MODIFIED) { public void applyProperty(final CPlatformWindow c, final Object value) { c.setStyleBits(DOCUMENT_MODIFIED, value == null ? false : Boolean.parseBoolean(value.toString())); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index edbebbacb67..768086220c3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -32,6 +32,7 @@ import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.event.InputEvent; import java.awt.event.InvocationEvent; import java.awt.event.KeyEvent; +import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.im.spi.InputMethodDescriptor; import java.awt.peer.*; @@ -543,9 +544,9 @@ public final class LWCToolkit extends LWToolkit { return super.getImage(filename); } - String fileneame2x = getScaledImageName(filename); - return (imageExists(fileneame2x)) - ? getImageWithResolutionVariant(filename, fileneame2x) + String filename2x = getScaledImageName(filename); + return (imageExists(filename2x)) + ? getImageWithResolutionVariant(filename, filename2x) : super.getImage(filename); } @@ -691,6 +692,7 @@ public final class LWCToolkit extends LWToolkit { } @Override + @SuppressWarnings("unchecked") public T createDragGestureRecognizer( Class abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { @@ -743,7 +745,7 @@ public final class LWCToolkit extends LWToolkit { * @since 1.3 */ @Override - public Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public Map mapInputMethodHighlight(InputMethodHighlight highlight) { return CInputMethod.mapInputMethodHighlight(highlight); } @@ -906,6 +908,9 @@ public final class LWCToolkit extends LWToolkit { } private static boolean isValidPath(String path) { - return !path.isEmpty() && !path.endsWith("/") && !path.endsWith("."); + return path != null && + !path.isEmpty() && + !path.endsWith("/") && + !path.endsWith("."); } } diff --git a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m b/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m deleted file mode 100644 index 11f98dbdde7..00000000000 --- a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 "apple_launcher_JavaAppLauncher.h" - -#import -#import - - -/* - * Class: apple_launcher_JavaAppLauncher - * Method: nativeConvertAndRelease - * Signature: (J)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_apple_launcher_JavaAppLauncher_nativeConvertAndRelease -(JNIEnv *env, jclass clazz, jlong nsObjectPtr) { - - jobject value = NULL; - -JNF_COCOA_ENTER(env); - - id obj = jlong_to_ptr(nsObjectPtr); - value = [[JNFDefaultCoercions defaultCoercer] coerceNSObject:obj withEnv:env]; - CFRelease(obj); - -JNF_COCOA_EXIT(env); - - return value; -} - -/* - * Class: apple_launcher_JavaAppLauncher - * Method: nativeInvokeNonPublic - * Signature: (Ljava/lang/Class;Ljava/lang/reflect/Method;[Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_apple_launcher_JavaAppLauncher_nativeInvokeNonPublic -(JNIEnv *env, jclass clazz, jclass targetClass, jobject targetMethod, jobjectArray args) { - jmethodID mainMethodID = (*env)->FromReflectedMethod(env, targetMethod); - if ((*env)->ExceptionOccurred(env)) return; - (*env)->CallStaticVoidMethod(env, targetClass, mainMethodID, args); -} diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m index affb6577d64..25b00545a74 100644 --- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m +++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m @@ -45,6 +45,7 @@ #include #include +#import "ThreadUtilities.h" static NSScreen* SplashNSScreen() { @@ -130,8 +131,12 @@ char* SplashGetScaledImageName(const char* jar, const char* file, NSAutoreleasePool *pool = [NSAutoreleasePool new]; *scaleFactor = 1; char* scaledFile = nil; - float screenScaleFactor = [SplashNSScreen() backingScaleFactor]; - + __block float screenScaleFactor = 1; + + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + screenScaleFactor = [SplashNSScreen() backingScaleFactor]; + }]; + if (screenScaleFactor > 1) { NSString *fileName = [NSString stringWithUTF8String: file]; NSUInteger length = [fileName length]; diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index df1f832cef8..c71f4c26fab 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -98,6 +98,7 @@ static int numOptions, maxOptions; */ static void SetClassPath(const char *s); static void SelectVersion(int argc, char **argv, char **main_class); +static void SetJvmEnvironment(int argc, char **argv); static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, int *pret, const char *jrepath); @@ -238,6 +239,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ jvmpath, sizeof(jvmpath), jvmcfg, sizeof(jvmcfg)); + if (!IsJavaArgs()) { + SetJvmEnvironment(argc,argv); + } + ifn.CreateJavaVM = 0; ifn.GetDefaultJavaVMInitArgs = 0; @@ -640,6 +645,67 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { return jvmtype; } +/* + * static void SetJvmEnvironment(int argc, char **argv); + * Is called just before the JVM is loaded. We can set env variables + * that are consumed by the JVM. This function is non-destructive, + * leaving the arg list intact. The first use is for the JVM flag + * -XX:NativeMemoryTracking=value. + */ +static void +SetJvmEnvironment(int argc, char **argv) { + + static const char* NMT_Env_Name = "NMT_LEVEL_"; + + int i; + for (i = 0; i < argc; i++) { + /* + * The following case checks for "-XX:NativeMemoryTracking=value". + * If value is non null, an environmental variable set to this value + * will be created to be used by the JVM. + * The argument is passed to the JVM, which will check validity. + * The JVM is responsible for removing the env variable. + */ + char *arg = argv[i]; + if (JLI_StrCCmp(arg, "-XX:NativeMemoryTracking=") == 0) { + int retval; + // get what follows this parameter, include "=" + size_t pnlen = JLI_StrLen("-XX:NativeMemoryTracking="); + if (JLI_StrLen(arg) > pnlen) { + char* value = arg + pnlen; + size_t pbuflen = pnlen + JLI_StrLen(value) + 10; // 10 max pid digits + + /* + * ensures that malloc successful + * DONT JLI_MemFree() pbuf. JLI_PutEnv() uses system call + * that could store the address. + */ + char * pbuf = (char*)JLI_MemAlloc(pbuflen); + + JLI_Snprintf(pbuf, pbuflen, "%s%d=%s", NMT_Env_Name, JLI_GetPid(), value); + retval = JLI_PutEnv(pbuf); + if (JLI_IsTraceLauncher()) { + char* envName; + char* envBuf; + + // ensures that malloc successful + envName = (char*)JLI_MemAlloc(pbuflen); + JLI_Snprintf(envName, pbuflen, "%s%d", NMT_Env_Name, JLI_GetPid()); + + printf("TRACER_MARKER: NativeMemoryTracking: env var is %s\n",envName); + printf("TRACER_MARKER: NativeMemoryTracking: putenv arg %s\n",pbuf); + envBuf = getenv(envName); + printf("TRACER_MARKER: NativeMemoryTracking: got value %s\n",envBuf); + free(envName); + } + + } + + } + + } +} + /* copied from HotSpot function "atomll()" */ static int parse_size(const char *s, jlong *result) { diff --git a/jdk/src/share/bin/jli_util.h b/jdk/src/share/bin/jli_util.h index d3c9f0ff8f2..579972278b3 100644 --- a/jdk/src/share/bin/jli_util.h +++ b/jdk/src/share/bin/jli_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,17 +64,22 @@ int JLI_GetStdArgc(); #ifdef _WIN32 #include #include +#include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) int JLI_Snprintf(char *buffer, size_t size, const char *format, ...); void JLI_CmdToArgs(char *cmdline); #define JLI_Lseek _lseeki64 +#define JLI_PutEnv _putenv +#define JLI_GetPid _getpid #else /* NIXES */ #include #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strncasecmp((p1), (p2), (p3)) #define JLI_Snprintf snprintf +#define JLI_PutEnv putenv +#define JLI_GetPid getpid #ifdef __solaris__ #define JLI_Lseek llseek #endif diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java index 03d649907e2..c22415b7575 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java @@ -126,18 +126,18 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants { new IIOMetadataNode(nativeMetadataFormatName); addChildNode(root, "BMPVersion", bmpVersion); - addChildNode(root, "Width", new Integer(width)); - addChildNode(root, "Height", new Integer(height)); + addChildNode(root, "Width", width); + addChildNode(root, "Height", height); addChildNode(root, "BitsPerPixel", new Short(bitsPerPixel)); - addChildNode(root, "Compression", new Integer(compression)); - addChildNode(root, "ImageSize", new Integer(imageSize)); + addChildNode(root, "Compression", compression); + addChildNode(root, "ImageSize", imageSize); IIOMetadataNode node = addChildNode(root, "PixelsPerMeter", null); - addChildNode(node, "X", new Integer(xPixelsPerMeter)); - addChildNode(node, "Y", new Integer(yPixelsPerMeter)); + addChildNode(node, "X", xPixelsPerMeter); + addChildNode(node, "Y", yPixelsPerMeter); - addChildNode(root, "ColorsUsed", new Integer(colorsUsed)); - addChildNode(root, "ColorsImportant", new Integer(colorsImportant)); + addChildNode(root, "ColorsUsed", colorsUsed); + addChildNode(root, "ColorsImportant", colorsImportant); int version = 0; for (int i = 0; i < bmpVersion.length(); i++) @@ -146,19 +146,19 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants { if (version >= 4) { node = addChildNode(root, "Mask", null); - addChildNode(node, "Red", new Integer(redMask)); - addChildNode(node, "Green", new Integer(greenMask)); - addChildNode(node, "Blue", new Integer(blueMask)); - addChildNode(node, "Alpha", new Integer(alphaMask)); + addChildNode(node, "Red", redMask); + addChildNode(node, "Green", greenMask); + addChildNode(node, "Blue", blueMask); + addChildNode(node, "Alpha", alphaMask); - addChildNode(root, "ColorSpaceType", new Integer(colorSpace)); + addChildNode(root, "ColorSpaceType", colorSpace); node = addChildNode(root, "CIEXYZEndPoints", null); addXYZPoints(node, "Red", redX, redY, redZ); addXYZPoints(node, "Green", greenX, greenY, greenZ); addXYZPoints(node, "Blue", blueX, blueY, blueZ); - node = addChildNode(root, "Intent", new Integer(intent)); + node = addChildNode(root, "Intent", intent); } // Palette diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index 51f1234d74d..f25863955ec 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -2323,7 +2323,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { SOSMarkerSegment sos = (SOSMarkerSegment) seg; SOSMarkerSegment.ScanComponentSpec [] specs = sos.componentSpecs; for (int i = 0; i < specs.length; i++) { - Integer id = new Integer(specs[i].componentSelector); + Integer id = specs[i].componentSelector; if (!ids.contains(id)) { ids.add(id); } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index 3b2a081d860..d3f489b7ee2 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -639,7 +639,7 @@ public class PNGImageReader extends ImageReader { metadata.zTXt_keyword.add(keyword); int method = stream.readUnsignedByte(); - metadata.zTXt_compressionMethod.add(new Integer(method)); + metadata.zTXt_compressionMethod.add(method); byte[] b = new byte[chunkLength - keyword.length() - 2]; stream.readFully(b); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index 11018ec4015..f02dd4391f0 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -1254,8 +1254,11 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { if (name.equals("IHDR")) { IHDR_width = getIntAttribute(node, "width"); IHDR_height = getIntAttribute(node, "height"); - IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth", - IHDR_bitDepths); + IHDR_bitDepth = + Integer.valueOf(IHDR_bitDepths[ + getEnumeratedAttribute(node, + "bitDepth", + IHDR_bitDepths)]); IHDR_colorType = getEnumeratedAttribute(node, "colorType", IHDR_colorTypeNames); IHDR_compressionMethod = @@ -1644,7 +1647,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { int compressionMethod = getEnumeratedAttribute(zTXt_node, "compressionMethod", zTXt_compressionMethodNames); - zTXt_compressionMethod.add(new Integer(compressionMethod)); + zTXt_compressionMethod.add(compressionMethod); String text = getAttribute(zTXt_node, "text"); zTXt_text.add(text); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java index c28046f0b58..28ad467eadd 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java @@ -75,9 +75,9 @@ public class WBMPMetadata extends IIOMetadata { IIOMetadataNode root = new IIOMetadataNode(nativeMetadataFormatName); - addChildNode(root, "WBMPType", new Integer(wbmpType)); - addChildNode(root, "Width", new Integer(width)); - addChildNode(root, "Height", new Integer(height)); + addChildNode(root, "WBMPType", wbmpType); + addChildNode(root, "Width", width); + addChildNode(root, "Height", height); return root; } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index b35e60d7ec6..cfdd8672303 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -812,12 +812,12 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "OptionPane.setButtonMargin", Boolean.FALSE, "OptionPane.sameSizeButtons", Boolean.TRUE, - "OptionPane.buttonOrientation", new Integer(SwingConstants.RIGHT), + "OptionPane.buttonOrientation", SwingConstants.RIGHT, "OptionPane.minimumSize", new DimensionUIResource(262, 90), - "OptionPane.buttonPadding", new Integer(10), + "OptionPane.buttonPadding", 10, "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, - "OptionPane.buttonClickThreshhold", new Integer(500), + "OptionPane.buttonClickThreshhold", 500, "OptionPane.isYesLast", Boolean.TRUE, "OptionPane.font", new FontLazyValue(Region.OPTION_PANE), diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java index 116fe475be3..79ebfbc8cff 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java @@ -567,7 +567,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "ProgressBar.selectionForeground", table.get("control"), "ProgressBar.selectionBackground", table.get("controlText"), "ProgressBar.border", loweredBevelBorder, - "ProgressBar.cellLength", new Integer(6), + "ProgressBar.cellLength", 6, "ProgressBar.cellSpacing", Integer.valueOf(0), // Buttons @@ -582,7 +582,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "released SPACE", "released" }), - "CheckBox.textIconGap", new Integer(8), + "CheckBox.textIconGap", 8, "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2), "CheckBox.icon", checkBoxIcon, "CheckBox.focus", table.get("activeCaptionBorder"), @@ -593,7 +593,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel }), "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2), - "RadioButton.textIconGap", new Integer(8), + "RadioButton.textIconGap", 8, "RadioButton.background", table.get("control"), "RadioButton.foreground", table.get("controlText"), "RadioButton.icon", radioButtonIcon, @@ -627,10 +627,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel "Menu.selectionBackground", menuItemPressedBackground, "Menu.checkIcon", menuItemCheckIcon, "Menu.arrowIcon", menuArrowIcon, - "Menu.menuPopupOffsetX", new Integer(0), - "Menu.menuPopupOffsetY", new Integer(0), - "Menu.submenuPopupOffsetX", new Integer(-2), - "Menu.submenuPopupOffsetY", new Integer(3), + "Menu.menuPopupOffsetX", 0, + "Menu.menuPopupOffsetY", 0, + "Menu.submenuPopupOffsetX", -2, + "Menu.submenuPopupOffsetY", 3, "Menu.shortcutKeys", new int[]{ SwingUtilities2.getSystemMnemonicKeyMask(), KeyEvent.META_MASK @@ -938,7 +938,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "Tree.collapsedIcon", treeCollapsedIcon, "Tree.editorBorder", focusBorder, "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"), - "Tree.rowHeight", new Integer(18), + "Tree.rowHeight", 18, "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE, "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "COPY", "copy", diff --git a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java index 800c0a53643..6a4d3dea7da 100644 --- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java @@ -1145,7 +1145,7 @@ public class CNCtx implements javax.naming.Context { // Never destroy an orb in CNCtx. // The orb we have is either the shared/default orb, or one passed in to a constructor - // from elsewhere, so that orb is somebody else's reponsibility. + // from elsewhere, so that orb is somebody else's responsibility. } protected void finalize() { diff --git a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java index 18654c87808..db1f907182a 100644 --- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java +++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java @@ -376,7 +376,7 @@ public class DnsClient { /** - * Tries to retreive an UDP packet matching the given xid + * Tries to retrieve a UDP packet matching the given xid * received within the timeout. * If a packet with different xid is received, the received packet * is enqueued with the corresponding xid in 'resps'. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java index 241105bf1ce..be3315674fa 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java @@ -137,7 +137,7 @@ abstract class AbstractLdapNamingEnumeration limit = (entries == null) ? 0 : entries.size(); // handle empty set posn = 0; // reset - // mimimize the number of calls to processReturnCode() + // minimize the number of calls to processReturnCode() // (expensive when batchSize is small and there are many results) if ((res.status != LdapClient.LDAP_SUCCESS) || ((res.status == LdapClient.LDAP_SUCCESS) && diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java index 5095823dc23..aa535a2b995 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java @@ -196,7 +196,7 @@ class ClientId { System.out.println("ClientId received an exception"); e.printStackTrace(); } - // Failed to invoke the comparator; flag unequality + // Failed to invoke the comparator; flag inequality return false; } if (((Integer) ret) == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java index db335f7acc9..85bc38076f5 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java @@ -75,7 +75,7 @@ final class EventQueue implements Runnable { * Enqueue an event. * @param event Either a NamingExceptionEvent or a subclass * of NamingEvent or - * UnsolicitedNotificatoniEvent. + * UnsolicitedNotificationEvent. * If it is a subclass of NamingEvent, all listeners must implement * the corresponding subinterface of NamingListener. * For example, for a ObjectAddedEvent, all listeners must @@ -141,7 +141,7 @@ final class EventQueue implements Runnable { // it is interested in. (No need to check mask or // instanceof subinterfaces.) // It is the responsibility of the enqueuer to - // only enqueue events with listseners of the correct type. + // only enqueue events with listeners of the correct type. if (e instanceof NamingEvent) { ((NamingEvent)e).dispatch(v.elementAt(i)); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java index a9d45a23c17..86006ff714b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java @@ -83,7 +83,7 @@ import javax.naming.ldap.UnsolicitedNotification; *a new notifier is created for the listener. * *

Deregistration

- *When a deregistration request is made, this class attemps to find its + *When a deregistration request is made, this class attempts to find its *corresponding notifier. If the notifier is found, the listener is removed *from the notifier's list. If the listener is the last listener on the list, *the notifier's thread is terminated and removed from this class's hashtable. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java index 50f6ac69f5f..36c7dad4611 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java @@ -34,7 +34,7 @@ import javax.naming.directory.*; /** * This subclass is used by LDAP to implement the schema calls. * Basically, it keeps track of which context it is an attribute of - * so it can get the schema for that cotnext. + * so it can get the schema for that context. * * @author Jon Ruiz */ @@ -134,7 +134,7 @@ final class LdapAttribute extends BasicAttribute { // setup internal state this.setBaseCtxInfo(); - // let the ObjectOutpurStream do the real work of serialization + // let the ObjectOutputStream do the real work of serialization out.defaultWriteObject(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java index e5821adea6e..c163dce796a 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -1651,7 +1651,7 @@ final public class LdapCtx extends ComponentDirContext * * This function is called regardless of the server's version, since * an administrator may have setup the server to support client schema - * queries. If this function trys a serarch on a v2 server that + * queries. If this function tries a search on a v2 server that * doesn't support schema, one of these two things will happen: * 1) It will get an exception when querying the root DSE * 2) It will not find a subschemasubentry on the root DSE @@ -2016,7 +2016,7 @@ final public class LdapCtx extends ComponentDirContext * - the returning attributes list is present but empty */ - // returns true if a search can be caried out as a compare, and sets + // returns true if a search can be carried out as a compare, and sets // tokens[0] and tokens[1] to the type and value respectively. // e.g. filter "cn=Jon Ruiz" becomes, type "cn" and value "Jon Ruiz" // This function uses the documents JNDI Compare example as a model @@ -2083,7 +2083,7 @@ final public class LdapCtx extends ComponentDirContext return false; // unbalanced } - // make sure the left and right half are not expresions themselves + // make sure the left and right half are not expressions themselves StringTokenizer illegalCharsTokenizer = new StringTokenizer(tokens[0], "()&|!=~><*", true); @@ -2443,7 +2443,7 @@ final public class LdapCtx extends ComponentDirContext } /** - * Set whether aliases are derefereced during resolution and searches. + * Set whether aliases are dereferenced during resolution and searches. */ private void setDerefAliases(String deref) { if (deref != null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java index d29e408cdec..b3f76d9ab0b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java @@ -346,8 +346,8 @@ public final class LdapName implements Name { } /** - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Returns a string value as + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Returns a string value as * a string, and a binary value as a byte array. */ public static Object unescapeAttributeValue(String val) { @@ -687,7 +687,7 @@ public final class LdapName implements Name { private final boolean binary; private final boolean valueCaseSensitive; - // If non-null, a canonical represention of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo(). private String comparable = null; @@ -842,8 +842,8 @@ public final class LdapName implements Name { } /* - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Escapes and quotes are + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to 16-bit * Unicode chars. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java index 0a09e0fda69..b810187c649 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java @@ -679,7 +679,7 @@ final class LdapReferralContext implements DirContext, LdapContext { } catch (LdapReferralException e) { - // %%% VR - setNameResolved(true); + // %%% setNameResolved(true); // append (referrals from) the exception that generated this // context to the new exception, so that referral processing @@ -897,7 +897,7 @@ final class LdapReferralContext implements DirContext, LdapContext { /* * Use the attributes and scope components from the LDAP URL (if present) - * to override the corrpesonding components supplied in SearchControls. + * to override the corresponding components supplied in SearchControls. */ private SearchControls overrideAttributesAndScope(SearchControls cons) { SearchControls urlCons; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java index 23347ac5dc8..6e7e3e6544b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java @@ -62,7 +62,7 @@ final class LdapRequest { cancelled = true; // Unblock reader of pending request - // Should only ever have atmost one waiter + // Should only ever have at most one waiter notify(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java index 7fddd7799f5..ae3d2bd4881 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java @@ -84,7 +84,7 @@ final class LdapSchemaParser { // Object Class specific IDs private static final String ABSTRACT_ID = "ABSTRACT"; private static final String STRUCTURAL_ID = "STRUCTURAL"; - private static final String AUXILARY_ID = "AUXILIARY"; + private static final String AUXILIARY_ID = "AUXILIARY"; private static final String MUST_ID = "MUST"; private static final String MAY_ID = "MAY"; @@ -300,8 +300,8 @@ final class LdapSchemaParser { return new Object[] {currentName, attrs}; } - // returns the index of the first whitespace char of a linear whitspace - // sequince ending at the given position. + // returns the index of the first whitespace char of a linear whitespace + // sequence ending at the given position. final private static int findTrailingWhitespace(String string, int pos) { for(int i = pos; i > 0; i--) { if(string.charAt(i) != WHSP) { @@ -423,7 +423,7 @@ final class LdapSchemaParser { if (tag.equals(OBSOLETE_ID) || tag.equals(ABSTRACT_ID) || tag.equals(STRUCTURAL_ID) || - tag.equals(AUXILARY_ID) || + tag.equals(AUXILIARY_ID) || tag.equals(SINGLE_VAL_ID) || tag.equals(COLLECTIVE_ID) || tag.equals(NO_USER_MOD_ID)) { @@ -819,7 +819,7 @@ final class LdapSchemaParser { count++; } - attr = attrs.get(AUXILARY_ID); + attr = attrs.get(AUXILIARY_ID); if (attr != null) { objectDesc.append(writeBoolean(attr)); count++; @@ -856,7 +856,7 @@ final class LdapSchemaParser { attrId.equals(MUST_ID) || attrId.equals(STRUCTURAL_ID) || attrId.equals(DESC_ID) || - attrId.equals(AUXILARY_ID) || + attrId.equals(AUXILIARY_ID) || attrId.equals(ABSTRACT_ID) || attrId.equals(OBSOLETE_ID)) { continue; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java index 329b1d249af..4af58a8b0dd 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java @@ -156,7 +156,7 @@ final class LdapSearchEnumeration String[] reqAttrs; if ((reqAttrs = searchArgs.reqAttrs) != null) { // create an attribute set for those requested - Attributes rattrs = new BasicAttributes(true); // caseignore + Attributes rattrs = new BasicAttributes(true); // ignore case for (int i = 0; i < reqAttrs.length; i++) { rattrs.put(reqAttrs[i], null); } @@ -213,8 +213,6 @@ final class LdapSearchEnumeration // Update search-specific variables LdapSearchEnumeration se = (LdapSearchEnumeration)ne; startName = se.startName; -//VR - keep original args, don't overwite with current args -// searchArgs = se.searchArgs; } void setStartName(Name nm) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java index ada02f6f3bc..40b2b56cf42 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java @@ -162,7 +162,7 @@ final public class LdapURL extends Uri { } /** - * Derermines whether an LDAP URL has query components. + * Determines whether an LDAP URL has query components. */ public static boolean hasQueryComponents(String url) { return (url.lastIndexOf('?') != -1); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java index 05df1bbd6b7..a7bf61d9494 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java @@ -62,7 +62,7 @@ class ServiceLocator { * * @param dn A string distinguished name (RFC 2253). * @return A domain name or null if none can be derived. - * @throw InvalidNameException If the distinugished name is invalid. + * @throw InvalidNameException If the distinguished name is invalid. */ static String mapDnToDomainName(String dn) throws InvalidNameException { if (dn == null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java index 0a696bd4ff2..17e7bc13779 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java @@ -25,32 +25,77 @@ package com.sun.jndi.ldap; +import sun.misc.SharedSecrets; + import java.net.MalformedURLException; import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; -abstract class VersionHelper { +public final class VersionHelper { - private static final VersionHelper helper = new VersionHelper12(); + private static final VersionHelper helper = new VersionHelper(); - VersionHelper() {} // Disallow anyone from creating one of these. + /** + * Determines whether classes may be loaded from an arbitrary URL code base. + */ + private static final boolean trustURLCodebase; + + static { + // System property to control whether classes may be loaded from an + // arbitrary URL code base + PrivilegedAction act = + () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false"); + String trust = AccessController.doPrivileged(act); + trustURLCodebase = "true".equalsIgnoreCase(trust); + } + + private VersionHelper() { } static VersionHelper getVersionHelper() { return helper; } - abstract ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException; + ClassLoader getURLClassLoader(String[] url) throws MalformedURLException { + ClassLoader parent = getContextClassLoader(); + /* + * Classes may only be loaded from an arbitrary URL code base when + * the system property com.sun.jndi.ldap.object.trustURLCodebase + * has been set to "true". + */ + if (url != null && trustURLCodebase) { + return URLClassLoader.newInstance(getUrlArray(url), parent); + } else { + return parent; + } + } + Class loadClass(String className) throws ClassNotFoundException { + return Class.forName(className, true, getContextClassLoader()); + } - static protected URL[] getUrlArray(String[] url) throws MalformedURLException { + Thread createThread(Runnable r) { + AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". + PrivilegedAction act = + () -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc); + return AccessController.doPrivileged(act); + } + + private ClassLoader getContextClassLoader() { + PrivilegedAction act = + Thread.currentThread()::getContextClassLoader; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String[] url) throws MalformedURLException { URL[] urlArray = new URL[url.length]; for (int i = 0; i < urlArray.length; i++) { urlArray[i] = new URL(url[i]); } return urlArray; } - - abstract Class loadClass(String className) throws ClassNotFoundException; - - abstract Thread createThread(Runnable r); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java deleted file mode 100644 index 468273ede97..00000000000 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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 com.sun.jndi.ldap; - -import java.net.URLClassLoader; -import java.net.MalformedURLException; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; -import sun.misc.SharedSecrets; - -final class VersionHelper12 extends VersionHelper { - - // System property to control whether classes may be loaded from an - // arbitrary URL code base. - private static final String TRUST_URL_CODEBASE_PROPERTY = - "com.sun.jndi.ldap.object.trustURLCodebase"; - - // Determine whether classes may be loaded from an arbitrary URL code base. - private static final String trustURLCodebase = - AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - return System.getProperty(TRUST_URL_CODEBASE_PROPERTY, - "false"); - } - } - ); - - VersionHelper12() {} // Disallow external from creating one of these. - - ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException { - ClassLoader parent = getContextClassLoader(); - /* - * Classes may only be loaded from an arbitrary URL code base when - * the system property com.sun.jndi.ldap.object.trustURLCodebase - * has been set to "true". - */ - if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) { - return URLClassLoader.newInstance(getUrlArray(url), parent); - } else { - return parent; - } - } - - Class loadClass(String className) throws ClassNotFoundException { - ClassLoader cl = getContextClassLoader(); - return Class.forName(className, true, cl); - } - - private ClassLoader getContextClassLoader() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - return Thread.currentThread().getContextClassLoader(); - } - } - ); - } - - Thread createThread(final Runnable r) { - final AccessControlContext acc = AccessController.getContext(); - // 4290486: doPrivileged is needed to create a thread in - // an environment that restricts "modifyThreadGroup". - return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return SharedSecrets.getJavaLangAccess() - .newThreadWithAcc(r, acc); - } - } - ); - } -} diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java index 2df13459570..0e3e1094d67 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java @@ -254,7 +254,7 @@ final class Connections implements PoolCallback { /** * Removes PooledConnection from list of connections. * The closing of the connection is separate from this method. - * This method is called usually when the caller encouters an error + * This method is called usually when the caller encounters an error * when using the connection and wants it removed from the pool. * * @return true if conn removed; false if it was not in pool diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java index f9786cad213..723f11a8783 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java @@ -68,8 +68,8 @@ import javax.naming.NamingException; * whenever a pooled connection is requested or a call to remove the expired * connections is made. The monitoring is done regularly when idle connection * timeout is set as the PoolCleaner removes expired connections periodically. - * As determined by the experiements, cleanup of resources using the - * ReferenceQueue mechanism is reliable and has immidiate effect than the + * As determined by experimentation, cleanup of resources using the + * ReferenceQueue mechanism is reliable and has more immediate effect than the * finalizer approach. * * @author Rosanna Lee diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java index 8009b67aa2c..3802f5f106c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java @@ -165,6 +165,7 @@ public class CorbaUtils { // Get Applet from environment if (env != null) { + @SuppressWarnings("deprecation") Applet applet = (Applet) env.get(Context.APPLET); if (applet != null) { // Create ORBs using applet and orbProp diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java index f8f41d598f9..606f38005cf 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java @@ -96,7 +96,7 @@ public abstract class AtomicContext extends ComponentContext { * Resolves the nns for 'name' when the named context is acting * as an intermediate context. * - * For a system that supports junctions, this would be equilvalent to + * For a system that supports junctions, this would be equivalent to * a_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. @@ -487,7 +487,7 @@ public abstract class AtomicContext extends ComponentContext { resolve_to_nns_and_continue(name, cont); return null; } else { - // use COmponentContext + // use ComponentContext return super.c_getNameParser_nns(name, cont); } } diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java index 351d6d7d0f7..24e65fa104a 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java @@ -137,7 +137,7 @@ public abstract class ComponentContext extends PartialCompositeContext { * as an intermediate context. * * For a system that supports only junctions, this would be - * equilvalent to + * equivalent to * c_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java index 6c09f935f97..44bc245bad4 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java @@ -172,7 +172,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by _nns methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setErrorNNS() + * encountered some error. Consequently, it would call setErrorNNS() * with the remaining name. Since the _nns method was expected to * operate upon the "nns" of the original name, the remaining name * must include the "nns". That's why this method adds a trailing "/". @@ -219,7 +219,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setError() + * encountered some error. Consequently, it would call setError() * with the resolved object and the remaining name. *

* After this method is called, isContinuing() returns false. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java index cafd047b144..176e3392b02 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java @@ -182,14 +182,14 @@ public class ContextEnumerator implements NamingEnumeration { if (!currentReturned) { // returning parent - if(debug) {System.out.println("getNextDescedant: simple case");} + if(debug) {System.out.println("getNextDescendant: simple case");} currentReturned = true; return currentChild; } else if (currentChildExpanded && currentChildEnum.hasMore()) { - if(debug) {System.out.println("getNextDescedant: expanded case");} + if(debug) {System.out.println("getNextDescendant: expanded case");} // if the current child is expanded, use it's enumerator return currentChildEnum.next(); @@ -197,7 +197,7 @@ public class ContextEnumerator implements NamingEnumeration { } else { // Ready to go onto next child - if(debug) {System.out.println("getNextDescedant: next case");} + if(debug) {System.out.println("getNextDescendant: next case");} prepNextChild(); return getNextDescendant(); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java index e10ee2aec41..35895db2395 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java @@ -881,8 +881,8 @@ public class HierMemDirCtx implements DirContext { } } - // CompundNames's HashCode() method isn't good enough for many string. - // The only prupose of this subclass is to have a more discerning + // CompoundNames's HashCode() method isn't good enough for many strings. + // The only purpose of this subclass is to have a more discerning // hash function. We'll make up for the performance hit by caching // the hash value. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java index b6efbedfa4b..8871e0f051c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java @@ -152,7 +152,7 @@ final public class LazySearchEnumerationImpl } else if (useFactory) { try { // Give name only if context non-null, - // otherewise, name will be interpreted relative + // otherwise, name will be interpreted relative // to initial context (not what we want) Name nm = (context != null ? new CompositeName(next.getName()) : null); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java index cf23c3dd2e4..695238309f3 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java @@ -256,7 +256,7 @@ public class SearchFilter implements AttrFilter { static final int LESS_MATCH = 4; /** - * A class for dealing wtih atomic filters + * A class for dealing with atomic filters */ final class AtomicFilter implements StringFilter { private String attrID; @@ -369,7 +369,7 @@ public class SearchFilter implements AttrFilter { } break; default: - if (debug) {System.out.println("AtomicFilter: unkown " + + if (debug) {System.out.println("AtomicFilter: unknown " + "matchType");} } } @@ -434,7 +434,7 @@ public class SearchFilter implements AttrFilter { /** - * Creates an LDAP filter as a conjuction of the attributes supplied. + * Creates an LDAP filter as a conjunction of the attributes supplied. */ public static String format(Attributes attrs) throws NamingException { if (attrs == null || attrs.size() == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java index cb5255d0a7b..8493330135b 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java @@ -168,7 +168,7 @@ abstract public class GenericURLContext implements Context { } } - // else 0 or 1 iniitial slashes; start is unchanged + // else 0 or 1 initial slashes; start is unchanged return url.substring(0, start); } diff --git a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java index 6143363284a..af88b606e21 100644 --- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java @@ -562,7 +562,7 @@ final public class ldapURLContext } // Search using the LDAP URL in name. - // LDAP URL query components override the search argments. + // LDAP URL query components override the search arguments. private NamingEnumeration searchUsingURL(String name) throws NamingException { diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 0a7eda76a51..7257b6c6f62 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -267,7 +267,7 @@ public class GcInfo implements CompositeData, CompositeDataView { return cdata.toString(); } - public Collection values() { + public Collection values() { return cdata.values(); } diff --git a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java index a735b4342ee..09be7ca7cd1 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java +++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,6 @@ package com.sun.naming.internal; import java.io.InputStream; import java.io.IOException; import java.lang.ref.WeakReference; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; @@ -126,52 +124,6 @@ public final class ResourceManager { private static final WeakReference NO_FACTORY = new WeakReference<>(null); - /** - * A class to allow JNDI properties be specified as applet parameters - * without creating a static dependency on java.applet. - */ - private static class AppletParameter { - private static final Class clazz = getClass("java.applet.Applet"); - private static final Method getMethod = - getMethod(clazz, "getParameter", String.class); - private static Class getClass(String name) { - try { - return Class.forName(name, true, null); - } catch (ClassNotFoundException e) { - return null; - } - } - private static Method getMethod(Class clazz, - String name, - Class... paramTypes) - { - if (clazz != null) { - try { - return clazz.getMethod(name, paramTypes); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } else { - return null; - } - } - - /** - * Returns the value of the applet's named parameter. - */ - static Object get(Object applet, String name) { - // if clazz is null then applet cannot be an Applet. - if (clazz == null || !clazz.isInstance(applet)) - throw new ClassCastException(applet.getClass().getName()); - try { - return getMethod.invoke(applet, name); - } catch (InvocationTargetException | - IllegalAccessException e) { - throw new AssertionError(e); - } - } - } - // There should be no instances of this class. private ResourceManager() { } @@ -179,12 +131,11 @@ public final class ResourceManager { // ---------- Public methods ---------- - /* + /** * Given the environment parameter passed to the initial context * constructor, returns the full environment for that initial * context (never null). This is based on the environment - * parameter, the applet parameters (where appropriate), the - * system properties, and all application resource files. + * parameter, the system properties, and all application resource files. * *

This method will modify env and save * a reference to it. The caller may no longer modify it. @@ -196,18 +147,16 @@ public final class ResourceManager { * resource file */ @SuppressWarnings("unchecked") - public static Hashtable getInitialEnvironment( - Hashtable env) + public static Hashtable getInitialEnvironment(Hashtable env) throws NamingException { - String[] props = VersionHelper.PROPS; // system/applet properties + String[] props = VersionHelper.PROPS; // system properties if (env == null) { env = new Hashtable<>(11); } - Object applet = env.get(Context.APPLET); - // Merge property values from env param, applet params, and system - // properties. The first value wins: there's no concatenation of + // Merge property values from env param, and system properties. + // The first value wins: there's no concatenation of // colon-separated lists. // Read system properties by first trying System.getProperties(), // and then trying System.getProperty() if that fails. The former @@ -217,18 +166,13 @@ public final class ResourceManager { for (int i = 0; i < props.length; i++) { Object val = env.get(props[i]); if (val == null) { - if (applet != null) { - val = AppletParameter.get(applet, props[i]); - } - if (val == null) { - // Read system property. - val = (jndiSysProps != null) + // Read system property. + val = (jndiSysProps != null) ? jndiSysProps[i] : helper.getJndiProperty(i); - } - if (val != null) { - ((Hashtable)env).put(props[i], val); - } + } + if (val != null) { + ((Hashtable)env).put(props[i], val); } } @@ -248,8 +192,8 @@ public final class ResourceManager { /** * Retrieves the property from the environment, or from the provider * resource file associated with the given context. The environment - * may in turn contain values that come from applet parameters, - * system properties, or application resource files. + * may in turn contain values that come from system properties, + * or application resource files. * * If concat is true and both the environment and the provider * resource file contain the property, the two values are concatenated @@ -289,7 +233,7 @@ public final class ResourceManager { * property. * * The property is gotten from the environment and the provider - * resource file associated with the given context and concantenated. + * resource file associated with the given context and concatenated. * See getProperty(). The resulting property value is a list of class names. *

* This method then loads each class using the current thread's context diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java index 63590be93aa..2a9db220af0 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,19 @@ package com.sun.naming.internal; -import java.io.InputStream; +import javax.naming.NamingEnumeration; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.naming.NamingEnumeration; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.*; /** * VersionHelper was used by JNDI to accommodate differences between @@ -45,10 +50,10 @@ import javax.naming.NamingEnumeration; * @author Scott Seligman */ -public abstract class VersionHelper { - private static VersionHelper helper = null; +public final class VersionHelper { + private static final VersionHelper helper = new VersionHelper(); - final static String[] PROPS = new String[] { + final static String[] PROPS = new String[]{ javax.naming.Context.INITIAL_CONTEXT_FACTORY, javax.naming.Context.OBJECT_FACTORIES, javax.naming.Context.URL_PKG_PREFIXES, @@ -67,31 +72,57 @@ public abstract class VersionHelper { public final static int DNS_URL = 5; public final static int CONTROL_FACTORIES = 6; - VersionHelper() {} // Disallow anyone from creating one of these. - - static { - helper = new VersionHelper12(); - } + private VersionHelper() {} // Disallow anyone from creating one of these. public static VersionHelper getVersionHelper() { return helper; } - public abstract Class loadClass(String className) - throws ClassNotFoundException; + public Class loadClass(String className) throws ClassNotFoundException { + return loadClass(className, getContextClassLoader()); + } - abstract Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException; + /** + * @param className A non-null fully qualified class name. + * @param codebase A non-null, space-separated list of URL strings. + */ + public Class loadClass(String className, String codebase) + throws ClassNotFoundException, MalformedURLException { - public abstract Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException; + ClassLoader parent = getContextClassLoader(); + ClassLoader cl = + URLClassLoader.newInstance(getUrlArray(codebase), parent); + + return loadClass(className, cl); + } + + /** + * Package private. + *

+ * This internal method is used with Thread Context Class Loader (TCCL), + * please don't expose this method as public. + */ + Class loadClass(String className, ClassLoader cl) + throws ClassNotFoundException { + Class cls = Class.forName(className, true, cl); + return cls; + } /* - * Returns a JNDI property from the system properties. Returns + * Returns a JNDI property from the system properties. Returns * null if the property is not set, or if there is no permission * to read it. */ - abstract String getJndiProperty(int i); + String getJndiProperty(int i) { + PrivilegedAction act = () -> { + try { + return System.getProperty(PROPS[i]); + } catch (SecurityException e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Reads each property in PROPS from the system properties, and @@ -99,13 +130,33 @@ public abstract class VersionHelper { * unset property, the corresponding array element is set to null. * Returns null if there is no permission to call System.getProperties(). */ - abstract String[] getJndiProperties(); + String[] getJndiProperties() { + PrivilegedAction act = () -> { + try { + return System.getProperties(); + } catch (SecurityException e) { + return null; + } + }; + Properties sysProps = AccessController.doPrivileged(act); + if (sysProps == null) { + return null; + } + String[] jProps = new String[PROPS.length]; + for (int i = 0; i < PROPS.length; i++) { + jProps[i] = sysProps.getProperty(PROPS[i]); + } + return jProps; + } /* * Returns the resource of a given name associated with a particular * class (never null), or null if none can be found. */ - abstract InputStream getResourceAsStream(Class c, String name); + InputStream getResourceAsStream(Class c, String name) { + PrivilegedAction act = () -> c.getResourceAsStream(name); + return AccessController.doPrivileged(act); + } /* * Returns an input stream for a file in /lib, @@ -113,7 +164,22 @@ public abstract class VersionHelper { * * @param filename The file name, sans directory. */ - abstract InputStream getJavaHomeLibStream(String filename); + InputStream getJavaHomeLibStream(String filename) { + PrivilegedAction act = () -> { + try { + String javahome = System.getProperty("java.home"); + if (javahome == null) { + return null; + } + String pathname = javahome + File.separator + + "lib" + File.separator + filename; + return new FileInputStream(pathname); + } catch (Exception e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Returns an enumeration (never null) of InputStreams of the @@ -121,29 +187,55 @@ public abstract class VersionHelper { * loader. Null represents the bootstrap class loader in some * Java implementations. */ - abstract NamingEnumeration getResources( - ClassLoader cl, String name) - throws IOException; + NamingEnumeration getResources(ClassLoader cl, + String name) throws IOException { + Enumeration urls; + PrivilegedExceptionAction> act = () -> + (cl == null) + ? ClassLoader.getSystemResources(name) + : cl.getResources(name); + try { + urls = AccessController.doPrivileged(act); + } catch (PrivilegedActionException e) { + throw (IOException) e.getException(); + } + return new InputStreamEnumeration(urls); + } - /* - * Returns the context class loader associated with the current thread. - * Null indicates the bootstrap class loader in some Java implementations. - * - * @throws SecurityException if the class loader is not accessible. + + /** + * Package private. + *

+ * This internal method returns Thread Context Class Loader (TCCL), + * if null, returns the system Class Loader. + *

+ * Please don't expose this method as public. + * @throws SecurityException if the class loader is not accessible */ - abstract ClassLoader getContextClassLoader(); + ClassLoader getContextClassLoader() { - static protected URL[] getUrlArray(String codebase) - throws MalformedURLException { + PrivilegedAction act = () -> { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + // Don't use bootstrap class loader directly! + loader = ClassLoader.getSystemClassLoader(); + } + return loader; + }; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String codebase) + throws MalformedURLException { // Parse codebase into separate URLs StringTokenizer parser = new StringTokenizer(codebase); - Vector vec = new Vector<>(10); + List list = new ArrayList<>(); while (parser.hasMoreTokens()) { - vec.addElement(parser.nextToken()); + list.add(parser.nextToken()); } - String[] url = new String[vec.size()]; + String[] url = new String[list.size()]; for (int i = 0; i < url.length; i++) { - url[i] = vec.elementAt(i); + url[i] = list.get(i); } URL[] urlArray = new URL[url.length]; @@ -152,4 +244,70 @@ public abstract class VersionHelper { } return urlArray; } + + /** + * Given an enumeration of URLs, an instance of this class represents + * an enumeration of their InputStreams. Each operation on the URL + * enumeration is performed within a doPrivileged block. + * This is used to enumerate the resources under a foreign codebase. + * This class is not MT-safe. + */ + private class InputStreamEnumeration implements + NamingEnumeration { + + private final Enumeration urls; + + private InputStream nextElement; + + InputStreamEnumeration(Enumeration urls) { + this.urls = urls; + } + + /* + * Returns the next InputStream, or null if there are no more. + * An InputStream that cannot be opened is skipped. + */ + private InputStream getNextElement() { + PrivilegedAction act = () -> { + while (urls.hasMoreElements()) { + try { + return urls.nextElement().openStream(); + } catch (IOException e) { + // skip this URL + } + } + return null; + }; + return AccessController.doPrivileged(act); + } + + public boolean hasMore() { + if (nextElement != null) { + return true; + } + nextElement = getNextElement(); + return (nextElement != null); + } + + public boolean hasMoreElements() { + return hasMore(); + } + + public InputStream next() { + if (hasMore()) { + InputStream res = nextElement; + nextElement = null; + return res; + } else { + throw new NoSuchElementException(); + } + } + + public InputStream nextElement() { + return next(); + } + + public void close() { + } + } } diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java deleted file mode 100644 index bf4586e7ebc..00000000000 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. 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 com.sun.naming.internal; - -import java.io.InputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URLClassLoader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.Enumeration; -import java.util.NoSuchElementException; -import java.util.Properties; - -import javax.naming.*; - -/** - * VersionHelper was used by JNDI to accommodate differences between - * JDK 1.1.x and the Java 2 platform. As this is no longer necessary - * since JNDI's inclusion in the platform, this class currently - * serves as a set of utilities for performing system-level things, - * such as class-loading and reading system properties. - * - * @author Rosanna Lee - * @author Scott Seligman - */ - -final class VersionHelper12 extends VersionHelper { - - // Disallow external from creating one of these. - VersionHelper12() { - } - - public Class loadClass(String className) throws ClassNotFoundException { - return loadClass(className, getContextClassLoader()); - } - - /** - * Package private. - * - * This internal method is used with Thread Context Class Loader (TCCL), - * please don't expose this method as public. - */ - Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException { - Class cls = Class.forName(className, true, cl); - return cls; - } - - /** - * @param className A non-null fully qualified class name. - * @param codebase A non-null, space-separated list of URL strings. - */ - public Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException { - - ClassLoader parent = getContextClassLoader(); - ClassLoader cl = - URLClassLoader.newInstance(getUrlArray(codebase), parent); - - return loadClass(className, cl); - } - - String getJndiProperty(final int i) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - try { - return System.getProperty(PROPS[i]); - } catch (SecurityException e) { - return null; - } - } - } - ); - } - - String[] getJndiProperties() { - Properties sysProps = AccessController.doPrivileged( - new PrivilegedAction() { - public Properties run() { - try { - return System.getProperties(); - } catch (SecurityException e) { - return null; - } - } - } - ); - if (sysProps == null) { - return null; - } - String[] jProps = new String[PROPS.length]; - for (int i = 0; i < PROPS.length; i++) { - jProps[i] = sysProps.getProperty(PROPS[i]); - } - return jProps; - } - - InputStream getResourceAsStream(final Class c, final String name) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - return c.getResourceAsStream(name); - } - } - ); - } - - InputStream getJavaHomeLibStream(final String filename) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - try { - String javahome = System.getProperty("java.home"); - if (javahome == null) { - return null; - } - String pathname = javahome + java.io.File.separator + - "lib" + java.io.File.separator + filename; - return new java.io.FileInputStream(pathname); - } catch (Exception e) { - return null; - } - } - } - ); - } - - NamingEnumeration getResources(final ClassLoader cl, - final String name) throws IOException { - Enumeration urls; - try { - urls = AccessController.doPrivileged( - new PrivilegedExceptionAction>() { - public Enumeration run() throws IOException { - return (cl == null) - ? ClassLoader.getSystemResources(name) - : cl.getResources(name); - } - } - ); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - return new InputStreamEnumeration(urls); - } - - /** - * Package private. - * - * This internal method returns Thread Context Class Loader (TCCL), - * if null, returns the system Class Loader. - * - * Please don't expose this method as public. - */ - ClassLoader getContextClassLoader() { - - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - ClassLoader loader = - Thread.currentThread().getContextClassLoader(); - if (loader == null) { - // Don't use bootstrap class loader directly! - loader = ClassLoader.getSystemClassLoader(); - } - - return loader; - } - } - ); - } - - /** - * Given an enumeration of URLs, an instance of this class represents - * an enumeration of their InputStreams. Each operation on the URL - * enumeration is performed within a doPrivileged block. - * This is used to enumerate the resources under a foreign codebase. - * This class is not MT-safe. - */ - class InputStreamEnumeration implements NamingEnumeration { - - private final Enumeration urls; - - private InputStream nextElement = null; - - InputStreamEnumeration(Enumeration urls) { - this.urls = urls; - } - - /* - * Returns the next InputStream, or null if there are no more. - * An InputStream that cannot be opened is skipped. - */ - private InputStream getNextElement() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - while (urls.hasMoreElements()) { - try { - return urls.nextElement().openStream(); - } catch (IOException e) { - // skip this URL - } - } - return null; - } - } - ); - } - - public boolean hasMore() { - if (nextElement != null) { - return true; - } - nextElement = getNextElement(); - return (nextElement != null); - } - - public boolean hasMoreElements() { - return hasMore(); - } - - public InputStream next() { - if (hasMore()) { - InputStream res = nextElement; - nextElement = null; - return res; - } else { - throw new NoSuchElementException(); - } - } - - public InputStream nextElement() { - return next(); - } - - public void close() { - } - } -} diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java index 5f0c12086d6..4005adc4262 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java @@ -33,18 +33,18 @@ import java.util.ArrayList; public class ExpressionParser implements ExpressionParserConstants { - Stack stack = new Stack(); + Stack stack = new Stack<>(); VirtualMachine vm = null; GetFrame frameGetter = null; private static GetFrame lastFrameGetter; private static LValue lastLValue; LValue peek() { - return (LValue)stack.peek(); + return stack.peek(); } LValue pop() { - return (LValue)stack.pop(); + return stack.pop(); } void push(LValue lval) { @@ -915,7 +915,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void PrimarySuffix() throws ParseException { - List argList; + List argList; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); @@ -993,8 +993,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(NULL); } - final public List Arguments() throws ParseException { - List argList = new ArrayList(); + final public List Arguments() throws ParseException { + List argList = new ArrayList<>(); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: @@ -1026,7 +1026,7 @@ public class ExpressionParser implements ExpressionParserConstants { throw new Error("Missing return statement in function"); } - final public void ArgumentList(List argList) throws ParseException { + final public void ArgumentList(List argList) throws ParseException { Expression(); argList.add(pop().interiorGetValue()); label_17: @@ -1046,7 +1046,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void AllocationExpression() throws ParseException { - List argList; String className; + List argList; String className; if (jj_2_7(2)) { jj_consume_token(NEW); PrimitiveType(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java index e7a59b3a4d6..3ad56be2d2c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -229,9 +229,9 @@ public class JavaClass extends JavaHeapObject { return name.indexOf('[') != -1; } - public Enumeration getInstances(boolean includeSubclasses) { + public Enumeration getInstances(boolean includeSubclasses) { if (includeSubclasses) { - Enumeration res = instances.elements(); + Enumeration res = instances.elements(); for (int i = 0; i < subclasses.length; i++) { res = new CompositeEnumeration(res, subclasses[i].getInstances(true)); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java index 508e0c0d4a3..471a77b595b 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,11 +166,11 @@ public abstract class JavaHeapObject extends JavaThing { * * @return an Enumeration of JavaHeapObject instances */ - public Enumeration getReferers() { + public Enumeration getReferers() { if (referersLen != -1) { throw new RuntimeException("not resolved: " + getIdString()); } - return new Enumeration() { + return new Enumeration() { private int num = 0; @@ -178,7 +178,7 @@ public abstract class JavaHeapObject extends JavaThing { return referers != null && num < referers.length; } - public Object nextElement() { + public JavaThing nextElement() { return referers[num++]; } }; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java index 46978cfaf90..c20d54b7392 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class ReachableExcludesImpl implements ReachableExcludes { private File excludesFile; private long lastModified; - private Hashtable methods; // Hashtable, used as a bag + private Hashtable methods; // Used as a bag /** * Create a new ReachableExcludesImpl over the given file. The file will be diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java index 831e8245873..43f4c03aa91 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ public class ReachableObjects { // Now grab the elements into a vector, and sort it in decreasing size JavaThing[] things = new JavaThing[bag.size()]; int i = 0; - for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { + for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { things[i++] = (JavaThing) e.nextElement(); } ArraySorter.sort(things, new Comparer() { @@ -131,7 +131,7 @@ public class ReachableObjects { return usedFields; } - private String[] getElements(Hashtable ht) { + private String[] getElements(Hashtable ht) { Object[] keys = ht.keySet().toArray(); int len = keys.length; String[] res = new String[len]; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java index 9c00ce05e18..77613c08e41 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ public class Snapshot { new HashMap(); // soft cache of finalizeable objects - lazily initialized - private SoftReference finalizablesCache; + private SoftReference> finalizablesCache; // represents null reference private JavaThing nullThing; @@ -383,7 +383,7 @@ public class Snapshot { /** * Return an Iterator of all of the classes in this snapshot. **/ - public Iterator getClasses() { + public Iterator getClasses() { // note that because classes is a TreeMap // classes are already sorted by name return classes.values().iterator(); @@ -395,8 +395,8 @@ public class Snapshot { return res; } - public synchronized Enumeration getFinalizerObjects() { - Vector obj; + public synchronized Enumeration getFinalizerObjects() { + Vector obj; if (finalizablesCache != null && (obj = finalizablesCache.get()) != null) { return obj.elements(); @@ -418,7 +418,7 @@ public class Snapshot { finalizables.add(referent); } } - finalizablesCache = new SoftReference(finalizables); + finalizablesCache = new SoftReference>(finalizables); return finalizables.elements(); } @@ -455,7 +455,7 @@ public class Snapshot { // Even though curr is in the rootset, we want to explore its // referers, because they might be more interesting. } - Enumeration referers = curr.getReferers(); + Enumeration referers = curr.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject t = (JavaHeapObject) referers.nextElement(); if (t != null && !visited.containsKey(t)) { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java index c69335d9798..c393b445ec6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); Object jse = getEngineMethod.invoke(manager, new Object[] {"js"}); oqlSupported = (jse != null); } catch (Exception exp) { @@ -205,9 +205,9 @@ public class OQLEngine { } if (q.className != null) { - Enumeration objects = clazz.getInstances(q.isInstanceOf); + Enumeration objects = clazz.getInstances(q.isInstanceOf); while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); Object[] args = new Object[] { wrapJavaObject(obj) }; boolean b = (whereCode == null); if (!b) { @@ -265,14 +265,14 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); engine = getEngineMethod.invoke(manager, new Object[] {"js"}); // initialize engine with init file (hat.js) InputStream strm = getInitStream(); Class engineClass = Class.forName("javax.script.ScriptEngine"); evalMethod = engineClass.getMethod("eval", - new Class[] { Reader.class }); + new Class[] { Reader.class }); evalMethod.invoke(engine, new Object[] {new InputStreamReader(strm)}); // initialize ScriptEngine.eval(String) and @@ -280,13 +280,13 @@ public class OQLEngine { Class invocableClass = Class.forName("javax.script.Invocable"); evalMethod = engineClass.getMethod("eval", - new Class[] { String.class }); + new Class[] { String.class }); invokeMethod = invocableClass.getMethod("invokeFunction", - new Class[] { String.class, Object[].class }); + new Class[] { String.class, Object[].class }); // initialize ScriptEngine.put(String, Object) method Method putMethod = engineClass.getMethod("put", - new Class[] { String.class, Object.class }); + new Class[] { String.class, Object.class }); // call ScriptEngine.put to initialize built-in heap object putMethod.invoke(engine, new Object[] { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d453d82c38c..cd08b1bf0da 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,10 +58,10 @@ class AllClassesQuery extends QueryHandler { startHtml("All Classes (including platform)"); } - Iterator classes = snapshot.getClasses(); + Iterator classes = snapshot.getClasses(); String lastPackage = null; while (classes.hasNext()) { - JavaClass clazz = (JavaClass) classes.next(); + JavaClass clazz = classes.next(); if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) { // skip this.. continue; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index dde9640b4a7..824501381f7 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,7 +151,7 @@ class ClassQuery extends QueryHandler { } out.println("

References to this object:

"); out.flush(); - Enumeration referers = obj.getReferers(); + Enumeration referers = obj.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject ref = (JavaHeapObject) referers.nextElement(); printThing(ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java index 91f7017ebf2..a717c7aa38c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerObjectsQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Objects pending finalization"); out.println("Finalizer summary"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java index 916cda738a4..c1aa35bce55 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerSummaryQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Finalizer Summary"); out.println("

"); @@ -74,7 +74,7 @@ public class FinalizerSummaryQuery extends QueryHandler { private long count; } - private void printFinalizerSummary(Enumeration objs) { + private void printFinalizerSummary(Enumeration objs) { int count = 0; Map map = new HashMap(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 1b466a49a4f..311df7bbb26 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,10 +111,10 @@ class InstancesCountQuery extends QueryHandler { } out.print(" "); if (snapshot.getHasNewSet()) { - Enumeration objects = clazz.getInstances(false); + Enumeration objects = clazz.getInstances(false); int newInst = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject)objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (obj.isNew()) { newInst++; } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java index ff1f60f7be5..7532b0b2e62 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,11 +73,11 @@ class InstancesQuery extends QueryHandler { out.print(""); printClass(clazz); out.print("

"); - Enumeration objects = clazz.getInstances(includeSubclasses); + Enumeration objects = clazz.getInstances(includeSubclasses); long totalSize = 0; long instances = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (newObjects && !obj.isNew()) continue; printThing(obj); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 73755c2e523..15f7ae8b492 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,15 +47,15 @@ public class RefsByTypeQuery extends QueryHandler { } else { Map referrersStat = new HashMap(); final Map refereesStat = new HashMap(); - Enumeration instances = clazz.getInstances(false); + Enumeration instances = clazz.getInstances(false); while (instances.hasMoreElements()) { - JavaHeapObject instance = (JavaHeapObject) instances.nextElement(); + JavaHeapObject instance = instances.nextElement(); if (instance.getId() == -1) { continue; } - Enumeration e = instance.getReferers(); + Enumeration e = instance.getReferers(); while (e.hasMoreElements()) { - JavaHeapObject ref = (JavaHeapObject) e.nextElement(); + JavaHeapObject ref = (JavaHeapObject)e.nextElement(); JavaClass cl = ref.getClazz(); if (cl == null) { System.out.println("null class for " + ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java index 6663d8ff894..c20afb22339 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,13 @@ package com.sun.tools.hat.internal.util; import java.util.Enumeration; import java.util.NoSuchElementException; +import com.sun.tools.hat.internal.model.JavaHeapObject; -public class CompositeEnumeration implements Enumeration { - Enumeration e1; - Enumeration e2; +public class CompositeEnumeration implements Enumeration { + Enumeration e1; + Enumeration e2; - public CompositeEnumeration(Enumeration e1, Enumeration e2) { + public CompositeEnumeration(Enumeration e1, Enumeration e2) { this.e1 = e1; this.e2 = e2; } @@ -48,7 +49,7 @@ public class CompositeEnumeration implements Enumeration { return e1.hasMoreElements() || e2.hasMoreElements(); } - public Object nextElement() { + public JavaHeapObject nextElement() { if (e1.hasMoreElements()) { return e1.nextElement(); } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java index 11572160825..93c10f0b00f 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import java.util.*; // Warnings from List filters and List[] requestLists is hard to fix. // Remove SuppressWarning when we fix the warnings from List filters // and List[] requestLists. The generic array is not supported. -@SuppressWarnings("unchecked") +@SuppressWarnings({"unchecked", "rawtypes"}) class EventRequestManagerImpl extends MirrorImpl implements EventRequestManager { diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java index e80e991aa15..3a94d73ac74 100644 --- a/jdk/src/share/classes/java/awt/Color.java +++ b/jdk/src/share/classes/java/awt/Color.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import java.awt.color.ColorSpace; * see * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html * . - *

+ * * @version 10 Feb 1997 * @author Sami Shaio * @author Arthur van Hoff diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 41d143522dc..d9faf3d3e80 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -542,7 +542,6 @@ public class Font implements java.io.Serializable * compatible alternative, then the font system will map the Font * instance to "Dialog", such that for example, the family as reported * by {@link #getFamily() getFamily} will be "Dialog". - *

* * @param name the font name. This can be a font face name or a font * family name, and may represent either a logical font or a physical diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index 4f03e1c61dd..3be860cab31 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,7 +151,7 @@ public abstract class Graphics { * is specified by the width and height * arguments. * - *

+ * * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the clipping rectangle. diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java index 4ea95bf5969..64b1db9bf06 100644 --- a/jdk/src/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/share/classes/java/awt/MenuComponent.java @@ -132,16 +132,24 @@ public abstract class MenuComponent implements java.io.Serializable { static { AWTAccessor.setMenuComponentAccessor( new AWTAccessor.MenuComponentAccessor() { + @Override public AppContext getAppContext(MenuComponent menuComp) { return menuComp.appContext; } + @Override public void setAppContext(MenuComponent menuComp, AppContext appContext) { menuComp.appContext = appContext; } + @Override public MenuContainer getParent(MenuComponent menuComp) { return menuComp.parent; } + @Override + public void setParent(MenuComponent menuComp, MenuContainer menuContainer) { + menuComp.parent = menuContainer; + } + @Override public Font getFont_NoClientCode(MenuComponent menuComp) { return menuComp.getFont_NoClientCode(); } diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java index e714428c0d1..0d89e6045be 100644 --- a/jdk/src/share/classes/java/awt/Polygon.java +++ b/jdk/src/share/classes/java/awt/Polygon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -351,7 +351,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are inside this * Polygon. - *

+ * * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains diff --git a/jdk/src/share/classes/java/awt/Rectangle.java b/jdk/src/share/classes/java/awt/Rectangle.java index d64deaf2f0e..727fe8e7ba8 100644 --- a/jdk/src/share/classes/java/awt/Rectangle.java +++ b/jdk/src/share/classes/java/awt/Rectangle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,14 +41,13 @@ import java.beans.Transient; *

* * A {@code Rectangle} whose width or height is exactly zero has location - * along those axes with zero dimension, but is otherwise considered empty. + * along those axes with zero dimension, but is otherwise considered empty. * The {@link #isEmpty} method will return true for such a {@code Rectangle}. * Methods which test if an empty {@code Rectangle} contains or intersects * a point or rectangle will always return false if either dimension is zero. * Methods which combine such a {@code Rectangle} with a point or rectangle * will include the location of the {@code Rectangle} on that axis in the * result as if the {@link #add(Point)} method were being called. - * *

* * A {@code Rectangle} whose width or height is negative has neither @@ -422,7 +421,7 @@ public class Rectangle extends Rectangle2D * Rectangle to the specified * x, y, width, * and height. - *

+ * * @param x the new X coordinate for the upper-left * corner of this Rectangle * @param y the new Y coordinate for the upper-left @@ -488,7 +487,7 @@ public class Rectangle extends Rectangle2D /** * Moves this Rectangle to the specified location. - *

+ * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @deprecated As of JDK version 1.1, @@ -629,7 +628,7 @@ public class Rectangle extends Rectangle2D /** * Sets the size of this Rectangle to the specified * width and height. - *

+ * * @param width the new width for this Rectangle * @param height the new height for this Rectangle * @deprecated As of JDK version 1.1, diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index 65b494ba52d..2fc0910cc96 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -1241,10 +1241,9 @@ public abstract class Toolkit { * clipboard enables data transfer between Java programs and native * applications which use native clipboard facilities. *

- * In addition to any and all formats specified in the flavormap.properties - * file, or other file specified by the AWT.DnD.flavorMapFileURL - * Toolkit property, text returned by the system Clipboard's - * getTransferData() method is available in the following flavors: + * In addition to any and all default formats text returned by the system + * Clipboard's getTransferData() method is available in the + * following flavors: *

* *

Summary of attributes

- * * diff --git a/jdk/src/share/classes/java/awt/geom/Arc2D.java b/jdk/src/share/classes/java/awt/geom/Arc2D.java index 3d92306f618..be51e8a4bc3 100644 --- a/jdk/src/share/classes/java/awt/geom/Arc2D.java +++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,8 @@ import java.io.Serializable; *

* * The arc is a partial section of a full ellipse which - * inscribes the framing rectangle of its parent {@link RectangularShape}. - * + * inscribes the framing rectangle of its parent {@link RectangularShape}. + * * * The angles are specified relative to the non-square * framing rectangle such that 45 degrees always falls on the line from diff --git a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java index 9e6a66eea5c..d9216606b73 100644 --- a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java +++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java @@ -324,7 +324,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp { * this part of the rectangle is not drawn. If the coordinates * of the rectangle are positive then the filtered image is drawn at * that position in the destination Raster. - *

+ * * @param src The Raster to transform. * @param dst The Raster in which to store the results of the * transformation. diff --git a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java index bac63a8f066..e848fd9c206 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,7 +85,7 @@ public class BufferedImageFilter extends ImageFilter implements Cloneable { * an image should avoid calling this method directly since that * operation could result in problems with retrieving the requested * pixels. - *

+ * * @param width the width to which to set the width of this * BufferedImageFilter * @param height the height to which to set the height of this diff --git a/jdk/src/share/classes/java/awt/image/ImageFilter.java b/jdk/src/share/classes/java/awt/image/ImageFilter.java index 33198346e03..04077b6d6a5 100644 --- a/jdk/src/share/classes/java/awt/image/ImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java @@ -225,7 +225,7 @@ public class ImageFilter implements ImageConsumer, Cloneable { * *

  • * Override the method to simply send the data. - * This is appropriate if the filter can handle the request itself — + * This is appropriate if the filter can handle the request itself — * for example, * if the generated pixels have been saved in some sort of buffer. * diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java index 6ad950288ee..65ff74aa4f9 100644 --- a/jdk/src/share/classes/java/awt/image/WritableRaster.java +++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -394,7 +394,7 @@ public class WritableRaster extends Raster { * is first converted to a 32-bit int (if necessary), using the above * rules for integral types, and then the int is cast to float or * double. - *

    + * * @param srcRaster The Raster from which to copy pixels. * * @throws NullPointerException if srcRaster is null. diff --git a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java index e6b923dda0e..b08e13481ee 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java +++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java @@ -370,7 +370,7 @@ public class ParameterBlock implements Cloneable, Serializable { * the specified parameter. */ public ParameterBlock add(int i) { - return add(new Integer(i)); + return add(i); } /** @@ -489,7 +489,7 @@ public class ParameterBlock implements Cloneable, Serializable { * the specified parameter. */ public ParameterBlock set(int i, int index) { - return set(new Integer(i), index); + return set(i, index); } /** diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java index 0c80d1490d4..41d39ce10ec 100644 --- a/jdk/src/share/classes/java/awt/print/PrinterJob.java +++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java @@ -546,7 +546,6 @@ public abstract class PrinterJob { * user settings returned from * printDialog(PrintRequestAttributeSet attributes to * this print() method. - *

    * * @param attributes a set of attributes for the job * @exception PrinterException an error in the print system diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java index dd41750f2f1..be0f95d8ede 100644 --- a/jdk/src/share/classes/java/beans/EventHandler.java +++ b/jdk/src/share/classes/java/beans/EventHandler.java @@ -437,7 +437,7 @@ public class EventHandler implements InvocationHandler { if (method.getDeclaringClass() == Object.class) { // Handle the Object public methods. if (methodName.equals("hashCode")) { - return new Integer(System.identityHashCode(proxy)); + return System.identityHashCode(proxy); } else if (methodName.equals("equals")) { return (proxy == arguments[0] ? Boolean.TRUE : Boolean.FALSE); } else if (methodName.equals("toString")) { diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java index d0e7108179d..ee64475b8c4 100644 --- a/jdk/src/share/classes/java/beans/MetaData.java +++ b/jdk/src/share/classes/java/beans/MetaData.java @@ -123,13 +123,13 @@ static final class ArrayPersistenceDelegate extends PersistenceDelegate { Class oldClass = oldInstance.getClass(); return new Expression(oldInstance, Array.class, "newInstance", new Object[]{oldClass.getComponentType(), - new Integer(Array.getLength(oldInstance))}); + Array.getLength(oldInstance)}); } protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { int n = Array.getLength(oldInstance); for (int i = 0; i < n; i++) { - Object index = new Integer(i); + Object index = i; // Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index}); // Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index}); Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index}); @@ -635,7 +635,7 @@ static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelega newSize = 0; } for (int i = 0; i < newSize; i++) { - Object index = new Integer(i); + Object index = i; Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index}); Expression newGetExp = new Expression(newInstance, "get", new Object[]{index}); @@ -892,7 +892,7 @@ static final class java_awt_MenuShortcut_PersistenceDelegate extends Persistence protected Expression instantiate(Object oldInstance, Encoder out) { java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance; return new Expression(oldInstance, m.getClass(), "new", - new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())}); + new Object[]{m.getKey(), Boolean.valueOf(m.usesShiftModifier())}); } } diff --git a/jdk/src/share/classes/java/beans/NameGenerator.java b/jdk/src/share/classes/java/beans/NameGenerator.java index 61dd9339853..fc1db4d0fb7 100644 --- a/jdk/src/share/classes/java/beans/NameGenerator.java +++ b/jdk/src/share/classes/java/beans/NameGenerator.java @@ -107,7 +107,7 @@ class NameGenerator { Integer size = nameToCount.get(className); int instanceNumber = (size == null) ? 0 : (size).intValue() + 1; - nameToCount.put(className, new Integer(instanceNumber)); + nameToCount.put(className, instanceNumber); result = className + instanceNumber; valueToName.put(instance, result); diff --git a/jdk/src/share/classes/java/lang/reflect/Modifier.java b/jdk/src/share/classes/java/lang/reflect/Modifier.java index 7387bbeaa75..f84a35166a9 100644 --- a/jdk/src/share/classes/java/lang/reflect/Modifier.java +++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java @@ -26,6 +26,7 @@ package java.lang.reflect; import java.security.AccessController; +import java.util.StringJoiner; import sun.reflect.LangReflectAccess; import sun.reflect.ReflectionFactory; @@ -232,27 +233,24 @@ public class Modifier { * represented by {@code mod} */ public static String toString(int mod) { - StringBuilder sb = new StringBuilder(); - int len; + StringJoiner sj = new StringJoiner(" "); - if ((mod & PUBLIC) != 0) sb.append("public "); - if ((mod & PROTECTED) != 0) sb.append("protected "); - if ((mod & PRIVATE) != 0) sb.append("private "); + if ((mod & PUBLIC) != 0) sj.add("public"); + if ((mod & PROTECTED) != 0) sj.add("protected"); + if ((mod & PRIVATE) != 0) sj.add("private"); /* Canonical order */ - if ((mod & ABSTRACT) != 0) sb.append("abstract "); - if ((mod & STATIC) != 0) sb.append("static "); - if ((mod & FINAL) != 0) sb.append("final "); - if ((mod & TRANSIENT) != 0) sb.append("transient "); - if ((mod & VOLATILE) != 0) sb.append("volatile "); - if ((mod & SYNCHRONIZED) != 0) sb.append("synchronized "); - if ((mod & NATIVE) != 0) sb.append("native "); - if ((mod & STRICT) != 0) sb.append("strictfp "); - if ((mod & INTERFACE) != 0) sb.append("interface "); + if ((mod & ABSTRACT) != 0) sj.add("abstract"); + if ((mod & STATIC) != 0) sj.add("static"); + if ((mod & FINAL) != 0) sj.add("final"); + if ((mod & TRANSIENT) != 0) sj.add("transient"); + if ((mod & VOLATILE) != 0) sj.add("volatile"); + if ((mod & SYNCHRONIZED) != 0) sj.add("synchronized"); + if ((mod & NATIVE) != 0) sj.add("native"); + if ((mod & STRICT) != 0) sj.add("strictfp"); + if ((mod & INTERFACE) != 0) sj.add("interface"); - if ((len = sb.length()) > 0) /* trim trailing space */ - return sb.toString().substring(0, len-1); - return ""; + return sj.toString(); } /* diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java index 0187565869f..0c9e3e81e1d 100644 --- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java +++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java @@ -127,7 +127,7 @@ public final class JapaneseEra // the number of defined JapaneseEra constants. // There could be an extra era defined in its configuration. - private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET + 1; + private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET; /** * Serialization version. @@ -148,7 +148,7 @@ public final class JapaneseEra for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); - KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET, isoDate); + KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate); } }; @@ -195,7 +195,7 @@ public final class JapaneseEra * @throws DateTimeException if the value is invalid */ public static JapaneseEra of(int japaneseEra) { - if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET - 1 >= KNOWN_ERAS.length) { + if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) { throw new DateTimeException("Invalid era: " + japaneseEra); } return KNOWN_ERAS[ordinal(japaneseEra)]; diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index f6a65c7b106..ce4ae7d1b97 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -2342,7 +2342,7 @@ public class Collections { public NavigableSet tailSet(E fromElement, boolean inclusive) { synchronized (mutex) { - return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive)); + return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive), mutex); } } } @@ -3486,6 +3486,7 @@ public class Collections { */ @Override public void replaceAll(UnaryOperator operator) { + Objects.requireNonNull(operator); list.replaceAll(e -> typeCheck(operator.apply(e))); } diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java index 569c35899bc..ab5f59d8a65 100644 --- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java +++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,9 +129,6 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * Returns the sum of values recorded, or zero if no values have been * recorded. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the sum will be NaN. - * *

    The value of a floating-point sum is a function both of the * input values as well as the order of addition operations. The * order of addition operations of this method is intentionally @@ -143,6 +140,44 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * numerical sum compared to a simple summation of {@code double} * values. * + * Because of the unspecified order of operations and the + * possibility of using differing summation schemes, the output of + * this method may vary on the same input values. + * + *

    Various conditions can result in a non-finite sum being + * computed. This can occur even if the all the recorded values + * being summed are finite. If any recorded value is non-finite, + * the sum will be non-finite: + * + *

      + * + *
    • If any recorded value is a NaN, then the final sum will be + * NaN. + * + *
    • If the recorded values contain one or more infinities, the + * sum will be infinite or NaN. + * + *
        + * + *
      • If the recorded values contain infinities of opposite sign, + * the sum will be NaN. + * + *
      • If the recorded values contain infinities of one sign and + * an intermediate sum overflows to an infinity of the opposite + * sign, the sum may be NaN. + * + *
      + * + *
    + * + * It is possible for intermediate sums of finite values to + * overflow into opposite-signed infinities; if that occurs, the + * final sum will be NaN even if the recorded values are all + * finite. + * + * If all the recorded values are zero, the sign of zero is + * not guaranteed to be preserved in the final sum. + * * @apiNote Values sorted by increasing absolute magnitude tend to yield * more accurate results. * @@ -193,15 +228,9 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * Returns the arithmetic mean of values recorded, or zero if no * values have been recorded. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the average will be code NaN. - * - *

    The average returned can vary depending upon the order in - * which values are recorded. - * - * This method may be implemented using compensated summation or - * other technique to reduce the error bound in the {@link #getSum - * numerical sum} used to compute the average. + *

    The computed average can vary numerically and have the + * special case behavior as computing the sum; see {@link #getSum} + * for details. * * @apiNote Values sorted by increasing absolute magnitude tend to yield * more accurate results. diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java index cfc12ffde28..08b4eeda304 100644 --- a/jdk/src/share/classes/java/util/stream/DoubleStream.java +++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -470,10 +470,7 @@ public interface DoubleStream extends BaseStream { * code is not necessarily equivalent to the summation computation * done by this method. * - *

    If any stream element is a NaN or the sum is at any point a NaN - * then the sum will be NaN. - * - * The value of a floating-point sum is a function both + *

    The value of a floating-point sum is a function both * of the input values as well as the order of addition * operations. The order of addition operations of this method is * intentionally not defined to allow for implementation @@ -485,6 +482,44 @@ public interface DoubleStream extends BaseStream { * numerical sum compared to a simple summation of {@code double} * values. * + * Because of the unspecified order of operations and the + * possibility of using differing summation schemes, the output of + * this method may vary on the same input elements. + * + *

    Various conditions can result in a non-finite sum being + * computed. This can occur even if the all the elements + * being summed are finite. If any element is non-finite, + * the sum will be non-finite: + * + *

      + * + *
    • If any element is a NaN, then the final sum will be + * NaN. + * + *
    • If the elements contain one or more infinities, the + * sum will be infinite or NaN. + * + *
        + * + *
      • If the elements contain infinities of opposite sign, + * the sum will be NaN. + * + *
      • If the elements contain infinities of one sign and + * an intermediate sum overflows to an infinity of the opposite + * sign, the sum may be NaN. + * + *
      + * + *
    + * + * It is possible for intermediate sums of finite values to + * overflow into opposite-signed infinities; if that occurs, the + * final sum will be NaN even if the elements are all + * finite. + * + * If all the elements are zero, the sign of zero is + * not guaranteed to be preserved in the final sum. + * *

    This is a terminal * operation. * @@ -555,15 +590,9 @@ public interface DoubleStream extends BaseStream { * mean of elements of this stream, or an empty optional if this * stream is empty. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the average will be NaN. - * - *

    The average returned can vary depending upon the order in - * which values are recorded. - * - * This method may be implemented using compensated summation or - * other technique to reduce the error bound in the {@link #sum - * numerical sum} used to compute the average. + *

    The computed average can vary numerically and have the + * special case behavior as computing the sum; see {@link #sum} + * for details. * *

    The average is a special case of a reduction. diff --git a/jdk/src/share/classes/javax/imageio/package.html b/jdk/src/share/classes/javax/imageio/package.html index f0927fa147b..f8254b11284 100644 --- a/jdk/src/share/classes/javax/imageio/package.html +++ b/jdk/src/share/classes/javax/imageio/package.html @@ -131,8 +131,8 @@ standard plug-ins.

  • the number of bands is 1;
  • the number of bits per sample is not greater than 8;
  • the size of a color component is not greater than 8; -

    - + +

    By default the GIF writer plug-in creates version "89a" images. This can be changed to "87a" by explicitly setting the version in the diff --git a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java index f4d17c2b427..54fb8f46745 100644 --- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java +++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java @@ -170,7 +170,7 @@ class PartialOrderIterator implements Iterator { while (iter.hasNext()) { DigraphNode node = iter.next(); int inDegree = node.getInDegree(); - inDegrees.put(node, new Integer(inDegree)); + inDegrees.put(node, inDegree); // Add nodes with zero in-degree to the zero list if (inDegree == 0) { @@ -191,7 +191,7 @@ class PartialOrderIterator implements Iterator { while (outNodes.hasNext()) { DigraphNode node = outNodes.next(); int inDegree = inDegrees.get(node).intValue() - 1; - inDegrees.put(node, new Integer(inDegree)); + inDegrees.put(node, inDegree); // If the in-degree has fallen to 0, place the node on the list if (inDegree == 0) { diff --git a/jdk/src/share/classes/javax/naming/Context.java b/jdk/src/share/classes/javax/naming/Context.java index db2acbde8d3..3f1b759b424 100644 --- a/jdk/src/share/classes/javax/naming/Context.java +++ b/jdk/src/share/classes/javax/naming/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,9 +203,7 @@ import java.util.Hashtable; *

    Application Resource Files

    * * When an application is deployed, it will generally have several - * codebase directories and JARs in its classpath. Similarly, when an - * applet is deployed, it will have a codebase and archives specifying - * where to find the applet's classes. JNDI locates (using + * codebase directories and JARs in its classpath. JNDI locates (using * {@link ClassLoader#getResources ClassLoader.getResources()}) * all application resource files named jndi.properties * in the classpath. @@ -236,7 +234,7 @@ import java.util.Hashtable; * * When JNDI constructs an initial context, the context's environment * is initialized with properties defined in the environment parameter - * passed to the constructor, the system properties, the applet parameters, + * passed to the constructor, the system properties, * and the application resource files. See * InitialContext * for details. @@ -268,8 +266,8 @@ import java.util.Hashtable; *

    * In this way, each service provider developer can specify a list of * factories to use with that service provider. These can be modified by - * the application resources specified by the deployer of the application - * or applet, which in turn can be modified by the user. + * the application resources specified by the deployer of the application, + * which in turn can be modified by the user. * * @author Rosanna Lee * @author Scott Seligman @@ -822,7 +820,7 @@ public interface Context { * of the property should be the fully qualified class name * of the factory class that will create an initial context. * This property may be specified in the environment parameter - * passed to the initial context constructor, an applet parameter, + * passed to the initial context constructor, * a system property, or an application resource file. * If it is not specified in any of these sources, * NoInitialContextException is thrown when an initial @@ -837,7 +835,6 @@ public interface Context { * @see NoInitialContextException * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String INITIAL_CONTEXT_FACTORY = "java.naming.factory.initial"; @@ -847,8 +844,8 @@ public interface Context { * of the property should be a colon-separated list of the fully * qualified class names of factory classes that will create an object * given information about the object. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * *

    The value of this constant is "java.naming.factory.object". * @@ -856,7 +853,6 @@ public interface Context { * @see javax.naming.spi.ObjectFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String OBJECT_FACTORIES = "java.naming.factory.object"; @@ -866,8 +862,8 @@ public interface Context { * of the property should be a colon-separated list of the fully * qualified class names of state factory classes that will be used * to get an object's state given the object itself. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * *

    The value of this constant is "java.naming.factory.state". * @@ -875,7 +871,6 @@ public interface Context { * @see javax.naming.spi.StateFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET * @since 1.3 */ String STATE_FACTORIES = "java.naming.factory.state"; @@ -887,9 +882,8 @@ public interface Context { * of the property should be a colon-separated list of package * prefixes for the class name of the factory class that will create * a URL context factory. - * This property may be specified in the environment, - * an applet parameter, a system property, or one or more - * resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * The prefix com.sun.jndi.url is always appended to * the possibly empty list of package prefixes. * @@ -900,8 +894,7 @@ public interface Context { * @see javax.naming.spi.ObjectFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET - */ + */ String URL_PKG_PREFIXES = "java.naming.factory.url.pkgs"; /** @@ -909,8 +902,8 @@ public interface Context { * for specifying configuration information for the service provider * to use. The value of the property should contain a URL string * (e.g. "ldap://somehost:389"). - * This property may be specified in the environment, - * an applet parameter, a system property, or a resource file. + * This property may be specified in the environment, a system property, + * or a resource file. * If it is not specified in any of these sources, * the default configuration is determined by the service provider. * @@ -918,7 +911,6 @@ public interface Context { * * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String PROVIDER_URL = "java.naming.provider.url"; @@ -926,8 +918,8 @@ public interface Context { * Constant that holds the name of the environment property * for specifying the DNS host and domain names to use for the * JNDI URL context (for example, "dns://somehost/wiz.com"). - * This property may be specified in the environment, - * an applet parameter, a system property, or a resource file. + * This property may be specified in the environment, a system property, + * or a resource file. * If it is not specified in any of these sources * and the program attempts to use a JNDI URL containing a DNS name, * a ConfigurationException will be thrown. @@ -1073,27 +1065,25 @@ public interface Context { String LANGUAGE = "java.naming.language"; /** - * Constant that holds the name of the environment property for - * specifying an applet for the initial context constructor to use - * when searching for other properties. - * The value of this property is the - * java.applet.Applet instance that is being executed. - * This property may be specified in the environment parameter - * passed to the initial context constructor. - * When this property is set, each property that the initial context - * constructor looks for in the system properties is first looked for - * in the applet's parameter list. - * If this property is unspecified, the initial context constructor - * will search for properties only in the environment parameter - * passed to it, the system properties, and application resource files. + * @deprecated An environment property with this name is ignored + * while constructing an initial context. + * This constant was originally used as a property name to specify an + * {@code Applet} to retrieve parameters from, when creating an initial + * context. Currently any applet properties that need to be passed to an + * initial context should be copied into the environment hashtable: + *

    {@code
    +     *     Hashtable env = new Hashtable();
    +     *     env.put(Context.INITIAL_CONTEXT_FACTORY,
    +     *       ((Applet) this).getParameter(Context.INITIAL_CONTEXT_FACTORY));
    +     *     env.put(Context.PROVIDER_URL,
    +     *       ((Applet) this).getParameter(Context.PROVIDER_URL));
    +     *     // ... other properties ...
          *
    -     * 

    The value of this constant is "java.naming.applet". - * - * @see #addToEnvironment(String, Object) - * @see #removeFromEnvironment(String) - * @see InitialContext + * Context ctx = new InitialContext(env); + * }

    * * @since 1.3 */ + @Deprecated String APPLET = "java.naming.applet"; }; diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java index 867af4ca598..8a9792dd3b4 100644 --- a/jdk/src/share/classes/javax/naming/InitialContext.java +++ b/jdk/src/share/classes/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,21 +41,13 @@ import com.sun.naming.internal.ResourceManager; * is initialized with properties defined in the environment parameter * passed to the constructor, and in any * application resource files. - * In addition, a small number of standard JNDI properties may - * be specified as system properties or as applet parameters - * (through the use of {@link Context#APPLET}). - * These special properties are listed in the field detail sections of the - * Context and - * LdapContext - * interface documentation. *

    * JNDI determines each property's value by merging * the values from the following two sources, in order: *

      *
    1. * The first occurrence of the property from the constructor's - * environment parameter and (for appropriate properties) the applet - * parameters and system properties. + * environment parameter and system properties. *
    2. * The application resource files (jndi.properties). *
    diff --git a/jdk/src/share/classes/javax/naming/directory/DirContext.java b/jdk/src/share/classes/javax/naming/directory/DirContext.java index 903ccbea421..2b77486673a 100644 --- a/jdk/src/share/classes/javax/naming/directory/DirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java @@ -723,7 +723,7 @@ public interface DirContext extends Context { * specified set of attributes. * This method returns all the attributes of such objects. * It is equivalent to supplying null as - * the atributesToReturn parameter to the method + * the attributesToReturn parameter to the method * search(Name, Attributes, String[]). *
    * See {@link #search(Name, Attributes, String[])} for a full description. diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java index 05db4a8648b..d70b865790e 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -334,8 +334,8 @@ public interface LdapContext extends DirContext { * qualified class names of factory classes that will create a control * given another control. See * ControlFactory.getControlInstance() for details. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. *

    * The value of this constant is "java.naming.factory.control". * diff --git a/jdk/src/share/classes/javax/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java index d688e11baf8..dc001705bdd 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java +++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java @@ -421,7 +421,7 @@ public class Rdn implements Serializable, Comparable { private String type; private Object value; - // If non-null, a cannonical representation of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo() private String comparable = null; @@ -571,10 +571,10 @@ public class Rdn implements Serializable, Comparable { } /** - * Given an attribute value string formated according to the rules + * Given an attribute value string formatted according to the rules * specified in * RFC 2253, - * returns the unformated value. Escapes and quotes are + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to equivalent * UTF-16 characters. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java index b7420b987ec..aaeb7a17ad9 100644 --- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java @@ -188,7 +188,7 @@ final public class SortControl extends BasicControl { /* * Encodes the sort control's value using ASN.1 BER. * The result includes the BER tag and length for the control's value but - * does not include the control's object identifer and criticality setting. + * does not include the control's object identifier and criticality setting. * * @param sortKeys A non-null list of keys to sort by. * @return A possibly null byte array representing the ASN.1 BER encoded diff --git a/jdk/src/share/classes/javax/naming/spi/NamingManager.java b/jdk/src/share/classes/javax/naming/spi/NamingManager.java index c6a99ec4c3e..6bb98ddc0ee 100644 --- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java +++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -491,7 +491,7 @@ public class NamingManager { * (e.g. "ftpURLContextFactory" for the "ftp" scheme-id), * in the package specified as follows. * The Context.URL_PKG_PREFIXES environment property (which - * may contain values taken from applet parameters, system properties, + * may contain values taken from system properties, * or application resource files) * contains a colon-separated list of package prefixes. * Each package prefix in @@ -661,8 +661,7 @@ public class NamingManager { if (className == null) { NoInitialContextException ne = new NoInitialContextException( "Need to specify class name in environment or system " + - "property, or as an applet parameter, or in an " + - "application resource file: " + + "property, or in an application resource file: " + Context.INITIAL_CONTEXT_FACTORY); throw ne; } diff --git a/jdk/src/share/classes/javax/print/Doc.java b/jdk/src/share/classes/javax/print/Doc.java index d28a3e565ef..873aac594a6 100644 --- a/jdk/src/share/classes/javax/print/Doc.java +++ b/jdk/src/share/classes/javax/print/Doc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,7 +168,7 @@ public interface Doc { * from the print data representation object. * However, if the print data representation object is itself a Reader, * then the print data representation object is simply returned. - *

    + * * @return Reader for reading the print data characters from this doc. * If a reader cannot be provided because this doc does not meet * the criteria stated above, null is returned. @@ -192,7 +192,7 @@ public interface Doc { * object as a stream of bytes is created and returned. However, if the * print data representation object is itself an input stream, then the * print data representation object is simply returned. - *

    + * * @return Input stream for reading the print data bytes from this doc. If * an input stream cannot be provided because this doc does not * meet the criteria stated above, null is returned. diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index eac9d38954d..cb00e00753b 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -381,7 +381,6 @@ import java.io.Serializable; *

  • * A line feed (LF) character standing by itself means * "go to column 1 of the next line." - *
  • * *

    * The client must itself perform all plain text print data formatting not @@ -436,7 +435,6 @@ import java.io.Serializable; * Java Print Service instance supports without having * to load the representation classes, which may be problematic for * limited-resource clients. - *

    * * @author Alan Kaminsky */ @@ -536,7 +534,7 @@ public class DocFlavor implements Serializable, Cloneable { * The charset for text types is a commonly useful example. * This convenience method will return the value of the specified * parameter if one was specified in the mime type for this flavor. - *

    + * * @param paramName the name of the paramater. This name is internally * converted to the canonical lower case format before performing * the match. @@ -638,7 +636,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.BYTE_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a byte array * (byte[]) as the print data representation class. - *

    * * @author Alan Kaminsky */ @@ -836,7 +833,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a byte stream ({@link * java.io.InputStream java.io.InputStream}) as the print * data representation class. - *

    * * @author Alan Kaminsky */ @@ -1038,8 +1034,7 @@ public class DocFlavor implements Serializable, Cloneable { * objects. * For example doc flavors using a Uniform Resource Locator ({@link * java.net.URL java.net.URL}) as the print data - * representation class. - *

    + * representation class. * * @author Alan Kaminsky */ @@ -1229,7 +1224,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a character array * (char[]) as the print data representation class. As such, * the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1279,7 +1273,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a string ({@link java.lang.String * java.lang.String}) as the print data representation class. * As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1327,7 +1320,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a character stream ({@link * java.io.Reader java.io.Reader}) as the print data * representation class. As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1376,7 +1368,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant * DocFlavor objects for example doc flavors for service formatted print * data. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java index f52eb72a0d2..a003e730880 100644 --- a/jdk/src/share/classes/javax/print/PrintService.java +++ b/jdk/src/share/classes/javax/print/PrintService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -327,7 +327,6 @@ public interface PrintService { * that indicates bounds on the legal values -- used, for example, by an * integer-valued attribute that must lie within a certain range. * - *

    * * @param category Printing attribute category to test. It must be a * {@link java.lang.Class Class} that implements diff --git a/jdk/src/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/share/classes/javax/print/PrintServiceLookup.java index aece5d1205a..70695a995f8 100644 --- a/jdk/src/share/classes/javax/print/PrintServiceLookup.java +++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -199,7 +199,6 @@ public abstract class PrintServiceLookup { * available that is not part of the installation. * If the lookup service is already registered, or cannot be registered, * the method returns false. - *

    * * @param sp an implementation of a lookup service. * @return true if the new lookup service is newly @@ -305,7 +304,6 @@ public abstract class PrintServiceLookup { *

    * Locates MultiDoc print services which can be positively confirmed * to support the combination of attributes and DocFlavors specified. - *

    * * @param flavors of documents required. If null or empty it is ignored. * @param attributes required to be supported. If null this diff --git a/jdk/src/share/classes/javax/print/ServiceUI.java b/jdk/src/share/classes/javax/print/ServiceUI.java index 20b23611ed1..c6ba370a064 100644 --- a/jdk/src/share/classes/javax/print/ServiceUI.java +++ b/jdk/src/share/classes/javax/print/ServiceUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,8 +131,7 @@ public class ServiceUI { * } * } * } - *

    - + * * @param gc used to select screen. null means primary or default screen. * @param x location of dialog including border in screen coordinates * @param y location of dialog including border in screen coordinates diff --git a/jdk/src/share/classes/javax/print/ServiceUIFactory.java b/jdk/src/share/classes/javax/print/ServiceUIFactory.java index d293a8cadc7..06deb02e5e8 100644 --- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java +++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,7 @@ public abstract class ServiceUIFactory { /** * Get a UI object which may be cast to the requested UI type * by the application and used in its user interface. - *

    + * * @param role requested. Must be one of the standard roles or * a private role supported by this factory. * @param ui type in which the role is requested. diff --git a/jdk/src/share/classes/javax/print/SimpleDoc.java b/jdk/src/share/classes/javax/print/SimpleDoc.java index 3cf0d779086..f73d794f76b 100644 --- a/jdk/src/share/classes/javax/print/SimpleDoc.java +++ b/jdk/src/share/classes/javax/print/SimpleDoc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -176,7 +176,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself a * Reader then the print data representation object is * simply returned. - *

    + * * @return a Reader for reading the print data * characters from this doc. * If a reader cannot be provided because this doc does not meet @@ -224,7 +224,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself an * input stream then the print data representation object is simply * returned. - *

    + * * @return an InputStream for reading the print data * bytes from this doc. If an input stream cannot be * provided because this doc does not meet diff --git a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java index dfa91a70fcb..f1f7f28c410 100644 --- a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java +++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,7 @@ public abstract class StreamPrintServiceFactory { * Although null is an acceptable value to use in the lookup of stream * printing services, it's typical to search for a particular * desired format, such as Postscript(TM). - *

    + * * @param flavor of the input document type - null means match all * types. * @param outputMimeType representing the required output format, used to @@ -153,7 +153,7 @@ public abstract class StreamPrintServiceFactory { * Implementations which allocate resources on construction should examine * the stream and may wish to only allocate resources if the stream is * non-null. - *

    + * * @param out destination stream for generated output. * @return a PrintService which will generate the format specified by the * DocFlavor supported by this Factory. diff --git a/jdk/src/share/classes/javax/print/attribute/Attribute.java b/jdk/src/share/classes/javax/print/attribute/Attribute.java index 5226f9cb80d..a6c58e6f933 100644 --- a/jdk/src/share/classes/javax/print/attribute/Attribute.java +++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import java.io.Serializable; * Interface Attribute is the base interface implemented by any and every * printing attribute class to indicate that the class represents a * printing attribute. All printing attributes are serializable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java index d78c8f2004a..72e583a0347 100644 --- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,6 @@ import java.util.Date; * rather than a java.util.Calendar because it typically takes * less memory to store and less time to compare a java.util.Date * than a java.util.Calendar. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java index e99c09d6bcb..994208f0a9e 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * PrintRequestAttribute} as well as DocAttribute, the client may include the * attribute in a attribute set which specifies a print job * to specify a characteristic for all the docs in that job. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java index b4482d2e455..bacc1074f2c 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java index 85ee7d8b402..f774066e592 100644 --- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,7 +102,6 @@ import java.io.Serializable; * uses some of the same integer values as the superclass. However, the * application in which the enumeration class and subclass are used may need to * have distinct integer values in the superclass and subclass. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java index 7956794d304..e4928a8196d 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java @@ -34,7 +34,6 @@ import java.util.HashMap; /** * Class HashAttributeSet provides an AttributeSet * implementation with characteristics of a hash map. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java index d4bc20e27d3..0b915ba2ca9 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface {@link * DocAttributeSet DocAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java index 980693694e6..f39c85883d5 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintJobAttributeSet PrintJobAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java index 53708f0259c..fde4ebb6945 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * class {@link HashAttributeSet HashAttributeSet} and enforces the * semantic restrictions of interface * {@link PrintRequestAttributeSet PrintRequestAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java index 64e5b9e48f3..d98430d0d75 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintServiceAttributeSet PrintServiceAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java index 7675a8327e7..1fbd3b2556d 100644 --- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ import java.io.Serializable; * established when it is constructed (see {@link #IntegerSyntax(int) * IntegerSyntax(int)}). Once constructed, an integer attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java index af8258090ba..ad9a0d7217a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,6 @@ package javax.print.attribute; * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute, * the client may include the attribute in a attribute set to * specify the attribute's value for the Print Job. - *

    * * @see PrintRequestAttributeSet * @see PrintJobAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java index 5bce73513e9..4c920a1b48a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java index 78fe37ccb76..48249480e60 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * as well as PrintRequestAttribute, the client may include the * attribute in a Doc}'s attribute set to specify * a job setting which pertains just to that doc. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java index eac683b194c..bde6c0cce8b 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java index 8ac2b656d18..f09b38870ed 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ package javax.print.attribute; * of a Print Service or some other characteristic of a Print Service. A Print * Service instance adds a number of PrintServiceAttributes to a Print * service's attribute set to report the Print Service's status. - *

    * * @see PrintServiceAttributeSet * diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java index badde734218..3d3296ed405 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java index 1089381d1c6..7e9c40835b5 100644 --- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,6 @@ import java.io.Serializable; * mind, there is no guarantee that the conversion factor for the client's units * will be an exact integer. If the conversion factor isn't an exact integer, * resolution values in the client's units won't be stored precisely. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 0aed773fe6e..8ba9303135a 100644 --- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,6 @@ import java.util.Vector; * Class SetOfIntegerSyntax has operations to return the set's members in * canonical array form, to test whether a given integer is a member of the * set, and to iterate through the members of the set. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java index 0f6a5dfe6c4..76832508c94 100644 --- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,6 @@ import java.io.Serializable; * client's units will be an exact integer. If the conversion factor isn't an * exact integer, resolution values in the client's units won't be stored * precisely. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java index 61e4bd57e62..ca8736b1315 100644 --- a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * which is a SupportedValuesAttribute giving the legal values a client may * specify for the {@link javax.print.attribute.standard.Copies Copies} * attribute. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java index 20e27fa314f..7b91de24d0f 100644 --- a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,6 @@ import java.util.Locale; * includes a locale to indicate the natural language. Thus, a text attribute * always represents a localized string. Once constructed, a text attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/share/classes/javax/print/attribute/URISyntax.java index 118b1c0cd8d..770ba8a9592 100644 --- a/jdk/src/share/classes/javax/print/attribute/URISyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.net.URI; * Class URISyntax is an abstract base class providing the common * implementation of all attributes whose value is a Uniform Resource * Identifier (URI). Once constructed, a URI attribute's value is immutable. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/package.html b/jdk/src/share/classes/javax/print/attribute/package.html index fa9851655a8..aeedb0df2c2 100644 --- a/jdk/src/share/classes/javax/print/attribute/package.html +++ b/jdk/src/share/classes/javax/print/attribute/package.html @@ -3,7 +3,7 @@ javax.print.attribute package