Thu, 31 Oct 2013 14:54:14 -0700
Merge
1.1 --- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Wed Oct 30 16:31:33 2013 -0700 1.2 +++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Thu Oct 31 14:54:14 2013 -0700 1.3 @@ -365,7 +365,7 @@ 1.4 return entry; 1.5 } 1.6 1.7 -address CppInterpreter::return_entry(TosState state, int length) { 1.8 +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { 1.9 // make it look good in the debugger 1.10 return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; 1.11 }
2.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Wed Oct 30 16:31:33 2013 -0700 2.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Oct 31 14:54:14 2013 -0700 2.3 @@ -153,13 +153,9 @@ 2.4 } 2.5 2.6 2.7 -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 2.8 - TosState incoming_state = state; 2.9 +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { 2.10 + address entry = __ pc(); 2.11 2.12 - Label cont; 2.13 - address compiled_entry = __ pc(); 2.14 - 2.15 - address entry = __ pc(); 2.16 #if !defined(_LP64) && defined(COMPILER2) 2.17 // All return values are where we want them, except for Longs. C2 returns 2.18 // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. 2.19 @@ -170,14 +166,12 @@ 2.20 // do this here. Unfortunately if we did a rethrow we'd see an machepilog node 2.21 // first which would move g1 -> O0/O1 and destroy the exception we were throwing. 2.22 2.23 - if (incoming_state == ltos) { 2.24 + if (state == ltos) { 2.25 __ srl (G1, 0, O1); 2.26 __ srlx(G1, 32, O0); 2.27 } 2.28 #endif // !_LP64 && COMPILER2 2.29 2.30 - __ bind(cont); 2.31 - 2.32 // The callee returns with the stack possibly adjusted by adapter transition 2.33 // We remove that possible adjustment here. 2.34 // All interpreter local registers are untouched. Any result is passed back 2.35 @@ -186,29 +180,18 @@ 2.36 2.37 __ mov(Llast_SP, SP); // Remove any adapter added stack space. 2.38 2.39 - Label L_got_cache, L_giant_index; 2.40 const Register cache = G3_scratch; 2.41 - const Register size = G1_scratch; 2.42 - if (EnableInvokeDynamic) { 2.43 - __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. 2.44 - __ cmp_and_br_short(G1_scratch, Bytecodes::_invokedynamic, Assembler::equal, Assembler::pn, L_giant_index); 2.45 - } 2.46 - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); 2.47 - __ bind(L_got_cache); 2.48 - __ ld_ptr(cache, ConstantPoolCache::base_offset() + 2.49 - ConstantPoolCacheEntry::flags_offset(), size); 2.50 - __ and3(size, 0xFF, size); // argument size in words 2.51 - __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes 2.52 - __ add(Lesp, size, Lesp); // pop arguments 2.53 + const Register index = G1_scratch; 2.54 + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); 2.55 + 2.56 + const Register flags = cache; 2.57 + __ ld_ptr(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset(), flags); 2.58 + const Register parameter_size = flags; 2.59 + __ and3(flags, ConstantPoolCacheEntry::parameter_size_mask, parameter_size); // argument size in words 2.60 + __ sll(parameter_size, Interpreter::logStackElementSize, parameter_size); // each argument size in bytes 2.61 + __ add(Lesp, parameter_size, Lesp); // pop arguments 2.62 __ dispatch_next(state, step); 2.63 2.64 - // out of the main line of code... 2.65 - if (EnableInvokeDynamic) { 2.66 - __ bind(L_giant_index); 2.67 - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4)); 2.68 - __ ba_short(L_got_cache); 2.69 - } 2.70 - 2.71 return entry; 2.72 } 2.73
3.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp Wed Oct 30 16:31:33 2013 -0700 3.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Oct 31 14:54:14 2013 -0700 3.3 @@ -2932,9 +2932,7 @@ 3.4 ConstantPoolCacheEntry::verify_tos_state_shift(); 3.5 // load return address 3.6 { 3.7 - const address table_addr = (is_invokeinterface || is_invokedynamic) ? 3.8 - (address)Interpreter::return_5_addrs_by_index_table() : 3.9 - (address)Interpreter::return_3_addrs_by_index_table(); 3.10 + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); 3.11 AddressLiteral table(table_addr); 3.12 __ set(table, temp); 3.13 __ sll(ra, LogBytesPerWord, ra); 3.14 @@ -2984,7 +2982,7 @@ 3.15 __ verify_oop(O0_recv); 3.16 3.17 // get return address 3.18 - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); 3.19 + AddressLiteral table(Interpreter::invoke_return_entry_table()); 3.20 __ set(table, Rtemp); 3.21 __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type 3.22 // Make sure we don't need to mask Rret after the above shift 3.23 @@ -3026,7 +3024,7 @@ 3.24 __ profile_final_call(O4); 3.25 3.26 // get return address 3.27 - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); 3.28 + AddressLiteral table(Interpreter::invoke_return_entry_table()); 3.29 __ set(table, Rtemp); 3.30 __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type 3.31 // Make sure we don't need to mask Rret after the above shift
4.1 --- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Wed Oct 30 16:31:33 2013 -0700 4.2 +++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Thu Oct 31 14:54:14 2013 -0700 4.3 @@ -1468,19 +1468,18 @@ 4.4 addr = new LIR_Address(src.result(), offset, type); 4.5 } 4.6 4.7 - if (data != dst) { 4.8 - __ move(data, dst); 4.9 - data = dst; 4.10 - } 4.11 + // Because we want a 2-arg form of xchg and xadd 4.12 + __ move(data, dst); 4.13 + 4.14 if (x->is_add()) { 4.15 - __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); 4.16 + __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); 4.17 } else { 4.18 if (is_obj) { 4.19 // Do the pre-write barrier, if any. 4.20 pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, 4.21 true /* do_load */, false /* patch */, NULL); 4.22 } 4.23 - __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); 4.24 + __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); 4.25 if (is_obj) { 4.26 // Seems to be a precise address 4.27 post_barrier(LIR_OprFact::address(addr), data);
5.1 --- a/src/cpu/x86/vm/cppInterpreter_x86.cpp Wed Oct 30 16:31:33 2013 -0700 5.2 +++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp Thu Oct 31 14:54:14 2013 -0700 5.3 @@ -367,7 +367,7 @@ 5.4 return entry; 5.5 } 5.6 5.7 -address CppInterpreter::return_entry(TosState state, int length) { 5.8 +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { 5.9 // make it look good in the debugger 5.10 return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); 5.11 }
6.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Wed Oct 30 16:31:33 2013 -0700 6.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Thu Oct 31 14:54:14 2013 -0700 6.3 @@ -150,13 +150,12 @@ 6.4 } 6.5 6.6 6.7 -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 6.8 - TosState incoming_state = state; 6.9 +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { 6.10 address entry = __ pc(); 6.11 6.12 #ifdef COMPILER2 6.13 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases 6.14 - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { 6.15 + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { 6.16 for (int i = 1; i < 8; i++) { 6.17 __ ffree(i); 6.18 } 6.19 @@ -164,7 +163,7 @@ 6.20 __ empty_FPU_stack(); 6.21 } 6.22 #endif 6.23 - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { 6.24 + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { 6.25 __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled"); 6.26 } else { 6.27 __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); 6.28 @@ -172,12 +171,12 @@ 6.29 6.30 // In SSE mode, interpreter returns FP results in xmm0 but they need 6.31 // to end up back on the FPU so it can operate on them. 6.32 - if (incoming_state == ftos && UseSSE >= 1) { 6.33 + if (state == ftos && UseSSE >= 1) { 6.34 __ subptr(rsp, wordSize); 6.35 __ movflt(Address(rsp, 0), xmm0); 6.36 __ fld_s(Address(rsp, 0)); 6.37 __ addptr(rsp, wordSize); 6.38 - } else if (incoming_state == dtos && UseSSE >= 2) { 6.39 + } else if (state == dtos && UseSSE >= 2) { 6.40 __ subptr(rsp, 2*wordSize); 6.41 __ movdbl(Address(rsp, 0), xmm0); 6.42 __ fld_d(Address(rsp, 0)); 6.43 @@ -194,33 +193,22 @@ 6.44 __ restore_bcp(); 6.45 __ restore_locals(); 6.46 6.47 - if (incoming_state == atos) { 6.48 + if (state == atos) { 6.49 Register mdp = rbx; 6.50 Register tmp = rcx; 6.51 __ profile_return_type(mdp, rax, tmp); 6.52 } 6.53 6.54 - Label L_got_cache, L_giant_index; 6.55 - if (EnableInvokeDynamic) { 6.56 - __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); 6.57 - __ jcc(Assembler::equal, L_giant_index); 6.58 - } 6.59 - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); 6.60 - __ bind(L_got_cache); 6.61 - __ movl(rbx, Address(rbx, rcx, 6.62 - Address::times_ptr, ConstantPoolCache::base_offset() + 6.63 - ConstantPoolCacheEntry::flags_offset())); 6.64 - __ andptr(rbx, 0xFF); 6.65 - __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); 6.66 + const Register cache = rbx; 6.67 + const Register index = rcx; 6.68 + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); 6.69 + 6.70 + const Register flags = cache; 6.71 + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); 6.72 + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); 6.73 + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); 6.74 __ dispatch_next(state, step); 6.75 6.76 - // out of the main line of code... 6.77 - if (EnableInvokeDynamic) { 6.78 - __ bind(L_giant_index); 6.79 - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); 6.80 - __ jmp(L_got_cache); 6.81 - } 6.82 - 6.83 return entry; 6.84 } 6.85
7.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Wed Oct 30 16:31:33 2013 -0700 7.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Thu Oct 31 14:54:14 2013 -0700 7.3 @@ -166,7 +166,7 @@ 7.4 } 7.5 7.6 7.7 -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 7.8 +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { 7.9 address entry = __ pc(); 7.10 7.11 // Restore stack bottom in case i2c adjusted stack 7.12 @@ -183,28 +183,16 @@ 7.13 __ profile_return_type(mdp, rax, tmp); 7.14 } 7.15 7.16 - Label L_got_cache, L_giant_index; 7.17 - if (EnableInvokeDynamic) { 7.18 - __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); 7.19 - __ jcc(Assembler::equal, L_giant_index); 7.20 - } 7.21 - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); 7.22 - __ bind(L_got_cache); 7.23 - __ movl(rbx, Address(rbx, rcx, 7.24 - Address::times_ptr, 7.25 - in_bytes(ConstantPoolCache::base_offset()) + 7.26 - 3 * wordSize)); 7.27 - __ andl(rbx, 0xFF); 7.28 - __ lea(rsp, Address(rsp, rbx, Address::times_8)); 7.29 + const Register cache = rbx; 7.30 + const Register index = rcx; 7.31 + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); 7.32 + 7.33 + const Register flags = cache; 7.34 + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); 7.35 + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); 7.36 + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); 7.37 __ dispatch_next(state, step); 7.38 7.39 - // out of the main line of code... 7.40 - if (EnableInvokeDynamic) { 7.41 - __ bind(L_giant_index); 7.42 - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); 7.43 - __ jmp(L_got_cache); 7.44 - } 7.45 - 7.46 return entry; 7.47 } 7.48
8.1 --- a/src/cpu/x86/vm/templateTable_x86_32.cpp Wed Oct 30 16:31:33 2013 -0700 8.2 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp Thu Oct 31 14:54:14 2013 -0700 8.3 @@ -2925,9 +2925,7 @@ 8.4 ConstantPoolCacheEntry::verify_tos_state_shift(); 8.5 // load return address 8.6 { 8.7 - const address table_addr = (is_invokeinterface || is_invokedynamic) ? 8.8 - (address)Interpreter::return_5_addrs_by_index_table() : 8.9 - (address)Interpreter::return_3_addrs_by_index_table(); 8.10 + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); 8.11 ExternalAddress table(table_addr); 8.12 __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr))); 8.13 }
9.1 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Oct 30 16:31:33 2013 -0700 9.2 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp Thu Oct 31 14:54:14 2013 -0700 9.3 @@ -2980,9 +2980,7 @@ 9.4 ConstantPoolCacheEntry::verify_tos_state_shift(); 9.5 // load return address 9.6 { 9.7 - const address table_addr = (is_invokeinterface || is_invokedynamic) ? 9.8 - (address)Interpreter::return_5_addrs_by_index_table() : 9.9 - (address)Interpreter::return_3_addrs_by_index_table(); 9.10 + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); 9.11 ExternalAddress table(table_addr); 9.12 __ lea(rscratch1, table); 9.13 __ movptr(flags, Address(rscratch1, flags, Address::times_ptr));
10.1 --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Oct 30 16:31:33 2013 -0700 10.2 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Oct 31 14:54:14 2013 -0700 10.3 @@ -1006,7 +1006,7 @@ 10.4 istate->set_stack_limit(stack_base - method->max_stack() - 1); 10.5 } 10.6 10.7 -address CppInterpreter::return_entry(TosState state, int length) { 10.8 +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { 10.9 ShouldNotCallThis(); 10.10 return NULL; 10.11 }
11.1 --- a/src/cpu/zero/vm/globals_zero.hpp Wed Oct 30 16:31:33 2013 -0700 11.2 +++ b/src/cpu/zero/vm/globals_zero.hpp Thu Oct 31 14:54:14 2013 -0700 11.3 @@ -57,6 +57,8 @@ 11.4 // GC Ergo Flags 11.5 define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread 11.6 11.7 +define_pd_global(uintx, TypeProfileLevel, 0); 11.8 + 11.9 #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) 11.10 11.11 #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP
12.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Wed Oct 30 16:31:33 2013 -0700 12.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Thu Oct 31 14:54:14 2013 -0700 12.3 @@ -1873,7 +1873,7 @@ 12.4 // number of implementors for decl_interface is 0 or 1. If 12.5 // it's 0 then no class implements decl_interface and there's 12.6 // no point in inlining. 12.7 - if (!holder->is_loaded() || decl_interface->nof_implementors() != 1) { 12.8 + if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_default_methods()) { 12.9 singleton = NULL; 12.10 } 12.11 }
13.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp Wed Oct 30 16:31:33 2013 -0700 13.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp Thu Oct 31 14:54:14 2013 -0700 13.3 @@ -57,6 +57,7 @@ 13.4 _init_state = ik->init_state(); 13.5 _nonstatic_field_size = ik->nonstatic_field_size(); 13.6 _has_nonstatic_fields = ik->has_nonstatic_fields(); 13.7 + _has_default_methods = ik->has_default_methods(); 13.8 _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: 13.9 13.10 _implementor = NULL; // we will fill these lazily
14.1 --- a/src/share/vm/ci/ciInstanceKlass.hpp Wed Oct 30 16:31:33 2013 -0700 14.2 +++ b/src/share/vm/ci/ciInstanceKlass.hpp Thu Oct 31 14:54:14 2013 -0700 14.3 @@ -52,6 +52,7 @@ 14.4 bool _has_finalizer; 14.5 bool _has_subklass; 14.6 bool _has_nonstatic_fields; 14.7 + bool _has_default_methods; 14.8 14.9 ciFlags _flags; 14.10 jint _nonstatic_field_size; 14.11 @@ -171,6 +172,11 @@ 14.12 } 14.13 } 14.14 14.15 + bool has_default_methods() { 14.16 + assert(is_loaded(), "must be loaded"); 14.17 + return _has_default_methods; 14.18 + } 14.19 + 14.20 ciInstanceKlass* get_canonical_holder(int offset); 14.21 ciField* get_field_by_offset(int field_offset, bool is_static); 14.22 ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
15.1 --- a/src/share/vm/compiler/compileBroker.cpp Wed Oct 30 16:31:33 2013 -0700 15.2 +++ b/src/share/vm/compiler/compileBroker.cpp Thu Oct 31 14:54:14 2013 -0700 15.3 @@ -780,6 +780,10 @@ 15.4 void CompileBroker::compilation_init() { 15.5 _last_method_compiled[0] = '\0'; 15.6 15.7 + // No need to initialize compilation system if we do not use it. 15.8 + if (!UseCompiler) { 15.9 + return; 15.10 + } 15.11 #ifndef SHARK 15.12 // Set the interface to the current compiler(s). 15.13 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
16.1 --- a/src/share/vm/interpreter/abstractInterpreter.hpp Wed Oct 30 16:31:33 2013 -0700 16.2 +++ b/src/share/vm/interpreter/abstractInterpreter.hpp Thu Oct 31 14:54:14 2013 -0700 16.3 @@ -158,8 +158,8 @@ 16.4 // Runtime support 16.5 16.6 // length = invoke bytecode length (to advance to next bytecode) 16.7 - static address deopt_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } 16.8 - static address return_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } 16.9 + static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } 16.10 + static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } 16.11 16.12 static address rethrow_exception_entry() { return _rethrow_exception_entry; } 16.13
17.1 --- a/src/share/vm/interpreter/cppInterpreter.hpp Wed Oct 30 16:31:33 2013 -0700 17.2 +++ b/src/share/vm/interpreter/cppInterpreter.hpp Thu Oct 31 14:54:14 2013 -0700 17.3 @@ -78,7 +78,7 @@ 17.4 static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } 17.5 static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } 17.6 17.7 - static address return_entry (TosState state, int length); 17.8 + static address return_entry (TosState state, int length, Bytecodes::Code code); 17.9 static address deopt_entry (TosState state, int length); 17.10 17.11 #ifdef TARGET_ARCH_x86
18.1 --- a/src/share/vm/interpreter/interpreter.cpp Wed Oct 30 16:31:33 2013 -0700 18.2 +++ b/src/share/vm/interpreter/interpreter.cpp Thu Oct 31 14:54:14 2013 -0700 18.3 @@ -329,15 +329,21 @@ 18.4 //------------------------------------------------------------------------------------------------------------------------ 18.5 // Deoptimization support 18.6 18.7 -// If deoptimization happens, this function returns the point of next bytecode to continue execution 18.8 +/** 18.9 + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. 18.10 + */ 18.11 address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { 18.12 assert(method->contains(bcp), "just checkin'"); 18.13 - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); 18.14 + 18.15 + // Get the original and rewritten bytecode. 18.16 + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); 18.17 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); 18.18 - int bci = method->bci_from(bcp); 18.19 - int length = -1; // initial value for debugging 18.20 + 18.21 + const int bci = method->bci_from(bcp); 18.22 + 18.23 // compute continuation length 18.24 - length = Bytecodes::length_at(method, bcp); 18.25 + const int length = Bytecodes::length_at(method, bcp); 18.26 + 18.27 // compute result type 18.28 BasicType type = T_ILLEGAL; 18.29 18.30 @@ -393,7 +399,7 @@ 18.31 return 18.32 is_top_frame 18.33 ? Interpreter::deopt_entry (as_TosState(type), length) 18.34 - : Interpreter::return_entry(as_TosState(type), length); 18.35 + : Interpreter::return_entry(as_TosState(type), length, code); 18.36 } 18.37 18.38 // If deoptimization happens, this function returns the point where the interpreter reexecutes
19.1 --- a/src/share/vm/interpreter/templateInterpreter.cpp Wed Oct 30 16:31:33 2013 -0700 19.2 +++ b/src/share/vm/interpreter/templateInterpreter.cpp Thu Oct 31 14:54:14 2013 -0700 19.3 @@ -184,8 +184,9 @@ 19.4 EntryPoint TemplateInterpreter::_continuation_entry; 19.5 EntryPoint TemplateInterpreter::_safept_entry; 19.6 19.7 -address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; 19.8 -address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; 19.9 +address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; 19.10 +address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; 19.11 +address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; 19.12 19.13 DispatchTable TemplateInterpreter::_active_table; 19.14 DispatchTable TemplateInterpreter::_normal_table; 19.15 @@ -237,22 +238,37 @@ 19.16 #endif // !PRODUCT 19.17 19.18 { CodeletMark cm(_masm, "return entry points"); 19.19 + const int index_size = sizeof(u2); 19.20 for (int i = 0; i < Interpreter::number_of_return_entries; i++) { 19.21 Interpreter::_return_entry[i] = 19.22 EntryPoint( 19.23 - generate_return_entry_for(itos, i), 19.24 - generate_return_entry_for(itos, i), 19.25 - generate_return_entry_for(itos, i), 19.26 - generate_return_entry_for(atos, i), 19.27 - generate_return_entry_for(itos, i), 19.28 - generate_return_entry_for(ltos, i), 19.29 - generate_return_entry_for(ftos, i), 19.30 - generate_return_entry_for(dtos, i), 19.31 - generate_return_entry_for(vtos, i) 19.32 + generate_return_entry_for(itos, i, index_size), 19.33 + generate_return_entry_for(itos, i, index_size), 19.34 + generate_return_entry_for(itos, i, index_size), 19.35 + generate_return_entry_for(atos, i, index_size), 19.36 + generate_return_entry_for(itos, i, index_size), 19.37 + generate_return_entry_for(ltos, i, index_size), 19.38 + generate_return_entry_for(ftos, i, index_size), 19.39 + generate_return_entry_for(dtos, i, index_size), 19.40 + generate_return_entry_for(vtos, i, index_size) 19.41 ); 19.42 } 19.43 } 19.44 19.45 + { CodeletMark cm(_masm, "invoke return entry points"); 19.46 + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; 19.47 + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); 19.48 + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); 19.49 + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); 19.50 + 19.51 + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { 19.52 + TosState state = states[i]; 19.53 + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); 19.54 + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); 19.55 + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); 19.56 + } 19.57 + } 19.58 + 19.59 { CodeletMark cm(_masm, "earlyret entry points"); 19.60 Interpreter::_earlyret_entry = 19.61 EntryPoint( 19.62 @@ -298,13 +314,6 @@ 19.63 } 19.64 } 19.65 19.66 - for (int j = 0; j < number_of_states; j++) { 19.67 - const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; 19.68 - int index = Interpreter::TosState_as_index(states[j]); 19.69 - Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); 19.70 - Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); 19.71 - } 19.72 - 19.73 { CodeletMark cm(_masm, "continuation entry points"); 19.74 Interpreter::_continuation_entry = 19.75 EntryPoint( 19.76 @@ -534,9 +543,46 @@ 19.77 //------------------------------------------------------------------------------------------------------------------------ 19.78 // Entry points 19.79 19.80 -address TemplateInterpreter::return_entry(TosState state, int length) { 19.81 +/** 19.82 + * Returns the return entry table for the given invoke bytecode. 19.83 + */ 19.84 +address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { 19.85 + switch (code) { 19.86 + case Bytecodes::_invokestatic: 19.87 + case Bytecodes::_invokespecial: 19.88 + case Bytecodes::_invokevirtual: 19.89 + case Bytecodes::_invokehandle: 19.90 + return Interpreter::invoke_return_entry_table(); 19.91 + case Bytecodes::_invokeinterface: 19.92 + return Interpreter::invokeinterface_return_entry_table(); 19.93 + case Bytecodes::_invokedynamic: 19.94 + return Interpreter::invokedynamic_return_entry_table(); 19.95 + default: 19.96 + fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code))); 19.97 + return NULL; 19.98 + } 19.99 +} 19.100 + 19.101 +/** 19.102 + * Returns the return entry address for the given top-of-stack state and bytecode. 19.103 + */ 19.104 +address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { 19.105 guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); 19.106 - return _return_entry[length].entry(state); 19.107 + const int index = TosState_as_index(state); 19.108 + switch (code) { 19.109 + case Bytecodes::_invokestatic: 19.110 + case Bytecodes::_invokespecial: 19.111 + case Bytecodes::_invokevirtual: 19.112 + case Bytecodes::_invokehandle: 19.113 + return _invoke_return_entry[index]; 19.114 + case Bytecodes::_invokeinterface: 19.115 + return _invokeinterface_return_entry[index]; 19.116 + case Bytecodes::_invokedynamic: 19.117 + return _invokedynamic_return_entry[index]; 19.118 + default: 19.119 + assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code))); 19.120 + return _return_entry[length].entry(state); 19.121 + } 19.122 } 19.123 19.124
20.1 --- a/src/share/vm/interpreter/templateInterpreter.hpp Wed Oct 30 16:31:33 2013 -0700 20.2 +++ b/src/share/vm/interpreter/templateInterpreter.hpp Thu Oct 31 14:54:14 2013 -0700 20.3 @@ -120,8 +120,9 @@ 20.4 static EntryPoint _continuation_entry; 20.5 static EntryPoint _safept_entry; 20.6 20.7 - static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries 20.8 - static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries 20.9 + static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries 20.10 + static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries 20.11 + static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries 20.12 20.13 static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) 20.14 static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) 20.15 @@ -161,12 +162,15 @@ 20.16 static address* normal_table() { return _normal_table.table_for(); } 20.17 20.18 // Support for invokes 20.19 - static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } 20.20 - static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } 20.21 - static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table 20.22 + static address* invoke_return_entry_table() { return _invoke_return_entry; } 20.23 + static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } 20.24 + static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } 20.25 + static int TosState_as_index(TosState state); 20.26 20.27 - static address return_entry (TosState state, int length); 20.28 - static address deopt_entry (TosState state, int length); 20.29 + static address* invoke_return_entry_table_for(Bytecodes::Code code); 20.30 + 20.31 + static address deopt_entry(TosState state, int length); 20.32 + static address return_entry(TosState state, int length, Bytecodes::Code code); 20.33 20.34 // Safepoint support 20.35 static void notice_safepoints(); // stops the thread when reaching a safepoint
21.1 --- a/src/share/vm/interpreter/templateInterpreterGenerator.hpp Wed Oct 30 16:31:33 2013 -0700 21.2 +++ b/src/share/vm/interpreter/templateInterpreterGenerator.hpp Thu Oct 31 14:54:14 2013 -0700 21.3 @@ -53,7 +53,7 @@ 21.4 address generate_ClassCastException_handler(); 21.5 address generate_ArrayIndexOutOfBounds_handler(const char* name); 21.6 address generate_continuation_for(TosState state); 21.7 - address generate_return_entry_for(TosState state, int step); 21.8 + address generate_return_entry_for(TosState state, int step, size_t index_size); 21.9 address generate_earlyret_entry_for(TosState state); 21.10 address generate_deopt_entry_for(TosState state, int step); 21.11 address generate_safept_entry_for(TosState state, address runtime_entry);
22.1 --- a/src/share/vm/oops/method.cpp Wed Oct 30 16:31:33 2013 -0700 22.2 +++ b/src/share/vm/oops/method.cpp Thu Oct 31 14:54:14 2013 -0700 22.3 @@ -1515,7 +1515,10 @@ 22.4 return bp->orig_bytecode(); 22.5 } 22.6 } 22.7 - ShouldNotReachHere(); 22.8 + { 22.9 + ResourceMark rm; 22.10 + fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci)); 22.11 + } 22.12 return Bytecodes::_shouldnotreachhere; 22.13 } 22.14
23.1 --- a/src/share/vm/opto/library_call.cpp Wed Oct 30 16:31:33 2013 -0700 23.2 +++ b/src/share/vm/opto/library_call.cpp Thu Oct 31 14:54:14 2013 -0700 23.3 @@ -2006,9 +2006,9 @@ 23.4 Node* arg2 = NULL; 23.5 23.6 if (is_increment) { 23.7 - arg2 = intcon(1); 23.8 + arg2 = intcon(1); 23.9 } else { 23.10 - arg2 = argument(1); 23.11 + arg2 = argument(1); 23.12 } 23.13 23.14 Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) ); 23.15 @@ -2056,7 +2056,7 @@ 23.16 if (is_decrement) { 23.17 arg2 = longcon(1); 23.18 } else { 23.19 - Node* arg2 = argument(2); // type long 23.20 + arg2 = argument(2); // type long 23.21 // argument(3) == TOP 23.22 } 23.23
24.1 --- a/src/share/vm/opto/loopTransform.cpp Wed Oct 30 16:31:33 2013 -0700 24.2 +++ b/src/share/vm/opto/loopTransform.cpp Thu Oct 31 14:54:14 2013 -0700 24.3 @@ -713,6 +713,10 @@ 24.4 case Op_ModL: body_size += 30; break; 24.5 case Op_DivL: body_size += 30; break; 24.6 case Op_MulL: body_size += 10; break; 24.7 + case Op_FlagsProj: 24.8 + // Can't handle unrolling of loops containing 24.9 + // nodes that generate a FlagsProj at the moment 24.10 + return false; 24.11 case Op_StrComp: 24.12 case Op_StrEquals: 24.13 case Op_StrIndexOf:
25.1 --- a/src/share/vm/opto/postaloc.cpp Wed Oct 30 16:31:33 2013 -0700 25.2 +++ b/src/share/vm/opto/postaloc.cpp Thu Oct 31 14:54:14 2013 -0700 25.3 @@ -97,7 +97,8 @@ 25.4 static bool expected_yanked_node(Node *old, Node *orig_old) { 25.5 // This code is expected only next original nodes: 25.6 // - load from constant table node which may have next data input nodes: 25.7 - // MachConstantBase, Phi, MachTemp, MachSpillCopy 25.8 + // MachConstantBase, MachTemp, MachSpillCopy 25.9 + // - Phi nodes that are considered Junk 25.10 // - load constant node which may have next data input nodes: 25.11 // MachTemp, MachSpillCopy 25.12 // - MachSpillCopy 25.13 @@ -112,7 +113,9 @@ 25.14 return (old == orig_old); 25.15 } else if (old->is_MachTemp()) { 25.16 return orig_old->is_Con(); 25.17 - } else if (old->is_Phi() || old->is_MachConstantBase()) { 25.18 + } else if (old->is_Phi()) { // Junk phi's 25.19 + return true; 25.20 + } else if (old->is_MachConstantBase()) { 25.21 return (orig_old->is_Con() && orig_old->is_MachConstant()); 25.22 } 25.23 return false; 25.24 @@ -522,11 +525,9 @@ 25.25 u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input 25.26 } 25.27 if (u != NodeSentinel) { // Junk Phi. Remove 25.28 - block->remove_node(j--); 25.29 + phi->replace_by(u); 25.30 + j -= yank_if_dead(phi, block, &value, ®nd); 25.31 phi_dex--; 25.32 - _cfg.unmap_node_from_block(phi); 25.33 - phi->replace_by(u); 25.34 - phi->disconnect_inputs(NULL, C); 25.35 continue; 25.36 } 25.37 // Note that if value[pidx] exists, then we merged no new values here
26.1 --- a/src/share/vm/opto/type.cpp Wed Oct 30 16:31:33 2013 -0700 26.2 +++ b/src/share/vm/opto/type.cpp Thu Oct 31 14:54:14 2013 -0700 26.3 @@ -2787,13 +2787,11 @@ 26.4 26.5 //-----------------------------filter------------------------------------------ 26.6 // Do not allow interface-vs.-noninterface joins to collapse to top. 26.7 -const Type *TypeOopPtr::filter( const Type *kills ) const { 26.8 +const Type *TypeOopPtr::filter(const Type *kills) const { 26.9 26.10 const Type* ft = join(kills); 26.11 const TypeInstPtr* ftip = ft->isa_instptr(); 26.12 const TypeInstPtr* ktip = kills->isa_instptr(); 26.13 - const TypeKlassPtr* ftkp = ft->isa_klassptr(); 26.14 - const TypeKlassPtr* ktkp = kills->isa_klassptr(); 26.15 26.16 if (ft->empty()) { 26.17 // Check for evil case of 'this' being a class and 'kills' expecting an 26.18 @@ -2807,8 +2805,6 @@ 26.19 // uplift the type. 26.20 if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) 26.21 return kills; // Uplift to interface 26.22 - if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) 26.23 - return kills; // Uplift to interface 26.24 26.25 return Type::TOP; // Canonical empty value 26.26 } 26.27 @@ -2825,14 +2821,6 @@ 26.28 assert(!ftip->klass_is_exact(), "interface could not be exact"); 26.29 return ktip->cast_to_ptr_type(ftip->ptr()); 26.30 } 26.31 - // Interface klass type could be exact in opposite to interface type, 26.32 - // return it here instead of incorrect Constant ptr J/L/Object (6894807). 26.33 - if (ftkp != NULL && ktkp != NULL && 26.34 - ftkp->is_loaded() && ftkp->klass()->is_interface() && 26.35 - !ftkp->klass_is_exact() && // Keep exact interface klass 26.36 - ktkp->is_loaded() && !ktkp->klass()->is_interface()) { 26.37 - return ktkp->cast_to_ptr_type(ftkp->ptr()); 26.38 - } 26.39 26.40 return ft; 26.41 } 26.42 @@ -4385,6 +4373,33 @@ 26.43 return (_offset == 0) && !below_centerline(_ptr); 26.44 } 26.45 26.46 +// Do not allow interface-vs.-noninterface joins to collapse to top. 26.47 +const Type *TypeKlassPtr::filter(const Type *kills) const { 26.48 + // logic here mirrors the one from TypeOopPtr::filter. See comments 26.49 + // there. 26.50 + const Type* ft = join(kills); 26.51 + const TypeKlassPtr* ftkp = ft->isa_klassptr(); 26.52 + const TypeKlassPtr* ktkp = kills->isa_klassptr(); 26.53 + 26.54 + if (ft->empty()) { 26.55 + if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) 26.56 + return kills; // Uplift to interface 26.57 + 26.58 + return Type::TOP; // Canonical empty value 26.59 + } 26.60 + 26.61 + // Interface klass type could be exact in opposite to interface type, 26.62 + // return it here instead of incorrect Constant ptr J/L/Object (6894807). 26.63 + if (ftkp != NULL && ktkp != NULL && 26.64 + ftkp->is_loaded() && ftkp->klass()->is_interface() && 26.65 + !ftkp->klass_is_exact() && // Keep exact interface klass 26.66 + ktkp->is_loaded() && !ktkp->klass()->is_interface()) { 26.67 + return ktkp->cast_to_ptr_type(ftkp->ptr()); 26.68 + } 26.69 + 26.70 + return ft; 26.71 +} 26.72 + 26.73 //----------------------compute_klass------------------------------------------ 26.74 // Compute the defining klass for this class 26.75 ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
27.1 --- a/src/share/vm/opto/type.hpp Wed Oct 30 16:31:33 2013 -0700 27.2 +++ b/src/share/vm/opto/type.hpp Thu Oct 31 14:54:14 2013 -0700 27.3 @@ -63,7 +63,7 @@ 27.4 class TypeOopPtr; 27.5 class TypeInstPtr; 27.6 class TypeAryPtr; 27.7 -class TypeKlassPtr; 27.8 +class TypeKlassPtr; 27.9 class TypeMetadataPtr; 27.10 27.11 //------------------------------Type------------------------------------------- 27.12 @@ -1202,6 +1202,9 @@ 27.13 27.14 virtual intptr_t get_con() const; 27.15 27.16 + // Do not allow interface-vs.-noninterface joins to collapse to top. 27.17 + virtual const Type *filter( const Type *kills ) const; 27.18 + 27.19 // Convenience common pre-built types. 27.20 static const TypeKlassPtr* OBJECT; // Not-null object klass or below 27.21 static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
28.1 --- a/src/share/vm/runtime/handles.cpp Wed Oct 30 16:31:33 2013 -0700 28.2 +++ b/src/share/vm/runtime/handles.cpp Thu Oct 31 14:54:14 2013 -0700 28.3 @@ -45,7 +45,7 @@ 28.4 oop* HandleArea::allocate_handle(oop obj) { 28.5 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); 28.6 assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); 28.7 - assert(obj->is_oop(), "sanity check"); 28.8 + assert(obj->is_oop(), err_msg("not an oop: " INTPTR_FORMAT, (intptr_t*) obj)); 28.9 return real_allocate_handle(obj); 28.10 } 28.11
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29.2 +++ b/test/compiler/inlining/InlineDefaultMethod.java Thu Oct 31 14:54:14 2013 -0700 29.3 @@ -0,0 +1,64 @@ 29.4 +/* 29.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 29.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 29.7 + * 29.8 + * This code is free software; you can redistribute it and/or modify it 29.9 + * under the terms of the GNU General Public License version 2 only, as 29.10 + * published by the Free Software Foundation. 29.11 + * 29.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 29.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 29.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 29.15 + * version 2 for more details (a copy is included in the LICENSE file that 29.16 + * accompanied this code). 29.17 + * 29.18 + * You should have received a copy of the GNU General Public License version 29.19 + * 2 along with this work; if not, write to the Free Software Foundation, 29.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 29.21 + * 29.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 29.23 + * or visit www.oracle.com if you need additional information or have any 29.24 + * questions. 29.25 + */ 29.26 + 29.27 +/* 29.28 + * @test 29.29 + * @bug 8026735 29.30 + * @summary CHA in C1 should make correct decisions about default methods 29.31 + * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod 29.32 + */ 29.33 + 29.34 + 29.35 +interface InterfaceWithDefaultMethod0 { 29.36 + default public int defaultMethod() { 29.37 + return 1; 29.38 + } 29.39 +} 29.40 + 29.41 +interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } 29.42 + 29.43 +abstract class Subtype implements InterfaceWithDefaultMethod1 { } 29.44 + 29.45 +class Decoy extends Subtype { 29.46 + public int defaultMethod() { 29.47 + return 2; 29.48 + } 29.49 +} 29.50 + 29.51 +class Instance extends Subtype { } 29.52 + 29.53 +public class InlineDefaultMethod { 29.54 + public static int test(InterfaceWithDefaultMethod1 x) { 29.55 + return x.defaultMethod(); 29.56 + } 29.57 + public static void main(String[] args) { 29.58 + InterfaceWithDefaultMethod1 a = new Decoy(); 29.59 + InterfaceWithDefaultMethod1 b = new Instance(); 29.60 + if (test(a) != 2 || 29.61 + test(b) != 1) { 29.62 + System.err.println("FAILED"); 29.63 + System.exit(97); 29.64 + } 29.65 + System.err.println("PASSED"); 29.66 + } 29.67 +}
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 30.2 +++ b/test/compiler/intrinsics/mathexact/NestedMathExactTest.java Thu Oct 31 14:54:14 2013 -0700 30.3 @@ -0,0 +1,54 @@ 30.4 +/* 30.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 30.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 30.7 + * 30.8 + * This code is free software; you can redistribute it and/or modify it 30.9 + * under the terms of the GNU General Public License version 2 only, as 30.10 + * published by the Free Software Foundation. 30.11 + * 30.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 30.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 30.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 30.15 + * version 2 for more details (a copy is included in the LICENSE file that 30.16 + * accompanied this code). 30.17 + * 30.18 + * You should have received a copy of the GNU General Public License version 30.19 + * 2 along with this work; if not, write to the Free Software Foundation, 30.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 30.21 + * 30.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 30.23 + * or visit www.oracle.com if you need additional information or have any 30.24 + * questions. 30.25 + */ 30.26 + 30.27 +/* 30.28 + * @test 30.29 + * @bug 8027444 30.30 + * @summary Test nested loops 30.31 + * @compile NestedMathExactTest.java 30.32 + * @run main NestedMathExactTest 30.33 + * 30.34 + */ 30.35 + 30.36 +public class NestedMathExactTest { 30.37 + public static final int LIMIT = 100; 30.38 + public static int[] result = new int[LIMIT]; 30.39 + public static int value = 17; 30.40 + 30.41 + public static void main(String[] args) { 30.42 + for (int i = 0; i < 100; ++i) { 30.43 + result[i] = runTest(); 30.44 + } 30.45 + } 30.46 + 30.47 + public static int runTest() { 30.48 + int sum = 0; 30.49 + for (int j = 0; j < 100000; j = Math.addExact(j, 1)) { 30.50 + sum = 1; 30.51 + for (int i = 0; i < 5; ++i) { 30.52 + sum *= value; 30.53 + } 30.54 + } 30.55 + return sum; 30.56 + } 30.57 +}
31.1 --- a/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Wed Oct 30 16:31:33 2013 -0700 31.2 +++ b/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Thu Oct 31 14:54:14 2013 -0700 31.3 @@ -24,6 +24,7 @@ 31.4 /* 31.5 * @test 31.6 * @bug 8026844 31.7 + * @bug 8027353 31.8 * @summary Test constant subtractExact 31.9 * @compile SubExactLConstantTest.java Verify.java 31.10 * @run main SubExactLConstantTest
32.1 --- a/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Wed Oct 30 16:31:33 2013 -0700 32.2 +++ b/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Thu Oct 31 14:54:14 2013 -0700 32.3 @@ -24,6 +24,7 @@ 32.4 /* 32.5 * @test 32.6 * @bug 8026844 32.7 + * @bug 8027353 32.8 * @summary Test non constant subtractExact 32.9 * @compile SubExactLNonConstantTest.java Verify.java 32.10 * @run main SubExactLNonConstantTest
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 33.2 +++ b/test/compiler/startup/StartupOutput.java Thu Oct 31 14:54:14 2013 -0700 33.3 @@ -0,0 +1,44 @@ 33.4 +/* 33.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 33.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.7 + * 33.8 + * This code is free software; you can redistribute it and/or modify it 33.9 + * under the terms of the GNU General Public License version 2 only, as 33.10 + * published by the Free Software Foundation. 33.11 + * 33.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 33.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 33.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33.15 + * version 2 for more details (a copy is included in the LICENSE file that 33.16 + * accompanied this code). 33.17 + * 33.18 + * You should have received a copy of the GNU General Public License version 33.19 + * 2 along with this work; if not, write to the Free Software Foundation, 33.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 33.21 + * 33.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 33.23 + * or visit www.oracle.com if you need additional information or have any 33.24 + * questions. 33.25 + */ 33.26 + 33.27 +/* 33.28 + * @test 33.29 + * @bug 8026949 33.30 + * @summary Test ensures correct VM output during startup 33.31 + * @library ../../testlibrary 33.32 + * 33.33 + */ 33.34 +import com.oracle.java.testlibrary.*; 33.35 + 33.36 +public class StartupOutput { 33.37 + public static void main(String[] args) throws Exception { 33.38 + ProcessBuilder pb; 33.39 + OutputAnalyzer out; 33.40 + 33.41 + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); 33.42 + out = new OutputAnalyzer(pb.start()); 33.43 + out.shouldNotContain("no space to run compilers"); 33.44 + 33.45 + out.shouldHaveExitValue(0); 33.46 + } 33.47 +}