diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java index 5752eaed39a1e3bd01bbc7fe96cbb8a575dd8ce5..874512fdc778a58018a003200b079695ab613ed5 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @@ -648,7 +648,12 @@ public class ConstantPool extends Oop implements ClassConstants { } public void printValueOn(PrintStream tty) { - tty.print("ConstantPool for " + getPoolHolder().getName().asString()); + Oop holder = poolHolder.getValue(this); + if (holder instanceof Klass) { + tty.print("ConstantPool for " + ((Klass)holder).getName().asString()); + } else { + tty.print("ConstantPool for partially loaded class"); + } } public long getObjectSize() { diff --git a/make/hotspot_version b/make/hotspot_version index f92de62e1534bbc6a07d4a196f54d789c938bbff..f67badd6da03d181a2193ab653da872e26afb41c 100644 --- a/make/hotspot_version +++ b/make/hotspot_version @@ -33,9 +33,9 @@ # Don't put quotes (fail windows build). HOTSPOT_VM_COPYRIGHT=Copyright 2011 -HS_MAJOR_VER=23 +HS_MAJOR_VER=24 HS_MINOR_VER=0 -HS_BUILD_NUMBER=16 +HS_BUILD_NUMBER=01 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/make/linux/makefiles/ppc.make b/make/linux/makefiles/ppc.make index 92957f963f93fa742097a565787ebd74e8f19647..8d085e642115591b37dff64f95b7dd70bb461890 100644 --- a/make/linux/makefiles/ppc.make +++ b/make/linux/makefiles/ppc.make @@ -28,3 +28,6 @@ OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) # Must also specify if CPU is big endian CFLAGS += -DVM_BIG_ENDIAN +ifdef E500V2 +ASFLAGS += -Wa,-mspe -Wa,--defsym -Wa,E500V2=1 +endif diff --git a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 565fdee65650036bf17e67231fa487aca78026b0..904489e3a2b19c98aeeb23af3dbf3c0b67ee73e5 100644 --- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -3231,6 +3231,26 @@ void LIR_Assembler::membar_release() { // no-op on TSO } +void LIR_Assembler::membar_loadload() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::loadload)); +} + +void LIR_Assembler::membar_storestore() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::storestore)); +} + +void LIR_Assembler::membar_loadstore() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::loadstore)); +} + +void LIR_Assembler::membar_storeload() { + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); +} + + // Pack two sequential registers containing 32 bit values // into a single 64 bit register. // src and src->successor() are packed into dst diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index c745ade299f7f46b6756bd550f63647f81cf5d10..b0062406da199e553a03b3f059f03f203c976d2e 100644 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -3713,6 +3713,25 @@ void LIR_Assembler::membar_release() { // __ store_fence(); } +void LIR_Assembler::membar_loadload() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::loadload)); +} + +void LIR_Assembler::membar_storestore() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::storestore)); +} + +void LIR_Assembler::membar_loadstore() { + // no-op + //__ membar(Assembler::Membar_mask_bits(Assembler::loadstore)); +} + +void LIR_Assembler::membar_storeload() { + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); +} + void LIR_Assembler::get_thread(LIR_Opr result_reg) { assert(result_reg->is_register(), "check"); #ifdef _LP64 diff --git a/src/cpu/x86/vm/vm_version_x86.cpp b/src/cpu/x86/vm/vm_version_x86.cpp index 2155d767980c29094ec26fb347f784fbd4278ab9..121be7a2ba7acac60c49bb4f8d78d88dfeb3b00a 100644 --- a/src/cpu/x86/vm/vm_version_x86.cpp +++ b/src/cpu/x86/vm/vm_version_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,8 +65,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator { address generate_getPsrInfo() { // Flags to test CPU type. - const uint32_t EFL_AC = 0x40000; - const uint32_t EFL_ID = 0x200000; + const uint32_t HS_EFL_AC = 0x40000; + const uint32_t HS_EFL_ID = 0x200000; // Values for when we don't have a CPUID instruction. const int CPU_FAMILY_SHIFT = 8; const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); @@ -100,7 +100,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator { // // if we are unable to change the AC flag, we have a 386 // - __ xorl(rax, EFL_AC); + __ xorl(rax, HS_EFL_AC); __ push(rax); __ popf(); __ pushf(); @@ -118,7 +118,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator { // __ bind(detect_486); __ mov(rax, rcx); - __ xorl(rax, EFL_ID); + __ xorl(rax, HS_EFL_ID); __ push(rax); __ popf(); __ pushf(); diff --git a/src/os/bsd/vm/osThread_bsd.cpp b/src/os/bsd/vm/osThread_bsd.cpp index efac8037698be5aab573b27296f8d237e22f4e29..98a3f2f6340281ffcceed0b81b45ac11b620b740 100644 --- a/src/os/bsd/vm/osThread_bsd.cpp +++ b/src/os/bsd/vm/osThread_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,11 @@ void OSThread::pd_initialize() { assert(this != NULL, "check"); +#ifdef __APPLE__ + _thread_id = 0; +#else _thread_id = NULL; +#endif _pthread_id = NULL; _siginfo = NULL; _ucontext = NULL; diff --git a/src/os/bsd/vm/osThread_bsd.hpp b/src/os/bsd/vm/osThread_bsd.hpp index 82dd34fcbe8bc5a32c8173cd8d1df115397cdb3d..0e60cc3eefdc5df8508cccbc00d77fd610c917b3 100644 --- a/src/os/bsd/vm/osThread_bsd.hpp +++ b/src/os/bsd/vm/osThread_bsd.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,17 @@ private: #ifdef _ALLBSD_SOURCE - // _thread_id and _pthread_id are the same on BSD - // keep both to minimize code divergence in os_bsd.cpp + +#ifdef __APPLE__ + thread_t _thread_id; +#else pthread_t _thread_id; +#endif + + // _pthread_id is the pthread id, which is used by library calls + // (e.g. pthread_kill). pthread_t _pthread_id; + #else // _thread_id is kernel thread id (similar to LWP id on Solaris). Each // thread has a unique thread_id (BsdThreads or NPTL). It can be used @@ -64,9 +71,15 @@ void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } #ifdef _ALLBSD_SOURCE +#ifdef __APPLE__ + thread_t thread_id() const { + return _thread_id; + } +#else pthread_t thread_id() const { return _thread_id; } +#endif #else pid_t thread_id() const { return _thread_id; @@ -84,9 +97,15 @@ } #endif // ASSERT #ifdef _ALLBSD_SOURCE +#ifdef __APPLE__ + void set_thread_id(thread_t id) { + _thread_id = id; + } +#else void set_thread_id(pthread_t id) { _thread_id = id; } +#endif #else void set_thread_id(pid_t id) { _thread_id = id; diff --git a/src/os/bsd/vm/os_bsd.cpp b/src/os/bsd/vm/os_bsd.cpp index 2611e9c1401e792e3625ab2508503a018713e8d6..5643798bc30e0f2d36419c45f704166e93554cb2 100644 --- a/src/os/bsd/vm/os_bsd.cpp +++ b/src/os/bsd/vm/os_bsd.cpp @@ -568,6 +568,25 @@ void os::init_system_properties_values() { sprintf(ld_library_path, "%s:%s", v, t); free(t); } + +#ifdef __APPLE__ + // Apple's Java6 has "." at the beginning of java.library.path. + // OpenJDK on Windows has "." at the end of java.library.path. + // OpenJDK on Linux and Solaris don't have "." in java.library.path + // at all. To ease the transition from Apple's Java6 to OpenJDK7, + // "." is appended to the end of java.library.path. Yes, this + // could cause a change in behavior, but Apple's Java6 behavior + // can be achieved by putting "." at the beginning of the + // JAVA_LIBRARY_PATH environment variable. + { + char *t = ld_library_path; + // that's +3 for appending ":." and the trailing '\0' + ld_library_path = (char *) malloc(strlen(t) + 3); + sprintf(ld_library_path, "%s:%s", t, "."); + free(t); + } +#endif + Arguments::set_library_path(ld_library_path); } @@ -979,8 +998,13 @@ static void *java_start(Thread *thread) { } #ifdef _ALLBSD_SOURCE +#ifdef __APPLE__ + // thread_id is mach thread on macos + osthread->set_thread_id(::mach_thread_self()); +#else // thread_id is pthread_id on BSD osthread->set_thread_id(::pthread_self()); +#endif #else // thread_id is kernel thread id (similar to Solaris LWP id) osthread->set_thread_id(os::Bsd::gettid()); @@ -1171,7 +1195,11 @@ bool os::create_attached_thread(JavaThread* thread) { // Store pthread info into the OSThread #ifdef _ALLBSD_SOURCE +#ifdef __APPLE__ + osthread->set_thread_id(::mach_thread_self()); +#else osthread->set_thread_id(::pthread_self()); +#endif #else osthread->set_thread_id(os::Bsd::gettid()); #endif @@ -1788,7 +1816,13 @@ size_t os::lasterror(char *buf, size_t len) { return n; } -intx os::current_thread_id() { return (intx)pthread_self(); } +intx os::current_thread_id() { +#ifdef __APPLE__ + return (intx)::mach_thread_self(); +#else + return (intx)::pthread_self(); +#endif +} int os::current_process_id() { // Under the old bsd thread library, bsd gives each thread @@ -5133,9 +5167,9 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { struct thread_basic_info tinfo; mach_msg_type_number_t tcount = THREAD_INFO_MAX; kern_return_t kr; - mach_port_t mach_thread; + thread_t mach_thread; - mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id()); + mach_thread = thread->osthread()->thread_id(); kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount); if (kr != KERN_SUCCESS) return -1; diff --git a/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp b/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp index 210d5d97b8185e3a20dc5f1062fc5034d76f266c..4ccf80744244c812e3fc1227b9e51a35dda4c860 100644 --- a/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp +++ b/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,12 +29,18 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. +#ifdef __APPLE__ +#define OS_THREAD_ID_TYPE thread_t +#else +#define OS_THREAD_ID_TYPE pthread_t +#endif + #define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ /******************************/ \ - nonstatic_field(OSThread, _thread_id, pthread_t) \ + nonstatic_field(OSThread, _thread_id, OS_THREAD_ID_TYPE) \ nonstatic_field(OSThread, _pthread_id, pthread_t) \ /* This must be the last entry, and must be present */ \ last_entry() @@ -46,7 +52,7 @@ /* Posix Thread IDs */ \ /**********************/ \ \ - declare_integer_type(pid_t) \ + declare_unsigned_integer_type(thread_t) \ declare_unsigned_integer_type(pthread_t) \ \ /* This must be the last entry, and must be present */ \ diff --git a/src/share/vm/c1/c1_Canonicalizer.cpp b/src/share/vm/c1/c1_Canonicalizer.cpp index 5cee812f04a08361d92be4be569586e49640bb4e..c7a5198da33e02dcd5771c29d90d64a4d65b540c 100644 --- a/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/src/share/vm/c1/c1_Canonicalizer.cpp @@ -908,3 +908,4 @@ void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} void Canonicalizer::do_ProfileCall(ProfileCall* x) {} void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {} void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {} +void Canonicalizer::do_MemBar(MemBar* x) {} diff --git a/src/share/vm/c1/c1_Canonicalizer.hpp b/src/share/vm/c1/c1_Canonicalizer.hpp index 571e707888b3f9d92ebcd8d24ca3366ccd5b3666..8ae3a2183191620e8581ef5f05b318510f229703 100644 --- a/src/share/vm/c1/c1_Canonicalizer.hpp +++ b/src/share/vm/c1/c1_Canonicalizer.hpp @@ -104,6 +104,7 @@ class Canonicalizer: InstructionVisitor { virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); + virtual void do_MemBar (MemBar* x); }; #endif // SHARE_VM_C1_C1_CANONICALIZER_HPP diff --git a/src/share/vm/c1/c1_GraphBuilder.cpp b/src/share/vm/c1/c1_GraphBuilder.cpp index ac0cea7080bb14aff9aa96647492983e3b047357..a59ae10dde49b83428b286a66525bde5f6b0cfdb 100644 --- a/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1418,6 +1418,12 @@ void GraphBuilder::method_return(Value x) { call_register_finalizer(); } + bool need_mem_bar = false; + if (method()->name() == ciSymbol::object_initializer_name() && + scope()->wrote_final()) { + need_mem_bar = true; + } + // Check to see whether we are inlining. If so, Return // instructions become Gotos to the continuation point. if (continuation() != NULL) { @@ -1437,6 +1443,10 @@ void GraphBuilder::method_return(Value x) { monitorexit(state()->lock_at(0), SynchronizationEntryBCI); } + if (need_mem_bar) { + append(new MemBar(lir_membar_storestore)); + } + // State at end of inlined method is the state of the caller // without the method parameters on stack, including the // return value, if any, of the inlined method on operand stack. @@ -1456,7 +1466,6 @@ void GraphBuilder::method_return(Value x) { // the continuation point. append_with_bci(goto_callee, scope_data()->continuation()->bci()); incr_num_returns(); - return; } @@ -1472,6 +1481,10 @@ void GraphBuilder::method_return(Value x) { append_split(new MonitorExit(receiver, state()->unlock())); } + if (need_mem_bar) { + append(new MemBar(lir_membar_storestore)); + } + append(new Return(x)); } @@ -1504,6 +1517,9 @@ void GraphBuilder::access_field(Bytecodes::Code code) { } } + if (field->is_final() && (code == Bytecodes::_putfield)) { + scope()->set_wrote_final(); + } const int offset = !needs_patching ? field->offset() : -1; switch (code) { diff --git a/src/share/vm/c1/c1_IR.cpp b/src/share/vm/c1/c1_IR.cpp index 917fc5bd5dbbd2d90ca91b754d46c3968cf1e5ca..bdff56008bd119f353818d804ef42321746bc9eb 100644 --- a/src/share/vm/c1/c1_IR.cpp +++ b/src/share/vm/c1/c1_IR.cpp @@ -141,6 +141,7 @@ IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMe _xhandlers = new XHandlers(method); _number_of_locks = 0; _monitor_pairing_ok = method->has_balanced_monitors(); + _wrote_final = false; _start = NULL; if (osr_bci == -1) { diff --git a/src/share/vm/c1/c1_IR.hpp b/src/share/vm/c1/c1_IR.hpp index 217774f575fa26bccf7ddbb5d1f0e9cf08b96591..83c25d633e07abcbe731604e908d0ddc2be1443a 100644 --- a/src/share/vm/c1/c1_IR.hpp +++ b/src/share/vm/c1/c1_IR.hpp @@ -149,6 +149,7 @@ class IRScope: public CompilationResourceObj { XHandlers* _xhandlers; // the exception handlers int _number_of_locks; // the number of monitor lock slots needed bool _monitor_pairing_ok; // the monitor pairing info + bool _wrote_final; // has written final field BlockBegin* _start; // the start block, successsors are method entries BitMap _requires_phi_function; // bit is set if phi functions at loop headers are necessary for a local variable @@ -181,6 +182,8 @@ class IRScope: public CompilationResourceObj { void set_min_number_of_locks(int n) { if (n > _number_of_locks) _number_of_locks = n; } bool monitor_pairing_ok() const { return _monitor_pairing_ok; } BlockBegin* start() const { return _start; } + void set_wrote_final() { _wrote_final = true; } + bool wrote_final () const { return _wrote_final; } }; diff --git a/src/share/vm/c1/c1_Instruction.hpp b/src/share/vm/c1/c1_Instruction.hpp index 9f9de6a14e351b4de999af94666890c32e169324..9cdef87b9f37794b648cf3876c2c9b0d67c24ea5 100644 --- a/src/share/vm/c1/c1_Instruction.hpp +++ b/src/share/vm/c1/c1_Instruction.hpp @@ -107,6 +107,7 @@ class UnsafePrefetchWrite; class ProfileCall; class ProfileInvoke; class RuntimeCall; +class MemBar; // A Value is a reference to the instruction creating the value typedef Instruction* Value; @@ -204,6 +205,7 @@ class InstructionVisitor: public StackObj { virtual void do_ProfileCall (ProfileCall* x) = 0; virtual void do_ProfileInvoke (ProfileInvoke* x) = 0; virtual void do_RuntimeCall (RuntimeCall* x) = 0; + virtual void do_MemBar (MemBar* x) = 0; }; @@ -2351,6 +2353,23 @@ LEAF(ProfileInvoke, Instruction) virtual void state_values_do(ValueVisitor*); }; +LEAF(MemBar, Instruction) + private: + LIR_Code _code; + + public: + MemBar(LIR_Code code) + : Instruction(voidType) + , _code(code) + { + pin(); + } + + LIR_Code code() { return _code; } + + virtual void input_values_do(ValueVisitor*) {} +}; + class BlockPair: public CompilationResourceObj { private: BlockBegin* _from; diff --git a/src/share/vm/c1/c1_InstructionPrinter.cpp b/src/share/vm/c1/c1_InstructionPrinter.cpp index 1db5a4dd1b70b1120055187798c3878da18102c3..88b0b3c7739a6b2368d0cd9fbcf60b09902f0bf9 100644 --- a/src/share/vm/c1/c1_InstructionPrinter.cpp +++ b/src/share/vm/c1/c1_InstructionPrinter.cpp @@ -855,4 +855,20 @@ void InstructionPrinter::do_RuntimeCall(RuntimeCall* x) { output()->put(')'); } +void InstructionPrinter::do_MemBar(MemBar* x) { + if (os::is_MP()) { + LIR_Code code = x->code(); + switch (code) { + case lir_membar_acquire : output()->print("membar_acquire"); break; + case lir_membar_release : output()->print("membar_release"); break; + case lir_membar : output()->print("membar"); break; + case lir_membar_loadload : output()->print("membar_loadload"); break; + case lir_membar_storestore: output()->print("membar_storestore"); break; + case lir_membar_loadstore : output()->print("membar_loadstore"); break; + case lir_membar_storeload : output()->print("membar_storeload"); break; + default : ShouldNotReachHere(); break; + } + } +} + #endif // PRODUCT diff --git a/src/share/vm/c1/c1_InstructionPrinter.hpp b/src/share/vm/c1/c1_InstructionPrinter.hpp index 944797042407e6e7b0ccdab37b033f598e477c81..de6bff4ffeeed89acaa82f211b201bb9d0fcce08 100644 --- a/src/share/vm/c1/c1_InstructionPrinter.hpp +++ b/src/share/vm/c1/c1_InstructionPrinter.hpp @@ -132,6 +132,7 @@ class InstructionPrinter: public InstructionVisitor { virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); + virtual void do_MemBar (MemBar* x); }; #endif // PRODUCT diff --git a/src/share/vm/c1/c1_LIR.cpp b/src/share/vm/c1/c1_LIR.cpp index 629d849bc60f7e242d87025f04ae69852e5b8c56..776a6a3df2d431aa76961c539b48ff32b8e0fff3 100644 --- a/src/share/vm/c1/c1_LIR.cpp +++ b/src/share/vm/c1/c1_LIR.cpp @@ -464,6 +464,10 @@ void LIR_OpVisitState::visit(LIR_Op* op) { case lir_membar: // result and info always invalid case lir_membar_acquire: // result and info always invalid case lir_membar_release: // result and info always invalid + case lir_membar_loadload: // result and info always invalid + case lir_membar_storestore: // result and info always invalid + case lir_membar_loadstore: // result and info always invalid + case lir_membar_storeload: // result and info always invalid { assert(op->as_Op0() != NULL, "must be"); assert(op->_info == NULL, "info not used by this instruction"); @@ -1607,6 +1611,10 @@ const char * LIR_Op::name() const { case lir_membar: s = "membar"; break; case lir_membar_acquire: s = "membar_acquire"; break; case lir_membar_release: s = "membar_release"; break; + case lir_membar_loadload: s = "membar_loadload"; break; + case lir_membar_storestore: s = "membar_storestore"; break; + case lir_membar_loadstore: s = "membar_loadstore"; break; + case lir_membar_storeload: s = "membar_storeload"; break; case lir_word_align: s = "word_align"; break; case lir_label: s = "label"; break; case lir_nop: s = "nop"; break; diff --git a/src/share/vm/c1/c1_LIR.hpp b/src/share/vm/c1/c1_LIR.hpp index 7220c335d09ea2fb7d9bc1ecfb6ca2a022cdbdcd..f8589c369640b4fddd301f682d4fb54b560b9118 100644 --- a/src/share/vm/c1/c1_LIR.hpp +++ b/src/share/vm/c1/c1_LIR.hpp @@ -866,6 +866,10 @@ enum LIR_Code { , lir_membar , lir_membar_acquire , lir_membar_release + , lir_membar_loadload + , lir_membar_storestore + , lir_membar_loadstore + , lir_membar_storeload , lir_get_thread , end_op0 , begin_op1 @@ -1918,6 +1922,10 @@ class LIR_List: public CompilationResourceObj { void membar() { append(new LIR_Op0(lir_membar)); } void membar_acquire() { append(new LIR_Op0(lir_membar_acquire)); } void membar_release() { append(new LIR_Op0(lir_membar_release)); } + void membar_loadload() { append(new LIR_Op0(lir_membar_loadload)); } + void membar_storestore() { append(new LIR_Op0(lir_membar_storestore)); } + void membar_loadstore() { append(new LIR_Op0(lir_membar_loadstore)); } + void membar_storeload() { append(new LIR_Op0(lir_membar_storeload)); } void nop() { append(new LIR_Op0(lir_nop)); } void build_frame() { append(new LIR_Op0(lir_build_frame)); } diff --git a/src/share/vm/c1/c1_LIRAssembler.cpp b/src/share/vm/c1/c1_LIRAssembler.cpp index 258fde283086d1fd137e741a0f97ca2eb36a12d3..528f21e841c1929d70dbeed634554167149090d4 100644 --- a/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/src/share/vm/c1/c1_LIRAssembler.cpp @@ -664,6 +664,22 @@ void LIR_Assembler::emit_op0(LIR_Op0* op) { membar_release(); break; + case lir_membar_loadload: + membar_loadload(); + break; + + case lir_membar_storestore: + membar_storestore(); + break; + + case lir_membar_loadstore: + membar_loadstore(); + break; + + case lir_membar_storeload: + membar_storeload(); + break; + case lir_get_thread: get_thread(op->result_opr()); break; diff --git a/src/share/vm/c1/c1_LIRAssembler.hpp b/src/share/vm/c1/c1_LIRAssembler.hpp index 14b629858330412c012aa24414e83015e2da0114..58adf591978ad1e28f4cc6cb63662850e2ab185e 100644 --- a/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/src/share/vm/c1/c1_LIRAssembler.hpp @@ -241,6 +241,10 @@ class LIR_Assembler: public CompilationResourceObj { void membar(); void membar_acquire(); void membar_release(); + void membar_loadload(); + void membar_storestore(); + void membar_loadstore(); + void membar_storeload(); void get_thread(LIR_Opr result); void verify_oop_map(CodeEmitInfo* info); diff --git a/src/share/vm/c1/c1_LIRGenerator.cpp b/src/share/vm/c1/c1_LIRGenerator.cpp index d92d919865c9af648d8bd3568f4b0f84aaaff680..3c7f305222a16666d379e5106ee590936f61203a 100644 --- a/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/src/share/vm/c1/c1_LIRGenerator.cpp @@ -3165,3 +3165,20 @@ LIR_Opr LIRGenerator::call_runtime(BasicTypeArray* signature, LIRItemList* args, } return result; } + +void LIRGenerator::do_MemBar(MemBar* x) { + if (os::is_MP()) { + LIR_Code code = x->code(); + switch(code) { + case lir_membar_acquire : __ membar_acquire(); break; + case lir_membar_release : __ membar_release(); break; + case lir_membar : __ membar(); break; + case lir_membar_loadload : __ membar_loadload(); break; + case lir_membar_storestore: __ membar_storestore(); break; + case lir_membar_loadstore : __ membar_loadstore(); break; + case lir_membar_storeload : __ membar_storeload(); break; + default : ShouldNotReachHere(); break; + } + } +} + diff --git a/src/share/vm/c1/c1_LIRGenerator.hpp b/src/share/vm/c1/c1_LIRGenerator.hpp index 2b8fc23e65b5ddadd9841d66dcb7131f768d1e41..56b28e4eb8e681859e0eb03662983f431b83fdc7 100644 --- a/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/src/share/vm/c1/c1_LIRGenerator.hpp @@ -525,6 +525,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); + virtual void do_MemBar (MemBar* x); }; diff --git a/src/share/vm/c1/c1_Optimizer.cpp b/src/share/vm/c1/c1_Optimizer.cpp index e1a0ef7bfddfc94f151447db79c1e40dc7ff15cb..ff05781ce6743d4cf7f93ad07dd45dda85915d53 100644 --- a/src/share/vm/c1/c1_Optimizer.cpp +++ b/src/share/vm/c1/c1_Optimizer.cpp @@ -509,6 +509,7 @@ public: void do_ProfileCall (ProfileCall* x); void do_ProfileInvoke (ProfileInvoke* x); void do_RuntimeCall (RuntimeCall* x); + void do_MemBar (MemBar* x); }; @@ -678,6 +679,7 @@ void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); } void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {} void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {} +void NullCheckVisitor::do_MemBar (MemBar* x) {} void NullCheckEliminator::visit(Value* p) { diff --git a/src/share/vm/c1/c1_ValueMap.hpp b/src/share/vm/c1/c1_ValueMap.hpp index 248d174964d9d131f2d74b00a7e72ced1c0732c4..4278b11d39af2b8ea5c17e44d03191dd818b0dd8 100644 --- a/src/share/vm/c1/c1_ValueMap.hpp +++ b/src/share/vm/c1/c1_ValueMap.hpp @@ -200,6 +200,7 @@ class ValueNumberingVisitor: public InstructionVisitor { void do_ProfileCall (ProfileCall* x) { /* nothing to do */ } void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ }; + void do_MemBar (MemBar* x) { /* nothing to do */ }; }; diff --git a/src/share/vm/utilities/globalDefinitions_gcc.hpp b/src/share/vm/utilities/globalDefinitions_gcc.hpp index 45b5e8fff6c39e23bdd41ab1b2a0b28c462b1260..e103816de931972e6675e248932af44687ac4fea 100644 --- a/src/share/vm/utilities/globalDefinitions_gcc.hpp +++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,14 +87,7 @@ #endif #ifdef __APPLE__ #include - #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) - // Mac OS X 10.4 defines EFL_AC and EFL_ID, - // which conflict with hotspot variable names. - // - // This has been fixed in Mac OS X 10.5. - #undef EFL_AC - #undef EFL_ID - #endif + #include #endif #include #endif // LINUX || _ALLBSD_SOURCE