Index: build/make/components/vm.xml =================================================================== --- build/make/components/vm.xml (revision 592915) +++ build/make/components/vm.xml (working copy) @@ -46,6 +46,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: build/make/deploy.xml =================================================================== --- build/make/deploy.xml (revision 592915) +++ build/make/deploy.xml (working copy) @@ -56,6 +56,11 @@ bin/default:gc_gen + + bin/default:gc_gen_compress + bin/default:gc_gen_compress + + bin/default:gc_cc bin/default:gc_cc Index: vm/gc_gen/src/common/gc_for_vm.cpp =================================================================== --- vm/gc_gen/src/common/gc_for_vm.cpp (revision 592915) +++ vm/gc_gen/src/common/gc_for_vm.cpp (working copy) @@ -139,13 +139,18 @@ INFO2("gc.process", "GC: end of GC wrapup\n"); } -#ifdef COMPRESS_REFERENCE + Boolean gc_supports_compressed_references() { +// true if gc dll has been built for compression +#ifdef REFS_USE_COMPRESSED return TRUE; +#else + return FALSE; +#endif } -#endif + /* this interface need reconsidering. is_pinned is unused. */ void gc_add_root_set_entry(Managed_Object_Handle *ref, Boolean is_pinned) { Index: vm/vmcore/src/init/vm_properties.cpp =================================================================== --- vm/vmcore/src/init/vm_properties.cpp (revision 592915) +++ vm/vmcore/src/init/vm_properties.cpp (working copy) @@ -64,9 +64,14 @@ "hyluni", "hyarchive" }; - +#if defined(POINTER64) && defined(REFS_USE_COMPRESSED) +#define GC_DLL "gc_gen_compress" +#else #define GC_DLL "gc_gen" +#endif + + /** * Compose a string of file names each of them beginning with path, * names separated by PORT_PATH_SEPARATOR. If patch is NULL, no path @@ -302,7 +307,9 @@ properties.set_new("vm.jvmti.enabled", "false"); properties.set_new("vm.jvmti.compiled_method_load.inlined", "false"); properties.set_new("vm.bootclasspath.appendclasspath", "false"); - properties.set_new("gc.dll", PORT_DSO_NAME(GC_DLL)); + + properties.set_new("gc.dll", PORT_DSO_NAME(GC_DLL)); + properties.set_new("thread.soft_unreservation", "false"); #ifdef POINTER64 Index: vm/vmcore/src/init/vm_init.cpp =================================================================== --- vm/vmcore/src/init/vm_init.cpp (revision 592915) +++ vm/vmcore/src/init/vm_init.cpp (working copy) @@ -57,6 +57,12 @@ #define LOG_DOMAIN "vm.core.init" #include "cxxlog.h" + +#define GC_COMPRESS_DLL "gc_gen_compress" +#define GC_MAX_COMPRESSED_BYTES 3950000000 //temporary ~4GB temp limit for compressed refs + + + VTable * cached_object_array_vtable_ptr; bool parallel_jit = true; VMEXPORT bool dump_stubs = false; @@ -159,7 +165,20 @@ * be reset from command line... */ #ifndef USE_GC_STATIC - char* gc_dll = vm_env->VmProperties()->get("gc.dll"); + char gc_compress_dll[] = GC_COMPRESS_DLL; + char* gc_dll; + bool gc_dll_property = true; +#if defined(POINTER64) && defined(REFS_USE_RUNTIME_SWITCH) + if (get_size_property("gc.mx", 0, VM_PROPERTIES) < GC_MAX_COMPRESSED_BYTES) + { + gc_dll = gc_compress_dll; + gc_dll_property = false; + } + else + gc_dll = vm_env->VmProperties()->get("gc.dll"); +#else + gc_dll = vm_env->VmProperties()->get("gc.dll"); +#endif if (!gc_dll) { LWARN(44, "{0} internal property is undefined" << "gc.dll"); @@ -173,7 +192,8 @@ LWARN(16, "GC library cannot be loaded: {0}" << gc_dll); status = JNI_ERR; } - vm_env->VmProperties()->destroy(gc_dll); + if(gc_dll_property) + vm_env->VmProperties()->destroy(gc_dll); #endif return status; } @@ -696,9 +716,11 @@ vm_env->verify = get_boolean_property("vm.use_verifier", TRUE, VM_PROPERTIES); #if defined(POINTER64) && defined(REFS_USE_RUNTIME_SWITCH) - vm_env->compress_references = get_boolean_property("vm.compress_references", TRUE, VM_PROPERTIES); + if (get_size_property("gc.mx", 0, VM_PROPERTIES) > GC_MAX_COMPRESSED_BYTES) + vm_env->compress_references = false; #endif + // "Tool Interface" enabling. vm_env->TI->setExecutionMode(vm_env); @@ -739,8 +761,11 @@ // vm_references_are_compressed returns current VM state, not potential // ability to support compressed mode // So, this check is turned off for now and it is FIXME - //status = check_compression(); - //if (status != JNI_OK) return status; + + // Turning this check back on + // With partitioning of gc dll's gc_supports_compressed_references is a state + status = check_compression(); + if (status != JNI_OK) return status; // Prepares to load natives status = natives_init();