This commit is contained in:
Dmitry Samersoff 2015-08-10 13:56:27 +03:00
commit 7a36a80c84
497 changed files with 18513 additions and 6537 deletions

View File

@ -318,3 +318,4 @@ f66c185284727f6e6ffd27e9c45ed2dd9da0a691 jdk9-b71
9b3a9d72f07b40c648de79961679f42283af1bb5 jdk9-b73
7c577fda1855d03c04546694d514678f596508c9 jdk9-b74
f55df5cfe11c97e4b58998b76f5bd00a73cde12d jdk9-b75
eeea9adfd1e3d075ef82148c00a4847a1aab4d26 jdk9-b76

View File

@ -318,3 +318,4 @@ c706ef5ea5da00078dc5e4334660315f7d99c15b jdk9-b71
4c2cbaae528bce970dabbb5676005d379357f4b6 jdk9-b73
57f3134853ecdd4a3ee2d4d26f22ba981d653d79 jdk9-b74
8fd6eeb878606e39c908f12535f34ebbfd225a4a jdk9-b75
d82072b699b880a1f647a5e2d7c0f86cec958941 jdk9-b76

View File

@ -318,3 +318,4 @@ f9f3706bd24c42c07cb260fe05730a749b8e52f4 jdk9-b72
29096b78d93b01a2f8882509cd40755e3d6b8cd9 jdk9-b73
622fe934e351e89107edf3c667d6b57f543f58f1 jdk9-b74
960b56805abd8460598897481820bd6a75f979e7 jdk9-b75
d8126bc88fa5cd1ae4e44d86a4b1280ca1c9e2aa jdk9-b76

View File

@ -478,3 +478,4 @@ c1b2825ef47e75cb34dd18450d1c4280b7c5853c jdk9-b72
e37d432868be0aa7cb5e0f3d7caff1e825d8ead3 jdk9-b73
fff6b54e9770ac4c12c2fb4cab5aa7672affa4bd jdk9-b74
2f354281e9915275693c4e519a959b8a6f22d3a3 jdk9-b75
0bc8d1656d6f2b1fdfe803c1305a108bb9939f35 jdk9-b76

View File

@ -2389,9 +2389,11 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf)
// Note that the code buffer's insts_mark is always relative to insts.
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(size_exception_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
address base = __ start_a_stub(size_exception_handler());
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
__ far_jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
@ -2405,9 +2407,11 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf)
// Note that the code buffer's insts_mark is always relative to insts.
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(size_deopt_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
address base = __ start_a_stub(size_deopt_handler());
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
__ adr(lr, __ pc());
@ -3657,24 +3661,37 @@ encode %{
MacroAssembler _masm(&cbuf);
address addr = (address)$meth$$method;
address call;
if (!_method) {
// A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
__ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf);
call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf);
} else if (_optimized_virtual) {
__ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf);
call = __ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf);
} else {
__ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf);
call = __ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf);
}
if (call == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
if (_method) {
// Emit stub for static call
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
if (stub == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
}
%}
enc_class aarch64_enc_java_dynamic_call(method meth) %{
MacroAssembler _masm(&cbuf);
__ ic_call((address)$meth$$method);
address call = __ ic_call((address)$meth$$method);
if (call == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
%}
enc_class aarch64_enc_call_epilog() %{
@ -3695,7 +3712,11 @@ encode %{
address entry = (address)$meth$$method;
CodeBlob *cb = CodeCache::find_blob(entry);
if (cb) {
__ trampoline_call(Address(entry, relocInfo::runtime_call_type));
address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
if (call == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
} else {
int gpcnt;
int fpcnt;

View File

@ -327,9 +327,16 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
ce->align_call(lir_static_call);
ce->emit_static_call_stub();
if (ce->compilation()->bailed_out()) {
return; // CodeCache is full
}
Address resolve(SharedRuntime::get_resolve_static_call_stub(),
relocInfo::static_call_type);
__ trampoline_call(resolve);
address call = __ trampoline_call(resolve);
if (call == NULL) {
ce->bailout("trampoline stub overflow");
return;
}
ce->add_call_info_here(info());
#ifndef PRODUCT

View File

@ -1996,13 +1996,21 @@ void LIR_Assembler::align_call(LIR_Code code) { }
void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
__ trampoline_call(Address(op->addr(), rtype));
address call = __ trampoline_call(Address(op->addr(), rtype));
if (call == NULL) {
bailout("trampoline stub overflow");
return;
}
add_call_info(code_offset(), op->info());
}
void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
__ ic_call(op->addr());
address call = __ ic_call(op->addr());
if (call == NULL) {
bailout("trampoline stub overflow");
return;
}
add_call_info(code_offset(), op->info());
}

View File

@ -26,6 +26,9 @@
#ifndef CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
#define CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
// ArrayCopyStub needs access to bailout
friend class ArrayCopyStub;
private:
int array_element_size(BasicType type) const;

View File

@ -51,7 +51,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Stub is fixed up when the corresponding call is converted from
// calling compiled code to calling interpreted code.
// mov rmethod, 0
@ -63,10 +63,11 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// That's why we must use the macroassembler to generate a stub.
MacroAssembler _masm(&cbuf);
address base = __ start_a_stub(to_interp_stub_size()*2);
address base = __ start_a_stub(to_interp_stub_size());
int offset = __ offset();
if (base == NULL) return; // CodeBuffer::expand failed
if (base == NULL) {
return NULL; // CodeBuffer::expand failed
}
// static stub relocation stores the instruction address of the call
__ relocate(static_stub_Relocation::spec(mark));
// static stub relocation also tags the Method* in the code-stream.
@ -76,6 +77,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
assert((__ offset() - offset) <= (int)to_interp_stub_size(), "stub too big");
__ end_a_stub();
return base;
}
#undef __

View File

@ -664,7 +664,7 @@ void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, in
// Maybe emit a call via a trampoline. If the code cache is small
// trampolines won't be emitted.
void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
address MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
assert(entry.rspec().type() == relocInfo::runtime_call_type
|| entry.rspec().type() == relocInfo::opt_virtual_call_type
|| entry.rspec().type() == relocInfo::static_call_type
@ -672,7 +672,10 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
unsigned int start_offset = offset();
if (far_branches() && !Compile::current()->in_scratch_emit_size()) {
emit_trampoline_stub(offset(), entry.target());
address stub = emit_trampoline_stub(start_offset, entry.target());
if (stub == NULL) {
return NULL; // CodeCache is full
}
}
if (cbuf) cbuf->set_insts_mark();
@ -682,6 +685,8 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
} else {
bl(pc());
}
// just need to return a non-null address
return pc();
}
@ -696,13 +701,11 @@ void MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
// load the call target from the constant pool
// branch (LR still points to the call site above)
void MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
address dest) {
address stub = start_a_stub(Compile::MAX_stubs_size/2);
if (stub == NULL) {
start_a_stub(Compile::MAX_stubs_size/2);
Compile::current()->env()->record_out_of_memory_failure();
return;
return NULL; // CodeBuffer::expand failed
}
// Create a trampoline stub relocation which relates this trampoline stub
@ -729,15 +732,16 @@ void MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline");
end_a_stub();
return stub;
}
void MacroAssembler::ic_call(address entry) {
address MacroAssembler::ic_call(address entry) {
RelocationHolder rh = virtual_call_Relocation::spec(pc());
// address const_ptr = long_constant((jlong)Universe::non_oop_word());
// unsigned long offset;
// ldr_constant(rscratch2, const_ptr);
movptr(rscratch2, (uintptr_t)Universe::non_oop_word());
trampoline_call(Address(entry, rh));
return trampoline_call(Address(entry, rh));
}
// Implementation of call_VM versions

View File

@ -539,7 +539,7 @@ public:
static int patch_oop(address insn_addr, address o);
void emit_trampoline_stub(int insts_call_instruction_offset, address target);
address emit_trampoline_stub(int insts_call_instruction_offset, address target);
// The following 4 methods return the offset of the appropriate move instruction
@ -942,7 +942,7 @@ public:
// Calls
void trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
static bool far_branches() {
return ReservedCodeCacheSize > branch_range;
@ -962,7 +962,7 @@ public:
}
// Emit the CompiledIC call idiom
void ic_call(address entry);
address ic_call(address entry);
public:

View File

@ -94,7 +94,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
const int IC_pos_in_java_to_interp_stub = 8;
#define __ _masm.
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
#ifdef COMPILER2
// Get the mark within main instrs section which is set to the address of the call.
address call_addr = cbuf.insts_mark();
@ -106,8 +106,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Start the stub.
address stub = __ start_a_stub(CompiledStaticCall::to_interp_stub_size());
if (stub == NULL) {
Compile::current()->env()->record_out_of_memory_failure();
return;
return NULL; // CodeCache is full
}
// For java_to_interp stubs we use R11_scratch1 as scratch register
@ -149,6 +148,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// End the stub.
__ end_a_stub();
return stub;
#else
ShouldNotReachHere();
#endif

View File

@ -1082,7 +1082,7 @@ void CallStubImpl::emit_trampoline_stub(MacroAssembler &_masm, int destination_t
// Start the stub.
address stub = __ start_a_stub(Compile::MAX_stubs_size/2);
if (stub == NULL) {
Compile::current()->env()->record_out_of_memory_failure();
ciEnv::current()->record_failure("CodeCache is full");
return;
}
@ -1160,7 +1160,7 @@ EmitCallOffsets emit_call_with_trampoline_stub(MacroAssembler &_masm, address en
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, offsets.insts_call_instruction_offset);
if (Compile::current()->env()->failing()) { return offsets; } // Code cache may be full.
if (ciEnv::current()->failing()) { return offsets; } // Code cache may be full.
__ relocate(rtype);
}
@ -3397,7 +3397,7 @@ encode %{
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
if (Compile::current()->env()->failing()) { return; } // Code cache may be full.
if (ciEnv::current()->failing()) { return; } // Code cache may be full.
__ relocate(_optimized_virtual ?
relocInfo::opt_virtual_call_type : relocInfo::static_call_type);
}
@ -3410,7 +3410,11 @@ encode %{
__ bl(__ pc()); // Emits a relocation.
// The stub for call to interpreter.
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
if (stub == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
}
%}
@ -3455,7 +3459,11 @@ encode %{
assert(_method, "execute next statement conditionally");
// The stub for call to interpreter.
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
if (stub == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
// Restore original sp.
__ ld(R11_scratch1, 0, R1_SP); // Load caller sp.

View File

@ -432,6 +432,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
__ mov(length()->as_register(), O4);
ce->emit_static_call_stub();
if (ce->compilation()->bailed_out()) {
return; // CodeCache is full
}
__ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
__ delayed()->nop();

View File

@ -53,7 +53,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
#ifdef COMPILER2
// Stub is fixed up when the corresponding call is converted from calling
// compiled code to calling interpreted code.
@ -64,9 +64,10 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(to_interp_stub_size()*2);
if (base == NULL) return; // CodeBuffer::expand failed.
address base = __ start_a_stub(to_interp_stub_size());
if (base == NULL) {
return NULL; // CodeBuffer::expand failed.
}
// Static stub relocation stores the instruction address of the call.
__ relocate(static_stub_Relocation::spec(mark));
@ -81,6 +82,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Update current stubs pointer and restore code_end.
__ end_a_stub();
return base;
#else
ShouldNotReachHere();
#endif

View File

@ -1773,9 +1773,11 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point());
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(size_exception_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
address base = __ start_a_stub(size_exception_handler());
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
@ -1796,9 +1798,11 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(size_deopt_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
address base = __ start_a_stub(size_deopt_handler());
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
__ save_frame(0);
@ -2599,7 +2603,12 @@ encode %{
emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type);
}
if (_method) { // Emit stub for static call.
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
// Stub does not fit into scratch buffer if TraceJumps is enabled
if (stub == NULL && !(TraceJumps && Compile::current()->in_scratch_emit_size())) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
}
%}

View File

@ -503,6 +503,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
ce->align_call(lir_static_call);
ce->emit_static_call_stub();
if (ce->compilation()->bailed_out()) {
return; // CodeCache is full
}
AddressLiteral resolve(SharedRuntime::get_resolve_static_call_stub(),
relocInfo::static_call_type);
__ call(resolve);

View File

@ -50,7 +50,7 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
#define __ _masm.
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Stub is fixed up when the corresponding call is converted from
// calling compiled code to calling interpreted code.
// movq rbx, 0
@ -62,9 +62,10 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// That's why we must use the macroassembler to generate a stub.
MacroAssembler _masm(&cbuf);
address base =
__ start_a_stub(to_interp_stub_size()*2);
if (base == NULL) return; // CodeBuffer::expand failed.
address base = __ start_a_stub(to_interp_stub_size());
if (base == NULL) {
return NULL; // CodeBuffer::expand failed.
}
// Static stub relocation stores the instruction address of the call.
__ relocate(static_stub_Relocation::spec(mark), Assembler::imm_operand);
// Static stub relocation also tags the Method* in the code-stream.
@ -74,6 +75,7 @@ void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
// Update current stubs pointer and restore insts_end.
__ end_a_stub();
return base;
}
#undef __

View File

@ -1594,7 +1594,10 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) {
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base = __ start_a_stub(size_exception_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
__ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
@ -1609,7 +1612,10 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
// That's why we must use the macroassembler to generate a handler.
MacroAssembler _masm(&cbuf);
address base = __ start_a_stub(size_deopt_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}
int offset = __ offset();
#ifdef _LP64

View File

@ -1907,7 +1907,11 @@ encode %{
static_call_Relocation::spec(), RELOC_IMM32 );
}
if (_method) { // Emit stub for static call.
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
if (stub == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
}
%}

View File

@ -2137,7 +2137,11 @@ encode %{
}
if (_method) {
// Emit stub for static call.
CompiledStaticCall::emit_to_interp_stub(cbuf);
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
if (stub == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return;
}
}
%}

View File

@ -60,8 +60,9 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
// ----------------------------------------------------------------------------
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
ShouldNotReachHere(); // Only needed for COMPILER2.
return NULL;
}
int CompiledStaticCall::to_interp_stub_size() {

View File

@ -239,25 +239,6 @@ bool Compiler::is_intrinsic_supported(methodHandle method) {
return true;
}
bool Compiler::is_intrinsic_disabled_by_flag(methodHandle method) {
vmIntrinsics::ID id = method->intrinsic_id();
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
if (vmIntrinsics::is_disabled_by_flags(id)) {
return true;
}
if (!InlineNatives && id != vmIntrinsics::_Reference_get) {
return true;
}
if (!InlineClassNatives && id == vmIntrinsics::_getClass) {
return true;
}
return false;
}
void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
assert(buffer_blob != NULL, "Must exist");
@ -275,7 +256,3 @@ void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
void Compiler::print_timers() {
Compilation::print_timers();
}
bool Compiler::is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
return is_intrinsic_supported(method) && !is_intrinsic_disabled_by_flag(method);
}

View File

@ -55,18 +55,9 @@ class Compiler: public AbstractCompiler {
// Print compilation timers and statistics
virtual void print_timers();
// Check the availability of an intrinsic for 'method' given a compilation context.
// The compilation context is needed to support per-method usage of the
// DisableIntrinsic flag. However, as C1 ignores the DisableIntrinsic flag, it
// ignores the compilation context.
virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context);
// Check if the C1 compiler supports an intrinsic for 'method'.
virtual bool is_intrinsic_supported(methodHandle method);
// Processing of command-line flags specific to the C1 compiler.
virtual bool is_intrinsic_disabled_by_flag(methodHandle method);
// Size of the code buffer
static int code_buffer_size();
};

View File

@ -3491,8 +3491,16 @@ void GraphBuilder::build_graph_for_intrinsic(ciMethod* callee) {
bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
// For calling is_intrinsic_available we need to transition to
// the '_thread_in_vm' state because is_intrinsic_available()
// does not accesses critical VM-internal data.
if (!_compilation->compiler()->is_intrinsic_available(callee->get_Method(), NULL)) {
// accesses critical VM-internal data.
bool is_available = false;
{
VM_ENTRY_MARK;
methodHandle mh(THREAD, callee->get_Method());
methodHandle ct(THREAD, method()->get_Method());
is_available = _compilation->compiler()->is_intrinsic_available(mh, ct);
}
if (!is_available) {
if (!InlineNatives) {
// Return false and also set message that the inlining of
// intrinsics has been disabled in general.

View File

@ -443,6 +443,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
// emit the static call stub stuff out of line
emit_static_call_stub();
CHECK_BAILOUT();
switch (op->code()) {
case lir_static_call:

View File

@ -417,8 +417,59 @@ int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) {
}
}
bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
bool vmIntrinsics::is_disabled_by_flags(methodHandle method, methodHandle compilation_context) {
vmIntrinsics::ID id = method->intrinsic_id();
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
// Check if the intrinsic corresponding to 'method' has been disabled on
// the command line by using the DisableIntrinsic flag (either globally
// or on a per-method level, see src/share/vm/compiler/abstractCompiler.hpp
// for details).
// Usually, the compilation context is the caller of the method 'method'.
// The only case when for a non-recursive method 'method' the compilation context
// is not the caller of the 'method' (but it is the method itself) is
// java.lang.ref.Referene::get.
// For java.lang.ref.Reference::get, the intrinsic version is used
// instead of the compiled version so that the value in the referent
// field can be registered by the G1 pre-barrier code. The intrinsified
// version of Reference::get also adds a memory barrier to prevent
// commoning reads from the referent field across safepoint since GC
// can change the referent field's value. See Compile::Compile()
// in src/share/vm/opto/compile.cpp or
// GraphBuilder::GraphBuilder() in src/share/vm/c1/c1_GraphBuilder.cpp
// for more details.
ccstr disable_intr = NULL;
if ((DisableIntrinsic[0] != '\0' && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
(!compilation_context.is_null() &&
CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", disable_intr) &&
strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)
) {
return true;
}
// -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
// the following switch statement.
if (!InlineNatives) {
switch (id) {
case vmIntrinsics::_indexOf:
case vmIntrinsics::_compareTo:
case vmIntrinsics::_equals:
case vmIntrinsics::_equalsC:
case vmIntrinsics::_getAndAddInt:
case vmIntrinsics::_getAndAddLong:
case vmIntrinsics::_getAndSetInt:
case vmIntrinsics::_getAndSetLong:
case vmIntrinsics::_getAndSetObject:
case vmIntrinsics::_loadFence:
case vmIntrinsics::_storeFence:
case vmIntrinsics::_fullFence:
case vmIntrinsics::_Reference_get:
break;
default:
return true;
}
}
switch (id) {
case vmIntrinsics::_isInstance:
case vmIntrinsics::_isAssignableFrom:
@ -430,6 +481,7 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
case vmIntrinsics::_Class_cast:
case vmIntrinsics::_getLength:
case vmIntrinsics::_newArray:
case vmIntrinsics::_getClass:
if (!InlineClassNatives) return true;
break;
case vmIntrinsics::_currentThread:
@ -522,6 +574,12 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
case vmIntrinsics::_getAndSetInt:
case vmIntrinsics::_getAndSetLong:
case vmIntrinsics::_getAndSetObject:
case vmIntrinsics::_loadFence:
case vmIntrinsics::_storeFence:
case vmIntrinsics::_fullFence:
case vmIntrinsics::_compareAndSwapObject:
case vmIntrinsics::_compareAndSwapLong:
case vmIntrinsics::_compareAndSwapInt:
if (!InlineUnsafeOps) return true;
break;
case vmIntrinsics::_getShortUnaligned:
@ -584,8 +642,8 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
if (!InlineObjectCopy || !InlineArrayCopy) return true;
break;
case vmIntrinsics::_compareTo:
if (!SpecialStringCompareTo) return true;
break;
if (!SpecialStringCompareTo) return true;
break;
case vmIntrinsics::_indexOf:
if (!SpecialStringIndexOf) return true;
break;
@ -602,8 +660,8 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
if (!InlineReflectionGetCallerClass) return true;
break;
case vmIntrinsics::_multiplyToLen:
if (!UseMultiplyToLenIntrinsic) return true;
break;
if (!UseMultiplyToLenIntrinsic) return true;
break;
case vmIntrinsics::_squareToLen:
if (!UseSquareToLenIntrinsic) return true;
break;

View File

@ -1389,10 +1389,9 @@ public:
// 'method' requires predicated logic.
static int predicates_needed(vmIntrinsics::ID id);
// Returns true if an intrinsic is disabled by command-line flags and
// false otherwise. Implements functionality common to the C1
// and the C2 compiler.
static bool is_disabled_by_flags(vmIntrinsics::ID id);
// Returns true if a compiler intrinsic is disabled by command-line flags
// and false otherwise.
static bool is_disabled_by_flags(methodHandle method, methodHandle compilation_context);
};
#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP

View File

@ -306,7 +306,7 @@ class CompiledStaticCall: public NativeCall {
friend CompiledStaticCall* compiledStaticCall_at(Relocation* call_site);
// Code
static void emit_to_interp_stub(CodeBuffer &cbuf);
static address emit_to_interp_stub(CodeBuffer &cbuf);
static int to_interp_stub_size();
static int reloc_to_interp_stub();

View File

@ -75,8 +75,8 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
//
// The second parameter, 'compilation_context', is needed to implement functionality
// related to the DisableIntrinsic command-line flag. The DisableIntrinsic flag can
// be used to prohibit the C2 compiler (but not the C1 compiler) to use an intrinsic.
// There are three ways to disable an intrinsic using the DisableIntrinsic flag:
// be used to prohibit the compilers to use an intrinsic. There are three ways to
// disable an intrinsic using the DisableIntrinsic flag:
//
// (1) -XX:DisableIntrinsic=_hashCode,_getClass
// Disables intrinsification of _hashCode and _getClass globally
@ -96,7 +96,8 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
// compilation context is aClass::aMethod and java.lang.ref.Reference::get,
// respectively.
virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
return false;
return is_intrinsic_supported(method) &&
!vmIntrinsics::is_disabled_by_flags(method, compilation_context);
}
// Determines if an intrinsic is supported by the compiler, that is,
@ -111,13 +112,6 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
return false;
}
// Implements compiler-specific processing of command-line flags.
// Processing of command-line flags common to all compilers is implemented
// in vmIntrinsicss::is_disabled_by_flag.
virtual bool is_intrinsic_disabled_by_flag(methodHandle method) {
return false;
}
// Compiler type queries.
bool is_c1() { return _type == c1; }
bool is_c2() { return _type == c2; }

View File

@ -79,10 +79,15 @@ void ArrayCopyNode::connect_outputs(GraphKit* kit) {
#ifndef PRODUCT
const char* ArrayCopyNode::_kind_names[] = {"arraycopy", "arraycopy, validated arguments", "clone", "oop array clone", "CopyOf", "CopyOfRange"};
void ArrayCopyNode::dump_spec(outputStream *st) const {
CallNode::dump_spec(st);
st->print(" (%s%s)", _kind_names[_kind], _alloc_tightly_coupled ? ", tightly coupled allocation" : "");
}
void ArrayCopyNode::dump_compact_spec(outputStream* st) const {
st->print("%s%s", _kind_names[_kind], _alloc_tightly_coupled ? ",tight" : "");
}
#endif
intptr_t ArrayCopyNode::get_length_if_constant(PhaseGVN *phase) const {

View File

@ -164,6 +164,7 @@ public:
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream* st) const;
#endif
};
#endif // SHARE_VM_OPTO_ARRAYCOPYNODE_HPP

View File

@ -623,9 +623,6 @@
diagnostic(bool, PrintIntrinsics, false, \
"prints attempted and successful inlining of intrinsics") \
\
diagnostic(ccstrlist, DisableIntrinsic, "", \
"do not expand intrinsics whose (internal) names appear here") \
\
develop(bool, StressReflectiveCode, false, \
"Use inexact types at allocations, etc., to test reflection") \
\

View File

@ -157,14 +157,6 @@ void C2Compiler::print_timers() {
Compile::print_timers();
}
bool C2Compiler::is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
// Assume a non-virtual dispatch. A virtual dispatch is
// possible for only a limited set of available intrinsics whereas
// a non-virtual dispatch is possible for all available intrinsics.
return is_intrinsic_supported(method, false) &&
!is_intrinsic_disabled_by_flag(method, compilation_context);
}
bool C2Compiler::is_intrinsic_supported(methodHandle method, bool is_virtual) {
vmIntrinsics::ID id = method->intrinsic_id();
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
@ -436,78 +428,6 @@ bool C2Compiler::is_intrinsic_supported(methodHandle method, bool is_virtual) {
return true;
}
bool C2Compiler::is_intrinsic_disabled_by_flag(methodHandle method, methodHandle compilation_context) {
vmIntrinsics::ID id = method->intrinsic_id();
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
if (vmIntrinsics::is_disabled_by_flags(method->intrinsic_id())) {
return true;
}
// Check if the intrinsic corresponding to 'method' has been disabled on
// the command line by using the DisableIntrinsic flag (either globally
// or on a per-method level, see src/share/vm/compiler/abstractCompiler.hpp
// for details).
// Usually, the compilation context is the caller of the method 'method'.
// The only case when for a non-recursive method 'method' the compilation context
// is not the caller of the 'method' (but it is the method itself) is
// java.lang.ref.Referene::get.
// For java.lang.ref.Reference::get, the intrinsic version is used
// instead of the C2-compiled version so that the value in the referent
// field can be registered by the G1 pre-barrier code. The intrinsified
// version of Reference::get also adds a memory barrier to prevent
// commoning reads from the referent field across safepoint since GC
// can change the referent field's value. See Compile::Compile()
// in src/share/vm/opto/compile.cpp for more details.
ccstr disable_intr = NULL;
if ((DisableIntrinsic[0] != '\0' && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
(!compilation_context.is_null() &&
CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", disable_intr) &&
strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)
) {
return true;
}
// -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
// the following switch statement.
if (!InlineNatives) {
switch (id) {
case vmIntrinsics::_indexOf:
case vmIntrinsics::_compareTo:
case vmIntrinsics::_equals:
case vmIntrinsics::_equalsC:
case vmIntrinsics::_getAndAddInt:
case vmIntrinsics::_getAndAddLong:
case vmIntrinsics::_getAndSetInt:
case vmIntrinsics::_getAndSetLong:
case vmIntrinsics::_getAndSetObject:
case vmIntrinsics::_loadFence:
case vmIntrinsics::_storeFence:
case vmIntrinsics::_fullFence:
case vmIntrinsics::_Reference_get:
break;
default:
return true;
}
}
if (!InlineUnsafeOps) {
switch (id) {
case vmIntrinsics::_loadFence:
case vmIntrinsics::_storeFence:
case vmIntrinsics::_fullFence:
case vmIntrinsics::_compareAndSwapObject:
case vmIntrinsics::_compareAndSwapLong:
case vmIntrinsics::_compareAndSwapInt:
return true;
default:
return false;
}
}
return false;
}
int C2Compiler::initial_code_buffer_size() {
assert(SegmentedCodeCache, "Should be only used with a segmented code cache");
return Compile::MAX_inst_size + Compile::MAX_locs_size + initial_const_capacity;

View File

@ -51,11 +51,11 @@ public:
// Print compilation timers and statistics
void print_timers();
// Check the availability of an intrinsic for 'method' given a compilation context.
virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context);
// Return true if the intrinsification of a method supported by the compiler
// assuming a non-virtual dispatch. Return false otherwise.
// assuming a non-virtual dispatch. (A virtual dispatch is
// possible for only a limited set of available intrinsics whereas
// a non-virtual dispatch is possible for all available intrinsics.)
// Return false otherwise.
virtual bool is_intrinsic_supported(methodHandle method) {
return is_intrinsic_supported(method, false);
}
@ -64,13 +64,6 @@ public:
// the dispatch mode specified by the 'is_virtual' parameter.
virtual bool is_intrinsic_supported(methodHandle method, bool is_virtual);
// Processing of command-line flags specific to the C2 compiler.
virtual bool is_intrinsic_disabled_by_flag(methodHandle method) {
return is_intrinsic_disabled_by_flag(method, NULL);
}
virtual bool is_intrinsic_disabled_by_flag(methodHandle method, methodHandle compilation_context);
// Initial size of the code buffer (may be increased at runtime)
static int initial_code_buffer_size();
};

View File

@ -52,6 +52,7 @@ const Type *StartNode::bottom_type() const { return _domain; }
const Type *StartNode::Value(PhaseTransform *phase) const { return _domain; }
#ifndef PRODUCT
void StartNode::dump_spec(outputStream *st) const { st->print(" #"); _domain->dump_on(st);}
void StartNode::dump_compact_spec(outputStream *st) const { /* empty */ }
#endif
//------------------------------Ideal------------------------------------------
@ -121,6 +122,23 @@ void ParmNode::dump_spec(outputStream *st) const {
if( !Verbose && !WizardMode ) bottom_type()->dump_on(st);
}
}
void ParmNode::dump_compact_spec(outputStream *st) const {
if (_con < TypeFunc::Parms) {
st->print("%s", names[_con]);
} else {
st->print("%d:", _con-TypeFunc::Parms);
// unconditionally dump bottom_type
bottom_type()->dump_on(st);
}
}
// For a ParmNode, all immediate inputs and outputs are considered relevant
// both in compact and standard representation.
void ParmNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
this->collect_nodes(in_rel, 1, false, false);
this->collect_nodes(out_rel, -1, false, false);
}
#endif
uint ParmNode::ideal_reg() const {
@ -948,6 +966,14 @@ void CallJavaNode::dump_spec(outputStream *st) const {
if( _method ) _method->print_short_name(st);
CallNode::dump_spec(st);
}
void CallJavaNode::dump_compact_spec(outputStream* st) const {
if (_method) {
_method->print_short_name(st);
} else {
st->print("<?>");
}
}
#endif
//=============================================================================
@ -995,6 +1021,16 @@ void CallStaticJavaNode::dump_spec(outputStream *st) const {
}
CallJavaNode::dump_spec(st);
}
void CallStaticJavaNode::dump_compact_spec(outputStream* st) const {
if (_method) {
_method->print_short_name(st);
} else if (_name) {
st->print("%s", _name);
} else {
st->print("<?>");
}
}
#endif
//=============================================================================
@ -1130,6 +1166,19 @@ void SafePointNode::dump_spec(outputStream *st) const {
st->print(" SafePoint ");
_replaced_nodes.dump(st);
}
// The related nodes of a SafepointNode are all data inputs, excluding the
// control boundary, as well as all outputs till level 2 (to include projection
// nodes and targets). In compact mode, just include inputs till level 1 and
// outputs as before.
void SafePointNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 1, false, false);
} else {
this->collect_nodes_in_all_data(in_rel, false);
}
this->collect_nodes(out_rel, -2, false, false);
}
#endif
const RegMask &SafePointNode::in_RegMask(uint idx) const {
@ -1676,6 +1725,27 @@ void AbstractLockNode::set_eliminated_lock_counter() {
_counter->set_tag(NamedCounter::EliminatedLockCounter);
}
}
const char* AbstractLockNode::_kind_names[] = {"Regular", "NonEscObj", "Coarsened", "Nested"};
void AbstractLockNode::dump_spec(outputStream* st) const {
st->print("%s ", _kind_names[_kind]);
CallNode::dump_spec(st);
}
void AbstractLockNode::dump_compact_spec(outputStream* st) const {
st->print("%s", _kind_names[_kind]);
}
// The related set of lock nodes includes the control boundary.
void AbstractLockNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 1, false, false);
} else {
this->collect_nodes_in_all_data(in_rel, true);
}
this->collect_nodes(out_rel, -2, false, false);
}
#endif
//=============================================================================

View File

@ -84,6 +84,7 @@ public:
virtual uint ideal_reg() const { return 0; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
#endif
};
@ -110,6 +111,8 @@ public:
virtual uint ideal_reg() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
@ -476,6 +479,7 @@ public:
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
@ -675,6 +679,7 @@ public:
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
#endif
};
@ -730,6 +735,7 @@ public:
virtual int Opcode() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
#endif
};
@ -951,6 +957,7 @@ private:
} _kind;
#ifndef PRODUCT
NamedCounter* _counter;
static const char* _kind_names[Nested+1];
#endif
protected:
@ -1005,6 +1012,9 @@ public:
#ifndef PRODUCT
void create_lock_counter(JVMState* s);
NamedCounter* counter() const { return _counter; }
virtual void dump_spec(outputStream* st) const;
virtual void dump_compact_spec(outputStream* st) const;
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};

View File

@ -2023,6 +2023,14 @@ const RegMask &PhiNode::out_RegMask() const {
}
#ifndef PRODUCT
void PhiNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
// For a PhiNode, the set of related nodes includes all inputs till level 2,
// and all outputs till level 1. In compact mode, inputs till level 1 are
// collected.
this->collect_nodes(in_rel, compact ? 1 : 2, false, false);
this->collect_nodes(out_rel, -1, false, false);
}
void PhiNode::dump_spec(outputStream *st) const {
TypeNode::dump_spec(st);
if (is_tripcount()) {
@ -2047,11 +2055,33 @@ const RegMask &GotoNode::out_RegMask() const {
return RegMask::Empty;
}
#ifndef PRODUCT
//-----------------------------related-----------------------------------------
// The related nodes of a GotoNode are all inputs at level 1, as well as the
// outputs at level 1. This is regardless of compact mode.
void GotoNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
this->collect_nodes(in_rel, 1, false, false);
this->collect_nodes(out_rel, -1, false, false);
}
#endif
//=============================================================================
const RegMask &JumpNode::out_RegMask() const {
return RegMask::Empty;
}
#ifndef PRODUCT
//-----------------------------related-----------------------------------------
// The related nodes of a JumpNode are all inputs at level 1, as well as the
// outputs at level 2 (to include actual jump targets beyond projection nodes).
// This is regardless of compact mode.
void JumpNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
this->collect_nodes(in_rel, 1, false, false);
this->collect_nodes(out_rel, -2, false, false);
}
#endif
//=============================================================================
const RegMask &JProjNode::out_RegMask() const {
return RegMask::Empty;
@ -2105,7 +2135,18 @@ uint JumpProjNode::cmp( const Node &n ) const {
#ifndef PRODUCT
void JumpProjNode::dump_spec(outputStream *st) const {
ProjNode::dump_spec(st);
st->print("@bci %d ",_dest_bci);
st->print("@bci %d ",_dest_bci);
}
void JumpProjNode::dump_compact_spec(outputStream *st) const {
ProjNode::dump_compact_spec(st);
st->print("(%d)%d@%d", _switch_val, _proj_no, _dest_bci);
}
void JumpProjNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
// The related nodes of a JumpProjNode are its inputs and outputs at level 1.
this->collect_nodes(in_rel, 1, false, false);
this->collect_nodes(out_rel, -1, false, false);
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -204,6 +204,7 @@ public:
virtual const RegMask &out_RegMask() const;
virtual const RegMask &in_RegMask(uint) const;
#ifndef PRODUCT
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
virtual void dump_spec(outputStream *st) const;
#endif
#ifdef ASSERT
@ -229,6 +230,10 @@ public:
virtual const Type *Value( PhaseTransform *phase ) const;
virtual Node *Identity( PhaseTransform *phase );
virtual const RegMask &out_RegMask() const;
#ifndef PRODUCT
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
//------------------------------CProjNode--------------------------------------
@ -382,6 +387,7 @@ public:
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const;
#endif
};
@ -393,6 +399,11 @@ public:
protected:
// Type of If input when this branch is always taken
virtual bool always_taken(const TypeTuple* t) const = 0;
#ifndef PRODUCT
public:
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
class IfTrueNode : public IfProjNode {
@ -455,6 +466,9 @@ public:
virtual int Opcode() const;
virtual const RegMask& out_RegMask() const;
virtual const Node* is_block_proj() const { return this; }
#ifndef PRODUCT
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
class JumpProjNode : public JProjNode {
@ -479,6 +493,8 @@ class JumpProjNode : public JProjNode {
uint proj_no() const { return _proj_no; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};

View File

@ -594,6 +594,10 @@ uint Compile::scratch_emit_size(const Node* n) {
n->as_MachBranch()->label_set(&fakeL, 0);
}
n->emit(buf, this->regalloc());
// Emitting into the scratch buffer should not fail
assert (!failing(), err_msg_res("Must not have pending failure. Reason is: %s", failure_reason()));
if (is_branch) // Restore label.
n->as_MachBranch()->label_set(saveL, save_bnum);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1601,11 +1601,41 @@ Node *IfProjNode::Identity(PhaseTransform *phase) {
return this;
}
//------------------------------dump_spec--------------------------------------
#ifndef PRODUCT
//-------------------------------related---------------------------------------
// An IfProjNode's related node set consists of its input (an IfNode) including
// the IfNode's condition, plus all of its outputs at level 1. In compact mode,
// the restrictions for IfNode apply (see IfNode::rel).
void IfProjNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
Node* ifNode = this->in(0);
in_rel->append(ifNode);
if (compact) {
ifNode->collect_nodes(in_rel, 3, false, true);
} else {
ifNode->collect_nodes_in_all_data(in_rel, false);
}
this->collect_nodes(out_rel, -1, false, false);
}
//------------------------------dump_spec--------------------------------------
void IfNode::dump_spec(outputStream *st) const {
st->print("P=%f, C=%f",_prob,_fcnt);
}
//-------------------------------related---------------------------------------
// For an IfNode, the set of related output nodes is just the output nodes till
// depth 2, i.e, the IfTrue/IfFalse projection nodes plus the nodes they refer.
// The related input nodes contain no control nodes, but all data nodes
// pertaining to the condition. In compact mode, the input nodes are collected
// up to a depth of 3.
void IfNode::related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 3, false, true);
} else {
this->collect_nodes_in_all_data(in_rel, false);
}
this->collect_nodes(out_rel, -2, false, false);
}
#endif
//------------------------------idealize_test----------------------------------

View File

@ -327,7 +327,7 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
methodHandle mh(THREAD, m->get_Method());
methodHandle ct(THREAD, method()->get_Method());
is_available = compiler->is_intrinsic_supported(mh, is_virtual) &&
!compiler->is_intrinsic_disabled_by_flag(mh, ct);
!vmIntrinsics::is_disabled_by_flags(mh, ct);
}
if (is_available) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -396,3 +396,17 @@ const Type *MoveD2LNode::Value( PhaseTransform *phase ) const {
return TypeLong::make( v.get_jlong() );
}
#ifndef PRODUCT
//----------------------------BinaryNode---------------------------------------
// The set of related nodes for a BinaryNode is all data inputs and all outputs
// till level 2 (i.e., one beyond the associated CMoveNode). In compact mode,
// it's the inputs till level 1 and the outputs till level 2.
void BinaryNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 1, false, true);
} else {
this->collect_nodes_in_all_data(in_rel, false);
}
this->collect_nodes(out_rel, -2, false, false);
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -145,6 +145,10 @@ class BinaryNode : public Node {
BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }
virtual int Opcode() const;
virtual uint ideal_reg() const { return 0; }
#ifndef PRODUCT
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -118,6 +118,20 @@ const TypePtr *ProjNode::adr_type() const {
bool ProjNode::pinned() const { return in(0)->pinned(); }
#ifndef PRODUCT
void ProjNode::dump_spec(outputStream *st) const { st->print("#%d",_con); if(_is_io_use) st->print(" (i_o_use)");}
void ProjNode::dump_compact_spec(outputStream *st) const {
for (DUIterator i = this->outs(); this->has_out(i); i++) {
Node* o = this->out(i);
if (NotANode(o)) {
st->print("[?]");
} else if (o == NULL) {
st->print("[_]");
} else {
st->print("[%d]", o->_idx);
}
}
st->print("#%d", _con);
}
#endif
//----------------------------check_con----------------------------------------

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,6 +87,7 @@ public:
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
#endif
// Return uncommon trap call node if proj is for "proj->[region->..]call_uct"

View File

@ -1489,16 +1489,6 @@ jfloat Node::getf() const {
#ifndef PRODUCT
//----------------------------NotANode----------------------------------------
// Used in debugging code to avoid walking across dead or uninitialized edges.
static inline bool NotANode(const Node* n) {
if (n == NULL) return true;
if (((intptr_t)n & 1) != 0) return true; // uninitialized, etc.
if (*(address*)n == badAddress) return true; // kill by Node::destruct
return false;
}
//------------------------------find------------------------------------------
// Find a neighbor of this Node with the given _idx
// If idx is negative, find its absolute value, following both _in and _out.
@ -1636,11 +1626,11 @@ void Node::set_debug_orig(Node* orig) {
//------------------------------dump------------------------------------------
// Dump a Node
void Node::dump(const char* suffix, outputStream *st) const {
void Node::dump(const char* suffix, bool mark, outputStream *st) const {
Compile* C = Compile::current();
bool is_new = C->node_arena()->contains(this);
C->_in_dump_cnt++;
st->print("%c%d\t%s\t=== ", is_new ? ' ' : 'o', _idx, Name());
st->print("%c%d%s\t%s\t=== ", is_new ? ' ' : 'o', _idx, mark ? " >" : "", Name());
// Dump the required and precedence inputs
dump_req(st);
@ -1760,42 +1750,60 @@ void Node::dump_out(outputStream *st) const {
st->print("]] ");
}
//------------------------------dump_nodes-------------------------------------
static void dump_nodes(const Node* start, int d, bool only_ctrl) {
Node* s = (Node*)start; // remove const
if (NotANode(s)) return;
uint depth = (uint)ABS(d);
int direction = d;
Compile* C = Compile::current();
GrowableArray <Node *> nstack(C->unique());
nstack.append(s);
//----------------------------collect_nodes_i----------------------------------
// Collects nodes from an Ideal graph, starting from a given start node and
// moving in a given direction until a certain depth (distance from the start
// node) is reached. Duplicates are ignored.
// Arguments:
// nstack: the nodes are collected into this array.
// start: the node at which to start collecting.
// direction: if this is a positive number, collect input nodes; if it is
// a negative number, collect output nodes.
// depth: collect nodes up to this distance from the start node.
// include_start: whether to include the start node in the result collection.
// only_ctrl: whether to regard control edges only during traversal.
// only_data: whether to regard data edges only during traversal.
static void collect_nodes_i(GrowableArray<Node*> *nstack, const Node* start, int direction, uint depth, bool include_start, bool only_ctrl, bool only_data) {
Node* s = (Node*) start; // remove const
nstack->append(s);
int begin = 0;
int end = 0;
for(uint i = 0; i < depth; i++) {
end = nstack.length();
end = nstack->length();
for(int j = begin; j < end; j++) {
Node* tp = nstack.at(j);
Node* tp = nstack->at(j);
uint limit = direction > 0 ? tp->len() : tp->outcnt();
for(uint k = 0; k < limit; k++) {
Node* n = direction > 0 ? tp->in(k) : tp->raw_out(k);
if (NotANode(n)) continue;
// do not recurse through top or the root (would reach unrelated stuff)
if (n->is_Root() || n->is_top()) continue;
if (n->is_Root() || n->is_top()) continue;
if (only_ctrl && !n->is_CFG()) continue;
if (only_data && n->is_CFG()) continue;
bool on_stack = nstack.contains(n);
bool on_stack = nstack->contains(n);
if (!on_stack) {
nstack.append(n);
nstack->append(n);
}
}
}
begin = end;
}
end = nstack.length();
if (direction > 0) {
if (!include_start) {
nstack->remove(s);
}
}
//------------------------------dump_nodes-------------------------------------
static void dump_nodes(const Node* start, int d, bool only_ctrl) {
if (NotANode(start)) return;
GrowableArray <Node *> nstack(Compile::current()->unique());
collect_nodes_i(&nstack, start, d, (uint) ABS(d), true, only_ctrl, false);
int end = nstack.length();
if (d > 0) {
for(int j = end-1; j >= 0; j--) {
nstack.at(j)->dump();
}
@ -1817,6 +1825,221 @@ void Node::dump_ctrl(int d) const {
dump_nodes(this, d, true);
}
//-----------------------------dump_compact------------------------------------
void Node::dump_comp() const {
this->dump_comp("\n");
}
//-----------------------------dump_compact------------------------------------
// Dump a Node in compact representation, i.e., just print its name and index.
// Nodes can specify additional specifics to print in compact representation by
// implementing dump_compact_spec.
void Node::dump_comp(const char* suffix, outputStream *st) const {
Compile* C = Compile::current();
C->_in_dump_cnt++;
st->print("%s(%d)", Name(), _idx);
this->dump_compact_spec(st);
if (suffix) {
st->print("%s", suffix);
}
C->_in_dump_cnt--;
}
//----------------------------dump_related-------------------------------------
// Dump a Node's related nodes - the notion of "related" depends on the Node at
// hand and is determined by the implementation of the virtual method rel.
void Node::dump_related() const {
Compile* C = Compile::current();
GrowableArray <Node *> in_rel(C->unique());
GrowableArray <Node *> out_rel(C->unique());
this->related(&in_rel, &out_rel, false);
for (int i = in_rel.length() - 1; i >= 0; i--) {
in_rel.at(i)->dump();
}
this->dump("\n", true);
for (int i = 0; i < out_rel.length(); i++) {
out_rel.at(i)->dump();
}
}
//----------------------------dump_related-------------------------------------
// Dump a Node's related nodes up to a given depth (distance from the start
// node).
// Arguments:
// d_in: depth for input nodes.
// d_out: depth for output nodes (note: this also is a positive number).
void Node::dump_related(uint d_in, uint d_out) const {
Compile* C = Compile::current();
GrowableArray <Node *> in_rel(C->unique());
GrowableArray <Node *> out_rel(C->unique());
// call collect_nodes_i directly
collect_nodes_i(&in_rel, this, 1, d_in, false, false, false);
collect_nodes_i(&out_rel, this, -1, d_out, false, false, false);
for (int i = in_rel.length() - 1; i >= 0; i--) {
in_rel.at(i)->dump();
}
this->dump("\n", true);
for (int i = 0; i < out_rel.length(); i++) {
out_rel.at(i)->dump();
}
}
//------------------------dump_related_compact---------------------------------
// Dump a Node's related nodes in compact representation. The notion of
// "related" depends on the Node at hand and is determined by the implementation
// of the virtual method rel.
void Node::dump_related_compact() const {
Compile* C = Compile::current();
GrowableArray <Node *> in_rel(C->unique());
GrowableArray <Node *> out_rel(C->unique());
this->related(&in_rel, &out_rel, true);
int n_in = in_rel.length();
int n_out = out_rel.length();
this->dump_comp(n_in == 0 ? "\n" : " ");
for (int i = 0; i < n_in; i++) {
in_rel.at(i)->dump_comp(i == n_in - 1 ? "\n" : " ");
}
for (int i = 0; i < n_out; i++) {
out_rel.at(i)->dump_comp(i == n_out - 1 ? "\n" : " ");
}
}
//------------------------------related----------------------------------------
// Collect a Node's related nodes. The default behaviour just collects the
// inputs and outputs at depth 1, including both control and data flow edges,
// regardless of whether the presentation is compact or not. For data nodes,
// the default is to collect all data inputs (till level 1 if compact), and
// outputs till level 1.
void Node::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (this->is_CFG()) {
collect_nodes_i(in_rel, this, 1, 1, false, false, false);
collect_nodes_i(out_rel, this, -1, 1, false, false, false);
} else {
if (compact) {
this->collect_nodes(in_rel, 1, false, true);
} else {
this->collect_nodes_in_all_data(in_rel, false);
}
this->collect_nodes(out_rel, -1, false, false);
}
}
//---------------------------collect_nodes-------------------------------------
// An entry point to the low-level node collection facility, to start from a
// given node in the graph. The start node is by default not included in the
// result.
// Arguments:
// ns: collect the nodes into this data structure.
// d: the depth (distance from start node) to which nodes should be
// collected. A value >0 indicates input nodes, a value <0, output
// nodes.
// ctrl: include only control nodes.
// data: include only data nodes.
void Node::collect_nodes(GrowableArray<Node*> *ns, int d, bool ctrl, bool data) const {
if (ctrl && data) {
// ignore nonsensical combination
return;
}
collect_nodes_i(ns, this, d, (uint) ABS(d), false, ctrl, data);
}
//--------------------------collect_nodes_in-----------------------------------
static void collect_nodes_in(Node* start, GrowableArray<Node*> *ns, bool primary_is_data, bool collect_secondary) {
// The maximum depth is determined using a BFS that visits all primary (data
// or control) inputs and increments the depth at each level.
uint d_in = 0;
GrowableArray<Node*> nodes(Compile::current()->unique());
nodes.push(start);
int nodes_at_current_level = 1;
int n_idx = 0;
while (nodes_at_current_level > 0) {
// Add all primary inputs reachable from the current level to the list, and
// increase the depth if there were any.
int nodes_at_next_level = 0;
bool nodes_added = false;
while (nodes_at_current_level > 0) {
nodes_at_current_level--;
Node* current = nodes.at(n_idx++);
for (uint i = 0; i < current->len(); i++) {
Node* n = current->in(i);
if (NotANode(n)) {
continue;
}
if ((primary_is_data && n->is_CFG()) || (!primary_is_data && !n->is_CFG())) {
continue;
}
if (!nodes.contains(n)) {
nodes.push(n);
nodes_added = true;
nodes_at_next_level++;
}
}
}
if (nodes_added) {
d_in++;
}
nodes_at_current_level = nodes_at_next_level;
}
start->collect_nodes(ns, d_in, !primary_is_data, primary_is_data);
if (collect_secondary) {
// Now, iterate over the secondary nodes in ns and add the respective
// boundary reachable from them.
GrowableArray<Node*> sns(Compile::current()->unique());
for (GrowableArrayIterator<Node*> it = ns->begin(); it != ns->end(); ++it) {
Node* n = *it;
n->collect_nodes(&sns, 1, primary_is_data, !primary_is_data);
for (GrowableArrayIterator<Node*> d = sns.begin(); d != sns.end(); ++d) {
ns->append_if_missing(*d);
}
sns.clear();
}
}
}
//---------------------collect_nodes_in_all_data-------------------------------
// Collect the entire data input graph. Include the control boundary if
// requested.
// Arguments:
// ns: collect the nodes into this data structure.
// ctrl: if true, include the control boundary.
void Node::collect_nodes_in_all_data(GrowableArray<Node*> *ns, bool ctrl) const {
collect_nodes_in((Node*) this, ns, true, ctrl);
}
//--------------------------collect_nodes_in_all_ctrl--------------------------
// Collect the entire control input graph. Include the data boundary if
// requested.
// ns: collect the nodes into this data structure.
// data: if true, include the control boundary.
void Node::collect_nodes_in_all_ctrl(GrowableArray<Node*> *ns, bool data) const {
collect_nodes_in((Node*) this, ns, false, data);
}
//------------------collect_nodes_out_all_ctrl_boundary------------------------
// Collect the entire output graph until hitting control node boundaries, and
// include those.
void Node::collect_nodes_out_all_ctrl_boundary(GrowableArray<Node*> *ns) const {
// Perform a BFS and stop at control nodes.
GrowableArray<Node*> nodes(Compile::current()->unique());
nodes.push((Node*) this);
while (nodes.length() > 0) {
Node* current = nodes.pop();
if (NotANode(current)) {
continue;
}
ns->append_if_missing(current);
if (!current->is_CFG()) {
for (DUIterator i = current->outs(); current->has_out(i); i++) {
nodes.push(current->out(i));
}
}
}
ns->remove((Node*) this);
}
// VERIFICATION CODE
// For each input edge to a node (ie - for each Use-Def edge), verify that
// there is a corresponding Def-Use edge.
@ -2173,6 +2396,11 @@ void TypeNode::dump_spec(outputStream *st) const {
st->print(" #"); _type->dump_on(st);
}
}
void TypeNode::dump_compact_spec(outputStream *st) const {
st->print("#");
_type->dump_on(st);
}
#endif
uint TypeNode::hash() const {
return Node::hash() + _type->hash();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1038,13 +1038,35 @@ public:
Node* find(int idx) const; // Search the graph for the given idx.
Node* find_ctrl(int idx) const; // Search control ancestors for the given idx.
void dump() const { dump("\n"); } // Print this node.
void dump(const char* suffix, outputStream *st = tty) const;// Print this node.
void dump(const char* suffix, bool mark = false, outputStream *st = tty) const; // Print this node.
void dump(int depth) const; // Print this node, recursively to depth d
void dump_ctrl(int depth) const; // Print control nodes, to depth d
virtual void dump_req(outputStream *st = tty) const; // Print required-edge info
virtual void dump_prec(outputStream *st = tty) const; // Print precedence-edge info
virtual void dump_out(outputStream *st = tty) const; // Print the output edge info
virtual void dump_spec(outputStream *st) const {}; // Print per-node info
void dump_comp() const; // Print this node in compact representation.
// Print this node in compact representation.
void dump_comp(const char* suffix, outputStream *st = tty) const;
virtual void dump_req(outputStream *st = tty) const; // Print required-edge info
virtual void dump_prec(outputStream *st = tty) const; // Print precedence-edge info
virtual void dump_out(outputStream *st = tty) const; // Print the output edge info
virtual void dump_spec(outputStream *st) const {}; // Print per-node info
// Print compact per-node info
virtual void dump_compact_spec(outputStream *st) const { dump_spec(st); }
void dump_related() const; // Print related nodes (depends on node at hand).
// Print related nodes up to given depths for input and output nodes.
void dump_related(uint d_in, uint d_out) const;
void dump_related_compact() const; // Print related nodes in compact representation.
// Collect related nodes.
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
// Collect nodes starting from this node, explicitly including/excluding control and data links.
void collect_nodes(GrowableArray<Node*> *ns, int d, bool ctrl, bool data) const;
// Node collectors, to be used in implementations of Node::rel().
// Collect the entire data input graph. Include control inputs if requested.
void collect_nodes_in_all_data(GrowableArray<Node*> *ns, bool ctrl) const;
// Collect the entire control input graph. Include data inputs if requested.
void collect_nodes_in_all_ctrl(GrowableArray<Node*> *ns, bool data) const;
// Collect the entire output graph until hitting and including control nodes.
void collect_nodes_out_all_ctrl_boundary(GrowableArray<Node*> *ns) const;
void verify_edges(Unique_Node_List &visited); // Verify bi-directional edges
void verify() const; // Check Def-Use info for my subgraph
static void verify_recur(const Node *n, int verify_depth, VectorSet &old_space, VectorSet &new_space);
@ -1091,6 +1113,20 @@ public:
#endif
};
#ifndef PRODUCT
// Used in debugging code to avoid walking across dead or uninitialized edges.
inline bool NotANode(const Node* n) {
if (n == NULL) return true;
if (((intptr_t)n & 1) != 0) return true; // uninitialized, etc.
if (*(address*)n == badAddress) return true; // kill by Node::destruct
return false;
}
#endif
//-----------------------------------------------------------------------------
// Iterators over DU info, and associated Node functions.
@ -1618,6 +1654,7 @@ public:
virtual uint ideal_reg() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void dump_compact_spec(outputStream *st) const;
#endif
};

View File

@ -1504,6 +1504,13 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
n->emit(*cb, _regalloc);
current_offset = cb->insts_size();
// Above we only verified that there is enough space in the instruction section.
// However, the instruction may emit stubs that cause code buffer expansion.
// Bail out here if expansion failed due to a lack of code cache space.
if (failing()) {
return;
}
#ifdef ASSERT
if (n->size(_regalloc) < (current_offset-instr_offset)) {
n->dump();
@ -1632,11 +1639,14 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
if (_method) {
// Emit the exception handler code.
_code_offsets.set_value(CodeOffsets::Exceptions, HandlerImpl::emit_exception_handler(*cb));
if (failing()) {
return; // CodeBuffer::expand failed
}
// Emit the deopt handler code.
_code_offsets.set_value(CodeOffsets::Deopt, HandlerImpl::emit_deopt_handler(*cb));
// Emit the MethodHandle deopt handler code (if required).
if (has_method_handle_invokes()) {
if (has_method_handle_invokes() && !failing()) {
// We can use the same code as for the normal deopt handler, we
// just need a different entry point address.
_code_offsets.set_value(CodeOffsets::DeoptMH, HandlerImpl::emit_deopt_handler(*cb));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,3 +88,18 @@ const Type *HaltNode::Value( PhaseTransform *phase ) const {
const RegMask &HaltNode::out_RegMask() const {
return RegMask::Empty;
}
#ifndef PRODUCT
//-----------------------------related-----------------------------------------
// Include all control inputs in the related set, and also the input data
// boundary. In compact mode, include all inputs till level 2. Also include
// all outputs at level 1.
void HaltNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 2, false, false);
} else {
this->collect_nodes_in_all_ctrl(in_rel, true);
}
this->collect_nodes(out_rel, -1, false, false);
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -64,6 +64,10 @@ public:
virtual const RegMask &out_RegMask() const;
virtual uint ideal_reg() const { return NotAMachineReg; }
virtual uint match_edge(uint idx) const { return 0; }
#ifndef PRODUCT
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
#endif // SHARE_VM_OPTO_ROOTNODE_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -498,6 +498,37 @@ Node *CmpNode::Identity( PhaseTransform *phase ) {
return this;
}
#ifndef PRODUCT
//----------------------------related------------------------------------------
// Related nodes of comparison nodes include all data inputs (until hitting a
// control boundary) as well as all outputs until and including control nodes
// as well as their projections. In compact mode, data inputs till depth 1 and
// all outputs till depth 1 are considered.
void CmpNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 1, false, true);
this->collect_nodes(out_rel, -1, false, false);
} else {
this->collect_nodes_in_all_data(in_rel, false);
this->collect_nodes_out_all_ctrl_boundary(out_rel);
// Now, find all control nodes in out_rel, and include their projections
// and projection targets (if any) in the result.
GrowableArray<Node*> proj(Compile::current()->unique());
for (GrowableArrayIterator<Node*> it = out_rel->begin(); it != out_rel->end(); ++it) {
Node* n = *it;
if (n->is_CFG() && !n->is_Proj()) {
// Assume projections and projection targets are found at levels 1 and 2.
n->collect_nodes(&proj, -2, false, false);
for (GrowableArrayIterator<Node*> p = proj.begin(); p != proj.end(); ++p) {
out_rel->append_if_missing(*p);
}
proj.clear();
}
}
}
}
#endif
//=============================================================================
//------------------------------cmp--------------------------------------------
// Simplify a CmpI (compare 2 integers) node, based on local information.
@ -1396,17 +1427,31 @@ const Type *BoolNode::Value( PhaseTransform *phase ) const {
return _test.cc2logical( phase->type( in(1) ) );
}
#ifndef PRODUCT
//------------------------------dump_spec--------------------------------------
// Dump special per-node info
#ifndef PRODUCT
void BoolNode::dump_spec(outputStream *st) const {
st->print("[");
_test.dump_on(st);
st->print("]");
}
//-------------------------------related---------------------------------------
// A BoolNode's related nodes are all of its data inputs, and all of its
// outputs until control nodes are hit, which are included. In compact
// representation, inputs till level 3 and immediate outputs are included.
void BoolNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
if (compact) {
this->collect_nodes(in_rel, 3, false, true);
this->collect_nodes(out_rel, -1, false, false);
} else {
this->collect_nodes_in_all_data(in_rel, false);
this->collect_nodes_out_all_ctrl_boundary(out_rel);
}
}
#endif
//------------------------------is_counted_loop_exit_test--------------------------------------
//----------------------is_counted_loop_exit_test------------------------------
// Returns true if node is used by a counted loop node.
bool BoolNode::is_counted_loop_exit_test() {
for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,6 @@ public:
// Supplied function to return the additive identity type.
// This is returned whenever the subtracts inputs are the same.
virtual const Type *add_id() const = 0;
};
@ -140,6 +139,13 @@ public:
const Type *add_id() const { return TypeInt::ZERO; }
const Type *bottom_type() const { return TypeInt::CC; }
virtual uint ideal_reg() const { return Op_RegFlags; }
#ifndef PRODUCT
// CmpNode and subclasses include all data inputs (until hitting a control
// boundary) in their related node set, as well as all outputs until and
// including eventual control nodes and their projections.
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};
//------------------------------CmpINode---------------------------------------
@ -311,6 +317,7 @@ public:
bool is_counted_loop_exit_test();
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
#endif
};

View File

@ -70,7 +70,10 @@ Flag::Error CICompilerCountConstraintFunc(bool verbose, intx* value) {
#endif
// The default CICompilerCount's value is CI_COMPILER_COUNT.
assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
// With a client VM, -XX:+TieredCompilation causes TieredCompilation
// to be true here (the option is validated later) and
// min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
if (*value < (intx)min_number_of_compiler_threads) {
if (verbose == true) {

View File

@ -848,6 +848,9 @@ public:
product(bool, UseCRC32CIntrinsics, false, \
"use intrinsics for java.util.zip.CRC32C") \
\
diagnostic(ccstrlist, DisableIntrinsic, "", \
"do not expand intrinsics whose (internal) names appear here") \
\
develop(bool, TraceCallFixup, false, \
"Trace all call fixups") \
\

View File

@ -26,6 +26,7 @@ import jdk.test.lib.*;
/*
* @test CheckCheckCICompilerCount
* @bug 8130858
* @bug 8132525
* @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not
* @library /testlibrary
* @modules java.base/sun.misc
@ -36,12 +37,28 @@ import jdk.test.lib.*;
public class CheckCICompilerCount {
private static final String[][] NON_TIERED_ARGUMENTS = {
{
"-server",
"-XX:-TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=0",
"-version"
},
{
"-server",
"-XX:-TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=1",
"-version"
},
{
"-client",
"-XX:-TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=0",
"-version"
},
{
"-client",
"-XX:-TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=1",
@ -50,6 +67,13 @@ public class CheckCICompilerCount {
};
private static final String[][] NON_TIERED_EXPECTED_OUTPUTS = {
{
"CICompilerCount=0 must be at least 1",
"Improperly specified VM option 'CICompilerCount=0'"
},
{
"intx CICompilerCount := 1 {product}"
},
{
"CICompilerCount=0 must be at least 1",
"Improperly specified VM option 'CICompilerCount=0'"
@ -60,18 +84,36 @@ public class CheckCICompilerCount {
};
private static final int[] NON_TIERED_EXIT = {
1,
0,
1,
0
};
private static final String[][] TIERED_ARGUMENTS = {
{
"-server",
"-XX:+TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=1",
"-version"
},
{
"-server",
"-XX:+TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=2",
"-version"
},
{
"-client",
"-XX:+TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=1",
"-version"
},
{
"-client",
"-XX:+TieredCompilation",
"-XX:+PrintFlagsFinal",
"-XX:CICompilerCount=2",
@ -80,6 +122,13 @@ public class CheckCICompilerCount {
};
private static final String[][] TIERED_EXPECTED_OUTPUTS = {
{
"CICompilerCount=1 must be at least 2",
"Improperly specified VM option 'CICompilerCount=1'"
},
{
"intx CICompilerCount := 2 {product}"
},
{
"CICompilerCount=1 must be at least 2",
"Improperly specified VM option 'CICompilerCount=1'"
@ -90,6 +139,8 @@ public class CheckCICompilerCount {
};
private static final int[] TIERED_EXIT = {
1,
0,
1,
0
};

View File

@ -318,3 +318,4 @@ a3200b88f259f904876b9ab13fd4c4ec2726f8ba jdk9-b71
be5efc34a43bdd982d1cbe11cb2f6d6a060dde60 jdk9-b73
eadcb2b55cd1daf77625813aad0f6f3967b1528a jdk9-b74
16b5e696f948cd8aa9b3afdb686ddffd48bd17a8 jdk9-b75
36801a89a04201b59874ec776ffe85d6253c9ab5 jdk9-b76

View File

@ -1,155 +0,0 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: Version.java,v 1.1.2.1 2005/08/01 02:11:19 jeffsuttor Exp $
*/
package com.sun.org.apache.xalan.internal;
/**
* Administrative class to keep track of the version number of
* the Xalan release.
* <P>This class implements the upcoming standard of having
* org.apache.project-name.Version.getVersion() be a standard way
* to get version information. This class will replace the older
* com.sun.org.apache.xalan.internal.processor.Version class.</P>
* <P>See also: com/sun/org/apache/xalan/internal/res/XSLTInfo.properties for
* information about the version of the XSLT spec we support.</P>
* @xsl.usage general
*/
public class Version
{
/**
* Get the basic version string for the current Xalan release.
* Version String formatted like
* <CODE>"<B>Xalan</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
*
* Futurework: have this read version info from jar manifest.
*
* @return String denoting our current version
*/
public static String getVersion()
{
return getProduct()+" "+getImplementationLanguage()+" "
+getMajorVersionNum()+"."+getReleaseVersionNum()+"."
+( (getDevelopmentVersionNum() > 0) ?
("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
}
/**
* Print the processor version to the command line.
*
* @param argv command line arguments, unused.
*/
public static void _main(String argv[])
{
System.out.println(getVersion());
}
/**
* Name of product: Xalan.
*/
public static String getProduct()
{
return "Xalan";
}
/**
* Implementation Language: Java.
*/
public static String getImplementationLanguage()
{
return "Java";
}
/**
* Major version number.
* Version number. This changes only when there is a
* significant, externally apparent enhancement from
* the previous release. 'n' represents the n'th
* version.
*
* Clients should carefully consider the implications
* of new versions as external interfaces and behaviour
* may have changed.
*/
public static int getMajorVersionNum()
{
return 2;
}
/**
* Release Number.
* Release number. This changes when:
* - a new set of functionality is to be added, eg,
* implementation of a new W3C specification.
* - API or behaviour change.
* - its designated as a reference release.
*/
public static int getReleaseVersionNum()
{
return 7;
}
/**
* Maintenance Drop Number.
* Optional identifier used to designate maintenance
* drop applied to a specific release and contains
* fixes for defects reported. It maintains compatibility
* with the release and contains no API changes.
* When missing, it designates the final and complete
* development drop for a release.
*/
public static int getMaintenanceVersionNum()
{
return 0;
}
/**
* Development Drop Number.
* Optional identifier designates development drop of
* a specific release. D01 is the first development drop
* of a new release.
*
* Development drops are works in progress towards a
* compeleted, final release. A specific development drop
* may not completely implement all aspects of a new
* feature, which may take several development drops to
* complete. At the point of the final drop for the
* release, the D suffix will be omitted.
*
* Each 'D' drops can contain functional enhancements as
* well as defect fixes. 'D' drops may not be as stable as
* the final releases.
*/
public static int getDevelopmentVersionNum()
{
try {
if ((new String("")).length() == 0)
return 0;
else
return Integer.parseInt("");
} catch (NumberFormatException nfe) {
return 0;
}
}
}

View File

@ -1,101 +0,0 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.apache.org. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package com.sun.org.apache.xerces.internal.impl;
/**
* This class defines the version number of the parser.
*
*/
public class Version {
//
// Data
//
/** Version string.
* @deprecated getVersion() should be used instead. */
public static final String fVersion = getVersion();
private static final String fImmutableVersion = "Xerces-J 2.7.1";
// public methods
/* Print out the version information.
* @return the version of the parser.
*/
public static String getVersion() {
return fImmutableVersion;
} // getVersion(): String
//
// MAIN
//
/**
* Prints out the version number to System.out. This is needed
* for the build system.
*/
public static void main(String argv[]) {
System.out.println(fVersion);
}
} // class Version

View File

@ -23,7 +23,7 @@
/*
* @test
* @modules java.xml/com.sun.org.apache.xalan.internal.xslt
* @modules java.xml/com.sun.org.apache.xml.internal.utils
* @summary Test internal transform CLI.
*/
@ -37,7 +37,7 @@ public class CLITest {
try {
String[] args = new String[] { "-XSLTC", "-XSL", getClass().getResource("tigertest.xsl").toString(), "-IN",
getClass().getResource("tigertest-in.xml").toString(), };
com.sun.org.apache.xalan.internal.xslt.Process._main(args);
ProcessXSLT.main(args);
} catch (Exception e) {
Assert.fail(e.getMessage());
}

View File

@ -0,0 +1,913 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: Process.java,v 1.2.4.2 2005/09/15 18:21:57 jeffsuttor Exp $
*/
// This file is a copied and modified version of
// com/sun/org/apache/xalan/internal/xslt/Process.java
// which has been modified to only use public exported APIs.
// The only adherence is with
// com.sun.org.apache.xml.internal.utils.DefaultErrorHandler
// which we try to instantiate using reflection, as that class
// can do a better job at reporting error location.
// We however don't have a hard dependency on it. We will use
// our own ErrorHandler if the default one is not accessible.
//
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.Properties;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.SourceLocator;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
/**
* The main() method handles the Xalan command-line interface.
*/
public class ProcessXSLT
{
/**
* Prints argument options.
*
*/
protected static void printArgOptions() {
System.out.println("xslproc options: ");
System.out.println("\n\t\t\t" + "-Common Options-" + "\n");
System.out.println(" [-XSLTC (use XSLTC for transformation)]"); //" [-XSLTC (use XSLTC for transformation)]
System.out.println(" [-IN inputXMLURL]"); //" [-IN inputXMLURL]");
System.out.println(" [-XSL XSLTransformationURL]"); //" [-XSL XSLTransformationURL]");
System.out.println(" [-OUT outputFileName]"); //" [-OUT outputFileName]");
System.out.println(" [-E (Do not expand entity refs)]"); //" [-V (Version info)]");
System.out.println(" [-EDUMP {optional filename} (Do stackdump on error.)]"); //" [-EDUMP {optional filename} (Do stackdump on error.)]");
System.out.println(" [-XML (Use XML formatter and add XML header.)]"); //" [-XML (Use XML formatter and add XML header.)]");
System.out.println(" [-TEXT (Use simple Text formatter.)]"); //" [-TEXT (Use simple Text formatter.)]");
System.out.println(" [-HTML (Use HTML formatter.)]"); //" [-HTML (Use HTML formatter.)]");
System.out.println( " [-PARAM name expression (Set a stylesheet parameter)]"); //" [-PARAM name expression (Set a stylesheet parameter)]");
System.out.println(" [-MEDIA mediaType (use media attribute to find stylesheet associated with a document.)]");
System.out.println(" [-FLAVOR flavorName (Explicitly use s2s=SAX or d2d=DOM to do transform.)] ");
System.out.println(" [-DIAG (Print overall milliseconds transform took.)]");
System.out.println(" [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]"); //" [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");
System.out.println(" [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]"); //" [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");
waitForReturnKey();
System.out.println(" [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]"); //" [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");
System.out.println(" [-SECURE (set the secure processing feature to true.)]"); //" [-SECURE (set the secure processing feature to true)]");
System.out.println("\n\t\t\t"+ "-Options for XSLTC-" + "\n");
System.out.println(" [-XO [transletName] (assign the name to the generated translet)]");
waitForReturnKey();
System.out.println(" [-XD destinationDirectory (specify a destination directory for translet)]");
System.out.println(" [-XJ jarfile (packages translet classes into a jar file of name <jarfile>)]");
System.out.println(" [-XP package (specifies a package name prefix for all generated translet classes)]");
System.out.println(" [-XN (enables template inlining)]");
System.out.println(" [-XX (turns on additional debugging message output)]");
System.out.println(" [-XT (use translet to transform if possible)]");
}
/**
* Command line interface to transform an XML document according to
* the instructions found in an XSL stylesheet.
* <p>The Process class provides basic functionality for
* performing transformations from the command line. To see a
* list of arguments supported, call with zero arguments.</p>
* <p>To set stylesheet parameters from the command line, use
* <code>-PARAM name expression</code>. If you want to set the
* parameter to a string value, simply pass the string value
* as-is, and it will be interpreted as a string. (Note: if
* the value has spaces in it, you may need to quote it depending
* on your shell environment).</p>
*
* @param argv Input parameters from command line
*/
public static void main(String argv[]) {
// Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
boolean doStackDumpOnError = false;
boolean doDiag = false;
boolean setQuietMode = false;
String msg = null;
boolean isSecureProcessing = false;
// Runtime.getRuntime().traceMethodCalls(false);
// Runtime.getRuntime().traceInstructions(false);
/**
* The default diagnostic writer...
*/
java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
java.io.PrintWriter dumpWriter = diagnosticsWriter;
String flavor = "s2s";
if (argv.length < 1) {
printArgOptions();
} else {
// J2SE does not support Xalan interpretive
// false -> true
boolean useXSLTC = true;
for (int i = 0; i < argv.length; i++) {
if ("-XSLTC".equalsIgnoreCase(argv[i])) {
useXSLTC = true;
}
}
TransformerFactory tfactory;
if (useXSLTC) {
String key = "javax.xml.transform.TransformerFactory";
String value = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
Properties props = System.getProperties();
props.put(key, value);
System.setProperties(props);
}
try {
tfactory = TransformerFactory.newInstance();
tfactory.setErrorListener(createDefaultErrorListener());
} catch (TransformerFactoryConfigurationError pfe) {
pfe.printStackTrace(dumpWriter);
// "XSL Process was not successful.");
msg = "XSL Process was not successful.";
diagnosticsWriter.println(msg);
tfactory = null; // shut up compiler
doExit(msg);
}
boolean formatOutput = false;
boolean useSourceLocation = false;
String inFileName = null;
String outFileName = null;
String dumpFileName = null;
String xslFileName = null;
String treedumpFileName = null;
String outputType = null;
String media = null;
List<String> params = new ArrayList<>();
boolean quietConflictWarnings = false;
URIResolver uriResolver = null;
EntityResolver entityResolver = null;
ContentHandler contentHandler = null;
int recursionLimit = -1;
for (int i = 0; i < argv.length; i++) {
if ("-XSLTC".equalsIgnoreCase(argv[i])) {
// The -XSLTC option has been processed.
} // J2SE does not support Xalan interpretive
else if ("-INDENT".equalsIgnoreCase(argv[i])) {
int indentAmount;
if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) {
indentAmount = Integer.parseInt(argv[++i]);
} else {
indentAmount = 0;
}
} else if ("-IN".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
inFileName = argv[++i];
} else {
System.err.println("Missing argument for -IN");
}
} else if ("-MEDIA".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length) {
media = argv[++i];
} else {
System.err.println("Missing argument for -MEDIA"); //"Missing argument for);
}
} else if ("-OUT".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
outFileName = argv[++i];
} else {
System.err.println("Missing argument for -OUT"); //"Missing argument for);
}
} else if ("-XSL".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
xslFileName = argv[++i];
} else {
System.err.println("Missing argument for -XSL"); //"Missing argument for);
}
} else if ("-FLAVOR".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length) {
flavor = argv[++i];
} else {
System.err.println("Missing argument for -FLAVOR"); //"Missing argument for);
}
} else if ("-PARAM".equalsIgnoreCase(argv[i])) {
if (i + 2 < argv.length) {
String name = argv[++i];
params.add(name);
String expression = argv[++i];
params.add(expression);
} else {
System.err.println("Missing argument for -PARAM"); //"Missing argument for);
}
} else if ("-E".equalsIgnoreCase(argv[i])) {
} else if ("-V".equalsIgnoreCase(argv[i])) {
diagnosticsWriter.println(">>>>>>> Java Version "
+ System.getProperty("java.version") + ", "
+ /* xmlProcessorLiaison.getParserDescription()+ */ "<<<<<<<");
} // J2SE does not support Xalan interpretive
/*
else if ("-QC".equalsIgnoreCase(argv[i]))
{
if (!useXSLTC)
quietConflictWarnings = true;
else
printInvalidXSLTCOption("-QC");
}
*/ else if ("-Q".equalsIgnoreCase(argv[i])) {
setQuietMode = true;
} else if ("-DIAG".equalsIgnoreCase(argv[i])) {
doDiag = true;
} else if ("-XML".equalsIgnoreCase(argv[i])) {
outputType = "xml";
} else if ("-TEXT".equalsIgnoreCase(argv[i])) {
outputType = "text";
} else if ("-HTML".equalsIgnoreCase(argv[i])) {
outputType = "html";
} else if ("-EDUMP".equalsIgnoreCase(argv[i])) {
doStackDumpOnError = true;
if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) {
dumpFileName = argv[++i];
}
} else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length) {
try {
Class<?> uriResolverClass = Class.forName(argv[++i]);
Constructor<?> ctor = uriResolverClass.getConstructor();
ctor.setAccessible(true);
uriResolver = (URIResolver) ctor.newInstance();
tfactory.setURIResolver(uriResolver);
} catch (Throwable cnfe) {
msg = "Class not found for option -URIResolver";
System.err.println(msg);
doExit(msg);
}
} else {
msg = "Missing argument for -URIResolver";
System.err.println(msg); //"Missing argument for);
doExit(msg);
}
} else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length) {
try {
Class<?> entityResolverClass = Class.forName(argv[++i]);
Constructor<?> ctor = entityResolverClass.getConstructor();
ctor.setAccessible(true);
entityResolver = (EntityResolver) ctor.newInstance();
} catch (Throwable cnfe) {
msg = "Class not found for option -EntityResolver";
System.err.println(msg);
doExit(msg);
}
} else {
// "Missing argument for);
msg = "Missing argument for -EntityResolver";
System.err.println(msg);
doExit(msg);
}
} else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) {
if (i + 1 < argv.length) {
try {
Class<?> contentHandlerClass = Class.forName(argv[++i]);
Constructor<?> ctor = contentHandlerClass.getConstructor();
ctor.setAccessible(true);
contentHandler = (ContentHandler) ctor.newInstance();
} catch (Throwable cnfe) {
msg = "Class not found for option -ContentHandler";
System.err.println(msg);
doExit(msg);
}
} else {
// "Missing argument for);
msg = "Missing argument for -ContentHandler";
System.err.println(msg);
doExit(msg);
}
} else if ("-XO".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
tfactory.setAttribute("generate-translet", "true");
tfactory.setAttribute("translet-name", argv[++i]);
} else {
tfactory.setAttribute("generate-translet", "true");
}
} else {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
i++;
}
printInvalidXalanOption("-XO");
}
} // Specify the destination directory for the translet classes.
else if ("-XD".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
tfactory.setAttribute("destination-directory", argv[++i]);
} else {
System.err.println("Missing argument for -XD"); //"Missing argument for);
}
} else {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
i++;
}
printInvalidXalanOption("-XD");
}
} // Specify the jar file name which the translet classes are packaged into.
else if ("-XJ".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
tfactory.setAttribute("generate-translet", "true");
tfactory.setAttribute("jar-name", argv[++i]);
} else {
System.err.println("Missing argument for -XJ"); //"Missing argument for);
}
} else {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
i++;
}
printInvalidXalanOption("-XJ");
}
} // Specify the package name prefix for the generated translet classes.
else if ("-XP".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
tfactory.setAttribute("package-name", argv[++i]);
} else {
System.err.println("Missing argument for -XP"); //"Missing argument for);
}
} else {
if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') {
i++;
}
printInvalidXalanOption("-XP");
}
} // Enable template inlining.
else if ("-XN".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
tfactory.setAttribute("enable-inlining", "true");
} else {
printInvalidXalanOption("-XN");
}
} // Turns on additional debugging message output
else if ("-XX".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
tfactory.setAttribute("debug", "true");
} else {
printInvalidXalanOption("-XX");
}
} // Create the Transformer from the translet if the translet class is newer
// than the stylesheet.
else if ("-XT".equalsIgnoreCase(argv[i])) {
if (useXSLTC) {
tfactory.setAttribute("auto-translet", "true");
} else {
printInvalidXalanOption("-XT");
}
} else if ("-SECURE".equalsIgnoreCase(argv[i])) {
isSecureProcessing = true;
try {
tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (TransformerConfigurationException e) {
}
} else {
System.err.println("Invalid argument: " + argv[i]); //"Invalid argument:);
}
}
// Print usage instructions if no xml and xsl file is specified in the command line
if (inFileName == null && xslFileName == null) {
msg = "Error: No stylesheet or input xml is specified. Run this command without any option for usage instructions.";
System.err.println(msg);
doExit(msg);
}
// Note that there are usage cases for calling us without a -IN arg
// The main XSL transformation occurs here!
try {
long start = System.currentTimeMillis();
if (null != dumpFileName) {
dumpWriter = new PrintWriter(new FileWriter(dumpFileName));
}
Templates stylesheet = null;
if (null != xslFileName) {
if (flavor.equals("d2d")) {
// Parse in the xml data into a DOM
DocumentBuilderFactory dfactory
= DocumentBuilderFactory.newInstance();
dfactory.setNamespaceAware(true);
if (isSecureProcessing) {
try {
dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (ParserConfigurationException pce) {
}
}
DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
Node xslDOM = docBuilder.parse(new InputSource(xslFileName));
stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
xslFileName));
} else {
// System.out.println("Calling newTemplates: "+xslFileName);
stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
// System.out.println("Done calling newTemplates: "+xslFileName);
}
}
PrintWriter resultWriter;
StreamResult strResult;
if (null != outFileName) {
strResult = new StreamResult(new FileOutputStream(outFileName));
// One possible improvement might be to ensure this is
// a valid URI before setting the systemId, but that
// might have subtle changes that pre-existing users
// might notice; we can think about that later -sc r1.46
strResult.setSystemId(outFileName);
} else {
strResult = new StreamResult(System.out);
// We used to default to incremental mode in this case.
// We've since decided that since the -INCREMENTAL switch is
// available, that default is probably not necessary nor
// necessarily a good idea.
}
SAXTransformerFactory stf = (SAXTransformerFactory) tfactory;
// Did they pass in a stylesheet, or should we get it from the
// document?
if (null == stylesheet) {
Source source
= stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
null, null);
if (null != source) {
stylesheet = tfactory.newTemplates(source);
} else {
if (null != media) {
throw new TransformerException("No stylesheet found in: "
+ inFileName + ", media=" + media); //"No stylesheet found in: "
} // + inFileName + ", media="
// + media);
else {
throw new TransformerException("No xml-stylesheet PI found in: " + inFileName); //"No xml-stylesheet PI found in: "
} //+ inFileName);
}
}
if (null != stylesheet) {
Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
transformer.setErrorListener(createDefaultErrorListener());
// Override the output format?
if (null != outputType) {
transformer.setOutputProperty(OutputKeys.METHOD, outputType);
}
int nParams = params.size();
for (int i = 0; i < nParams; i += 2) {
transformer.setParameter((String) params.get(i),
(String) params.get(i + 1));
}
if (uriResolver != null) {
transformer.setURIResolver(uriResolver);
}
if (null != inFileName) {
if (flavor.equals("d2d")) {
// Parse in the xml data into a DOM
DocumentBuilderFactory dfactory
= DocumentBuilderFactory.newInstance();
dfactory.setCoalescing(true);
dfactory.setNamespaceAware(true);
if (isSecureProcessing) {
try {
dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (ParserConfigurationException pce) {
}
}
DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
if (entityResolver != null) {
docBuilder.setEntityResolver(entityResolver);
}
Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
Document doc = docBuilder.newDocument();
org.w3c.dom.DocumentFragment outNode
= doc.createDocumentFragment();
transformer.transform(new DOMSource(xmlDoc, inFileName),
new DOMResult(outNode));
// Now serialize output to disk with identity transformer
Transformer serializer = stf.newTransformer();
serializer.setErrorListener(createDefaultErrorListener());
Properties serializationProps
= stylesheet.getOutputProperties();
serializer.setOutputProperties(serializationProps);
if (contentHandler != null) {
SAXResult result = new SAXResult(contentHandler);
serializer.transform(new DOMSource(outNode), result);
} else {
serializer.transform(new DOMSource(outNode), strResult);
}
} else if (flavor.equals("th")) {
for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior
{
// System.out.println("Testing the TransformerHandler...");
XMLReader reader = null;
// Use JAXP1.1 ( if possible )
try {
javax.xml.parsers.SAXParserFactory factory
= javax.xml.parsers.SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
if (isSecureProcessing) {
try {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (org.xml.sax.SAXException se) {
}
}
javax.xml.parsers.SAXParser jaxpParser
= factory.newSAXParser();
reader = jaxpParser.getXMLReader();
} catch (javax.xml.parsers.ParserConfigurationException ex) {
throw new org.xml.sax.SAXException(ex);
} catch (javax.xml.parsers.FactoryConfigurationError ex1) {
throw new org.xml.sax.SAXException(ex1.toString());
} catch (NoSuchMethodError ex2) {
} catch (AbstractMethodError ame) {
}
if (null == reader) {
reader = XMLReaderFactory.createXMLReader();
}
TransformerHandler th = stf.newTransformerHandler(stylesheet);
reader.setContentHandler(th);
reader.setDTDHandler(th);
if (th instanceof org.xml.sax.ErrorHandler) {
reader.setErrorHandler((org.xml.sax.ErrorHandler) th);
}
try {
reader.setProperty(
"http://xml.org/sax/properties/lexical-handler", th);
} catch (org.xml.sax.SAXNotRecognizedException e) {
} catch (org.xml.sax.SAXNotSupportedException e) {
}
try {
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
} catch (org.xml.sax.SAXException se) {
}
th.setResult(strResult);
reader.parse(new InputSource(inFileName));
}
} else {
if (entityResolver != null) {
XMLReader reader = null;
// Use JAXP1.1 ( if possible )
try {
javax.xml.parsers.SAXParserFactory factory
= javax.xml.parsers.SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
if (isSecureProcessing) {
try {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (org.xml.sax.SAXException se) {
}
}
javax.xml.parsers.SAXParser jaxpParser
= factory.newSAXParser();
reader = jaxpParser.getXMLReader();
} catch (javax.xml.parsers.ParserConfigurationException ex) {
throw new org.xml.sax.SAXException(ex);
} catch (javax.xml.parsers.FactoryConfigurationError ex1) {
throw new org.xml.sax.SAXException(ex1.toString());
} catch (NoSuchMethodError ex2) {
} catch (AbstractMethodError ame) {
}
if (null == reader) {
reader = XMLReaderFactory.createXMLReader();
}
reader.setEntityResolver(entityResolver);
if (contentHandler != null) {
SAXResult result = new SAXResult(contentHandler);
transformer.transform(
new SAXSource(reader, new InputSource(inFileName)),
result);
} else {
transformer.transform(
new SAXSource(reader, new InputSource(inFileName)),
strResult);
}
} else if (contentHandler != null) {
SAXResult result = new SAXResult(contentHandler);
transformer.transform(new StreamSource(inFileName), result);
} else {
// System.out.println("Starting transform");
transformer.transform(new StreamSource(inFileName),
strResult);
// System.out.println("Done with transform");
}
}
} else {
StringReader reader
= new StringReader("<?xml version=\"1.0\"?> <doc/>");
transformer.transform(new StreamSource(reader), strResult);
}
} else {
// "XSL Process was not successful.");
msg = "XSL Process was not successful.";
diagnosticsWriter.println(msg);
doExit(msg);
}
// close output streams
if (null != outFileName && strResult != null) {
java.io.OutputStream out = strResult.getOutputStream();
java.io.Writer writer = strResult.getWriter();
try {
if (out != null) {
out.close();
}
if (writer != null) {
writer.close();
}
} catch (java.io.IOException ie) {
}
}
long stop = System.currentTimeMillis();
long millisecondsDuration = stop - start;
if (doDiag) {
msg = " --------- Transform of " + inFileName + " via "
+ xslFileName + " took " + millisecondsDuration + " ms";
diagnosticsWriter.println('\n');
diagnosticsWriter.println(msg);
}
} catch (Throwable throwable) {
doStackDumpOnError = true;
diagnosticsWriter.println();
if (doStackDumpOnError) {
throwable.printStackTrace(dumpWriter);
} else {
printLocation(diagnosticsWriter, throwable);
diagnosticsWriter.println("Unexpected exception: " + throwable);
}
// diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful.");
if (null != dumpFileName) {
dumpWriter.close();
}
doExit(throwable.getMessage());
}
if (null != dumpFileName) {
dumpWriter.close();
}
if (null != diagnosticsWriter) {
// diagnosticsWriter.close();
}
// if(!setQuietMode)
// diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
// else
// diagnosticsWriter.println(""); //"Xalan: done");
}
}
/**
* It is _much_ easier to debug under VJ++ if I can set a single breakpoint
* before this blows itself out of the water... (I keep checking this in, it
* keeps vanishing. Grr!)
*
*/
static void doExit(String msg) {
throw new RuntimeException(msg);
}
/**
* Wait for a return key to continue
*
* @param resbundle The resource bundle
*/
private static void waitForReturnKey() {
System.out.println("(press <return> to continue)");
try {
while (System.in.read() != '\n');
} catch (java.io.IOException e) {
}
}
/**
* Print a message if an option cannot be used with -XSLTC.
*
* @param option The option String
*/
private static void printInvalidXSLTCOption(String option) {
System.err.println("The option " + option + " is not supported in XSLTC mode.");
}
/**
* Print a message if an option can only be used with -XSLTC.
*
* @param option The option String
*/
private static void printInvalidXalanOption(String option) {
System.err.println("The option " + option + " can only be used with -XSLTC.");
}
static class DummyErrorListenerHandler implements ErrorHandler, ErrorListener {
@Override
public void warning(SAXParseException exception) throws SAXException {
System.err.println("WARNING: " + exception);
}
@Override
public void error(SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void fatalError(SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void warning(TransformerException exception) throws TransformerException {
System.err.println("WARNING: " + exception);
}
@Override
public void error(TransformerException exception) throws TransformerException {
throw exception;
}
@Override
public void fatalError(TransformerException exception) throws TransformerException {
throw exception;
}
}
static ErrorListener createDefaultErrorListener() {
try {
Class<?> errorHandler =
Class.forName("com.sun.org.apache.xml.internal.utils.DefaultErrorHandler");
Constructor<?> ctor = errorHandler.getConstructor();
return (ErrorListener) ctor.newInstance();
} catch (Throwable r) {
return new DummyErrorListenerHandler();
}
}
private static void printLocation(PrintWriter diagnosticsWriter, Throwable throwable) {
try {
Class<?> errorHandler =
Class.forName("com.sun.org.apache.xml.internal.utils.DefaultErrorHandler");
Method m = errorHandler.getMethod("printLocation", PrintWriter.class, Throwable.class);
m.invoke(null, diagnosticsWriter, throwable);
} catch (Throwable t) {
SourceLocator locator = null;
Throwable cause = throwable;
// Try to find the locator closest to the cause.
do {
if (cause instanceof TransformerException) {
SourceLocator causeLocator = ((TransformerException) cause).getLocator();
if (null != causeLocator) {
locator = causeLocator;
}
cause = ((TransformerException) cause).getCause();
} else if (cause instanceof SAXException) {
cause = ((SAXException) cause).getException();
} else {
cause = cause.getCause();
}
} while (null != cause);
if (null != locator) {
// m_pw.println("Parser fatal error: "+exception.getMessage());
String id = (null != locator.getPublicId())
? locator.getPublicId()
: (null != locator.getSystemId())
? locator.getSystemId() : "SystemId Unknown"; //"SystemId Unknown";
diagnosticsWriter.print(id + "; " + "line: " + locator.getLineNumber()
+ "; column: " + locator.getColumnNumber() + "; ");
}
diagnosticsWriter.print("(" + throwable + ": unknown location)");
}
}
}

View File

@ -321,3 +321,4 @@ f5911c6155c29ac24b6f9068273207e5ebd3a3df jdk9-b69
285939df908721cdb2b18a119638114306b8dca7 jdk9-b73
6232472e51418757f7b2bf05332678ea78096e6b jdk9-b74
086bcd5e4a531a350c84668c8dc019461588ee3d jdk9-b75
55bb88306dc57d07f2c854803465f6d9a7eb4aba jdk9-b76

View File

@ -318,3 +318,4 @@ f376824d4940f45719d91838f3f6249f873440db jdk9-b72
1c8bca2ebba13948199de33a1b71e2d6f1c7a8a6 jdk9-b73
6dd82d2e4a104f4d204b2890f33ef11ec3e3f8d0 jdk9-b74
4dd09cb5f7c2a2a23a9958ea7a602dd74d5709b2 jdk9-b75
4526c0da8fb362eebd7e88f4d44e86858cf9b80b jdk9-b76

View File

@ -0,0 +1,52 @@
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. 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.
#
default: all
include $(SPEC)
include MakeBase.gmk
##########################################################################################
### CLDRConverter needs the JRE time zone names from the java.base source.
define cldrconverter_copytznames
$(MKDIR) -p '$(@D)'
$(RM) '$@'
$(SED) -e "s/package sun.util.resources/package build.tools.cldrconverter/" \
-e "s/extends TimeZoneNamesBundle//" \
-e "s/protected final/static final/" \
< $(<) > $@
endef
$(eval $(call SetupCopyFiles,COPY_INTERIM_CLDRCONVERTER, \
SRC := $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/resources, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes/build/tools/cldrconverter, \
FILES := TimeZoneNames.java, \
MACRO := cldrconverter_copytznames))
##########################################################################################
all: $(COPY_INTERIM_CLDRCONVERTER)

View File

@ -38,8 +38,8 @@ include SetupJavaCompilers.gmk
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
SETUP := GENERATE_OLDBYTECODE, \
ADD_JAVAC_FLAGS := "-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes", \
SRC := $(JDK_TOPDIR)/make/src/classes, \
ADD_JAVAC_FLAGS := "-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes$(PATH_SEP)$(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes", \
SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
COPY := boot.modules ext.modules))

View File

@ -27,6 +27,10 @@ include LauncherCommon.gmk
$(eval $(call SetupLauncher,jsadebugd, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
-DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
,,,,,,,,,Info-privileged.plist))
$(eval $(call SetupLauncher,jhsdb, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.SALauncher"$(COMMA) }' \
,,,,,,,,,Info-privileged.plist))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -135,9 +135,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs;
Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
Java_sun_nio_fs_GnomeFileTypeDetector_probeGio;
Java_sun_nio_fs_MagicFileTypeDetector_initialize0;
Java_sun_nio_fs_MagicFileTypeDetector_probe0;
Java_sun_nio_fs_LinuxWatchService_eventSize;

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -130,9 +130,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_SolarisEventPort_port_1getn;
Java_sun_nio_ch_SolarisEventPort_port_1send;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
Java_sun_nio_fs_GnomeFileTypeDetector_probeGio;
Java_sun_nio_fs_UnixNativeDispatcher_init;
Java_sun_nio_fs_UnixNativeDispatcher_getcwd;
Java_sun_nio_fs_UnixNativeDispatcher_strerror;

View File

@ -27,12 +27,15 @@ package build.tools.cldrconverter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.ResourceBundle;
class Bundle {
static enum Type {
@ -145,6 +148,13 @@ class Bundle {
return id;
}
String getJavaID() {
// Tweak ISO compatibility for bundle generation
return id.replaceFirst("^he", "iw")
.replaceFirst("^id", "in")
.replaceFirst("^yi", "ji");
}
boolean isRoot() {
return "root".equals(id);
}
@ -298,8 +308,8 @@ class Bundle {
continue;
}
if (id.startsWith("en")) {
fillInAbbrs(key, nameMap);
if (id.equals("en")) {
fillInJREs(key, nameMap);
}
}
}
@ -381,7 +391,8 @@ class Bundle {
if (Objects.nonNull(parentsMap)) {
for (Iterator<String> it = myMap.keySet().iterator(); it.hasNext();) {
String key = it.next();
if (Objects.deepEquals(parentsMap.get(key), myMap.get(key))) {
if (!key.equals("numberingScripts") && // real body "NumberElements" may differ
Objects.deepEquals(parentsMap.get(key), myMap.get(key))) {
it.remove();
}
}
@ -621,78 +632,41 @@ class Bundle {
return null;
}
private void fillInAbbrs(String key, Map<String, String> map) {
fillInAbbrs(TZ_STD_LONG_KEY, TZ_STD_SHORT_KEY, map);
fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
static Object[][] jreTimeZoneNames = TimeZoneNames.getContents();
private void fillInJREs(String key, Map<String, String> map) {
String tzid = null;
// If the standard std is "Standard Time" and daylight std is "Summer Time",
// replace the standard std with the generic std to avoid using
// the same abbrivation except for Australia time zone names.
String std = map.get(TZ_STD_SHORT_KEY);
String dst = map.get(TZ_DST_SHORT_KEY);
String gen = map.get(TZ_GEN_SHORT_KEY);
if (std != null) {
if (dst == null) {
// if dst is null, create long and short names from the standard
// std. ("Something Standard Time" to "Something Daylight Time",
// or "Something Time" to "Something Summer Time")
String name = map.get(TZ_STD_LONG_KEY);
if (name != null) {
if (name.contains("Standard Time")) {
name = name.replace("Standard Time", "Daylight Time");
} else if (name.endsWith("Mean Time")) {
if (!name.startsWith("Greenwich ")) {
name = name.replace("Mean Time", "Summer Time");
if (key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
// Look for tzid
String meta = key.substring(CLDRConverter.METAZONE_ID_PREFIX.length());
if (meta.equals("GMT")) {
tzid = meta;
} else {
for (String tz : CLDRConverter.handlerMetaZones.keySet()) {
if (CLDRConverter.handlerMetaZones.get(tz).equals(meta)) {
tzid = tz;
break;
}
} else if (name.endsWith(" Time")) {
name = name.replace(" Time", " Summer Time");
}
map.put(TZ_DST_LONG_KEY, name);
fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
}
}
if (gen == null) {
String name = map.get(TZ_STD_LONG_KEY);
if (name != null) {
if (name.endsWith("Standard Time")) {
name = name.replace("Standard Time", "Time");
} else if (name.endsWith("Mean Time")) {
if (!name.startsWith("Greenwich ")) {
name = name.replace("Mean Time", "Time");
}
}
map.put(TZ_GEN_LONG_KEY, name);
fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
}
}
}
} else {
tzid = key.substring(CLDRConverter.TIMEZONE_ID_PREFIX.length());
}
private void fillInAbbrs(String longKey, String shortKey, Map<String, String> map) {
String abbr = map.get(shortKey);
if (abbr == null) {
String name = map.get(longKey);
if (name != null) {
abbr = toAbbr(name);
if (abbr != null) {
map.put(shortKey, abbr);
if (tzid != null) {
for (Object[] jreZone : jreTimeZoneNames) {
if (jreZone[0].equals(tzid)) {
for (int i = 0; i < ZONE_NAME_KEYS.length; i++) {
if (map.get(ZONE_NAME_KEYS[i]) == null) {
String[] jreNames = (String[])jreZone[1];
map.put(ZONE_NAME_KEYS[i], jreNames[i]);
}
}
break;
}
}
private String toAbbr(String name) {
String[] substrs = name.split("\\s+");
StringBuilder sb = new StringBuilder();
for (String s : substrs) {
char c = s.charAt(0);
if (c >= 'A' && c <= 'Z') {
sb.append(c);
}
}
return sb.length() > 0 ? sb.toString() : null;
}
private void convert(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb) {
switch (cldrLetter) {

View File

@ -433,35 +433,35 @@ public class CLDRConverter {
Map<String, Object> localeNamesMap = extractLocaleNames(targetMap, bundle.getID());
if (!localeNamesMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("LocaleNames").add(toLanguageTag(bundle.getID()));
bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, BundleType.OPEN);
bundleGenerator.generateBundle("util", "LocaleNames", bundle.getJavaID(), true, localeNamesMap, BundleType.OPEN);
}
}
if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) {
Map<String, Object> currencyNamesMap = extractCurrencyNames(targetMap, bundle.getID(), bundle.getCurrencies());
if (!currencyNamesMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("CurrencyNames").add(toLanguageTag(bundle.getID()));
bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, BundleType.OPEN);
bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getJavaID(), true, currencyNamesMap, BundleType.OPEN);
}
}
if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) {
Map<String, Object> zoneNamesMap = extractZoneNames(targetMap, bundle.getID());
if (!zoneNamesMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("TimeZoneNames").add(toLanguageTag(bundle.getID()));
bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getID(), true, zoneNamesMap, BundleType.TIMEZONE);
bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getJavaID(), true, zoneNamesMap, BundleType.TIMEZONE);
}
}
if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) {
Map<String, Object> calendarDataMap = extractCalendarData(targetMap, bundle.getID());
if (!calendarDataMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("CalendarData").add(toLanguageTag(bundle.getID()));
bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, BundleType.PLAIN);
bundleGenerator.generateBundle("util", "CalendarData", bundle.getJavaID(), true, calendarDataMap, BundleType.PLAIN);
}
}
if (bundleTypes.contains(Bundle.Type.FORMATDATA)) {
Map<String, Object> formatDataMap = extractFormatData(targetMap, bundle.getID());
if (!formatDataMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("FormatData").add(toLanguageTag(bundle.getID()));
bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, BundleType.PLAIN);
bundleGenerator.generateBundle("text", "FormatData", bundle.getJavaID(), true, formatDataMap, BundleType.PLAIN);
}
}

View File

@ -27,6 +27,7 @@ package build.tools.cldrconverter;
import java.io.File;
import java.io.IOException;
import java.text.DateFormatSymbols;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -900,6 +901,12 @@ class LDMLParseHandler extends AbstractLDMLHandler<Object> {
Entry<?> entry = (Entry<?>) currentContainer;
Object value = entry.getValue();
if (value != null) {
String key = entry.getKey();
// Tweak for MonthNames for the root locale, Needed for
// SimpleDateFormat.format()/parse() roundtrip.
if (id.equals("root") && key.startsWith("MonthNames")) {
value = new DateFormatSymbols(Locale.US).getShortMonths();
}
put(entry.getKey(), value);
}
}

View File

@ -82,7 +82,7 @@ public final class BlowfishCipher extends CipherSpi {
/**
* Sets the padding mechanism of this cipher.
*
* @param padding the padding mechanism
* @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* does not exist

View File

@ -77,7 +77,7 @@ public final class DESCipher extends CipherSpi {
/**
* Sets the padding mechanism of this cipher.
*
* @param padding the padding mechanism
* @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* does not exist

View File

@ -74,7 +74,7 @@ public final class DESedeCipher extends CipherSpi {
/**
* Sets the padding mechanism of this cipher.
*
* @param padding the padding mechanism
* @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* does not exist

View File

@ -32,7 +32,7 @@ import javax.crypto.spec.*;
/**
* This class implements the CMS DESede KeyWrap algorithm as defined
* in <a href=http://www.w3.org/TR/xmlenc-core/#sec-Alg-SymmetricKeyWrap>
* in <a href=http://www.w3.org/TR/xmlenc-core/#sec-Alg-SymmetricKeyWrap></a>
* "XML Encryption Syntax and Processing" section 5.6.2
* "CMS Triple DES Key Wrap".
* Note: only <code>CBC</code> mode and <code>NoPadding</code> padding
@ -159,9 +159,8 @@ public final class DESedeWrapCipher extends CipherSpi {
/**
* Initializes this cipher with a key and a source of randomness.
*
* <p>The cipher only supports the following two operation modes:<b>
* Cipher.WRAP_MODE, and <b>
* Cipher.UNWRAP_MODE.
* <p>The cipher only supports the following two operation modes:
* {@code Cipher.WRAP_MODE}, and {@code Cipher.UNWRAP_MODE}.
* <p>For modes other than the above two, UnsupportedOperationException
* will be thrown.
* <p>If this cipher requires an initialization vector (IV), it will get
@ -192,9 +191,8 @@ public final class DESedeWrapCipher extends CipherSpi {
* Initializes this cipher with a key, a set of algorithm parameters,
* and a source of randomness.
*
* <p>The cipher only supports the following two operation modes:<b>
* Cipher.WRAP_MODE, and <b>
* Cipher.UNWRAP_MODE.
* <p>The cipher only supports the following two operation modes:
* {@code Cipher.WRAP_MODE}, and {@code Cipher.UNWRAP_MODE}.
* <p>For modes other than the above two, UnsupportedOperationException
* will be thrown.
* <p>If this cipher requires an initialization vector (IV), it will get
@ -252,9 +250,8 @@ public final class DESedeWrapCipher extends CipherSpi {
* Initializes this cipher with a key, a set of algorithm parameters,
* and a source of randomness.
*
* <p>The cipher only supports the following two operation modes:<b>
* Cipher.WRAP_MODE, and <b>
* Cipher.UNWRAP_MODE.
* <p>The cipher only supports the following two operation modes:
* {@code Cipher.WRAP_MODE}, and {@code Cipher.UNWRAP_MODE}.
* <p>For modes other than the above two, UnsupportedOperationException
* will be thrown.
* <p>If this cipher requires an initialization vector (IV), it will get
@ -360,15 +357,15 @@ public final class DESedeWrapCipher extends CipherSpi {
* current Cipher.engineInit(...) implementation,
* IllegalStateException will always be thrown upon invocation.
*
* @param in the input buffer.
* @param inOffset the offset in <code>in</code> where the input
* @param input the input buffer.
* @param inputOffset the offset in {@code input} where the input
* starts.
* @param inLen the input length.
* @param out the buffer for the result.
* @param outOffset the ofset in <code>out</code> where the result
* @param inputLen the input length.
* @param output the buffer for the result.
* @param outputOffset the ofset in {@code output} where the result
* is stored.
*
* @return the number of bytes stored in <code>out</code>.
* @return the number of bytes stored in {@code out}.
*
* @exception IllegalStateException upon invocation of this method.
*/

View File

@ -100,7 +100,7 @@ public final class DHKeyPairGenerator extends KeyPairGeneratorSpi {
* generator, and optionally the requested size in bits of the random
* exponent (private value).
*
* @param params the parameter set used to generate the key pair
* @param algParams the parameter set used to generate the key pair
* @param random the source of randomness
*
* @exception InvalidAlgorithmParameterException if the given parameters

View File

@ -92,7 +92,7 @@ extends AlgorithmParameterGeneratorSpi {
* generation values, which specify the size of the prime modulus and
* the size of the random exponent, both in bits.
*
* @param params the set of parameter generation values
* @param genParamSpec the set of parameter generation values
* @param random the source of randomness
*
* @exception InvalidAlgorithmParameterException if the given parameter

View File

@ -80,7 +80,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi {
* Sets the padding mechanism of this cipher. This algorithm only uses
* PKCS #5 padding.
*
* @param padding the padding mechanism
* @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* is invalid

View File

@ -92,7 +92,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi {
* Sets the padding mechanism of this cipher. This algorithm only uses
* PKCS #5 padding.
*
* @param padding the padding mechanism
* @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* is invalid

View File

@ -75,7 +75,7 @@ public final class PBKDF2HmacSHA1Factory extends SecretKeyFactorySpi {
*
* @param key the key
*
* @param keySpec the requested format in which the key material shall be
* @param keySpecCl the requested format in which the key material shall be
* returned
*
* @return the underlying key specification (key material) in the

View File

@ -42,8 +42,8 @@ public class BufferedOutputStream extends FilterOutputStream {
/**
* The number of valid bytes in the buffer. This value is always
* in the range <tt>0</tt> through <tt>buf.length</tt>; elements
* <tt>buf[0]</tt> through <tt>buf[count-1]</tt> contain valid
* in the range {@code 0} through {@code buf.length}; elements
* {@code buf[0]} through {@code buf[count-1]} contain valid
* byte data.
*/
protected int count;

View File

@ -170,7 +170,7 @@ public class BufferedReader extends Reader {
* Reads a single character.
*
* @return The character read, as an integer in the range
* 0 to 65535 (<tt>0x00-0xffff</tt>), or -1 if the
* 0 to 65535 ({@code 0x00-0xffff}), or -1 if the
* end of the stream has been reached
* @exception IOException If an I/O error occurs
*/

View File

@ -34,7 +34,7 @@ package java.io;
* The default is large enough for most purposes.
*
* <p> A newLine() method is provided, which uses the platform's own notion of
* line separator as defined by the system property <tt>line.separator</tt>.
* line separator as defined by the system property {@code line.separator}.
* Not all platforms use the newline character ('\n') to terminate lines.
* Calling this method to terminate each output line is therefore preferred to
* writing a newline character directly.
@ -195,7 +195,7 @@ public class BufferedWriter extends Writer {
/**
* Writes a portion of a String.
*
* <p> If the value of the <tt>len</tt> parameter is negative then no
* <p> If the value of the {@code len} parameter is negative then no
* characters are written. This is contrary to the specification of this
* method in the {@linkplain java.io.Writer#write(java.lang.String,int,int)
* superclass}, which requires that an {@link IndexOutOfBoundsException} be
@ -225,7 +225,7 @@ public class BufferedWriter extends Writer {
/**
* Writes a line separator. The line separator string is defined by the
* system property <tt>line.separator</tt>, and is not necessarily a single
* system property {@code line.separator}, and is not necessarily a single
* newline ('\n') character.
*
* @exception IOException If an I/O error occurs

View File

@ -32,9 +32,9 @@ package java.io;
* counter keeps track of the next byte to
* be supplied by the <code>read</code> method.
* <p>
* Closing a <tt>ByteArrayInputStream</tt> has no effect. The methods in
* Closing a {@code ByteArrayInputStream} has no effect. The methods in
* this class can be called after the stream has been closed without
* generating an <tt>IOException</tt>.
* generating an {@code IOException}.
*
* @author Arthur van Hoff
* @see java.io.StringBufferInputStream
@ -272,9 +272,9 @@ class ByteArrayInputStream extends InputStream {
}
/**
* Closing a <tt>ByteArrayInputStream</tt> has no effect. The methods in
* Closing a {@code ByteArrayInputStream} has no effect. The methods in
* this class can be called after the stream has been closed without
* generating an <tt>IOException</tt>.
* generating an {@code IOException}.
*/
public void close() throws IOException {
}

View File

@ -31,12 +31,12 @@ import java.util.Arrays;
* This class implements an output stream in which the data is
* written into a byte array. The buffer automatically grows as data
* is written to it.
* The data can be retrieved using <code>toByteArray()</code> and
* <code>toString()</code>.
* The data can be retrieved using {@code toByteArray()} and
* {@code toString()}.
* <p>
* Closing a <tt>ByteArrayOutputStream</tt> has no effect. The methods in
* Closing a {@code ByteArrayOutputStream} has no effect. The methods in
* this class can be called after the stream has been closed without
* generating an <tt>IOException</tt>.
* generating an {@code IOException}.
*
* @author Arthur van Hoff
* @since 1.0
@ -138,8 +138,8 @@ public class ByteArrayOutputStream extends OutputStream {
}
/**
* Writes <code>len</code> bytes from the specified byte array
* starting at offset <code>off</code> to this byte array output stream.
* Writes {@code len} bytes from the specified byte array
* starting at offset {@code off} to this byte array output stream.
*
* @param b the data.
* @param off the start offset in the data.
@ -158,7 +158,7 @@ public class ByteArrayOutputStream extends OutputStream {
/**
* Writes the complete contents of this byte array output stream to
* the specified output stream argument, as if by calling the output
* stream's write method using <code>out.write(buf, 0, count)</code>.
* stream's write method using {@code out.write(buf, 0, count)}.
*
* @param out the output stream to which to write the data.
* @exception IOException if an I/O error occurs.
@ -168,7 +168,7 @@ public class ByteArrayOutputStream extends OutputStream {
}
/**
* Resets the <code>count</code> field of this byte array output
* Resets the {@code count} field of this byte array output
* stream to zero, so that all currently accumulated output in the
* output stream is discarded. The output stream can be used again,
* reusing the already allocated buffer space.
@ -194,7 +194,7 @@ public class ByteArrayOutputStream extends OutputStream {
/**
* Returns the current size of the buffer.
*
* @return the value of the <code>count</code> field, which is the number
* @return the value of the {@code count} field, which is the number
* of valid bytes in this output stream.
* @see java.io.ByteArrayOutputStream#count
*/
@ -204,7 +204,7 @@ public class ByteArrayOutputStream extends OutputStream {
/**
* Converts the buffer's contents into a string decoding bytes using the
* platform's default character set. The length of the new <tt>String</tt>
* platform's default character set. The length of the new {@code String}
* is a function of the character set, and hence may not be equal to the
* size of the buffer.
*
@ -224,7 +224,7 @@ public class ByteArrayOutputStream extends OutputStream {
/**
* Converts the buffer's contents into a string by decoding the bytes using
* the named {@link java.nio.charset.Charset charset}. The length of the new
* <tt>String</tt> is a function of the charset, and hence may not be equal
* {@code String} is a function of the charset, and hence may not be equal
* to the length of the byte array.
*
* <p> This method always replaces malformed-input and unmappable-character
@ -251,14 +251,14 @@ public class ByteArrayOutputStream extends OutputStream {
* copied into it. Each character <i>c</i> in the resulting string is
* constructed from the corresponding element <i>b</i> in the byte
* array such that:
* <blockquote><pre>
* c == (char)(((hibyte &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
* </pre></blockquote>
* <blockquote><pre>{@code
* c == (char)(((hibyte & 0xff) << 8) | (b & 0xff))
* }</pre></blockquote>
*
* @deprecated This method does not properly convert bytes into characters.
* As of JDK&nbsp;1.1, the preferred way to do this is via the
* <code>toString(String enc)</code> method, which takes an encoding-name
* argument, or the <code>toString()</code> method, which uses the
* {@code toString(String enc)} method, which takes an encoding-name
* argument, or the {@code toString()} method, which uses the
* platform's default character encoding.
*
* @param hibyte the high byte of each resulting Unicode character.
@ -273,9 +273,9 @@ public class ByteArrayOutputStream extends OutputStream {
}
/**
* Closing a <tt>ByteArrayOutputStream</tt> has no effect. The methods in
* Closing a {@code ByteArrayOutputStream} has no effect. The methods in
* this class can be called after the stream has been closed without
* generating an <tt>IOException</tt>.
* generating an {@code IOException}.
*/
public void close() throws IOException {
}

View File

@ -62,13 +62,13 @@ public class CharArrayReader extends Reader {
* Creates a CharArrayReader from the specified array of chars.
*
* <p> The resulting reader will start reading at the given
* <tt>offset</tt>. The total number of <tt>char</tt> values that can be
* read from this reader will be either <tt>length</tt> or
* <tt>buf.length-offset</tt>, whichever is smaller.
* {@code offset}. The total number of {@code char} values that can be
* read from this reader will be either {@code length} or
* {@code buf.length-offset}, whichever is smaller.
*
* @throws IllegalArgumentException
* If <tt>offset</tt> is negative or greater than
* <tt>buf.length</tt>, or if <tt>length</tt> is negative, or if
* If {@code offset} is negative or greater than
* {@code buf.length}, or if {@code length} is negative, or if
* the sum of these two values is negative.
*
* @param buf Input buffer (not copied)

View File

@ -141,21 +141,21 @@ class CharArrayWriter extends Writer {
/**
* Appends the specified character sequence to this writer.
*
* <p> An invocation of this method of the form <tt>out.append(csq)</tt>
* <p> An invocation of this method of the form {@code out.append(csq)}
* behaves in exactly the same way as the invocation
*
* <pre>
* out.write(csq.toString()) </pre>
*
* <p> Depending on the specification of <tt>toString</tt> for the
* character sequence <tt>csq</tt>, the entire sequence may not be
* appended. For instance, invoking the <tt>toString</tt> method of a
* <p> Depending on the specification of {@code toString} for the
* character sequence {@code csq}, the entire sequence may not be
* appended. For instance, invoking the {@code toString} method of a
* character buffer will return a subsequence whose content depends upon
* the buffer's position and limit.
*
* @param csq
* The character sequence to append. If <tt>csq</tt> is
* <tt>null</tt>, then the four characters <tt>"null"</tt> are
* The character sequence to append. If {@code csq} is
* {@code null}, then the four characters "{@code null}" are
* appended to this writer.
*
* @return This writer
@ -171,8 +171,9 @@ class CharArrayWriter extends Writer {
/**
* Appends a subsequence of the specified character sequence to this writer.
*
* <p> An invocation of this method of the form <tt>out.append(csq, start,
* end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in
* <p> An invocation of this method of the form
* {@code out.append(csq, start, end)} when
* {@code csq} is not {@code null}, behaves in
* exactly the same way as the invocation
*
* <pre>
@ -180,9 +181,9 @@ class CharArrayWriter extends Writer {
*
* @param csq
* The character sequence from which a subsequence will be
* appended. If <tt>csq</tt> is <tt>null</tt>, then characters
* will be appended as if <tt>csq</tt> contained the four
* characters <tt>"null"</tt>.
* appended. If {@code csq} is {@code null}, then characters
* will be appended as if {@code csq} contained the four
* characters "{@code null}".
*
* @param start
* The index of the first character in the subsequence
@ -194,9 +195,9 @@ class CharArrayWriter extends Writer {
* @return This writer
*
* @throws IndexOutOfBoundsException
* If <tt>start</tt> or <tt>end</tt> are negative, <tt>start</tt>
* is greater than <tt>end</tt>, or <tt>end</tt> is greater than
* <tt>csq.length()</tt>
* If {@code start} or {@code end} are negative, {@code start}
* is greater than {@code end}, or {@code end} is greater than
* {@code csq.length()}
*
* @since 1.5
*/
@ -209,7 +210,7 @@ class CharArrayWriter extends Writer {
/**
* Appends the specified character to this writer.
*
* <p> An invocation of this method of the form <tt>out.append(c)</tt>
* <p> An invocation of this method of the form {@code out.append(c)}
* behaves in exactly the same way as the invocation
*
* <pre>

View File

@ -47,7 +47,7 @@ import sun.nio.cs.StreamEncoder;
* If this virtual machine has a console then it is represented by a
* unique instance of this class which can be obtained by invoking the
* {@link java.lang.System#console()} method. If no console device is
* available then an invocation of that method will return <tt>null</tt>.
* available then an invocation of that method will return {@code null}.
* <p>
* Read and write operations are synchronized to guarantee the atomic
* completion of critical operations; therefore invoking methods
@ -56,17 +56,17 @@ import sun.nio.cs.StreamEncoder;
* on the objects returned by {@link #reader()} and {@link #writer()} may
* block in multithreaded scenarios.
* <p>
* Invoking <tt>close()</tt> on the objects returned by the {@link #reader()}
* Invoking {@code close()} on the objects returned by the {@link #reader()}
* and the {@link #writer()} will not close the underlying stream of those
* objects.
* <p>
* The console-read methods return <tt>null</tt> when the end of the
* The console-read methods return {@code null} when the end of the
* console input stream is reached, for example by typing control-D on
* Unix or control-Z on Windows. Subsequent read operations will succeed
* if additional characters are later entered on the console's input
* device.
* <p>
* Unless otherwise specified, passing a <tt>null</tt> argument to any method
* Unless otherwise specified, passing a {@code null} argument to any method
* in this class will cause a {@link NullPointerException} to be thrown.
* <p>
* <b>Security note:</b>
@ -107,7 +107,7 @@ public final class Console implements Flushable
* <p>
* This method is intended to be used by sophisticated applications, for
* example, a {@link java.util.Scanner} object which utilizes the rich
* parsing/scanning functionality provided by the <tt>Scanner</tt>:
* parsing/scanning functionality provided by the {@code Scanner}:
* <blockquote><pre>
* Console con = System.console();
* if (con != null) {
@ -117,7 +117,7 @@ public final class Console implements Flushable
* </pre></blockquote>
* <p>
* For simple applications requiring only line-oriented reading, use
* <tt>{@link #readLine}</tt>.
* {@link #readLine}.
* <p>
* The bulk read operations {@link java.io.Reader#read(char[]) read(char[]) },
* {@link java.io.Reader#read(char[], int, int) read(char[], int, int) } and
@ -126,8 +126,8 @@ public final class Console implements Flushable
* bound for each invocation, even if the destination buffer has space for
* more characters. The {@code Reader}'s {@code read} methods may block if a
* line bound has not been entered or reached on the console's input device.
* A line bound is considered to be any one of a line feed (<tt>'\n'</tt>),
* a carriage return (<tt>'\r'</tt>), a carriage return followed immediately
* A line bound is considered to be any one of a line feed ({@code '\n'}),
* a carriage return ({@code '\r'}), a carriage return followed immediately
* by a linefeed, or an end of stream.
*
* @return The reader associated with this console
@ -152,7 +152,7 @@ public final class Console implements Flushable
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws IllegalFormatException
@ -175,8 +175,9 @@ public final class Console implements Flushable
* A convenience method to write a formatted string to this console's
* output stream using the specified format string and arguments.
*
* <p> An invocation of this method of the form <tt>con.printf(format,
* args)</tt> behaves in exactly the same way as the invocation of
* <p> An invocation of this method of the form
* {@code con.printf(format, args)} behaves in exactly the same way
* as the invocation of
* <pre>con.format(format, args)</pre>.
*
* @param format
@ -191,7 +192,7 @@ public final class Console implements Flushable
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws IllegalFormatException
@ -237,7 +238,7 @@ public final class Console implements Flushable
* If an I/O error occurs.
*
* @return A string containing the line read from the console, not
* including any line-termination characters, or <tt>null</tt>
* including any line-termination characters, or {@code null}
* if an end of stream has been reached.
*/
public String readLine(String fmt, Object ... args) {
@ -265,7 +266,7 @@ public final class Console implements Flushable
* If an I/O error occurs.
*
* @return A string containing the line read from the console, not
* including any line-termination characters, or <tt>null</tt>
* including any line-termination characters, or {@code null}
* if an end of stream has been reached.
*/
public String readLine() {
@ -302,7 +303,7 @@ public final class Console implements Flushable
*
* @return A character array containing the password or passphrase read
* from the console, not including any line-termination characters,
* or <tt>null</tt> if an end of stream has been reached.
* or {@code null} if an end of stream has been reached.
*/
public char[] readPassword(String fmt, Object ... args) {
char[] passwd = null;
@ -346,7 +347,7 @@ public final class Console implements Flushable
*
* @return A character array containing the password or passphrase read
* from the console, not including any line-termination characters,
* or <tt>null</tt> if an end of stream has been reached.
* or {@code null} if an end of stream has been reached.
*/
public char[] readPassword() {
return readPassword("");

View File

@ -63,8 +63,8 @@ import sun.security.action.GetPropertyAction;
* pathname string, each name is separated from the next by a single copy of
* the default <em>separator character</em>. The default name-separator
* character is defined by the system property <code>file.separator</code>, and
* is made available in the public static fields <code>{@link
* #separator}</code> and <code>{@link #separatorChar}</code> of this class.
* is made available in the public static fields {@link
* #separator} and {@link #separatorChar} of this class.
* When a pathname string is converted into an abstract pathname, the names
* within it may be separated by the default name-separator character or by any
* other name-separator character that is supported by the underlying system.
@ -82,11 +82,11 @@ import sun.security.action.GetPropertyAction;
* <p> The <em>parent</em> of an abstract pathname may be obtained by invoking
* the {@link #getParent} method of this class and consists of the pathname's
* prefix and each name in the pathname's name sequence except for the last.
* Each directory's absolute pathname is an ancestor of any <tt>File</tt>
* Each directory's absolute pathname is an ancestor of any {@code File}
* object with an absolute abstract pathname which begins with the directory's
* absolute pathname. For example, the directory denoted by the abstract
* pathname <tt>"/usr"</tt> is an ancestor of the directory denoted by the
* pathname <tt>"/usr/local/bin"</tt>.
* pathname {@code "/usr"} is an ancestor of the directory denoted by the
* pathname {@code "/usr/local/bin"}.
*
* <p> The prefix concept is used to handle root directories on UNIX platforms,
* and drive specifiers, root directories and UNC pathnames on Microsoft Windows platforms,
@ -217,7 +217,7 @@ public class File
/**
* The system-dependent default name-separator character, represented as a
* string for convenience. This string contains a single character, namely
* <code>{@link #separatorChar}</code>.
* {@link #separatorChar}.
*/
public static final String separator = "" + separatorChar;
@ -236,7 +236,7 @@ public class File
/**
* The system-dependent path-separator character, represented as a string
* for convenience. This string contains a single character, namely
* <code>{@link #pathSeparatorChar}</code>.
* {@link #pathSeparatorChar}.
*/
public static final String pathSeparator = "" + pathSeparatorChar;
@ -374,33 +374,34 @@ public class File
}
/**
* Creates a new <tt>File</tt> instance by converting the given
* <tt>file:</tt> URI into an abstract pathname.
* Creates a new {@code File} instance by converting the given
* {@code file:} URI into an abstract pathname.
*
* <p> The exact form of a <tt>file:</tt> URI is system-dependent, hence
* <p> The exact form of a {@code file:} URI is system-dependent, hence
* the transformation performed by this constructor is also
* system-dependent.
*
* <p> For a given abstract pathname <i>f</i> it is guaranteed that
*
* <blockquote><tt>
* new File(</tt><i>&nbsp;f</i><tt>.{@link #toURI() toURI}()).equals(</tt><i>&nbsp;f</i><tt>.{@link #getAbsoluteFile() getAbsoluteFile}())
* </tt></blockquote>
* <blockquote><code>
* new File(</code><i>&nbsp;f</i><code>.{@link #toURI()
* toURI}()).equals(</code><i>&nbsp;f</i><code>.{@link #getAbsoluteFile() getAbsoluteFile}())
* </code></blockquote>
*
* so long as the original abstract pathname, the URI, and the new abstract
* pathname are all created in (possibly different invocations of) the same
* Java virtual machine. This relationship typically does not hold,
* however, when a <tt>file:</tt> URI that is created in a virtual machine
* however, when a {@code file:} URI that is created in a virtual machine
* on one operating system is converted into an abstract pathname in a
* virtual machine on a different operating system.
*
* @param uri
* An absolute, hierarchical URI with a scheme equal to
* <tt>"file"</tt>, a non-empty path component, and undefined
* {@code "file"}, a non-empty path component, and undefined
* authority, query, and fragment components
*
* @throws NullPointerException
* If <tt>uri</tt> is <tt>null</tt>
* If {@code uri} is {@code null}
*
* @throws IllegalArgumentException
* If the preconditions on the parameter do not hold
@ -533,7 +534,7 @@ public class File
* Returns the absolute pathname string of this abstract pathname.
*
* <p> If this abstract pathname is already absolute, then the pathname
* string is simply returned as if by the <code>{@link #getPath}</code>
* string is simply returned as if by the {@link #getPath}
* method. If this abstract pathname is the empty abstract pathname then
* the pathname string of the current user directory, which is named by the
* system property <code>user.dir</code>, is returned. Otherwise this
@ -581,7 +582,7 @@ public class File
* converts this pathname to absolute form if necessary, as if by invoking the
* {@link #getAbsolutePath} method, and then maps it to its unique form in a
* system-dependent way. This typically involves removing redundant names
* such as <tt>"."</tt> and <tt>".."</tt> from the pathname, resolving
* such as {@code "."} and {@code ".."} from the pathname, resolving
* symbolic links (on UNIX platforms), and converting drive letters to a
* standard case (on Microsoft Windows platforms).
*
@ -604,8 +605,8 @@ public class File
*
* @throws SecurityException
* If a required system property value cannot be accessed, or
* if a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead}</code> method denies
* if a security manager exists and its {@link
* java.lang.SecurityManager#checkRead} method denies
* read access to the file
*
* @since 1.1
@ -632,8 +633,8 @@ public class File
*
* @throws SecurityException
* If a required system property value cannot be accessed, or
* if a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead}</code> method denies
* if a security manager exists and its {@link
* java.lang.SecurityManager#checkRead} method denies
* read access to the file
*
* @since 1.2
@ -687,7 +688,7 @@ public class File
}
/**
* Constructs a <tt>file:</tt> URI that represents this abstract pathname.
* Constructs a {@code file:} URI that represents this abstract pathname.
*
* <p> The exact form of the URI is system-dependent. If it can be
* determined that the file denoted by this abstract pathname is a
@ -695,15 +696,16 @@ public class File
*
* <p> For a given abstract pathname <i>f</i>, it is guaranteed that
*
* <blockquote><tt>
* new {@link #File(java.net.URI) File}(</tt><i>&nbsp;f</i><tt>.toURI()).equals(</tt><i>&nbsp;f</i><tt>.{@link #getAbsoluteFile() getAbsoluteFile}())
* </tt></blockquote>
* <blockquote><code>
* new {@link #File(java.net.URI) File}(</code><i>&nbsp;f</i><code>.toURI()).equals(
* </code><i>&nbsp;f</i><code>.{@link #getAbsoluteFile() getAbsoluteFile}())
* </code></blockquote>
*
* so long as the original abstract pathname, the URI, and the new abstract
* pathname are all created in (possibly different invocations of) the same
* Java virtual machine. Due to the system-dependent nature of abstract
* pathnames, however, this relationship typically does not hold when a
* <tt>file:</tt> URI that is created in a virtual machine on one operating
* {@code file:} URI that is created in a virtual machine on one operating
* system is converted into an abstract pathname in a virtual machine on a
* different operating system.
*
@ -716,7 +718,7 @@ public class File
* may be used to obtain a {@code Path} representing this abstract pathname.
*
* @return An absolute, hierarchical URI with a scheme equal to
* <tt>"file"</tt>, a path representing this abstract pathname,
* {@code "file"}, a path representing this abstract pathname,
* and undefined authority, query, and fragment components
* @throws SecurityException If a required system property value cannot
* be accessed.
@ -753,8 +755,8 @@ public class File
* application; <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*/
public boolean canRead() {
@ -781,8 +783,8 @@ public class File
* <code>false</code> otherwise.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*/
public boolean canWrite() {
@ -804,8 +806,8 @@ public class File
* by this abstract pathname exists; <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file or directory
*/
public boolean exists() {
@ -834,8 +836,8 @@ public class File
* <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*/
public boolean isDirectory() {
@ -867,8 +869,8 @@ public class File
* <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*/
public boolean isFile() {
@ -894,8 +896,8 @@ public class File
* underlying platform
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*
* @since 1.2
@ -928,8 +930,8 @@ public class File
* file does not exist or if an I/O error occurs
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*/
public long lastModified() {
@ -959,8 +961,8 @@ public class File
* denoting system-dependent entities such as devices or pipes.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method denies read access to the file
*/
public long length() {
@ -997,8 +999,8 @@ public class File
* If an I/O error occurred
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.2
@ -1026,8 +1028,8 @@ public class File
* successfully deleted; <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkDelete}</code> method denies
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkDelete} method denies
* delete access to the file
*/
public boolean delete() {
@ -1060,8 +1062,8 @@ public class File
* facility should be used instead.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkDelete}</code> method denies
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkDelete} method denies
* delete access to the file
*
* @see #delete
@ -1301,8 +1303,8 @@ public class File
* created; <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method does not permit the named directory to be created
*/
public boolean mkdir() {
@ -1327,12 +1329,12 @@ public class File
* otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkRead(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkRead(java.lang.String)}
* method does not permit verification of the existence of the
* named directory and all necessary parent directories; or if
* the <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* the {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method does not permit the named directory and all necessary
* parent directories to be created
*/
@ -1375,8 +1377,8 @@ public class File
* <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to either the old or new pathnames
*
* @throws NullPointerException
@ -1405,7 +1407,7 @@ public class File
* but some provide more precision. The argument will be truncated to fit
* the supported precision. If the operation succeeds and no intervening
* operations on the file take place, then the next invocation of the
* <code>{@link #lastModified}</code> method will return the (possibly
* {@link #lastModified} method will return the (possibly
* truncated) <code>time</code> argument that was passed to this method.
*
* @param time The new last-modified time, measured in milliseconds since
@ -1417,8 +1419,8 @@ public class File
* @throws IllegalArgumentException If the argument is negative
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the named file
*
* @since 1.2
@ -1448,8 +1450,8 @@ public class File
* <code>false</code> otherwise
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the named file
*
* @since 1.2
@ -1491,8 +1493,8 @@ public class File
* the access permissions of this abstract pathname.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the named file
*
* @since 1.6
@ -1514,11 +1516,12 @@ public class File
* machine with special privileges that allow it to modify files that
* disallow write operations.
*
* <p> An invocation of this method of the form <tt>file.setWritable(arg)</tt>
* <p> An invocation of this method of the form {@code file.setWritable(arg)}
* behaves in exactly the same way as the invocation
*
* <pre>
* file.setWritable(arg, true) </pre>
* <pre>{@code
* file.setWritable(arg, true)
* }</pre>
*
* @param writable
* If <code>true</code>, sets the access permission to allow write
@ -1529,8 +1532,8 @@ public class File
* change the access permissions of this abstract pathname.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.6
@ -1568,8 +1571,8 @@ public class File
* operation will fail.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.6
@ -1591,11 +1594,12 @@ public class File
* machine with special privileges that allow it to read files that are
* marked as unreadable.
*
* <p>An invocation of this method of the form <tt>file.setReadable(arg)</tt>
* <p>An invocation of this method of the form {@code file.setReadable(arg)}
* behaves in exactly the same way as the invocation
*
* <pre>
* file.setReadable(arg, true) </pre>
* <pre>{@code
* file.setReadable(arg, true)
* }</pre>
*
* @param readable
* If <code>true</code>, sets the access permission to allow read
@ -1609,8 +1613,8 @@ public class File
* operation will fail.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.6
@ -1648,8 +1652,8 @@ public class File
* operation will fail.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.6
@ -1671,11 +1675,12 @@ public class File
* virtual machine with special privileges that allow it to execute files
* that are not marked executable.
*
* <p>An invocation of this method of the form <tt>file.setExcutable(arg)</tt>
* <p>An invocation of this method of the form {@code file.setExcutable(arg)}
* behaves in exactly the same way as the invocation
*
* <pre>
* file.setExecutable(arg, true) </pre>
* <pre>{@code
* file.setExecutable(arg, true)
* }</pre>
*
* @param executable
* If <code>true</code>, sets the access permission to allow execute
@ -1689,8 +1694,8 @@ public class File
* operation will fail.
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method denies write access to the file
*
* @since 1.6
@ -1710,8 +1715,8 @@ public class File
* <em>and</em> the application is allowed to execute the file
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkExec(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkExec(java.lang.String)}
* method denies execute access to the file
*
* @since 1.6
@ -1783,12 +1788,12 @@ public class File
* Returns the size of the partition <a href="#partName">named</a> by this
* abstract pathname.
*
* @return The size, in bytes, of the partition or <tt>0L</tt> if this
* @return The size, in bytes, of the partition or {@code 0L} if this
* abstract pathname does not name a partition
*
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link RuntimePermission}<tt>("getFileSystemAttributes")</tt>
* {@link RuntimePermission}{@code ("getFileSystemAttributes")}
* or its {@link SecurityManager#checkRead(String)} method denies
* read access to the file named by this abstract pathname
*
@ -1819,14 +1824,14 @@ public class File
* makes no guarantee that write operations to this file system
* will succeed.
*
* @return The number of unallocated bytes on the partition or <tt>0L</tt>
* @return The number of unallocated bytes on the partition or {@code 0L}
* if the abstract pathname does not name a partition. This
* value will be less than or equal to the total file system size
* returned by {@link #getTotalSpace}.
*
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link RuntimePermission}<tt>("getFileSystemAttributes")</tt>
* {@link RuntimePermission}{@code ("getFileSystemAttributes")}
* or its {@link SecurityManager#checkRead(String)} method denies
* read access to the file named by this abstract pathname
*
@ -1860,14 +1865,14 @@ public class File
* virtual machine. This method makes no guarantee that write operations
* to this file system will succeed.
*
* @return The number of available bytes on the partition or <tt>0L</tt>
* @return The number of available bytes on the partition or {@code 0L}
* if the abstract pathname does not name a partition. On
* systems where this information is not available, this method
* will be equivalent to a call to {@link #getFreeSpace}.
*
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link RuntimePermission}<tt>("getFileSystemAttributes")</tt>
* {@link RuntimePermission}{@code ("getFileSystemAttributes")}
* or its {@link SecurityManager#checkRead(String)} method denies
* read access to the file named by this abstract pathname
*
@ -1939,7 +1944,7 @@ public class File
*
* This method provides only part of a temporary-file facility. To arrange
* for a file created by this method to be deleted automatically, use the
* <code>{@link #deleteOnExit}</code> method.
* {@link #deleteOnExit} method.
*
* <p> The <code>prefix</code> argument must be at least three characters
* long. It is recommended that the prefix be a short, meaningful string
@ -1987,8 +1992,8 @@ public class File
* @throws IOException If a file could not be created
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method does not allow a file to be created
*
* @since 1.2
@ -2032,9 +2037,9 @@ public class File
/**
* Creates an empty file in the default temporary-file directory, using
* the given prefix and suffix to generate its name. Invoking this method
* is equivalent to invoking <code>{@link #createTempFile(java.lang.String,
* is equivalent to invoking {@link #createTempFile(java.lang.String,
* java.lang.String, java.io.File)
* createTempFile(prefix,&nbsp;suffix,&nbsp;null)}</code>.
* createTempFile(prefix,&nbsp;suffix,&nbsp;null)}.
*
* <p> The {@link
* java.nio.file.Files#createTempFile(String,String,java.nio.file.attribute.FileAttribute[])
@ -2059,8 +2064,8 @@ public class File
* @throws IOException If a file could not be created
*
* @throws SecurityException
* If a security manager exists and its <code>{@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}</code>
* If a security manager exists and its {@link
* java.lang.SecurityManager#checkWrite(java.lang.String)}
* method does not allow a file to be created
*
* @since 1.2
@ -2136,7 +2141,7 @@ public class File
/**
* Returns the pathname string of this abstract pathname. This is just the
* string returned by the <code>{@link #getPath}</code> method.
* string returned by the {@link #getPath} method.
*
* @return The string form of this abstract pathname
*/

View File

@ -37,7 +37,7 @@ import sun.nio.ch.FileChannelImpl;
* <code>File</code> or to a <code>FileDescriptor</code>. Whether or not
* a file is available or may be created depends upon the underlying
* platform. Some platforms, in particular, allow a file to be opened
* for writing by only one <tt>FileOutputStream</tt> (or other
* for writing by only one {@code FileOutputStream} (or other
* file-writing object) at a time. In such situations the constructors in
* this class will fail if the file involved is already open.
*

View File

@ -32,9 +32,9 @@ package java.io;
* size are appropriate. To specify these values yourself, construct an
* InputStreamReader on a FileInputStream.
*
* <p><code>FileReader</code> is meant for reading streams of characters.
* <p>{@code FileReader} is meant for reading streams of characters.
* For reading streams of raw bytes, consider using a
* <code>FileInputStream</code>.
* {@code FileInputStream}.
*
* @see InputStreamReader
* @see FileInputStream
@ -45,7 +45,7 @@ package java.io;
public class FileReader extends InputStreamReader {
/**
* Creates a new <tt>FileReader</tt>, given the name of the
* Creates a new {@code FileReader}, given the name of the
* file to read from.
*
* @param fileName the name of the file to read from
@ -59,10 +59,10 @@ public class FileReader extends InputStreamReader {
}
/**
* Creates a new <tt>FileReader</tt>, given the <tt>File</tt>
* Creates a new {@code FileReader}, given the {@code File}
* to read from.
*
* @param file the <tt>File</tt> to read from
* @param file the {@code File} to read from
* @exception FileNotFoundException if the file does not exist,
* is a directory rather than a regular file,
* or for some other reason cannot be opened for
@ -73,8 +73,8 @@ public class FileReader extends InputStreamReader {
}
/**
* Creates a new <tt>FileReader</tt>, given the
* <tt>FileDescriptor</tt> to read from.
* Creates a new {@code FileReader}, given the
* {@code FileDescriptor} to read from.
*
* @param fd the FileDescriptor to read from
*/

View File

@ -34,13 +34,13 @@ package java.io;
*
* <p>Whether or not a file is available or may be created depends upon the
* underlying platform. Some platforms, in particular, allow a file to be
* opened for writing by only one <tt>FileWriter</tt> (or other file-writing
* opened for writing by only one {@code FileWriter} (or other file-writing
* object) at a time. In such situations the constructors in this class
* will fail if the file involved is already open.
*
* <p><code>FileWriter</code> is meant for writing streams of characters.
* <p>{@code FileWriter} is meant for writing streams of characters.
* For writing streams of raw bytes, consider using a
* <code>FileOutputStream</code>.
* {@code FileOutputStream}.
*
* @see OutputStreamWriter
* @see FileOutputStream
@ -68,7 +68,7 @@ public class FileWriter extends OutputStreamWriter {
* indicating whether or not to append the data written.
*
* @param fileName String The system-dependent filename.
* @param append boolean if <code>true</code>, then data will be written
* @param append boolean if {@code true}, then data will be written
* to the end of the file rather than the beginning.
* @throws IOException if the named file exists but is a directory rather
* than a regular file, does not exist but cannot be
@ -92,11 +92,11 @@ public class FileWriter extends OutputStreamWriter {
/**
* Constructs a FileWriter object given a File object. If the second
* argument is <code>true</code>, then bytes will be written to the end
* argument is {@code true}, then bytes will be written to the end
* of the file rather than the beginning.
*
* @param file a File object to write to
* @param append if <code>true</code>, then bytes will be written
* @param append if {@code true}, then bytes will be written
* to the end of the file rather than the beginning
* @throws IOException if the file exists but is a directory rather than
* a regular file, does not exist but cannot be created,

View File

@ -57,7 +57,7 @@ public class FilterOutputStream extends OutputStream {
* underlying output stream.
*
* @param out the underlying output stream to be assigned to
* the field <tt>this.out</tt> for later use, or
* the field {@code this.out} for later use, or
* <code>null</code> if this instance is to be
* created without an underlying stream.
*/
@ -70,9 +70,9 @@ public class FilterOutputStream extends OutputStream {
* <p>
* The <code>write</code> method of <code>FilterOutputStream</code>
* calls the <code>write</code> method of its underlying output stream,
* that is, it performs <tt>out.write(b)</tt>.
* that is, it performs {@code out.write(b)}.
* <p>
* Implements the abstract <tt>write</tt> method of <tt>OutputStream</tt>.
* Implements the abstract {@code write} method of {@code OutputStream}.
*
* @param b the <code>byte</code>.
* @exception IOException if an I/O error occurs.

View File

@ -28,7 +28,7 @@ package java.io;
import java.io.IOException;
/**
* A <tt>Flushable</tt> is a destination of data that can be flushed. The
* A {@code Flushable} is a destination of data that can be flushed. The
* flush method is invoked to write any buffered output to the underlying
* stream.
*

View File

@ -35,11 +35,11 @@ public class IOError extends Error {
/**
* Constructs a new instance of IOError with the specified cause. The
* IOError is created with the detail message of
* <tt>(cause==null ? null : cause.toString())</tt> (which typically
* {@code (cause==null ? null : cause.toString())} (which typically
* contains the class and detail message of cause).
*
* @param cause
* The cause of this error, or <tt>null</tt> if the cause
* The cause of this error, or {@code null} if the cause
* is not known
*/
public IOError(Throwable cause) {

View File

@ -34,10 +34,10 @@ package java.io;
*
* <p> By default, line numbering begins at 0. This number increments at every
* <a href="#lt">line terminator</a> as the data is read, and can be changed
* with a call to <tt>setLineNumber(int)</tt>. Note however, that
* <tt>setLineNumber(int)</tt> does not actually change the current position in
* with a call to {@code setLineNumber(int)}. Note however, that
* {@code setLineNumber(int)} does not actually change the current position in
* the stream; it only changes the value that will be returned by
* <tt>getLineNumber()</tt>.
* {@code getLineNumber()}.
*
* <p> A line is considered to be <a name="lt">terminated</a> by any one of a
* line feed ('\n'), a carriage return ('\r'), or a carriage return followed
@ -193,7 +193,7 @@ public class LineNumberReader extends BufferedReader {
*
* @return A String containing the contents of the line, not including
* any <a href="#lt">line termination characters</a>, or
* <tt>null</tt> if the end of the stream has been reached
* {@code null} if the end of the stream has been reached
*
* @throws IOException
* If an I/O error occurs
@ -226,7 +226,7 @@ public class LineNumberReader extends BufferedReader {
* If an I/O error occurs
*
* @throws IllegalArgumentException
* If <tt>n</tt> is negative
* If {@code n} is negative
*/
public long skip(long n) throws IOException {
if (n < 0)

View File

@ -94,7 +94,7 @@ public abstract class OutputStream implements Closeable, Flushable {
* <p>
* If <code>off</code> is negative, or <code>len</code> is negative, or
* <code>off+len</code> is greater than the length of the array
* <code>b</code>, then an <tt>IndexOutOfBoundsException</tt> is thrown.
* {@code b}, then an {@code IndexOutOfBoundsException} is thrown.
*
* @param b the data.
* @param off the start offset in the data.

View File

@ -53,7 +53,7 @@ import sun.nio.cs.StreamEncoder;
* </pre>
*
* <p> A <i>surrogate pair</i> is a character represented by a sequence of two
* <tt>char</tt> values: A <i>high</i> surrogate in the range '&#92;uD800' to
* {@code char} values: A <i>high</i> surrogate in the range '&#92;uD800' to
* '&#92;uDBFF' followed by a <i>low</i> surrogate in the range '&#92;uDC00' to
* '&#92;uDFFF'.
*
@ -161,7 +161,7 @@ public class OutputStreamWriter extends Writer {
* <p> If this instance was created with the {@link
* #OutputStreamWriter(OutputStream, String)} constructor then the returned
* name, being unique for the encoding, may differ from the name passed to
* the constructor. This method may return <tt>null</tt> if the stream has
* the constructor. This method may return {@code null} if the stream has
* been closed. </p>
*
* @return The historical name of this encoding, or possibly

View File

@ -32,22 +32,22 @@ import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
/**
* A <code>PrintStream</code> adds functionality to another output stream,
* A {@code PrintStream} adds functionality to another output stream,
* namely the ability to print representations of various data values
* conveniently. Two other features are provided as well. Unlike other output
* streams, a <code>PrintStream</code> never throws an
* <code>IOException</code>; instead, exceptional situations merely set an
* internal flag that can be tested via the <code>checkError</code> method.
* Optionally, a <code>PrintStream</code> can be created so as to flush
* automatically; this means that the <code>flush</code> method is
* streams, a {@code PrintStream} never throws an
* {@code IOException}; instead, exceptional situations merely set an
* internal flag that can be tested via the {@code checkError} method.
* Optionally, a {@code PrintStream} can be created so as to flush
* automatically; this means that the {@code flush} method is
* automatically invoked after a byte array is written, one of the
* <code>println</code> methods is invoked, or a newline character or byte
* (<code>'\n'</code>) is written.
* {@code println} methods is invoked, or a newline character or byte
* ({@code '\n'}) is written.
*
* <p> All characters printed by a <code>PrintStream</code> are converted into
* bytes using the platform's default character encoding. The <code>{@link
* PrintWriter}</code> class should be used in situations that require writing
* characters rather than bytes.
* <p> All characters printed by a {@code PrintStream} are converted into
* bytes using the platform's default character encoding.
* The {@link PrintWriter} class should be used in situations that require
* writing characters rather than bytes.
*
* @author Frank Yellin
* @author Mark Reinhold
@ -142,8 +142,8 @@ public class PrintStream extends FilterOutputStream
* printed
* @param autoFlush A boolean; if true, the output buffer will be flushed
* whenever a byte array is written, one of the
* <code>println</code> methods is invoked, or a newline
* character or byte (<code>'\n'</code>) is written
* {@code println} methods is invoked, or a newline
* character or byte ({@code '\n'}) is written
*
* @see java.io.PrintWriter#PrintWriter(java.io.OutputStream, boolean)
*/
@ -158,8 +158,8 @@ public class PrintStream extends FilterOutputStream
* printed
* @param autoFlush A boolean; if true, the output buffer will be flushed
* whenever a byte array is written, one of the
* <code>println</code> methods is invoked, or a newline
* character or byte (<code>'\n'</code>) is written
* {@code println} methods is invoked, or a newline
* character or byte ({@code '\n'}) is written
* @param encoding The name of a supported
* <a href="../lang/package-summary.html#charenc">
* character encoding</a>
@ -371,21 +371,21 @@ public class PrintStream extends FilterOutputStream
/**
* Flushes the stream and checks its error state. The internal error state
* is set to <code>true</code> when the underlying output stream throws an
* <code>IOException</code> other than <code>InterruptedIOException</code>,
* and when the <code>setError</code> method is invoked. If an operation
* is set to {@code true} when the underlying output stream throws an
* {@code IOException} other than {@code InterruptedIOException},
* and when the {@code setError} method is invoked. If an operation
* on the underlying output stream throws an
* <code>InterruptedIOException</code>, then the <code>PrintStream</code>
* {@code InterruptedIOException}, then the {@code PrintStream}
* converts the exception back into an interrupt by doing:
* <pre>
* <pre>{@code
* Thread.currentThread().interrupt();
* </pre>
* }</pre>
* or the equivalent.
*
* @return <code>true</code> if and only if this stream has encountered an
* <code>IOException</code> other than
* <code>InterruptedIOException</code>, or the
* <code>setError</code> method has been invoked
* @return {@code true} if and only if this stream has encountered an
* {@code IOException} other than
* {@code InterruptedIOException}, or the
* {@code setError} method has been invoked
*/
public boolean checkError() {
if (out != null)
@ -398,11 +398,11 @@ public class PrintStream extends FilterOutputStream
}
/**
* Sets the error state of the stream to <code>true</code>.
* Sets the error state of the stream to {@code true}.
*
* <p> This method will cause subsequent invocations of {@link
* #checkError()} to return <tt>true</tt> until {@link
* #clearError()} is invoked.
* #checkError()} to return {@code true} until
* {@link #clearError()} is invoked.
*
* @since 1.1
*/
@ -414,7 +414,7 @@ public class PrintStream extends FilterOutputStream
* Clears the internal error state of this stream.
*
* <p> This method will cause subsequent invocations of {@link
* #checkError()} to return <tt>false</tt> until another write
* #checkError()} to return {@code false} until another write
* operation fails and invokes {@link #setError()}.
*
* @since 1.6
@ -430,12 +430,12 @@ public class PrintStream extends FilterOutputStream
/**
* Writes the specified byte to this stream. If the byte is a newline and
* automatic flushing is enabled then the <code>flush</code> method will be
* automatic flushing is enabled then the {@code flush} method will be
* invoked.
*
* <p> Note that the byte is written as given; to write a character that
* will be translated according to the platform's default character
* encoding, use the <code>print(char)</code> or <code>println(char)</code>
* encoding, use the {@code print(char)} or {@code println(char)}
* methods.
*
* @param b The byte to be written
@ -460,13 +460,13 @@ public class PrintStream extends FilterOutputStream
}
/**
* Writes <code>len</code> bytes from the specified byte array starting at
* offset <code>off</code> to this stream. If automatic flushing is
* enabled then the <code>flush</code> method will be invoked.
* Writes {@code len} bytes from the specified byte array starting at
* offset {@code off} to this stream. If automatic flushing is
* enabled then the {@code flush} method will be invoked.
*
* <p> Note that the bytes will be written as given; to write characters
* that will be translated according to the platform's default character
* encoding, use the <code>print(char)</code> or <code>println(char)</code>
* encoding, use the {@code print(char)} or {@code println(char)}
* methods.
*
* @param buf A byte array
@ -559,13 +559,13 @@ public class PrintStream extends FilterOutputStream
/* Methods that do not terminate lines */
/**
* Prints a boolean value. The string produced by <code>{@link
* java.lang.String#valueOf(boolean)}</code> is translated into bytes
* Prints a boolean value. The string produced by {@link
* java.lang.String#valueOf(boolean)} is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param b The <code>boolean</code> to be printed
* @param b The {@code boolean} to be printed
*/
public void print(boolean b) {
write(b ? "true" : "false");
@ -575,22 +575,22 @@ public class PrintStream extends FilterOutputStream
* Prints a character. The character is translated into one or more bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param c The <code>char</code> to be printed
* @param c The {@code char} to be printed
*/
public void print(char c) {
write(String.valueOf(c));
}
/**
* Prints an integer. The string produced by <code>{@link
* java.lang.String#valueOf(int)}</code> is translated into bytes
* Prints an integer. The string produced by {@link
* java.lang.String#valueOf(int)} is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param i The <code>int</code> to be printed
* @param i The {@code int} to be printed
* @see java.lang.Integer#toString(int)
*/
public void print(int i) {
@ -598,13 +598,13 @@ public class PrintStream extends FilterOutputStream
}
/**
* Prints a long integer. The string produced by <code>{@link
* java.lang.String#valueOf(long)}</code> is translated into bytes
* Prints a long integer. The string produced by {@link
* java.lang.String#valueOf(long)} is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param l The <code>long</code> to be printed
* @param l The {@code long} to be printed
* @see java.lang.Long#toString(long)
*/
public void print(long l) {
@ -612,13 +612,13 @@ public class PrintStream extends FilterOutputStream
}
/**
* Prints a floating-point number. The string produced by <code>{@link
* java.lang.String#valueOf(float)}</code> is translated into bytes
* Prints a floating-point number. The string produced by {@link
* java.lang.String#valueOf(float)} is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param f The <code>float</code> to be printed
* @param f The {@code float} to be printed
* @see java.lang.Float#toString(float)
*/
public void print(float f) {
@ -627,12 +627,12 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a double-precision floating-point number. The string produced by
* <code>{@link java.lang.String#valueOf(double)}</code> is translated into
* {@link java.lang.String#valueOf(double)} is translated into
* bytes according to the platform's default character encoding, and these
* bytes are written in exactly the manner of the <code>{@link
* #write(int)}</code> method.
* bytes are written in exactly the manner of the {@link
* #write(int)} method.
*
* @param d The <code>double</code> to be printed
* @param d The {@code double} to be printed
* @see java.lang.Double#toString(double)
*/
public void print(double d) {
@ -643,24 +643,24 @@ public class PrintStream extends FilterOutputStream
* Prints an array of characters. The characters are converted into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param s The array of chars to be printed
*
* @throws NullPointerException If <code>s</code> is <code>null</code>
* @throws NullPointerException If {@code s} is {@code null}
*/
public void print(char s[]) {
write(s);
}
/**
* Prints a string. If the argument is <code>null</code> then the string
* <code>"null"</code> is printed. Otherwise, the string's characters are
* Prints a string. If the argument is {@code null} then the string
* {@code "null"} is printed. Otherwise, the string's characters are
* converted into bytes according to the platform's default character
* encoding, and these bytes are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param s The <code>String</code> to be printed
* @param s The {@code String} to be printed
*/
public void print(String s) {
if (s == null) {
@ -670,13 +670,13 @@ public class PrintStream extends FilterOutputStream
}
/**
* Prints an object. The string produced by the <code>{@link
* java.lang.String#valueOf(Object)}</code> method is translated into bytes
* Prints an object. The string produced by the {@link
* java.lang.String#valueOf(Object)} method is translated into bytes
* according to the platform's default character encoding, and these bytes
* are written in exactly the manner of the
* <code>{@link #write(int)}</code> method.
* {@link #write(int)} method.
*
* @param obj The <code>Object</code> to be printed
* @param obj The {@code Object} to be printed
* @see java.lang.Object#toString()
*/
public void print(Object obj) {
@ -689,8 +689,8 @@ public class PrintStream extends FilterOutputStream
/**
* Terminates the current line by writing the line separator string. The
* line separator string is defined by the system property
* <code>line.separator</code>, and is not necessarily a single newline
* character (<code>'\n'</code>).
* {@code line.separator}, and is not necessarily a single newline
* character ({@code '\n'}).
*/
public void println() {
newLine();
@ -698,10 +698,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a boolean and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(boolean)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(boolean)} and then
* {@link #println()}.
*
* @param x The <code>boolean</code> to be printed
* @param x The {@code boolean} to be printed
*/
public void println(boolean x) {
synchronized (this) {
@ -712,10 +712,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a character and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(char)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(char)} and then
* {@link #println()}.
*
* @param x The <code>char</code> to be printed.
* @param x The {@code char} to be printed.
*/
public void println(char x) {
synchronized (this) {
@ -726,10 +726,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints an integer and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(int)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(int)} and then
* {@link #println()}.
*
* @param x The <code>int</code> to be printed.
* @param x The {@code int} to be printed.
*/
public void println(int x) {
synchronized (this) {
@ -740,10 +740,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a long and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(long)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(long)} and then
* {@link #println()}.
*
* @param x a The <code>long</code> to be printed.
* @param x a The {@code long} to be printed.
*/
public void println(long x) {
synchronized (this) {
@ -754,10 +754,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a float and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(float)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(float)} and then
* {@link #println()}.
*
* @param x The <code>float</code> to be printed.
* @param x The {@code float} to be printed.
*/
public void println(float x) {
synchronized (this) {
@ -768,10 +768,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a double and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(double)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(double)} and then
* {@link #println()}.
*
* @param x The <code>double</code> to be printed.
* @param x The {@code double} to be printed.
*/
public void println(double x) {
synchronized (this) {
@ -782,8 +782,8 @@ public class PrintStream extends FilterOutputStream
/**
* Prints an array of characters and then terminate the line. This method
* behaves as though it invokes <code>{@link #print(char[])}</code> and
* then <code>{@link #println()}</code>.
* behaves as though it invokes {@link #print(char[])} and
* then {@link #println()}.
*
* @param x an array of chars to print.
*/
@ -796,10 +796,10 @@ public class PrintStream extends FilterOutputStream
/**
* Prints a String and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(String)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(String)} and then
* {@link #println()}.
*
* @param x The <code>String</code> to be printed.
* @param x The {@code String} to be printed.
*/
public void println(String x) {
synchronized (this) {
@ -812,10 +812,10 @@ public class PrintStream extends FilterOutputStream
* Prints an Object and then terminate the line. This method calls
* at first String.valueOf(x) to get the printed object's string value,
* then behaves as
* though it invokes <code>{@link #print(String)}</code> and then
* <code>{@link #println()}</code>.
* though it invokes {@link #print(String)} and then
* {@link #println()}.
*
* @param x The <code>Object</code> to be printed.
* @param x The {@code Object} to be printed.
*/
public void println(Object x) {
String s = String.valueOf(x);
@ -830,11 +830,13 @@ public class PrintStream extends FilterOutputStream
* A convenience method to write a formatted string to this output stream
* using the specified format string and arguments.
*
* <p> An invocation of this method of the form <tt>out.printf(format,
* args)</tt> behaves in exactly the same way as the invocation
* <p> An invocation of this method of the form
* {@code out.printf(format, args)} behaves
* in exactly the same way as the invocation
*
* <pre>
* out.format(format, args) </pre>
* <pre>{@code
* out.format(format, args)
* }</pre>
*
* @param format
* A format string as described in <a
@ -848,7 +850,7 @@ public class PrintStream extends FilterOutputStream
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws java.util.IllegalFormatException
@ -861,7 +863,7 @@ public class PrintStream extends FilterOutputStream
* formatter class specification.
*
* @throws NullPointerException
* If the <tt>format</tt> is <tt>null</tt>
* If the {@code format} is {@code null}
*
* @return This output stream
*
@ -875,15 +877,17 @@ public class PrintStream extends FilterOutputStream
* A convenience method to write a formatted string to this output stream
* using the specified format string and arguments.
*
* <p> An invocation of this method of the form <tt>out.printf(l, format,
* args)</tt> behaves in exactly the same way as the invocation
* <p> An invocation of this method of the form
* {@code out.printf(l, format, args)} behaves
* in exactly the same way as the invocation
*
* <pre>
* out.format(l, format, args) </pre>
* <pre>{@code
* out.format(l, format, args)
* }</pre>
*
* @param l
* The {@linkplain java.util.Locale locale} to apply during
* formatting. If <tt>l</tt> is <tt>null</tt> then no localization
* formatting. If {@code l} is {@code null} then no localization
* is applied.
*
* @param format
@ -898,7 +902,7 @@ public class PrintStream extends FilterOutputStream
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws java.util.IllegalFormatException
@ -911,7 +915,7 @@ public class PrintStream extends FilterOutputStream
* formatter class specification.
*
* @throws NullPointerException
* If the <tt>format</tt> is <tt>null</tt>
* If the {@code format} is {@code null}
*
* @return This output stream
*
@ -941,7 +945,7 @@ public class PrintStream extends FilterOutputStream
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws java.util.IllegalFormatException
@ -954,7 +958,7 @@ public class PrintStream extends FilterOutputStream
* formatter class specification.
*
* @throws NullPointerException
* If the <tt>format</tt> is <tt>null</tt>
* If the {@code format} is {@code null}
*
* @return This output stream
*
@ -983,7 +987,7 @@ public class PrintStream extends FilterOutputStream
*
* @param l
* The {@linkplain java.util.Locale locale} to apply during
* formatting. If <tt>l</tt> is <tt>null</tt> then no localization
* formatting. If {@code l} is {@code null} then no localization
* is applied.
*
* @param format
@ -998,7 +1002,7 @@ public class PrintStream extends FilterOutputStream
* limited by the maximum dimension of a Java array as defined by
* <cite>The Java&trade; Virtual Machine Specification</cite>.
* The behaviour on a
* <tt>null</tt> argument depends on the <a
* {@code null} argument depends on the <a
* href="../util/Formatter.html#syntax">conversion</a>.
*
* @throws java.util.IllegalFormatException
@ -1011,7 +1015,7 @@ public class PrintStream extends FilterOutputStream
* formatter class specification.
*
* @throws NullPointerException
* If the <tt>format</tt> is <tt>null</tt>
* If the {@code format} is {@code null}
*
* @return This output stream
*
@ -1037,21 +1041,22 @@ public class PrintStream extends FilterOutputStream
/**
* Appends the specified character sequence to this output stream.
*
* <p> An invocation of this method of the form <tt>out.append(csq)</tt>
* <p> An invocation of this method of the form {@code out.append(csq)}
* behaves in exactly the same way as the invocation
*
* <pre>
* out.print(csq.toString()) </pre>
* <pre>{@code
* out.print(csq.toString())
* }</pre>
*
* <p> Depending on the specification of <tt>toString</tt> for the
* character sequence <tt>csq</tt>, the entire sequence may not be
* appended. For instance, invoking then <tt>toString</tt> method of a
* <p> Depending on the specification of {@code toString} for the
* character sequence {@code csq}, the entire sequence may not be
* appended. For instance, invoking then {@code toString} method of a
* character buffer will return a subsequence whose content depends upon
* the buffer's position and limit.
*
* @param csq
* The character sequence to append. If <tt>csq</tt> is
* <tt>null</tt>, then the four characters <tt>"null"</tt> are
* The character sequence to append. If {@code csq} is
* {@code null}, then the four characters {@code "null"} are
* appended to this output stream.
*
* @return This output stream
@ -1070,18 +1075,20 @@ public class PrintStream extends FilterOutputStream
* Appends a subsequence of the specified character sequence to this output
* stream.
*
* <p> An invocation of this method of the form <tt>out.append(csq, start,
* end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in
* <p> An invocation of this method of the form
* {@code out.append(csq, start, end)} when
* {@code csq} is not {@code null}, behaves in
* exactly the same way as the invocation
*
* <pre>
* out.print(csq.subSequence(start, end).toString()) </pre>
* <pre>{@code
* out.print(csq.subSequence(start, end).toString())
* }</pre>
*
* @param csq
* The character sequence from which a subsequence will be
* appended. If <tt>csq</tt> is <tt>null</tt>, then characters
* will be appended as if <tt>csq</tt> contained the four
* characters <tt>"null"</tt>.
* appended. If {@code csq} is {@code null}, then characters
* will be appended as if {@code csq} contained the four
* characters {@code "null"}.
*
* @param start
* The index of the first character in the subsequence
@ -1093,9 +1100,9 @@ public class PrintStream extends FilterOutputStream
* @return This output stream
*
* @throws IndexOutOfBoundsException
* If <tt>start</tt> or <tt>end</tt> are negative, <tt>start</tt>
* is greater than <tt>end</tt>, or <tt>end</tt> is greater than
* <tt>csq.length()</tt>
* If {@code start} or {@code end} are negative, {@code start}
* is greater than {@code end}, or {@code end} is greater than
* {@code csq.length()}
*
* @since 1.5
*/
@ -1108,11 +1115,12 @@ public class PrintStream extends FilterOutputStream
/**
* Appends the specified character to this output stream.
*
* <p> An invocation of this method of the form <tt>out.append(c)</tt>
* <p> An invocation of this method of the form {@code out.append(c)}
* behaves in exactly the same way as the invocation
*
* <pre>
* out.print(c) </pre>
* <pre>{@code
* out.print(c)
* }</pre>
*
* @param c
* The 16-bit character to append

Some files were not shown because too many files have changed in this diff Show More