# HG changeset patch # User kvn # Date 1298488696 28800 # Node ID a97fd181b813a5cd4c2b42a97ed1b942c35345a7 # Parent 5841dc1964f0b4ccab8e189471196d4a5b1c5e6c# Parent f77b3ec064b066a2a69143816e883e5922999eb4 Merge diff -r 5841dc1964f0 -r a97fd181b813 make/Makefile --- a/make/Makefile Tue Feb 22 15:26:36 2011 -0800 +++ b/make/Makefile Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, 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 @@ -43,6 +43,7 @@ # ALT_OUTPUTDIR Output directory to use for hotspot build # ALT_EXPORT_PATH Directory to export hotspot build to # ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules) +# ALT_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling # ALT_BUILD_WIN_SA Building SA on Windows is disabled by default. # Set ALT_BUILD_WIN_SA=1 to enable building SA on # Windows. diff -r 5841dc1964f0 -r a97fd181b813 make/defs.make --- a/make/defs.make Tue Feb 22 15:26:36 2011 -0800 +++ b/make/defs.make Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, 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 @@ -162,6 +162,13 @@ JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) endif +# Other parts of JDK build may require an import JDK that can be executed +# on the build host. For cross-compile builds we also need an import JDK +# that matches the target arch, so for that we set ALT_JDK_TARGET_IMPORT_PATH +ifneq ($(ALT_JDK_TARGET_IMPORT_PATH),) + JDK_IMPORT_PATH=$(ALT_JDK_TARGET_IMPORT_PATH) +endif + # Find JDK used for javac compiles BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) ifneq ($(ALT_BOOTDIR),) diff -r 5841dc1964f0 -r a97fd181b813 make/jprt.properties --- a/make/jprt.properties Tue Feb 22 15:26:36 2011 -0800 +++ b/make/jprt.properties Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, 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 @@ -437,6 +437,7 @@ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ diff -r 5841dc1964f0 -r a97fd181b813 make/windows/create.bat --- a/make/windows/create.bat Tue Feb 22 15:26:36 2011 -0800 +++ b/make/windows/create.bat Wed Feb 23 11:18:16 2011 -0800 @@ -1,6 +1,6 @@ @echo off REM -REM Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,7 @@ :testit -cl 2>&1 | grep "IA-64" >NUL -if %errorlevel% == 0 goto isia64 -cl 2>&1 | grep "AMD64" >NUL +cl 2>&1 | grep "x64" >NUL if %errorlevel% == 0 goto amd64 set ARCH=x86 set BUILDARCH=i486 @@ -64,12 +62,6 @@ set BUILDARCH=amd64 set Platform_arch=x86 set Platform_arch_model=x86_64 -goto done -:isia64 -set ARCH=ia64 -set BUILDARCH=ia64 -set Platform_arch=ia64 -set Platform_arch_model=ia64 :done setlocal @@ -81,7 +73,7 @@ REM Set HotSpotWorkSpace to the directy two steps above this script for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi) set HotSpotBuildRoot=%HotSpotWorkSpace%build -set HotSpotBuildSpace=%HotSpotBuildRoot%\vs +set HotSpotBuildSpace=%HotSpotBuildRoot%\vs-%BUILDARCH% set HotSpotJDKDist=%1 @@ -89,9 +81,9 @@ for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i echo ************************************************************** -set ProjectFile=jvm.vcproj +set ProjectFile=%HotSpotBuildSpace%\jvm.vcproj if "%MSC_VER%" == "1200" ( -set ProjectFile=jvm.dsp +set ProjectFile=%HotSpotBuildSpace%\jvm.dsp echo Will generate VC6 project {unsupported} ) else ( if "%MSC_VER%" == "1400" ( @@ -163,7 +155,7 @@ ) REM force regneration of ProjectFile -if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% +if exist %ProjectFile% del %ProjectFile% for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( echo -- %%i -- @@ -182,6 +174,7 @@ echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make +echo MSC_VER=%MSC_VER% >> %HotSpotBuildSpace%\%%i\local.make for /D %%j in (debug, fastdebug, product) do ( if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j @@ -196,7 +189,7 @@ pushd %HotSpotBuildRoot% REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables -nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile% +nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %ProjectFile% popd diff -r 5841dc1964f0 -r a97fd181b813 make/windows/makefiles/compile.make --- a/make/windows/makefiles/compile.make Tue Feb 22 15:26:36 2011 -0800 +++ b/make/windows/makefiles/compile.make Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2011, 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 @@ -141,9 +141,6 @@ !endif !endif -# Add what version of the compiler we think this is to the compile line -CPP_FLAGS=$(CPP_FLAGS) /D "MSC_VER=$(MSC_VER)" - # By default, we do not want to use the debug version of the msvcrt.dll file # but if MFC_DEBUG is defined in the environment it will be used. MS_RUNTIME_OPTION = /MD diff -r 5841dc1964f0 -r a97fd181b813 make/windows/makefiles/projectcreator.make --- a/make/windows/makefiles/projectcreator.make Tue Feb 22 15:26:36 2011 -0800 +++ b/make/windows/makefiles/projectcreator.make Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -36,8 +36,6 @@ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \ $(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.java \ - $(WorkSpace)\src\share\tools\ProjectCreator\Macro.java \ - $(WorkSpace)\src\share\tools\ProjectCreator\MacroDefinitions.java \ $(WorkSpace)\src\share\tools\ProjectCreator\ProjectCreator.java \ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \ @@ -50,6 +48,10 @@ # This is only used internally ProjectCreatorIncludesPRIVATE=\ + -relativeInclude src\closed\share\vm \ + -relativeInclude src\closed\os\windows\vm \ + -relativeInclude src\closed\os_cpu\windows_$(Platform_arch)\vm \ + -relativeInclude src\closed\cpu\$(Platform_arch)\vm \ -relativeInclude src\share\vm \ -relativeInclude src\share\vm\prims \ -relativeInclude src\os\windows\vm \ @@ -84,7 +86,7 @@ -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \ -startAt src \ -compiler $(VcVersion) \ - -projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \ + -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \ -jdkTargetRoot $(HOTSPOTJDKDIST) \ -define ALIGN_STACK_FRAMES \ -define VM_LITTLE_ENDIAN \ @@ -106,13 +108,20 @@ # Add in build-specific options !if "$(BUILDARCH)" == "i486" ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -platformName Win32 \ -define IA32 \ -ignorePath x86_64 \ -define TARGET_ARCH_MODEL_x86_32 !else +!if "$(BUILDARCH)" == "amd64" ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ + -platformName x64 \ + -define AMD64 \ + -define _LP64 \ -ignorePath x86_32 \ - -define TARGET_ARCH_MODEL_x86_64 + -define TARGET_ARCH_MODEL_x86_64 \ + -define TARGET_OS_ARCH_MODEL_windows_x86_64 +!endif !endif ProjectCreatorIDEOptionsIgnoreCompiler1=\ diff -r 5841dc1964f0 -r a97fd181b813 make/windows/makefiles/rules.make --- a/make/windows/makefiles/rules.make Tue Feb 22 15:26:36 2011 -0800 +++ b/make/windows/makefiles/rules.make Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2011, 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 @@ -53,7 +53,7 @@ !if "$(MSC_VER)" == "1200" VcVersion=VC6 -ProjectFile=vm.dsp +ProjectFile=jvm.dsp !elseif "$(MSC_VER)" == "1400" diff -r 5841dc1964f0 -r a97fd181b813 make/windows/platform_amd64 --- a/make/windows/platform_amd64 Tue Feb 22 15:26:36 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -// Platform file for win32 NT platform - -os_family = windows - -arch = x86 - -arch_model = x86_64 - -os_arch = windows_x86 - -os_arch_model = windows_x86_64 - -lib_arch = amd64 - -compiler = visCPP diff -r 5841dc1964f0 -r a97fd181b813 make/windows/platform_i486 --- a/make/windows/platform_i486 Tue Feb 22 15:26:36 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -// Platform file for windows platform - -os_family = windows - -arch = x86 - -arch_model = x86_32 - -os_arch = windows_x86 - -os_arch_model = windows_x86_32 - -lib_arch = i386 - -compiler = visCPP diff -r 5841dc1964f0 -r a97fd181b813 make/windows/platform_ia64 --- a/make/windows/platform_ia64 Tue Feb 22 15:26:36 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -// Platform file for Itanium Windows platform $Revision: 1.0 $ - -os_family = win32 - -arch = ia64 - -os_arch = win32_ia64 - -compiler = visCPP - -gnu_dis_arch = ia64 - diff -r 5841dc1964f0 -r a97fd181b813 make/windows/projectfiles/common/Makefile --- a/make/windows/projectfiles/common/Makefile Tue Feb 22 15:26:36 2011 -0800 +++ b/make/windows/projectfiles/common/Makefile Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -54,8 +54,6 @@ JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make -Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH) - !if "$(Variant)" == "compiler2" # Pick up rules for building adlc !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make @@ -105,17 +103,16 @@ !endif ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \ - -platform $(Platform) \ -define HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \ -define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \ -define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\" -$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class +$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions) clean: @rm -rf $(HOTSPOTBUILDSPACE)/classes - @rm -r ../$(ProjectFile) + @rm -r $(HOTSPOTBUILDSPACE)/$(ProjectFile) $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources) @if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes diff -r 5841dc1964f0 -r a97fd181b813 src/os/windows/vm/perfMemory_windows.cpp --- a/src/os/windows/vm/perfMemory_windows.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/os/windows/vm/perfMemory_windows.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, 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 @@ -298,8 +298,8 @@ static char* get_user_name_slow(int vmid) { // directory search - char* oldest_user = NULL; - time_t oldest_ctime = 0; + char* latest_user = NULL; + time_t latest_ctime = 0; const char* tmpdirname = os::get_temp_directory(); @@ -375,18 +375,29 @@ continue; } - // compare and save filename with latest creation time - if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) { - - if (statbuf.st_ctime > oldest_ctime) { - char* user = strchr(dentry->d_name, '_') + 1; + // If we found a matching file with a newer creation time, then + // save the user name. The newer creation time indicates that + // we found a newer incarnation of the process associated with + // vmid. Due to the way that Windows recycles pids and the fact + // that we can't delete the file from the file system namespace + // until last close, it is possible for there to be more than + // one hsperfdata file with a name matching vmid (diff users). + // + // We no longer ignore hsperfdata files where (st_size == 0). + // In this function, all we're trying to do is determine the + // name of the user that owns the process associated with vmid + // so the size doesn't matter. Very rarely, we have observed + // hsperfdata files where (st_size == 0) and the st_size field + // later becomes the expected value. + // + if (statbuf.st_ctime > latest_ctime) { + char* user = strchr(dentry->d_name, '_') + 1; - if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user); - oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1); + if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user); + latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1); - strcpy(oldest_user, user); - oldest_ctime = statbuf.st_ctime; - } + strcpy(latest_user, user); + latest_ctime = statbuf.st_ctime; } FREE_C_HEAP_ARRAY(char, filename); @@ -399,7 +410,7 @@ os::closedir(tmpdirp); FREE_C_HEAP_ARRAY(char, tdbuf); - return(oldest_user); + return(latest_user); } // return the name of the user that owns the process identified by vmid. @@ -1339,6 +1350,38 @@ CloseHandle(fh); fh = NULL; return NULL; + } else { + // We created the file mapping, but rarely the size of the + // backing store file is reported as zero (0) which can cause + // failures when trying to use the hsperfdata file. + struct stat statbuf; + int ret_code = ::stat(filename, &statbuf); + if (ret_code == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("Could not get status information from file %s: %s\n", + filename, strerror(errno)); + } + CloseHandle(fmh); + CloseHandle(fh); + fh = NULL; + fmh = NULL; + return NULL; + } + + // We could always call FlushFileBuffers() but the Microsoft + // docs indicate that it is considered expensive so we only + // call it when we observe the size as zero (0). + if (statbuf.st_size == 0 && FlushFileBuffers(fh) != TRUE) { + DWORD lasterror = GetLastError(); + if (PrintMiscellaneous && Verbose) { + warning("could not flush file %s: %d\n", filename, lasterror); + } + CloseHandle(fmh); + CloseHandle(fh); + fh = NULL; + fmh = NULL; + return NULL; + } } // the file has been successfully created and the file mapping diff -r 5841dc1964f0 -r a97fd181b813 src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp --- a/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, 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 @@ -71,7 +71,7 @@ PVOID HandlerData; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; -#if MSC_VER < 1500 +#if _MSC_VER < 1500 /* Not needed for VS2008 compiler, comes from winnt.h. */ typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/BuildConfig.java --- a/src/share/tools/ProjectCreator/BuildConfig.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/BuildConfig.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -51,12 +51,14 @@ if (vars == null) vars = new Hashtable(); String flavourBuild = flavour + "_" + build; + String platformName = getFieldString(null, "PlatformName"); System.out.println(); System.out.println(flavourBuild); - put("Name", getCI().makeCfgName(flavourBuild)); + put("Name", getCI().makeCfgName(flavourBuild, platformName)); put("Flavour", flavour); put("Build", build); + put("PlatformName", platformName); // ones mentioned above were needed to expand format String buildBase = expandFormat(getFieldString(null, "BuildBase")); @@ -93,7 +95,7 @@ protected void initDefaultLinkerFlags() { Vector linkerFlags = new Vector(); - linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"))); + linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName"))); put("LinkerFlags", linkerFlags); } @@ -115,18 +117,15 @@ } - Vector getPreferredPaths(MacroDefinitions macros) { + Vector getPreferredPaths() { Vector preferredPaths = new Vector(); + // In the case of multiple files with the same name in - // different subdirectories, prefer the versions specified in - // the platform file as the "os_family" and "arch" macros. - for (Iterator iter = macros.getMacros(); iter.hasNext(); ) { - Macro macro = (Macro) iter.next(); - if (macro.name.equals("os_family") || - macro.name.equals("arch")) { - preferredPaths.add(macro.contents); - } - } + // different subdirectories, prefer these versions + preferredPaths.add("windows"); + preferredPaths.add("x86"); + preferredPaths.add("closed"); + // Also prefer "opto" over "adlc" for adlcVMDeps.hpp preferredPaths.add("opto"); @@ -137,18 +136,7 @@ void handleDB() { WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); - File incls = new File(get("OutputDir")+Util.sep+"incls"); - - incls.mkdirs(); - - MacroDefinitions macros = new MacroDefinitions(); - try { - macros.readFrom(getFieldString(null, "Platform"), false); - } catch (Exception e) { - throw new RuntimeException(e); - } - - putSpecificField("AllFilesHash", computeAllFiles(platform, macros)); + putSpecificField("AllFilesHash", computeAllFiles(platform)); } @@ -190,10 +178,10 @@ ht.put(expandFormat(key), expandFormat(value)); } - Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) { + Hashtable computeAllFiles(WinGammaPlatform platform) { Hashtable rv = new Hashtable(); DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); - Vector preferredPaths = getPreferredPaths(macros); + Vector preferredPaths = getPreferredPaths(); // Hold errors until end Vector filesNotFound = new Vector(); @@ -228,8 +216,7 @@ System.err.println("Error: some files were not found or " + "appeared in multiple subdirectories of " + "directory " + get("SourceBase") + " and could not " + - "be resolved with the os_family and arch " + - "macros in the platform file."); + "be resolved with os_family and arch."); if (filesNotFound.size() != 0) { System.err.println("Files not found:"); for (Iterator iter = filesNotFound.iterator(); @@ -254,10 +241,14 @@ Vector sysDefines = new Vector(); sysDefines.add("WIN32"); sysDefines.add("_WINDOWS"); - sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name")); + sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\""); sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\""); sysDefines.add("_JNI_IMPLEMENTATION_"); - sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); + if (vars.get("PlatformName").equals("Win32")) { + sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\""); + } else { + sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\""); + } sysDefines.addAll(defines); @@ -710,7 +701,7 @@ } abstract class CompilerInterface { abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); - abstract Vector getBaseLinkerFlags(String outDir, String outDll); + abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName); abstract Vector getDebugCompilerFlags(String opt); abstract Vector getDebugLinkerFlags(); abstract void getAdditionalNonKernelLinkerFlags(Vector rv); @@ -718,7 +709,7 @@ abstract Vector getProductLinkerFlags(); abstract String getOptFlag(); abstract String getNoOptFlag(); - abstract String makeCfgName(String flavourBuild); + abstract String makeCfgName(String flavourBuild, String platformName); void addAttr(Vector receiver, String attr, String value) { receiver.add(attr); receiver.add(value); diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/DirectoryTree.java --- a/src/share/tools/ProjectCreator/DirectoryTree.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/DirectoryTree.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -55,6 +55,9 @@ private Vector nodes = new Vector(); public FileIterator(Node rootNode) { + if(rootNode == null) { + return; + } nodes.add(rootNode); prune(); } @@ -112,10 +115,7 @@ throws IllegalArgumentException { File root = new File(Util.normalize(baseDirectory)); if (!root.isDirectory()) { - throw new IllegalArgumentException("baseDirectory \"" + - baseDirectory + - "\" does not exist or " + - "is not a directory"); + return; } try { root = root.getCanonicalFile(); diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/FileFormatException.java --- a/src/share/tools/ProjectCreator/FileFormatException.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/FileFormatException.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -22,7 +22,9 @@ * */ +@SuppressWarnings("serial") public class FileFormatException extends Exception { + public FileFormatException() { super(); } diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/Macro.java --- a/src/share/tools/ProjectCreator/Macro.java Tue Feb 22 15:26:36 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 1999, 2010, 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. - * - * 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. - * - */ - -public class Macro { - public String name; - public String contents; -} diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/MacroDefinitions.java --- a/src/share/tools/ProjectCreator/MacroDefinitions.java Tue Feb 22 15:26:36 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* - * Copyright (c) 1999, 2010, 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. - * - * 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. - * - */ - -import java.io.*; -import java.util.*; - -public class MacroDefinitions { - private Vector macros; - - public MacroDefinitions() { - macros = new Vector(); - } - - public void addMacro(String name, String contents) { - Macro macro = new Macro(); - macro.name = name; - macro.contents = contents; - macros.add(macro); - } - - private boolean lineIsEmpty(String s) { - for (int i = 0; i < s.length(); i++) { - if (!Character.isWhitespace(s.charAt(i))) { - return false; - } - } - return true; - } - - public void readFrom(String fileName, boolean missingOk) - throws FileNotFoundException, FileFormatException, IOException { - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(fileName)); - } catch (FileNotFoundException e) { - if (missingOk) { - return; - } else { - throw(e); - } - } - String line; - do { - line = reader.readLine(); - if (line != null) { - // This had to be rewritten (compare to Database.java) - // because the Solaris platform file has been - // repurposed and now contains "macros" with spaces in - // them. - - if ((!line.startsWith("//")) && - (!lineIsEmpty(line))) { - int nameBegin = -1; - int nameEnd = -1; - boolean gotEquals = false; - int contentsBegin = -1; - int contentsEnd = -1; - - int i = 0; - // Scan forward for beginning of name - while (i < line.length()) { - if (!Character.isWhitespace(line.charAt(i))) { - break; - } - i++; - } - nameBegin = i; - - // Scan forward for end of name - while (i < line.length()) { - if (Character.isWhitespace(line.charAt(i))) { - break; - } - i++; - } - nameEnd = i; - - // Scan forward for equals sign - while (i < line.length()) { - if (line.charAt(i) == '=') { - gotEquals = true; - break; - } - i++; - } - - // Scan forward for start of contents - i++; - while (i < line.length()) { - if (!Character.isWhitespace(line.charAt(i))) { - break; - } - i++; - } - contentsBegin = i; - - // Scan *backward* for end of contents - i = line.length() - 1; - while (i >= 0) { - if (!Character.isWhitespace(line.charAt(i))) { - break; - } - } - contentsEnd = i+1; - - // Now do consistency check - if (!((nameBegin < nameEnd) && - (nameEnd < contentsBegin) && - (contentsBegin < contentsEnd) && - (gotEquals == true))) { - throw new FileFormatException( - "Expected \"macroname = value\", " + - "but found: " + line - ); - } - - String name = line.substring(nameBegin, nameEnd); - String contents = line.substring(contentsBegin, - contentsEnd); - addMacro(name, contents); - } - } - } while (line != null); - reader.close(); - } - - /** This returns an Iterator of Macros. You should not mutate the - returned Macro objects or use the Iterator to remove - macros. */ - public Iterator getMacros() { - return macros.iterator(); - } -} diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/Util.java --- a/src/share/tools/ProjectCreator/Util.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/Util.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -47,7 +47,7 @@ return sb.toString(); } - static String join(String padder, String v[]) { + static String join(String padder, String v[]) { StringBuffer sb = new StringBuffer(); for (int i=0; i 2) { + if (file.charAt(1) == ':' && file.charAt(2) == '/') { + // convert drive letter to uppercase + String drive = file.substring(0, 1).toUpperCase(); + return drive + file.substring(1); + } + } + return file; } static String sep = File.separator; - static String os = "Win32"; //System.getProperty("os.name"); } diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/WinGammaPlatform.java --- a/src/share/tools/ProjectCreator/WinGammaPlatform.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -235,13 +235,6 @@ (locationsInTree.size() == 0)) { filesNotFound.add(fileName); } else if (locationsInTree.size() > 1) { - // We shouldn't have duplicate file names in our workspace. - System.err.println(); - System.err.println("There are multiple files named as: " + fileName); - System.exit(-1); - // The following code could be safely removed if we don't need duplicate - // file names. - // Iterate through them, trying to find one with a // preferred path search: @@ -336,7 +329,7 @@ String projectName = getProjectName(projectFileName, ext); - writeProjectFile(projectFileName, projectName, createAllConfigs()); + writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName"))); } protected void writePrologue(String[] args) { @@ -376,7 +369,13 @@ HsArgHandler.STRING ), - new HsArgRule("-projectFileName", + new HsArgRule("-platformName", + "PlatformName", + null, + HsArgHandler.STRING + ), + + new HsArgRule("-projectFileName", "ProjectFileName", null, HsArgHandler.STRING @@ -394,12 +393,6 @@ HsArgHandler.STRING ), - new HsArgRule("-platform", - "Platform", - null, - HsArgHandler.STRING - ), - new HsArgRule("-absoluteInclude", "AbsoluteInclude", null, @@ -590,28 +583,27 @@ BuildConfig.putField(null, "PlatformObject", this); } - Vector createAllConfigs() { + Vector createAllConfigs(String platform) { Vector allConfigs = new Vector(); allConfigs.add(new C1DebugConfig()); - boolean b = true; - if (b) { - allConfigs.add(new C1FastDebugConfig()); - allConfigs.add(new C1ProductConfig()); + allConfigs.add(new C1FastDebugConfig()); + allConfigs.add(new C1ProductConfig()); - allConfigs.add(new C2DebugConfig()); - allConfigs.add(new C2FastDebugConfig()); - allConfigs.add(new C2ProductConfig()); + allConfigs.add(new C2DebugConfig()); + allConfigs.add(new C2FastDebugConfig()); + allConfigs.add(new C2ProductConfig()); - allConfigs.add(new TieredDebugConfig()); - allConfigs.add(new TieredFastDebugConfig()); - allConfigs.add(new TieredProductConfig()); + allConfigs.add(new TieredDebugConfig()); + allConfigs.add(new TieredFastDebugConfig()); + allConfigs.add(new TieredProductConfig()); - allConfigs.add(new CoreDebugConfig()); - allConfigs.add(new CoreFastDebugConfig()); - allConfigs.add(new CoreProductConfig()); + allConfigs.add(new CoreDebugConfig()); + allConfigs.add(new CoreFastDebugConfig()); + allConfigs.add(new CoreProductConfig()); + if (platform.equals("Win32")) { allConfigs.add(new KernelDebugConfig()); allConfigs.add(new KernelFastDebugConfig()); allConfigs.add(new KernelProductConfig()); diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/WinGammaPlatformVC6.java --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -223,7 +223,7 @@ return rv; } - Vector getBaseLinkerFlags(String outDir, String outDll) { + Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { Vector rv = new Vector(); rv.add("PROP Ignore_Export_Lib 0"); @@ -231,8 +231,12 @@ rv.add("ADD CPP /MD"); rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " + " advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.lib"); + String machine = "/machine:I386"; + if (platformName.equals("x64")) { + machine = "/machine:X64"; + } rv.add("ADD LINK32 /out:\""+outDll+"\" "+ - " /nologo /subsystem:windows /machine:I386" + + " /nologo /subsystem:windows /machine:" + machine + " /nologo /base:\"0x8000000\" /subsystem:windows /dll" + " /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+ " /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+ @@ -287,7 +291,7 @@ return "d"; } - String makeCfgName(String flavourBuild) { - return "vm - "+ Util.os + " " + flavourBuild; + String makeCfgName(String flavourBuild, String platform) { + return "vm - "+ platform + " " + flavourBuild; } } diff -r 5841dc1964f0 -r a97fd181b813 src/share/tools/ProjectCreator/WinGammaPlatformVC7.java --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -37,7 +37,7 @@ public void writeProjectFile(String projectFileName, String projectName, Vector allConfigs) throws IOException { System.out.println(); - System.out.println(" Writing .vcproj file..."); + System.out.println(" Writing .vcproj file: "+projectFileName); // If we got this far without an error, we're safe to actually // write the .vcproj file printWriter = new PrintWriter(new FileWriter(projectFileName)); @@ -54,9 +54,8 @@ "SccLocalPath", "" } ); - startTag("Platforms", null); - tag("Platform", new String[] {"Name", Util.os}); + tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")}); endTag("Platforms"); startTag("Configurations", null); @@ -81,12 +80,47 @@ abstract class NameFilter { - protected String fname; + protected String fname; abstract boolean match(FileInfo fi); String filterString() { return ""; } String name() { return this.fname;} + + @Override + // eclipse auto-generated + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + getOuterType().hashCode(); + result = prime * result + ((fname == null) ? 0 : fname.hashCode()); + return result; + } + + @Override + // eclipse auto-generated + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + NameFilter other = (NameFilter) obj; + if (!getOuterType().equals(other.getOuterType())) + return false; + if (fname == null) { + if (other.fname != null) + return false; + } else if (!fname.equals(other.fname)) + return false; + return true; + } + + // eclipse auto-generated + private WinGammaPlatformVC7 getOuterType() { + return WinGammaPlatformVC7.this; + } } class DirectoryFilter extends NameFilter { @@ -109,9 +143,50 @@ boolean match(FileInfo fi) { - int lastSlashIndex = fi.full.lastIndexOf('/'); - String fullDir = fi.full.substring(0, lastSlashIndex); - return fullDir.endsWith(dir); + int lastSlashIndex = fi.full.lastIndexOf('/'); + String fullDir = fi.full.substring(0, lastSlashIndex); + return fullDir.endsWith(dir); + } + + @Override + // eclipse auto-generated + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + getOuterType().hashCode(); + result = prime * result + baseLen; + result = prime * result + ((dir == null) ? 0 : dir.hashCode()); + result = prime * result + dirLen; + return result; + } + + @Override + // eclipse auto-generated + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + DirectoryFilter other = (DirectoryFilter) obj; + if (!getOuterType().equals(other.getOuterType())) + return false; + if (baseLen != other.baseLen) + return false; + if (dir == null) { + if (other.dir != null) + return false; + } else if (!dir.equals(other.dir)) + return false; + if (dirLen != other.dirLen) + return false; + return true; + } + + // eclipse auto-generated + private WinGammaPlatformVC7 getOuterType() { + return WinGammaPlatformVC7.this; } } @@ -232,32 +307,39 @@ DirectoryFilter container = null; for(FileInfo fileInfo : files) { - if (!fileInfo.full.startsWith(sbase)) { - continue; - } + if (!fileInfo.full.startsWith(sbase)) { + continue; + } + + int lastSlash = fileInfo.full.lastIndexOf('/'); + String dir = fileInfo.full.substring(sbase.length(), lastSlash); + if(dir.equals("share/vm")) { + // skip files directly in share/vm - should only be precompiled.hpp which is handled below + continue; + } + if (!dir.equals(currentDir)) { + currentDir = dir; + if (container != null && !rv.contains(container)) { + rv.add(container); + } - int lastSlash = fileInfo.full.lastIndexOf('/'); - String dir = fileInfo.full.substring(sbase.length(), lastSlash); - if(dir.equals("share/vm")) { - // skip files directly in share/vm - should only be precompiled.hpp which is handled below - continue; - } - if (!dir.equals(currentDir)) { - currentDir = dir; - if (container != null) { - rv.add(container); - } - - // remove "share/vm/" from names - String name = dir; - if (dir.startsWith("share/vm/")) { - name = dir.substring("share/vm/".length(), dir.length()); - } - container = new DirectoryFilter(name, dir, sbase); - } + // remove "share/vm/" from names + String name = dir; + if (dir.startsWith("share/vm/")) { + name = dir.substring("share/vm/".length(), dir.length()); + } + DirectoryFilter newfilter = new DirectoryFilter(name, dir, sbase); + int i = rv.indexOf(newfilter); + if(i == -1) { + container = newfilter; + } else { + // if the filter already exists, reuse it + container = (DirectoryFilter) rv.get(i); + } + } } - if (container != null) { - rv.add(container); + if (container != null && !rv.contains(container)) { + rv.add(container); } ContainerFilter generated = new ContainerFilter("Generated"); @@ -583,7 +665,7 @@ return rv; } - Vector getBaseLinkerFlags(String outDir, String outDll) { + Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) { Vector rv = new Vector(); addAttr(rv, "Name", "VCLinkerTool"); @@ -610,8 +692,13 @@ addAttr(rv, "SubSystem", "2"); addAttr(rv, "BaseAddress", "0x8000000"); addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); - // Set /MACHINE option. 1 is machineX86 - addAttr(rv, "TargetMachine", "1"); + if(platformName.equals("Win32")) { + // Set /MACHINE option. 1 is X86 + addAttr(rv, "TargetMachine", "1"); + } else { + // Set /MACHINE option. 17 is X64 + addAttr(rv, "TargetMachine", "17"); + } return rv; } @@ -656,12 +743,6 @@ addAttr(rv, "Optimization", "2"); // Set /Oy- option addAttr(rv, "OmitFramePointers", "FALSE"); - } - - Vector getProductCompilerFlags() { - Vector rv = new Vector(); - - getProductCompilerFlags_common(rv); // Set /Ob option. 1 is expandOnlyInline addAttr(rv, "InlineFunctionExpansion", "1"); // Set /GF option. @@ -670,6 +751,12 @@ addAttr(rv, "RuntimeLibrary", "2"); // Set /Gy option addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); + } + + Vector getProductCompilerFlags() { + Vector rv = new Vector(); + + getProductCompilerFlags_common(rv); return rv; } @@ -693,7 +780,7 @@ return "0"; } - String makeCfgName(String flavourBuild) { - return flavourBuild + "|" + Util.os; + String makeCfgName(String flavourBuild, String platform) { + return flavourBuild + "|" + platform; } } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/adlc/adlc.hpp --- a/src/share/vm/adlc/adlc.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/adlc/adlc.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -42,11 +42,6 @@ using namespace std; #endif -// make sure the MSC_VER and _MSC_VER settings make sense -#if _MSC_VER != MSC_VER && (_MSC_VER != 1400 || MSC_VER != 1399) -#error "Something is wrong with the detection of MSC_VER in the makefiles" -#endif - #if _MSC_VER >= 1400 #define strdup _strdup #endif diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/classfile/classFileParser.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -331,7 +331,7 @@ length, CHECK_(nullHandle)); constantPoolOop constant_pool = oopFactory::new_constantPool(length, - methodOopDesc::IsSafeConc, + oopDesc::IsSafeConc, CHECK_(nullHandle)); constantPoolHandle cp (THREAD, constant_pool); @@ -1929,10 +1929,9 @@ } // All sizing information for a methodOop is finally available, now create it - methodOop m_oop = oopFactory::new_method( - code_length, access_flags, linenumber_table_length, - total_lvt_length, checked_exceptions_length, - methodOopDesc::IsSafeConc, CHECK_(nullHandle)); + methodOop m_oop = oopFactory::new_method(code_length, access_flags, linenumber_table_length, + total_lvt_length, checked_exceptions_length, + oopDesc::IsSafeConc, CHECK_(nullHandle)); methodHandle m (THREAD, m_oop); ClassLoadingService::add_class_method_size(m_oop->size()*HeapWordSize); diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1040,9 +1040,10 @@ } else { // must read from what 'p' points to in each loop. klassOop k = ((volatile oopDesc*)p)->klass_or_null(); - if (k != NULL && - ((oopDesc*)p)->is_parsable() && - ((oopDesc*)p)->is_conc_safe()) { + // We trust the size of any object that has a non-NULL + // klass and (for those in the perm gen) is parsable + // -- irrespective of its conc_safe-ty. + if (k != NULL && ((oopDesc*)p)->is_parsable()) { assert(k->is_oop(), "Should really be klass oop."); oop o = (oop)p; assert(o->is_oop(), "Should be an oop"); @@ -1051,6 +1052,7 @@ assert(res != 0, "Block size should not be 0"); return res; } else { + // May return 0 if P-bits not present. return c->block_size_if_printezis_bits(p); } } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -6360,18 +6360,16 @@ // A variant of the above (block_size_using_printezis_bits()) except // that we return 0 if the P-bits are not yet set. size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const { - if (_markBitMap.isMarked(addr)) { - assert(_markBitMap.isMarked(addr + 1), "Missing Printezis bit?"); + if (_markBitMap.isMarked(addr + 1)) { + assert(_markBitMap.isMarked(addr), "P-bit can be set only for marked objects"); HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2); size_t size = pointer_delta(nextOneAddr + 1, addr); assert(size == CompactibleFreeListSpace::adjustObjectSize(size), "alignment problem"); assert(size >= 3, "Necessary for Printezis marks to work"); return size; - } else { - assert(!_markBitMap.isMarked(addr + 1), "Bit map inconsistency?"); - return 0; - } + } + return 0; } HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const { @@ -9212,7 +9210,6 @@ size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) { size_t res = _sp->block_size_no_stall(addr, _collector); - assert(res != 0, "Should always be able to compute a size"); if (_sp->block_is_obj(addr)) { if (_live_bit_map->isMarked(addr)) { // It can't have been dead in a previous cycle @@ -9221,6 +9218,7 @@ _dead_bit_map->mark(addr); // mark the dead object } } + // Could be 0, if the block size could not be computed without stalling. return res; } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -132,8 +132,7 @@ VM_GenCollectFullConcurrent(unsigned int gc_count_before, unsigned int full_gc_count_before, GCCause::Cause gc_cause) - : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) { - _gc_cause = gc_cause; + : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */) { assert(FullGCCount_lock != NULL, "Error"); assert(UseAsyncConcMarkSweepGC, "Else will hang caller"); } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/g1/vm_operations_g1.hpp --- a/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, 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 @@ -44,7 +44,7 @@ public: VM_G1OperationWithAllocRequest(unsigned int gc_count_before, size_t word_size) - : VM_GC_Operation(gc_count_before), + : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), _word_size(word_size), _result(NULL), _pause_succeeded(false) { } HeapWord* result() { return _result; } bool pause_succeeded() { return _pause_succeeded; } @@ -55,9 +55,7 @@ VM_G1CollectFull(unsigned int gc_count_before, unsigned int full_gc_count_before, GCCause::Cause cause) - : VM_GC_Operation(gc_count_before, full_gc_count_before) { - _gc_cause = cause; - } + : VM_GC_Operation(gc_count_before, cause, full_gc_count_before) { } virtual VMOp_Type type() const { return VMOp_G1CollectFull; } virtual void doit(); virtual const char* name() const { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -1196,11 +1196,6 @@ static inline void adjust_pointer(oop* p) { adjust_pointer(p, false); } static inline void adjust_pointer(narrowOop* p) { adjust_pointer(p, false); } - template - static inline void adjust_pointer(T* p, - HeapWord* beg_addr, - HeapWord* end_addr); - // Reference Processing static ReferenceProcessor* const ref_processor() { return _ref_processor; } @@ -1408,15 +1403,6 @@ return ((HeapWord*) k) >= dense_prefix(perm_space_id); } -template -inline void PSParallelCompact::adjust_pointer(T* p, - HeapWord* beg_addr, - HeapWord* end_addr) { - if (is_in((HeapWord*)p, beg_addr, end_addr)) { - adjust_pointer(p); - } -} - #ifdef ASSERT inline void PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr) diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, 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 @@ -34,7 +34,7 @@ // The following methods are used by the parallel scavenge collector VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size, bool is_tlab, unsigned int gc_count) : - VM_GC_Operation(gc_count), + VM_GC_Operation(gc_count, GCCause::_allocation_failure), _size(size), _is_tlab(is_tlab), _result(NULL) @@ -57,7 +57,7 @@ VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size, unsigned int gc_count, unsigned int full_gc_count) : - VM_GC_Operation(gc_count, full_gc_count, true /* full */), + VM_GC_Operation(gc_count, GCCause::_allocation_failure, full_gc_count, true /* full */), _size(size), _result(NULL) { @@ -80,9 +80,8 @@ VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count, GCCause::Cause gc_cause) : - VM_GC_Operation(gc_count, full_gc_count, true /* full */) + VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */) { - _gc_cause = gc_cause; } void VM_ParallelGCSystemGC::doit() { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/shared/vmGCOperations.cpp --- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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,8 @@ bool VM_GC_Operation::doit_prologue() { assert(Thread::current()->is_Java_thread(), "just checking"); + assert(((_gc_cause != GCCause::_no_gc) && + (_gc_cause != GCCause::_no_cause_specified)), "Illegal GCCause"); acquire_pending_list_lock(); // If the GC count has changed someone beat us to the collection diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_implementation/shared/vmGCOperations.hpp --- a/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -85,6 +85,7 @@ public: VM_GC_Operation(unsigned int gc_count_before, + GCCause::Cause _cause, unsigned int full_gc_count_before = 0, bool full = false) { _full = full; @@ -92,7 +93,7 @@ _gc_count_before = gc_count_before; // A subclass constructor will likely overwrite the following - _gc_cause = GCCause::_no_cause_specified; + _gc_cause = _cause; _gc_locked = false; @@ -136,6 +137,7 @@ VM_GC_HeapInspection(outputStream* out, bool request_full_gc, bool need_prologue) : VM_GC_Operation(0 /* total collections, dummy, ignored */, + GCCause::_heap_inspection /* GC Cause */, 0 /* total full collections, dummy, ignored */, request_full_gc) { _out = out; @@ -160,7 +162,7 @@ VM_GenCollectForAllocation(size_t size, bool tlab, unsigned int gc_count_before) - : VM_GC_Operation(gc_count_before), + : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), _size(size), _tlab(tlab) { _res = NULL; @@ -182,9 +184,8 @@ unsigned int full_gc_count_before, GCCause::Cause gc_cause, int max_level) - : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */), - _max_level(max_level) - { _gc_cause = gc_cause; } + : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */), + _max_level(max_level) { } ~VM_GenCollectFull() {} virtual VMOp_Type type() const { return VMOp_GenCollectFull; } virtual void doit(); @@ -199,7 +200,7 @@ unsigned int gc_count_before, unsigned int full_gc_count_before, GCCause::Cause gc_cause) - : VM_GC_Operation(gc_count_before, full_gc_count_before, true), + : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), _size(size) { _res = NULL; _gc_cause = gc_cause; diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_interface/collectedHeap.cpp --- a/src/share/vm/gc_interface/collectedHeap.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -100,8 +100,7 @@ } } -void CollectedHeap::check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) - { +void CollectedHeap::check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) { if (CheckMemoryInitialization && ZapUnusedHeapArea) { for (size_t slot = 0; slot < size; slot += 1) { assert((*(intptr_t*) (addr + slot)) == ((intptr_t) badHeapWordVal), diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_interface/gcCause.cpp --- a/src/share/vm/gc_interface/gcCause.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_interface/gcCause.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, 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 @@ -92,28 +92,3 @@ } ShouldNotReachHere(); } - -#ifndef PRODUCT - -bool GCCause::is_for_full_collection(GCCause::Cause cause) { - bool result; - - // There are more GCCause::Cause types than listed here. - // For brevity, we list only those that cause full collections. - switch (cause) { - case _allocation_failure: - case _tenured_generation_full: - case _permanent_generation_full: - case _cms_generation_full: - case _last_ditch_collection: - result = true; - break; - - default: - result = false; - break; - } - return result; -} - -#endif // PRODUCT diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/gc_interface/gcCause.hpp --- a/src/share/vm/gc_interface/gcCause.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/gc_interface/gcCause.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, 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 @@ -85,8 +85,6 @@ // Return a string describing the GCCause. static const char* to_string(GCCause::Cause cause); - // Return true if the GCCause is for a full collection. - static bool is_for_full_collection(GCCause::Cause cause) PRODUCT_RETURN0; }; #endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/interpreter/rewriter.cpp --- a/src/share/vm/interpreter/rewriter.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/interpreter/rewriter.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -67,13 +67,11 @@ // Creates a constant pool cache given a CPC map -// This creates the constant pool cache initially in a state -// that is unsafe for concurrent GC processing but sets it to -// a safe mode before the constant pool cache is returned. void Rewriter::make_constant_pool_cache(TRAPS) { const int length = _cp_cache_map.length(); constantPoolCacheOop cache = - oopFactory::new_constantPoolCache(length, methodOopDesc::IsUnsafeConc, CHECK); + oopFactory::new_constantPoolCache(length, CHECK); + No_Safepoint_Verifier nsv; cache->initialize(_cp_cache_map); // Don't bother with the next pass if there is no JVM_CONSTANT_InvokeDynamic. diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/memory/oopFactory.cpp --- a/src/share/vm/memory/oopFactory.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/memory/oopFactory.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -92,12 +92,21 @@ } } -objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { +objArrayOop oopFactory::new_system_objArray(int length, bool in_perm_gen, TRAPS) { int size = objArrayOopDesc::object_size(length); KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj()); - objArrayOop o = (objArrayOop) - Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); + oop o; + if (in_perm_gen) { + o = Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); + } else { + o = Universe::heap()->array_allocate(klass, size, length, CHECK_NULL); + } // initialization not needed, allocated cleared + return (objArrayOop) o; +} + +objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { + objArrayOop o = oopFactory::new_system_objArray(length, true, CHECK_NULL); return o; } @@ -111,10 +120,9 @@ constantPoolCacheOop oopFactory::new_constantPoolCache(int length, - bool is_conc_safe, TRAPS) { constantPoolCacheKlass* ck = constantPoolCacheKlass::cast(Universe::constantPoolCacheKlassObj()); - return ck->allocate(length, is_conc_safe, CHECK_NULL); + return ck->allocate(length, CHECK_NULL); } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/memory/oopFactory.hpp --- a/src/share/vm/memory/oopFactory.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/memory/oopFactory.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -69,7 +69,6 @@ bool is_conc_safe, TRAPS); static constantPoolCacheOop new_constantPoolCache(int length, - bool is_conc_safe, TRAPS); // Instance classes @@ -103,6 +102,7 @@ // System object arrays static objArrayOop new_system_objArray(int length, TRAPS); + static objArrayOop new_system_objArray(int length, bool in_perm_gen, TRAPS); // Regular object arrays static objArrayOop new_objArray(klassOop klass, int length, TRAPS); diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/arrayKlassKlass.cpp --- a/src/share/vm/oops/arrayKlassKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/arrayKlassKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -128,27 +128,6 @@ } return klassKlass::oop_update_pointers(cm, obj); } - -int -arrayKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert(obj->is_klass(), "must be klass"); - arrayKlass* ak = arrayKlass::cast(klassOop(obj)); - - oop* p; - p = ak->adr_component_mirror(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = ak->adr_lower_dimension(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = ak->adr_higher_dimension(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - - { - HandleMark hm; - ak->vtable()->oop_update_pointers(cm, beg_addr, end_addr); - } - return klassKlass::oop_update_pointers(cm, obj, beg_addr, end_addr); -} #endif // SERIALGC // Printing diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/compiledICHolderKlass.cpp --- a/src/share/vm/oops/compiledICHolderKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/compiledICHolderKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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,21 +145,6 @@ PSParallelCompact::adjust_pointer(c->adr_holder_klass()); return c->object_size(); } - -int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm, - oop obj, - HeapWord* beg_addr, - HeapWord* end_addr) { - assert(obj->is_compiledICHolder(), "must be compiledICHolder"); - compiledICHolderOop c = compiledICHolderOop(obj); - - oop* p; - p = c->adr_holder_method(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = c->adr_holder_klass(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - return c->object_size(); -} #endif // SERIALGC // Printing diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/constMethodKlass.cpp --- a/src/share/vm/oops/constMethodKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/constMethodKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -184,21 +184,6 @@ } return cm_oop->object_size(); } - -int constMethodKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, - HeapWord* end_addr) { - assert(obj->is_constMethod(), "should be constMethod"); - constMethodOop cm_oop = constMethodOop(obj); - - oop* const beg_oop = MAX2((oop*)beg_addr, cm_oop->oop_block_beg()); - oop* const end_oop = MIN2((oop*)end_addr, cm_oop->oop_block_end()); - for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) { - PSParallelCompact::adjust_pointer(cur_oop); - } - - return cm_oop->object_size(); -} #endif // SERIALGC // Printing diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/constantPoolKlass.cpp --- a/src/share/vm/oops/constantPoolKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/constantPoolKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -55,26 +55,35 @@ constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) { int size = constantPoolOopDesc::object_size(length); KlassHandle klass (THREAD, as_klassOop()); - constantPoolOop c = - (constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); + assert(klass()->is_oop(), "Can't be null, else handlizing of c below won't work"); + constantPoolHandle pool; + { + constantPoolOop c = + (constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); + assert(c->klass_or_null() != NULL, "Handlizing below won't work"); + pool = constantPoolHandle(THREAD, c); + } - c->set_length(length); - c->set_tags(NULL); - c->set_cache(NULL); - c->set_operands(NULL); - c->set_pool_holder(NULL); - c->set_flags(0); + pool->set_length(length); + pool->set_tags(NULL); + pool->set_cache(NULL); + pool->set_operands(NULL); + pool->set_pool_holder(NULL); + pool->set_flags(0); // only set to non-zero if constant pool is merged by RedefineClasses - c->set_orig_length(0); + pool->set_orig_length(0); // if constant pool may change during RedefineClasses, it is created // unsafe for GC concurrent processing. - c->set_is_conc_safe(is_conc_safe); + pool->set_is_conc_safe(is_conc_safe); // all fields are initialized; needed for GC + // Note: because we may be in this "conc_unsafe" state when allocating + // t_oop below, which may in turn cause a GC, it is imperative that our + // size be correct, consistent and henceforth stable, at this stage. + assert(pool->is_oop() && pool->is_parsable(), "Else size() below is unreliable"); + assert(size == pool->size(), "size() is wrong"); + // initialize tag array - // Note: cannot introduce constant pool handle before since it is not - // completely initialized (no class) -> would cause assertion failure - constantPoolHandle pool (THREAD, c); typeArrayOop t_oop = oopFactory::new_permanent_byteArray(length, CHECK_NULL); typeArrayHandle tags (THREAD, t_oop); for (int index = 0; index < length; index++) { @@ -82,6 +91,8 @@ } pool->set_tags(tags()); + // Check that our size was stable at its old value. + assert(size == pool->size(), "size() changed"); return pool(); } @@ -271,40 +282,6 @@ return cp->object_size(); } -int -constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert (obj->is_constantPool(), "obj must be constant pool"); - constantPoolOop cp = (constantPoolOop) obj; - - // If the tags array is null we are in the middle of allocating this constant - // pool. - if (cp->tags() != NULL) { - oop* base = (oop*)cp->base(); - oop* const beg_oop = MAX2((oop*)beg_addr, base); - oop* const end_oop = MIN2((oop*)end_addr, base + cp->length()); - const size_t beg_idx = pointer_delta(beg_oop, base, sizeof(oop*)); - const size_t end_idx = pointer_delta(end_oop, base, sizeof(oop*)); - for (size_t cur_idx = beg_idx; cur_idx < end_idx; ++cur_idx, ++base) { - if (cp->is_pointer_entry(int(cur_idx))) { - PSParallelCompact::adjust_pointer(base); - } - } - } - - oop* p; - p = cp->tags_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = cp->cache_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = cp->operands_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = cp->pool_holder_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - - return cp->object_size(); -} - void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPool(), "should be constant pool"); constantPoolOop cp = (constantPoolOop) obj; diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/cpCacheKlass.cpp --- a/src/share/vm/oops/cpCacheKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/cpCacheKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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,43 +49,31 @@ constantPoolCacheOop constantPoolCacheKlass::allocate(int length, - bool is_conc_safe, TRAPS) { // allocate memory int size = constantPoolCacheOopDesc::object_size(length); KlassHandle klass (THREAD, as_klassOop()); - // This is the original code. The code from permanent_obj_allocate() - // was in-lined to allow the setting of is_conc_safe before the klass - // is installed. + // Commented out below is the original code. The code from + // permanent_obj_allocate() was in-lined so that we could + // set the _length field, necessary to correctly compute its + // size(), before setting its klass word further below. // constantPoolCacheOop cache = (constantPoolCacheOop) // CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); oop obj = CollectedHeap::permanent_obj_allocate_no_klass_install(klass, size, CHECK_NULL); - constantPoolCacheOop cache = (constantPoolCacheOop) obj; - cache->set_is_conc_safe(is_conc_safe); - // The store to is_conc_safe must be visible before the klass - // is set. This should be done safely because _is_conc_safe has - // been declared volatile. If there are any problems, consider adding - // OrderAccess::storestore(); - CollectedHeap::post_allocation_install_obj_klass(klass, obj, size); NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value((HeapWord*) obj, size)); - - // The length field affects the size of the object. The allocation - // above allocates the correct size (see calculation of "size") but - // the size() method of the constant pool cache oop will not reflect - // that size until the correct length is set. - cache->set_length(length); + constantPoolCacheOop cache = (constantPoolCacheOop) obj; + assert(!UseConcMarkSweepGC || obj->klass_or_null() == NULL, + "klass should be NULL here when using CMS"); + cache->set_length(length); // should become visible before klass is set below. + cache->set_constant_pool(NULL); - // The store of the length must be visible before is_conc_safe is - // set to a safe state. - // This should be done safely because _is_conc_safe has - // been declared volatile. If there are any problems, consider adding - // OrderAccess::storestore(); - cache->set_is_conc_safe(methodOopDesc::IsSafeConc); - cache->set_constant_pool(NULL); + OrderAccess::storestore(); + obj->set_klass(klass()); + assert(cache->size() == size, "Incorrect cache->size()"); return cache; } @@ -176,11 +164,6 @@ return size; } -bool constantPoolCacheKlass::oop_is_conc_safe(oop obj) const { - assert(obj->is_constantPoolCache(), "should be constant pool"); - return constantPoolCacheOop(obj)->is_conc_safe(); -} - #ifndef SERIALGC void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { @@ -220,25 +203,6 @@ return cache->object_size(); } - -int -constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, - HeapWord* end_addr) { - assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); - constantPoolCacheOop cache = (constantPoolCacheOop)obj; - - // Iteration over constant pool cache instance variables - oop* p; - p = (oop*)cache->constant_pool_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - - // Iteration over constant pool cache entries - for (int i = 0; i < cache->length(); ++i) { - cache->entry_at(i)->update_pointers(beg_addr, end_addr); - } - return cache->object_size(); -} #endif // SERIALGC void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/cpCacheKlass.hpp --- a/src/share/vm/oops/cpCacheKlass.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/cpCacheKlass.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -39,7 +39,7 @@ // Allocation DEFINE_ALLOCATE_PERMANENT(constantPoolCacheKlass); - constantPoolCacheOop allocate(int length, bool is_conc_safe, TRAPS); + constantPoolCacheOop allocate(int length, TRAPS); static klassOop create_klass(TRAPS); // Casting from klassOop @@ -55,7 +55,6 @@ // Garbage collection void oop_follow_contents(oop obj); int oop_adjust_pointers(oop obj); - virtual bool oop_is_conc_safe(oop obj) const; // Parallel Scavenge and Parallel Old PARALLEL_GC_DECLS diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/cpCacheOop.cpp --- a/src/share/vm/oops/cpCacheOop.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/cpCacheOop.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -368,16 +368,6 @@ PSParallelCompact::adjust_pointer((oop*)&_f2); } } - -void ConstantPoolCacheEntry::update_pointers(HeapWord* beg_addr, - HeapWord* end_addr) { - assert(in_words(size()) == 4, "check code below - may need adjustment"); - // field[1] is always oop or NULL - PSParallelCompact::adjust_pointer((oop*)&_f1, beg_addr, end_addr); - if (is_vfinal()) { - PSParallelCompact::adjust_pointer((oop*)&_f2, beg_addr, end_addr); - } -} #endif // SERIALGC // RedefineClasses() API support: diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/cpCacheOop.hpp --- a/src/share/vm/oops/cpCacheOop.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/cpCacheOop.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -287,7 +287,6 @@ #endif // SERIALGC void update_pointers(); - void update_pointers(HeapWord* beg_addr, HeapWord* end_addr); // RedefineClasses() API support: // If this constantPoolCacheEntry refers to old_method then update it @@ -321,9 +320,6 @@ private: int _length; constantPoolOop _constant_pool; // the corresponding constant pool - // If true, safe for concurrent GC processing, - // Set unconditionally in constantPoolCacheKlass::allocate() - volatile bool _is_conc_safe; // Sizing debug_only(friend class ClassVerifier;) @@ -390,12 +386,6 @@ return entry_at(primary_index); } - // GC support - // If the _length field has not been set, the size of the - // constantPoolCache cannot be correctly calculated. - bool is_conc_safe() { return _is_conc_safe; } - void set_is_conc_safe(bool v) { _is_conc_safe = v; } - // Code generation static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); } static ByteSize entry_offset(int raw_index) { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/instanceKlass.cpp --- a/src/share/vm/oops/instanceKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/instanceKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -1736,14 +1736,6 @@ PSParallelCompact::adjust_pointer(p), \ assert_nothing) } - -void instanceKlass::update_static_fields(HeapWord* beg_addr, HeapWord* end_addr) { - InstanceKlass_BOUNDED_OOP_ITERATE( \ - start_of_static_fields(), static_oop_field_size(), \ - beg_addr, end_addr, \ - PSParallelCompact::adjust_pointer(p), \ - assert_nothing ) -} #endif // SERIALGC void instanceKlass::oop_follow_contents(oop obj) { @@ -1876,15 +1868,6 @@ return size_helper(); } -int instanceKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - InstanceKlass_BOUNDED_OOP_MAP_ITERATE( \ - obj, beg_addr, end_addr, \ - PSParallelCompact::adjust_pointer(p), \ - assert_nothing) - return size_helper(); -} - void instanceKlass::push_static_fields(PSPromotionManager* pm) { InstanceKlass_OOP_ITERATE( \ start_of_static_fields(), static_oop_field_size(), \ diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/instanceKlass.hpp --- a/src/share/vm/oops/instanceKlass.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/instanceKlass.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -740,7 +740,6 @@ void follow_static_fields(ParCompactionManager* cm); void copy_static_fields(ParCompactionManager* cm); void update_static_fields(); - void update_static_fields(HeapWord* beg_addr, HeapWord* end_addr); #endif // SERIALGC // Naming diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/instanceKlassKlass.cpp --- a/src/share/vm/oops/instanceKlassKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -353,35 +353,6 @@ return ik->object_size(); } -int instanceKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, - HeapWord* end_addr) { - assert(obj->is_klass(),"must be a klass"); - assert(klassOop(obj)->klass_part()->oop_is_instance_slow(), - "must be instance klass"); - - instanceKlass* ik = instanceKlass::cast(klassOop(obj)); - ik->update_static_fields(beg_addr, end_addr); - ik->vtable()->oop_update_pointers(cm, beg_addr, end_addr); - ik->itable()->oop_update_pointers(cm, beg_addr, end_addr); - - oop* const beg_oop = MAX2((oop*)beg_addr, ik->oop_block_beg()); - oop* const end_oop = MIN2((oop*)end_addr, ik->oop_block_end()); - for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) { - PSParallelCompact::adjust_pointer(cur_oop); - } - - // The oop_map_cache, jni_ids and jni_id_map are allocated from the C heap, - // and so don't lie within any 'Chunk' boundaries. Update them when the - // lowest addressed oop in the instanceKlass 'oop_block' is updated. - if (beg_oop == ik->oop_block_beg()) { - OopClosure* closure = PSParallelCompact::adjust_root_pointer_closure(); - iterate_c_heap_oops(ik, closure); - } - - klassKlass::oop_update_pointers(cm, obj, beg_addr, end_addr); - return ik->object_size(); -} #endif // SERIALGC klassOop diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/instanceRefKlass.cpp --- a/src/share/vm/oops/instanceRefKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/instanceRefKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -344,33 +344,6 @@ } return size_helper(); } - - -template void -specialized_oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - T* p; - T* referent_addr = p = (T*)java_lang_ref_Reference::referent_addr(obj); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - T* next_addr = p = (T*)java_lang_ref_Reference::next_addr(obj); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - T* discovered_addr = p = (T*)java_lang_ref_Reference::discovered_addr(obj); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - debug_only(trace_reference_gc("instanceRefKlass::oop_update_ptrs", obj, - referent_addr, next_addr, discovered_addr);) -} - -int -instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - instanceKlass::oop_update_pointers(cm, obj, beg_addr, end_addr); - if (UseCompressedOops) { - specialized_oop_update_pointers(cm, obj, beg_addr, end_addr); - } else { - specialized_oop_update_pointers(cm, obj, beg_addr, end_addr); - } - return size_helper(); -} #endif // SERIALGC void instanceRefKlass::update_nonstatic_oop_maps(klassOop k) { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/klassKlass.cpp --- a/src/share/vm/oops/klassKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/klassKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -188,19 +188,6 @@ return oop_size(obj); } - -int klassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - Klass* k = Klass::cast(klassOop(obj)); - - oop* const beg_oop = MAX2((oop*)beg_addr, k->oop_block_beg()); - oop* const end_oop = MIN2((oop*)end_addr, k->oop_block_end()); - for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) { - PSParallelCompact::adjust_pointer(cur_oop); - } - - return oop_size(obj); -} #endif // SERIALGC diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/klassPS.hpp --- a/src/share/vm/oops/klassPS.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/klassPS.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, 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 @@ -37,17 +37,13 @@ objects that do (or may) cross chunk boundaries; it updates only those \ oops that are in the region [beg_addr, end_addr). */ \ virtual void oop_follow_contents(ParCompactionManager* cm, oop obj); \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj); \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj, \ - HeapWord* beg_addr, HeapWord* end_addr); + virtual int oop_update_pointers(ParCompactionManager* cm, oop obj); // Pure virtual version for klass.hpp #define PARALLEL_GC_DECLS_PV \ virtual void oop_push_contents(PSPromotionManager* pm, oop obj) = 0; \ virtual void oop_follow_contents(ParCompactionManager* cm, oop obj) = 0; \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj) = 0; \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj, \ - HeapWord* beg_addr, HeapWord* end_addr) = 0; + virtual int oop_update_pointers(ParCompactionManager* cm, oop obj) = 0; #else // SERIALGC #define PARALLEL_GC_DECLS #define PARALLEL_GC_DECLS_PV diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/klassVtable.cpp --- a/src/share/vm/oops/klassVtable.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/klassVtable.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -677,25 +677,6 @@ PSParallelCompact::adjust_pointer(adr_method_at(i)); } } - -void klassVtable::oop_update_pointers(ParCompactionManager* cm, - HeapWord* beg_addr, HeapWord* end_addr) { - const int n = length(); - const int entry_size = vtableEntry::size(); - - int beg_idx = 0; - HeapWord* const method_0 = (HeapWord*)adr_method_at(0); - if (beg_addr > method_0) { - // it's safe to use cast, as we have guarantees on vtable size to be sane - beg_idx = int((pointer_delta(beg_addr, method_0) + entry_size - 1) / entry_size); - } - - oop* const beg_oop = adr_method_at(beg_idx); - oop* const end_oop = MIN2((oop*)end_addr, adr_method_at(n)); - for (oop* cur_oop = beg_oop; cur_oop < end_oop; cur_oop += entry_size) { - PSParallelCompact::adjust_pointer(cur_oop); - } -} #endif // SERIALGC // Iterators @@ -820,25 +801,6 @@ ime++; } } - -void klassItable::oop_update_pointers(ParCompactionManager* cm, - HeapWord* beg_addr, HeapWord* end_addr) { - // offset table - itableOffsetEntry* ioe = offset_entry(0); - for(int i = 0; i < _size_offset_table; i++) { - oop* p = (oop*)&ioe->_interface; - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - ioe++; - } - - // method table - itableMethodEntry* ime = method_entry(0); - for(int j = 0; j < _size_method_table; j++) { - oop* p = (oop*)&ime->_method; - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - ime++; - } -} #endif // SERIALGC // Iterators diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/klassVtable.hpp --- a/src/share/vm/oops/klassVtable.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/klassVtable.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -99,8 +99,6 @@ // Parallel Old void oop_follow_contents(ParCompactionManager* cm); void oop_update_pointers(ParCompactionManager* cm); - void oop_update_pointers(ParCompactionManager* cm, - HeapWord* beg_addr, HeapWord* end_addr); #endif // SERIALGC // Iterators @@ -295,8 +293,6 @@ // Parallel Old void oop_follow_contents(ParCompactionManager* cm); void oop_update_pointers(ParCompactionManager* cm); - void oop_update_pointers(ParCompactionManager* cm, - HeapWord* beg_addr, HeapWord* end_addr); #endif // SERIALGC // Iterators diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodDataKlass.cpp --- a/src/share/vm/oops/methodDataKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodDataKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, 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 @@ -188,25 +188,6 @@ } return m->object_size(); } - -int -methodDataKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert(obj->is_methodData(), "should be method data"); - - oop* p; - methodDataOop m = methodDataOop(obj); - - p = m->adr_method(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - - ResourceMark rm; - ProfileData* data; - for (data = m->first_data(); m->is_valid(data); data = m->next_data(data)) { - data->update_pointers(beg_addr, end_addr); - } - return m->object_size(); -} #endif // SERIALGC #ifndef PRODUCT diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodDataOop.cpp --- a/src/share/vm/oops/methodDataOop.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodDataOop.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -271,17 +271,6 @@ } } } - -void ReceiverTypeData::update_pointers(HeapWord* beg_addr, HeapWord* end_addr) { - // The loop bounds could be computed based on beg_addr/end_addr and the - // boundary test hoisted outside the loop (see klassVTable for an example); - // however, row_limit() is small enough (2) to make that less efficient. - for (uint row = 0; row < row_limit(); row++) { - if (receiver_unchecked(row) != NULL) { - PSParallelCompact::adjust_pointer(adr_receiver(row), beg_addr, end_addr); - } - } -} #endif // SERIALGC #ifndef PRODUCT diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodDataOop.hpp --- a/src/share/vm/oops/methodDataOop.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodDataOop.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, 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 @@ -452,7 +452,6 @@ // Parallel old support virtual void follow_contents(ParCompactionManager* cm) {} virtual void update_pointers() {} - virtual void update_pointers(HeapWord* beg_addr, HeapWord* end_addr) {} #endif // SERIALGC // CI translation: ProfileData can represent both MethodDataOop data @@ -748,7 +747,6 @@ // Parallel old support virtual void follow_contents(ParCompactionManager* cm); virtual void update_pointers(); - virtual void update_pointers(HeapWord* beg_addr, HeapWord* end_addr); #endif // SERIALGC oop* adr_receiver(uint row) { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodKlass.cpp --- a/src/share/vm/oops/methodKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -214,27 +214,6 @@ #endif // COMPILER2 return m->object_size(); } - -int methodKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert(obj->is_method(), "should be method"); - - oop* p; - methodOop m = methodOop(obj); - - p = m->adr_constMethod(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = m->adr_constants(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - -#ifdef COMPILER2 - if (m->method_data() != NULL) { - p = m->adr_method_data(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - } -#endif // COMPILER2 - return m->object_size(); -} #endif // SERIALGC #ifndef PRODUCT diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodOop.cpp --- a/src/share/vm/oops/methodOop.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodOop.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -985,9 +985,11 @@ IsUnsafeConc, CHECK_(methodHandle())); methodHandle newm (THREAD, newm_oop); + NOT_PRODUCT(int nmsz = newm->is_parsable() ? newm->size() : -1;) int new_method_size = newm->method_size(); // Create a shallow copy of methodOopDesc part, but be careful to preserve the new constMethodOop constMethodOop newcm = newm->constMethod(); + NOT_PRODUCT(int ncmsz = newcm->is_parsable() ? newcm->size() : -1;) int new_const_method_size = newm->constMethod()->object_size(); memcpy(newm(), m(), sizeof(methodOopDesc)); @@ -999,9 +1001,19 @@ // or concurrent marking but those phases will be correct. Setting and // resetting is done in preference to a careful copying into newcm to // avoid having to know the precise layout of a constMethodOop. - m->constMethod()->set_is_conc_safe(false); + m->constMethod()->set_is_conc_safe(oopDesc::IsUnsafeConc); + assert(m->constMethod()->is_parsable(), "Should remain parsable"); + + // NOTE: this is a reachable object that transiently signals "conc_unsafe" + // However, no allocations are done during this window + // during which it is tagged conc_unsafe, so we are assured that any concurrent + // thread will not wait forever for the object to revert to "conc_safe". + // Further, any such conc_unsafe object will indicate a stable size + // through the transition. memcpy(newcm, m->constMethod(), sizeof(constMethodOopDesc)); - m->constMethod()->set_is_conc_safe(true); + m->constMethod()->set_is_conc_safe(oopDesc::IsSafeConc); + assert(m->constMethod()->is_parsable(), "Should remain parsable"); + // Reset correct method/const method, method size, and parameter info newcm->set_method(newm()); newm->set_constMethod(newcm); @@ -1035,6 +1047,8 @@ // Only set is_conc_safe to true when changes to newcm are // complete. + assert(!newm->is_parsable() || nmsz < 0 || newm->size() == nmsz, "newm->size() inconsistency"); + assert(!newcm->is_parsable() || ncmsz < 0 || newcm->size() == ncmsz, "newcm->size() inconsistency"); newcm->set_is_conc_safe(true); return newm; } @@ -1372,7 +1386,7 @@ } // See comment in methodOop.hpp which explains why this exists. -#if defined(_M_AMD64) && MSC_VER >= 1400 +#if defined(_M_AMD64) && _MSC_VER >= 1400 #pragma optimize("", off) void CompressedLineNumberWriteStream::write_pair(int bci, int line) { write_pair_inline(bci, line); diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/methodOop.hpp --- a/src/share/vm/oops/methodOop.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/methodOop.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -144,9 +144,6 @@ public: - static const bool IsUnsafeConc = false; - static const bool IsSafeConc = true; - // accessors for instance variables constMethodOop constMethod() const { return _constMethod; } void set_constMethod(constMethodOop xconst) { oop_store_without_check((oop*)&_constMethod, (oop)xconst); } @@ -732,8 +729,8 @@ // Disabling optimization doesn't work for methods in header files // so we force it to call through the non-optimized version in the .cpp. // It's gross, but it's the only way we can ensure that all callers are -// fixed. MSC_VER is defined in build/windows/makefiles/compile.make. -#if defined(_M_AMD64) && MSC_VER >= 1400 +// fixed. _MSC_VER is defined by the windows compiler +#if defined(_M_AMD64) && _MSC_VER >= 1400 void write_pair(int bci, int line); #else void write_pair(int bci, int line) { write_pair_inline(bci, line); } diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/objArrayKlass.cpp --- a/src/share/vm/oops/objArrayKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/objArrayKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -470,16 +470,6 @@ ObjArrayKlass_OOP_ITERATE(a, p, PSParallelCompact::adjust_pointer(p)) return a->object_size(); } - -int objArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert (obj->is_objArray(), "obj must be obj array"); - objArrayOop a = objArrayOop(obj); - ObjArrayKlass_BOUNDED_OOP_ITERATE( \ - a, p, beg_addr, end_addr, \ - PSParallelCompact::adjust_pointer(p)) - return a->object_size(); -} #endif // SERIALGC // JVM support diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/objArrayKlassKlass.cpp --- a/src/share/vm/oops/objArrayKlassKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/objArrayKlassKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -254,22 +254,6 @@ return arrayKlassKlass::oop_update_pointers(cm, obj); } - -int objArrayKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, - HeapWord* end_addr) { - assert(obj->is_klass(), "must be klass"); - assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array"); - - oop* p; - objArrayKlass* oak = objArrayKlass::cast((klassOop)obj); - p = oak->element_klass_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - p = oak->bottom_klass_addr(); - PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); - - return arrayKlassKlass::oop_update_pointers(cm, obj, beg_addr, end_addr); -} #endif // SERIALGC #ifndef PRODUCT diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/oop.hpp --- a/src/share/vm/oops/oop.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/oop.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -71,6 +71,11 @@ static BarrierSet* _bs; public: + enum ConcSafeType { + IsUnsafeConc = false, + IsSafeConc = true + }; + markOop mark() const { return _mark; } markOop* mark_addr() const { return (markOop*) &_mark; } @@ -317,13 +322,6 @@ // Parallel Old void update_contents(ParCompactionManager* cm); - void update_contents(ParCompactionManager* cm, - HeapWord* begin_limit, - HeapWord* end_limit); - void update_contents(ParCompactionManager* cm, - klassOop old_klass, - HeapWord* begin_limit, - HeapWord* end_limit); void follow_contents(ParCompactionManager* cm); void follow_header(ParCompactionManager* cm); @@ -364,7 +362,6 @@ #ifndef SERIALGC // Parallel old void update_header(); - void update_header(HeapWord* beg_addr, HeapWord* end_addr); #endif // SERIALGC // mark-sweep support diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/oop.pcgc.inline.hpp --- a/src/share/vm/oops/oop.pcgc.inline.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/oop.pcgc.inline.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -57,41 +57,6 @@ // Else skip it. The typeArrayKlass in the header never needs scavenging. } -inline void oopDesc::update_contents(ParCompactionManager* cm, - HeapWord* begin_limit, - HeapWord* end_limit) { - // The klass field must be updated before anything else - // can be done. - debug_only(klassOopDesc* original_klass = klass()); - - update_contents(cm, klass(), begin_limit, end_limit); -} - -inline void oopDesc::update_contents(ParCompactionManager* cm, - klassOop old_klass, - HeapWord* begin_limit, - HeapWord* end_limit) { - - klassOop updated_klass = - PSParallelCompact::summary_data().calc_new_klass(old_klass); - - // Needs to be boundary aware for the 64 bit case - // update_header(); - // The klass has moved. Is the location of the klass - // within the limits? - if ((((HeapWord*)&_metadata._klass) >= begin_limit) && - (((HeapWord*)&_metadata._klass) < end_limit)) { - set_klass(updated_klass); - } - - Klass* klass = updated_klass->klass_part(); - if (!klass->oop_is_typeArray()) { - // It might contain oops beyond the header, so take the virtual call. - klass->oop_update_pointers(cm, this, begin_limit, end_limit); - } - // Else skip it. The typeArrayKlass in the header never needs scavenging. -} - inline void oopDesc::follow_contents(ParCompactionManager* cm) { assert (PSParallelCompact::mark_bitmap()->is_marked(this), "should be marked"); @@ -140,13 +105,4 @@ } } -inline void oopDesc::update_header(HeapWord* beg_addr, HeapWord* end_addr) { - if (UseCompressedOops) { - PSParallelCompact::adjust_pointer(compressed_klass_addr(), - beg_addr, end_addr); - } else { - PSParallelCompact::adjust_pointer(klass_addr(), beg_addr, end_addr); - } -} - #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/oops/typeArrayKlass.cpp --- a/src/share/vm/oops/typeArrayKlass.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/oops/typeArrayKlass.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -250,13 +250,6 @@ assert(obj->is_typeArray(),"must be a type array"); return typeArrayOop(obj)->object_size(); } - -int -typeArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, - HeapWord* beg_addr, HeapWord* end_addr) { - assert(obj->is_typeArray(),"must be a type array"); - return typeArrayOop(obj)->object_size(); -} #endif // SERIALGC void typeArrayKlass::initialize(TRAPS) { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/prims/jvmtiRedefineClasses.cpp --- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1247,12 +1247,12 @@ // Constant pools are not easily reused so we allocate a new one // each time. // merge_cp is created unsafe for concurrent GC processing. It - // should be marked safe before discarding it because, even if - // garbage. If it crosses a card boundary, it may be scanned + // should be marked safe before discarding it. Even though + // garbage, if it crosses a card boundary, it may be scanned // in order to find the start of the first complete object on the card. constantPoolHandle merge_cp(THREAD, oopFactory::new_constantPool(merge_cp_length, - methodOopDesc::IsUnsafeConc, + oopDesc::IsUnsafeConc, THREAD)); int orig_length = old_cp->orig_length(); if (orig_length == 0) { @@ -2343,7 +2343,7 @@ // sized constant pool with the klass to save space. constantPoolHandle smaller_cp(THREAD, oopFactory::new_constantPool(scratch_cp_length, - methodOopDesc::IsUnsafeConc, + oopDesc::IsUnsafeConc, THREAD)); // preserve orig_length() value in the smaller copy int orig_length = scratch_cp->orig_length(); diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/prims/methodHandleWalk.cpp --- a/src/share/vm/prims/methodHandleWalk.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/prims/methodHandleWalk.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1134,8 +1134,9 @@ constantPoolHandle MethodHandleCompiler::get_constant_pool(TRAPS) const { constantPoolHandle nullHandle; - bool is_conc_safe = true; - constantPoolOop cpool_oop = oopFactory::new_constantPool(_constants.length(), is_conc_safe, CHECK_(nullHandle)); + constantPoolOop cpool_oop = oopFactory::new_constantPool(_constants.length(), + oopDesc::IsSafeConc, + CHECK_(nullHandle)); constantPoolHandle cpool(THREAD, cpool_oop); // Fill the real constant pool skipping the zero element. @@ -1180,10 +1181,9 @@ else flags_bits = (/*JVM_MH_INVOKE_BITS |*/ JVM_ACC_PUBLIC | JVM_ACC_FINAL | JVM_ACC_SYNTHETIC); - bool is_conc_safe = true; methodOop m_oop = oopFactory::new_method(bytecode_length(), accessFlags_from(flags_bits), - 0, 0, 0, is_conc_safe, CHECK_(nullHandle)); + 0, 0, 0, oopDesc::IsSafeConc, CHECK_(nullHandle)); methodHandle m(THREAD, m_oop); m_oop = NULL; // oop not GC safe diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/runtime/arguments.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1410,7 +1410,7 @@ // by ergonomics. if (MaxHeapSize <= max_heap_for_compressed_oops()) { #if !defined(COMPILER1) || defined(TIERED) - if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { + if (FLAG_IS_DEFAULT(UseCompressedOops)) { FLAG_SET_ERGO(bool, UseCompressedOops, true); } #endif @@ -3103,6 +3103,19 @@ // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled. set_aggressive_opts_flags(); + // Turn off biased locking for locking debug mode flags, + // which are subtlely different from each other but neither works with + // biased locking. + if (!UseFastLocking || UseHeavyMonitors) { + if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) { + // flag set to true on command line; warn the user that they + // can't enable biased locking here + warning("Biased Locking is not supported with locking debug flags" + "; ignoring UseBiasedLocking flag." ); + } + UseBiasedLocking = false; + } + #ifdef CC_INTERP // Clear flags not supported by the C++ interpreter FLAG_SET_DEFAULT(ProfileInterpreter, false); diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/runtime/globals.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -3661,10 +3661,10 @@ manageable(bool, PrintConcurrentLocks, false, \ "Print java.util.concurrent locks in thread dump") \ \ - diagnostic(bool, TransmitErrorReport, false, \ + product(bool, TransmitErrorReport, false, \ "Enable error report transmission on erroneous termination") \ \ - diagnostic(ccstr, ErrorReportServer, NULL, \ + product(ccstr, ErrorReportServer, NULL, \ "Override built-in error report server address") \ \ /* Shared spaces */ \ @@ -3695,7 +3695,7 @@ product(uintx, SharedReadOnlySize, 10*M, \ "Size of read-only space in permanent generation (in bytes)") \ \ - product(uintx, SharedMiscDataSize, 4*M, \ + product(uintx, SharedMiscDataSize, NOT_LP64(4*M) LP64_ONLY(5*M), \ "Size of the shared data area adjacent to the heap (in bytes)") \ \ product(uintx, SharedMiscCodeSize, 4*M, \ diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/services/heapDumper.cpp --- a/src/share/vm/services/heapDumper.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/services/heapDumper.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -1397,6 +1397,7 @@ public: VM_HeapDumper(DumpWriter* writer, bool gc_before_heap_dump, bool oome) : VM_GC_Operation(0 /* total collections, dummy, ignored */, + GCCause::_heap_dump /* GC Cause */, 0 /* total full collections, dummy, ignored */, gc_before_heap_dump) { _local_writer = writer; diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/services/management.cpp --- a/src/share/vm/services/management.cpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/services/management.cpp Wed Feb 23 11:18:16 2011 -0800 @@ -1311,7 +1311,7 @@ if (locked_monitors) { // Constructs Object[] and int[] to contain the object monitor and the stack depth // where the thread locked it - objArrayOop array = oopFactory::new_system_objArray(num_locked_monitors, CHECK_NULL); + objArrayOop array = oopFactory::new_system_objArray(num_locked_monitors, false, CHECK_NULL); objArrayHandle mh(THREAD, array); monitors_array = mh; @@ -1353,7 +1353,7 @@ GrowableArray* locks = (tcl != NULL ? tcl->owned_locks() : NULL); int num_locked_synchronizers = (locks != NULL ? locks->length() : 0); - objArrayOop array = oopFactory::new_system_objArray(num_locked_synchronizers, CHECK_NULL); + objArrayOop array = oopFactory::new_system_objArray(num_locked_synchronizers, false, CHECK_NULL); objArrayHandle sh(THREAD, array); synchronizers_array = sh; diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/utilities/errorReporter.hpp --- a/src/share/vm/utilities/errorReporter.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/utilities/errorReporter.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -26,6 +26,7 @@ #define SHARE_VM_UTILITIES_ERRORREPORTER_HPP #include "utilities/globalDefinitions.hpp" +#include "memory/allocation.hpp" class ErrorReporter : public StackObj { diff -r 5841dc1964f0 -r a97fd181b813 src/share/vm/utilities/hashtable.hpp --- a/src/share/vm/utilities/hashtable.hpp Tue Feb 22 15:26:36 2011 -0800 +++ b/src/share/vm/utilities/hashtable.hpp Wed Feb 23 11:18:16 2011 -0800 @@ -276,7 +276,7 @@ } int index_for(Symbol* name, Handle loader) { - return hash_to_index(compute_hash(name, loader)); + return this->hash_to_index(compute_hash(name, loader)); } };