# HG changeset patch # User Thomas Wuerthinger # Date 1330358778 -3600 # Node ID 532be189cf090eacf6fcd27d51cc1400a91724cd # Parent 8f01f899bccdaba90f4ad028d67c337be74905a4 Reducing diff to hsx24 diff -r 8f01f899bccd -r 532be189cf09 src/cpu/x86/vm/c1_Runtime1_x86.cpp --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -594,47 +594,46 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { OopMapSet* oop_maps = new OopMapSet(); #ifdef GRAAL - // graal passes the argument in r10 - OopMap* oop_map = save_live_registers(sasm, 1); + OopMap* oop_map = save_live_registers(sasm, 1); - // now all registers are saved and can be used freely - // verify that no old value is used accidentally - __ invalidate_registers(true, true, true, true, true, true); + // now all registers are saved and can be used freely + // verify that no old value is used accidentally + __ invalidate_registers(true, true, true, true, true, true); - // registers used by this stub - const Register temp_reg = rbx; + // registers used by this stub + const Register temp_reg = rbx; - // load argument for exception that is passed as an argument into the stub - if (has_argument) { - __ movptr(c_rarg1, r10); - } - int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0); + // load argument for exception that is passed as an argument into the stub + if (has_argument) { + __ movptr(c_rarg1, r10); + } + int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0); - oop_maps->add_gc_map(call_offset, oop_map); + oop_maps->add_gc_map(call_offset, oop_map); #else - // preserve all registers - int num_rt_args = has_argument ? 2 : 1; - OopMap* oop_map = save_live_registers(sasm, num_rt_args); + // preserve all registers + int num_rt_args = has_argument ? 2 : 1; + OopMap* oop_map = save_live_registers(sasm, num_rt_args); - // now all registers are saved and can be used freely - // verify that no old value is used accidentally - __ invalidate_registers(true, true, true, true, true, true); + // now all registers are saved and can be used freely + // verify that no old value is used accidentally + __ invalidate_registers(true, true, true, true, true, true); - // registers used by this stub - const Register temp_reg = rbx; + // registers used by this stub + const Register temp_reg = rbx; - // load argument for exception that is passed as an argument into the stub - if (has_argument) { - #ifdef _LP64 - __ movptr(c_rarg1, Address(rbp, 2*BytesPerWord)); - #else - __ movptr(temp_reg, Address(rbp, 2*BytesPerWord)); - __ push(temp_reg); - #endif // _LP64 - } - int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); + // load argument for exception that is passed as an argument into the stub + if (has_argument) { +#ifdef _LP64 + __ movptr(c_rarg1, Address(rbp, 2*BytesPerWord)); +#else + __ movptr(temp_reg, Address(rbp, 2*BytesPerWord)); + __ push(temp_reg); +#endif // _LP64 + } + int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); - oop_maps->add_gc_map(call_offset, oop_map); + oop_maps->add_gc_map(call_offset, oop_map); #endif __ stop("should not reach here"); @@ -980,6 +979,7 @@ return oop_maps; } +#ifdef GRAAL JRT_ENTRY(void, graal_create_null_exception(JavaThread* thread)) thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); JRT_END @@ -1008,9 +1008,7 @@ thread->set_vm_result((oop) result.get_jobject()); JRT_END - - - +#endif OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { @@ -1381,8 +1379,7 @@ break; case unwind_exception_id: - { - __ set_info("unwind_exception", dont_gc_arguments); + { __ set_info("unwind_exception", dont_gc_arguments); // note: no stubframe since we are about to leave the current // activation and we are calling a leaf VM function only. generate_unwind_exception(sasm); @@ -1441,17 +1438,18 @@ __ movptr(rsi, Address(rsp, (klass_off) * VMRegImpl::stack_slot_size)); // subclass __ movptr(rax, Address(rsp, (sup_k_off) * VMRegImpl::stack_slot_size)); // superclass - Label success; Label miss; #ifdef GRAAL - // TODO this should really be within the XirSnippets + Label success; __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL); #endif __ check_klass_subtype_slow_path(rsi, rax, rcx, rdi, NULL, &miss); // fallthrough on success: +#ifdef GRAAL __ bind(success); +#endif __ movptr(Address(rsp, (result_off) * VMRegImpl::stack_slot_size), 1); // result __ pop(rax); __ pop(rcx); diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/c1/c1_Runtime1.cpp --- a/src/share/vm/c1/c1_Runtime1.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/c1/c1_Runtime1.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -201,6 +201,10 @@ case slow_subtype_check_id: case fpu2long_stub_id: case unwind_exception_id: + case counter_overflow_id: +#if defined(SPARC) || defined(PPC) + case handle_exception_nofpu_id: // Unused on sparc +#endif #ifdef GRAAL case graal_verify_pointer_id: case graal_unwind_exception_call_id: @@ -209,12 +213,6 @@ case graal_arithmetic_drem_id: case graal_set_deopt_info_id: #endif -#ifndef TIERED - case counter_overflow_id: // Not generated outside the tiered world -#endif -#if defined(SPARC) || defined(PPC) - case handle_exception_nofpu_id: // Unused on sparc -#endif break; // All other stubs should have oopmaps @@ -744,19 +742,7 @@ EXCEPTION_MARK; oop obj = lock->obj(); - -#ifdef DEBUG - if (!obj->is_oop()) { - ResetNoHandleMark rhm; - nmethod* method = thread->last_frame().cb()->as_nmethod_or_null(); - if (method != NULL) { - tty->print_cr("ERROR in monitorexit in method %s wrong obj " INTPTR_FORMAT, method->name(), obj); - } - thread->print_stack_on(tty); - assert(false, "invalid lock object pointer dected"); - } -#endif - + assert(obj->is_oop(), "must be NULL or an object"); if (UseFastLocking) { // When using fast locking, the compiled code has already tried the fast case ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD); diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/ci/ciField.cpp --- a/src/share/vm/ci/ciField.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/ci/ciField.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -306,20 +306,15 @@ return type; } -bool ciField::will_link(ciInstanceKlass* accessing_klass, - Bytecodes::Code bc) { - VM_ENTRY_MARK; - return will_link_from_vm(accessing_klass, bc); -} // ------------------------------------------------------------------ // ciField::will_link // // Can a specific access to this field be made without causing // link errors? -bool ciField::will_link_from_vm(ciInstanceKlass* accessing_klass, +bool ciField::will_link(ciInstanceKlass* accessing_klass, Bytecodes::Code bc) { - Thread* THREAD = Thread::current(); + VM_ENTRY_MARK; if (_offset == -1) { // at creation we couldn't link to our holder so we need to // maintain that stance, otherwise there's no safe way to use this diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/ci/ciKlass.cpp --- a/src/share/vm/ci/ciKlass.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/ci/ciKlass.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -72,8 +72,9 @@ if (this == that) { return true; } - - //VM_ENTRY_MARK; +#ifndef GRAAL + VM_ENTRY_MARK; +#endif Klass* this_klass = get_Klass(); klassOop that_klass = that->get_klassOop(); bool result = this_klass->is_subtype_of(that_klass); diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/ci/ciObjectFactory.cpp --- a/src/share/vm/ci/ciObjectFactory.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/ci/ciObjectFactory.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -87,10 +87,11 @@ _ci_objects = new (arena) GrowableArray(arena, expected_size, 0, NULL); // If the shared ci objects exist append them to this factory's objects - - /*if (_shared_ci_objects != NULL) { +#ifndef GRAAL + if (_shared_ci_objects != NULL) { _ci_objects->appendAll(_shared_ci_objects); - }*/ + } +#endif _unloaded_methods = new (arena) GrowableArray(arena, 4, 0, NULL); _unloaded_klasses = new (arena) GrowableArray(arena, 8, 0, NULL); @@ -219,15 +220,16 @@ ciSymbol* ciObjectFactory::get_symbol(Symbol* key) { - /*vmSymbols::SID sid = vmSymbols::find_sid(key); +#ifndef GRAAL + vmSymbols::SID sid = vmSymbols::find_sid(key); if (sid != vmSymbols::NO_SID) { // do not pollute the main cache with it - ciSymbol* result = vm_symbol_at(sid); - assert(result != NULL, ""); - return result; - }*/ + return vm_symbol_at(sid); + } - //assert(vmSymbols::find_sid(key) == vmSymbols::NO_SID, ""); + assert(vmSymbols::find_sid(key) == vmSymbols::NO_SID, ""); +#endif + ciSymbol* s = new (arena()) ciSymbol(key, vmSymbols::NO_SID); _symbols->push(s); return s; diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/classfile/classLoader.cpp --- a/src/share/vm/classfile/classLoader.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/classfile/classLoader.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -566,7 +566,7 @@ ClassPathEntry* e = _first_entry; while (e != NULL) { // assume zip entries have been canonicalized - if (strcmp(entry->name(), e->name()) == 0) { + if (strcmp(entry->name(), e->name()) == 0) { return true; } e = e->next(); diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/compiler/compileBroker.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -727,15 +727,13 @@ // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); -#ifdef GRAAL +#if defined(GRAAL) _compilers[0] = new GraalCompiler(); -#else -#ifdef COMPILER1 +#elif defined(COMPILER1) if (c1_count > 0) { _compilers[0] = new Compiler(); } #endif // COMPILER1 -#endif #ifdef COMPILER2 if (c2_count > 0) { @@ -1093,13 +1091,13 @@ { MutexLocker locker(queue->lock(), thread); +#ifdef GRAAL if (JavaThread::current()->is_compiling() && !BackgroundCompilation) { -#ifdef GRAAL TRACE_graal_1("Recursive compile %s!", method->name_and_sig_as_C_string()); -#endif method->set_not_compilable(); return; } +#endif // Make sure the method has not slipped into the queues since // last we checked; note that those checks were "fast bail-outs". @@ -1181,8 +1179,7 @@ } else { // Recursive compile request => ignore. } -#endif -#ifndef GRAAL +#else if (blocking) { wait_for_completion(task); } diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/oops/constantPoolOop.cpp --- a/src/share/vm/oops/constantPoolOop.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/oops/constantPoolOop.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -346,7 +346,6 @@ int cpc_index = operand; DEBUG_ONLY(cpc_index -= CPCACHE_INDEX_TAG); assert((int)(u2)cpc_index == cpc_index, "clean u2"); - assert(cache() != NULL, "cache not null, maybe class is resolved but not rewritten yet"); int member_index = cache()->entry_at(cpc_index)->constant_pool_index(); return member_index; } diff -r 8f01f899bccd -r 532be189cf09 src/share/vm/runtime/compilationPolicy.cpp --- a/src/share/vm/runtime/compilationPolicy.cpp Mon Feb 27 16:26:41 2012 +0100 +++ b/src/share/vm/runtime/compilationPolicy.cpp Mon Feb 27 17:06:18 2012 +0100 @@ -60,11 +60,11 @@ break; case 1: -//#ifdef COMPILER2 +#if defined(COMPILER2) || defined(GRAAL) CompilationPolicy::set_policy(new StackWalkCompPolicy()); -//#else -// Unimplemented(); -//#endif +#else + Unimplemented(); +#endif break; case 2: #ifdef TIERED @@ -420,7 +420,7 @@ } // StackWalkCompPolicy - walk up stack to find a suitable method to compile -//#ifdef COMPILER2 +#if defined(COMPILER2) || defined(GRAAL) const char* StackWalkCompPolicy::_msg = NULL; @@ -646,4 +646,4 @@ -//#endif // COMPILER2 +#endif // COMPILER2 || GRAAL