This commit is contained in:
Igor Nekrestyanov 2011-03-08 14:26:17 -08:00
commit 9cf3a2a85c
294 changed files with 5410 additions and 2772 deletions

View File

@ -105,3 +105,4 @@ f83cd8bd35c678f94e526990e03dc838d0ec2717 jdk7-b127
7da3f5f30855dec6bf3a86529e87dee883b90c72 jdk7-b128 7da3f5f30855dec6bf3a86529e87dee883b90c72 jdk7-b128
6823ea7eb8eb6fab405d7edb7a5c2f690887a2fa jdk7-b129 6823ea7eb8eb6fab405d7edb7a5c2f690887a2fa jdk7-b129
a36beda9b9de91231d92a2c529f21cc218fcf8d5 jdk7-b130 a36beda9b9de91231d92a2c529f21cc218fcf8d5 jdk7-b130
d8af56da89bc0fc02a6b6ad78f51157a46d665ab jdk7-b131

View File

@ -105,3 +105,4 @@ bd70f76b0309068f157ae759c36eac8f2c6d098e jdk7-b127
57d702105b23fb90e40beaf00f8f8aeae5e249e7 jdk7-b128 57d702105b23fb90e40beaf00f8f8aeae5e249e7 jdk7-b128
a6b015b59fbc2518762c17ccc35702f03ef7713a jdk7-b129 a6b015b59fbc2518762c17ccc35702f03ef7713a jdk7-b129
cc58c11af15411042719e9c82707fdbef60a9e0f jdk7-b130 cc58c11af15411042719e9c82707fdbef60a9e0f jdk7-b130
5d86d951426aaf340b1ba84ae2d5ab5da65a71e2 jdk7-b131

View File

@ -105,3 +105,4 @@ d7532bcd3742f1576dd07ff9fbb535c9c9a276e9 jdk7-b126
9baa8f94a11d6c5cab3f9f0e5a20106326d0932e jdk7-b128 9baa8f94a11d6c5cab3f9f0e5a20106326d0932e jdk7-b128
66fa0fcc779296c99746b09efce6109944f82f30 jdk7-b129 66fa0fcc779296c99746b09efce6109944f82f30 jdk7-b129
563a8f8b5be3940e9346cffac4eff9ed02b3c69f jdk7-b130 563a8f8b5be3940e9346cffac4eff9ed02b3c69f jdk7-b130
9d6dd2cdfcb92612dbd836ecded87770d52b49db jdk7-b131

View File

@ -149,3 +149,5 @@ d535bf4c12355a2897e918da9f8910c0aceec4fb hs20-b07
ae4b185f2ed14af7bab610738c333840598cdcc4 jdk7-b129 ae4b185f2ed14af7bab610738c333840598cdcc4 jdk7-b129
ae4b185f2ed14af7bab610738c333840598cdcc4 hs21-b01 ae4b185f2ed14af7bab610738c333840598cdcc4 hs21-b01
e9aa2ca89ad6c53420623d579765f9706ec523d7 jdk7-b130 e9aa2ca89ad6c53420623d579765f9706ec523d7 jdk7-b130
0aa3b49089112d5faa77902ad680c582ab53f651 jdk7-b131
e9aa2ca89ad6c53420623d579765f9706ec523d7 hs21-b02

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2009, 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,8 +31,7 @@ import sun.jvm.hotspot.types.*;
/** Very minimal port for now to get frames working */ /** Very minimal port for now to get frames working */
public class StubRoutines { public class StubRoutines {
private static AddressField callStubReturnAddressField; private static AddressField callStubReturnAddressField;
private static AddressField callStubCompiledReturnAddressField;
static { static {
VM.registerVMInitializedObserver(new Observer() { VM.registerVMInitializedObserver(new Observer() {
@ -44,20 +43,7 @@ public class StubRoutines {
private static synchronized void initialize(TypeDataBase db) { private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("StubRoutines"); Type type = db.lookupType("StubRoutines");
callStubReturnAddressField = type.getAddressField("_call_stub_return_address"); callStubReturnAddressField = type.getAddressField("_call_stub_return_address");
// Only some platforms have specific return from compiled to call_stub
try {
type = db.lookupType("StubRoutines::x86");
if (type != null) {
callStubCompiledReturnAddressField = type.getAddressField("_call_stub_compiled_return");
}
} catch (RuntimeException re) {
callStubCompiledReturnAddressField = null;
}
if (callStubCompiledReturnAddressField == null && VM.getVM().getCPU().equals("x86")) {
throw new InternalError("Missing definition for _call_stub_compiled_return");
}
} }
public StubRoutines() { public StubRoutines() {
@ -65,20 +51,10 @@ public class StubRoutines {
public boolean returnsToCallStub(Address returnPC) { public boolean returnsToCallStub(Address returnPC) {
Address addr = callStubReturnAddressField.getValue(); Address addr = callStubReturnAddressField.getValue();
boolean result = false;
if (addr == null) {
result = (addr == returnPC);
} else {
result = addr.equals(returnPC);
}
if (result || callStubCompiledReturnAddressField == null ) return result;
// Could be a return to compiled code return point
addr = callStubCompiledReturnAddressField.getValue();
if (addr == null) { if (addr == null) {
return (addr == returnPC); return (addr == returnPC);
} else { } else {
return (addr.equals(returnPC)); return (addr.equals(returnPC));
} }
} }
} }

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # 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_OUTPUTDIR Output directory to use for hotspot build
# ALT_EXPORT_PATH Directory to export hotspot build to # ALT_EXPORT_PATH Directory to export hotspot build to
# ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules) # 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. # ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
# Set ALT_BUILD_WIN_SA=1 to enable building SA on # Set ALT_BUILD_WIN_SA=1 to enable building SA on
# Windows. # Windows.

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -162,6 +162,13 @@ ifneq ($(ALT_JDK_IMPORT_PATH),)
JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH)
endif 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 # Find JDK used for javac compiles
BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM)
ifneq ($(ALT_BOOTDIR),) ifneq ($(ALT_BOOTDIR),)

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=21 HS_MAJOR_VER=21
HS_MINOR_VER=0 HS_MINOR_VER=0
HS_BUILD_NUMBER=02 HS_BUILD_NUMBER=03
JDK_MAJOR_VER=1 JDK_MAJOR_VER=1
JDK_MINOR_VER=7 JDK_MINOR_VER=7

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -437,6 +437,7 @@ jprt.my.windows.x64.test.targets = \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${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_ParNewGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ ${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-GCBasher_ParOldGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \

View File

@ -1,6 +1,6 @@
@echo off @echo off
REM 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 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM REM
REM This code is free software; you can redistribute it and/or modify it REM This code is free software; you can redistribute it and/or modify it
@ -50,9 +50,7 @@ goto end
:testit :testit
cl 2>&1 | grep "IA-64" >NUL cl 2>&1 | grep "x64" >NUL
if %errorlevel% == 0 goto isia64
cl 2>&1 | grep "AMD64" >NUL
if %errorlevel% == 0 goto amd64 if %errorlevel% == 0 goto amd64
set ARCH=x86 set ARCH=x86
set BUILDARCH=i486 set BUILDARCH=i486
@ -64,12 +62,6 @@ set ARCH=x86
set BUILDARCH=amd64 set BUILDARCH=amd64
set Platform_arch=x86 set Platform_arch=x86
set Platform_arch_model=x86_64 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 :done
setlocal setlocal
@ -81,7 +73,7 @@ if not "%2" == "" goto usage
REM Set HotSpotWorkSpace to the directy two steps above this script REM Set HotSpotWorkSpace to the directy two steps above this script
for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi) for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi)
set HotSpotBuildRoot=%HotSpotWorkSpace%build set HotSpotBuildRoot=%HotSpotWorkSpace%build
set HotSpotBuildSpace=%HotSpotBuildRoot%\vs set HotSpotBuildSpace=%HotSpotBuildRoot%\vs-%BUILDARCH%
set HotSpotJDKDist=%1 set HotSpotJDKDist=%1
@ -89,9 +81,9 @@ REM figure out MSC version
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
echo ************************************************************** echo **************************************************************
set ProjectFile=jvm.vcproj set ProjectFile=%HotSpotBuildSpace%\jvm.vcproj
if "%MSC_VER%" == "1200" ( if "%MSC_VER%" == "1200" (
set ProjectFile=jvm.dsp set ProjectFile=%HotSpotBuildSpace%\jvm.dsp
echo Will generate VC6 project {unsupported} echo Will generate VC6 project {unsupported}
) else ( ) else (
if "%MSC_VER%" == "1400" ( if "%MSC_VER%" == "1400" (
@ -163,7 +155,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\
) )
REM force regneration of ProjectFile 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 ( for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
echo -- %%i -- echo -- %%i --
@ -182,6 +174,7 @@ echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.m
echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make
echo Platform_arch=%Platform_arch% >> %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 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 ( for /D %%j in (debug, fastdebug, product) do (
if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
@ -196,7 +189,7 @@ popd
pushd %HotSpotBuildRoot% 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 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 popd

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -141,9 +141,6 @@ COMPILER_NAME=VS2010
!endif !endif
!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 # 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. # but if MFC_DEBUG is defined in the environment it will be used.
MS_RUNTIME_OPTION = /MD MS_RUNTIME_OPTION = /MD

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -36,8 +36,6 @@ ProjectCreatorSources=\
$(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \
$(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \
$(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.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\ProjectCreator.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \
@ -50,6 +48,10 @@ ProjectCreatorSources=\
# This is only used internally # This is only used internally
ProjectCreatorIncludesPRIVATE=\ 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 \
-relativeInclude src\share\vm\prims \ -relativeInclude src\share\vm\prims \
-relativeInclude src\os\windows\vm \ -relativeInclude src\os\windows\vm \
@ -84,7 +86,7 @@ ProjectCreatorIDEOptions=\
-buildBase $(HOTSPOTBUILDSPACE)\%f\%b \ -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
-startAt src \ -startAt src \
-compiler $(VcVersion) \ -compiler $(VcVersion) \
-projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \ -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \
-jdkTargetRoot $(HOTSPOTJDKDIST) \ -jdkTargetRoot $(HOTSPOTJDKDIST) \
-define ALIGN_STACK_FRAMES \ -define ALIGN_STACK_FRAMES \
-define VM_LITTLE_ENDIAN \ -define VM_LITTLE_ENDIAN \
@ -106,13 +108,20 @@ ProjectCreatorIDEOptions=\
# Add in build-specific options # Add in build-specific options
!if "$(BUILDARCH)" == "i486" !if "$(BUILDARCH)" == "i486"
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-platformName Win32 \
-define IA32 \ -define IA32 \
-ignorePath x86_64 \ -ignorePath x86_64 \
-define TARGET_ARCH_MODEL_x86_32 -define TARGET_ARCH_MODEL_x86_32
!else !else
!if "$(BUILDARCH)" == "amd64"
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-platformName x64 \
-define AMD64 \
-define _LP64 \
-ignorePath x86_32 \ -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 !endif
ProjectCreatorIDEOptionsIgnoreCompiler1=\ ProjectCreatorIDEOptionsIgnoreCompiler1=\

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -53,7 +53,7 @@ ProjectFile=jvm.vcproj
!if "$(MSC_VER)" == "1200" !if "$(MSC_VER)" == "1200"
VcVersion=VC6 VcVersion=VC6
ProjectFile=vm.dsp ProjectFile=jvm.dsp
!elseif "$(MSC_VER)" == "1400" !elseif "$(MSC_VER)" == "1400"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -54,8 +54,6 @@ BootStrapDir=$(HOTSPOTJDKDIST)
JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make
Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH)
!if "$(Variant)" == "compiler2" !if "$(Variant)" == "compiler2"
# Pick up rules for building adlc # Pick up rules for building adlc
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
@ -105,17 +103,16 @@ HOTSPOT_VM_DISTRO="OpenJDK"
!endif !endif
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \ ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \
-platform $(Platform) \
-define HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \ -define HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \
-define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \ -define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \
-define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\" -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) @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
clean: clean:
@rm -rf $(HOTSPOTBUILDSPACE)/classes @rm -rf $(HOTSPOTBUILDSPACE)/classes
@rm -r ../$(ProjectFile) @rm -r $(HOTSPOTBUILDSPACE)/$(ProjectFile)
$(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources) $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources)
@if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes @if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes

View File

@ -2407,14 +2407,23 @@ void MacroAssembler::lcmp( Register Ra, Register Rb, Register Rresult) {
#endif #endif
void MacroAssembler::load_sized_value(Address src, Register dst, void MacroAssembler::load_sized_value(Address src, Register dst, size_t size_in_bytes, bool is_signed) {
size_t size_in_bytes, bool is_signed) {
switch (size_in_bytes) { switch (size_in_bytes) {
case 8: ldx(src, dst); break; case 8: ld_long(src, dst); break;
case 4: ld( src, dst); break; case 4: ld( src, dst); break;
case 2: is_signed ? ldsh(src, dst) : lduh(src, dst); break; case 2: is_signed ? ldsh(src, dst) : lduh(src, dst); break;
case 1: is_signed ? ldsb(src, dst) : ldub(src, dst); break; case 1: is_signed ? ldsb(src, dst) : ldub(src, dst); break;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
}
}
void MacroAssembler::store_sized_value(Register src, Address dst, size_t size_in_bytes) {
switch (size_in_bytes) {
case 8: st_long(src, dst); break;
case 4: st( src, dst); break;
case 2: sth( src, dst); break;
case 1: stb( src, dst); break;
default: ShouldNotReachHere();
} }
} }

View File

@ -2330,8 +2330,9 @@ public:
void lcmp( Register Ra, Register Rb, Register Rresult); void lcmp( Register Ra, Register Rb, Register Rresult);
#endif #endif
// Loading values by size and signed-ness // Load and store values by size and signed-ness
void load_sized_value(Address src, Register dst, size_t size_in_bytes, bool is_signed); void load_sized_value( Address src, Register dst, size_t size_in_bytes, bool is_signed);
void store_sized_value(Register src, Address dst, size_t size_in_bytes);
void float_cmp( bool is_float, int unordered_result, void float_cmp( bool is_float, int unordered_result,
FloatRegister Fa, FloatRegister Fb, FloatRegister Fa, FloatRegister Fb,

View File

@ -596,16 +596,9 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ st_ptr(O1_scratch, Address(O0_argslot, 0)); __ st_ptr(O1_scratch, Address(O0_argslot, 0));
} else { } else {
Address prim_value_addr(O1_scratch, java_lang_boxing_object::value_offset_in_bytes(arg_type)); Address prim_value_addr(O1_scratch, java_lang_boxing_object::value_offset_in_bytes(arg_type));
__ load_sized_value(prim_value_addr, O2_scratch, type2aelembytes(arg_type), is_signed_subword_type(arg_type)); const int arg_size = type2aelembytes(arg_type);
if (arg_slots == 2) { __ load_sized_value(prim_value_addr, O2_scratch, arg_size, is_signed_subword_type(arg_type));
__ unimplemented("not yet tested"); __ store_sized_value(O2_scratch, Address(O0_argslot, 0), arg_size); // long store uses O2/O3 on !_LP64
#ifndef _LP64
__ signx(O2_scratch, O3_scratch); // Sign extend
#endif
__ st_long(O2_scratch, Address(O0_argslot, 0)); // Uses O2/O3 on !_LP64
} else {
__ st_ptr( O2_scratch, Address(O0_argslot, 0));
}
} }
if (direct_to_method) { if (direct_to_method) {
@ -784,11 +777,9 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
switch (ek) { switch (ek) {
case _adapter_opt_i2l: case _adapter_opt_i2l:
{ {
__ ldsw(arg_lsw, O2_scratch); // Load LSW __ ldsw(arg_lsw, O2_scratch); // Load LSW
#ifndef _LP64 NOT_LP64(__ srlx(O2_scratch, BitsPerInt, O3_scratch)); // Move high bits to lower bits for std
__ signx(O2_scratch, O3_scratch); // Sign extend __ st_long(O2_scratch, arg_msw); // Uses O2/O3 on !_LP64
#endif
__ st_long(O2_scratch, arg_msw); // Uses O2/O3 on !_LP64
} }
break; break;
case _adapter_opt_unboxl: case _adapter_opt_unboxl:

View File

@ -8125,6 +8125,17 @@ instruct convP2B( iRegI dst, iRegP src ) %{
%} %}
#endif #endif
instruct cmpLTMask0( iRegI dst, iRegI src, immI0 zero, flagsReg ccr ) %{
match(Set dst (CmpLTMask src zero));
effect(KILL ccr);
size(4);
format %{ "SRA $src,#31,$dst\t# cmpLTMask0" %}
ins_encode %{
__ sra($src$$Register, 31, $dst$$Register);
%}
ins_pipe(ialu_reg_imm);
%}
instruct cmpLTMask_reg_reg( iRegI dst, iRegI p, iRegI q, flagsReg ccr ) %{ instruct cmpLTMask_reg_reg( iRegI dst, iRegI p, iRegI q, flagsReg ccr ) %{
match(Set dst (CmpLTMask p q)); match(Set dst (CmpLTMask p q));
effect( KILL ccr ); effect( KILL ccr );
@ -8144,19 +8155,7 @@ instruct cadd_cmpLTMask( iRegI p, iRegI q, iRegI y, iRegI tmp, flagsReg ccr ) %{
format %{ "SUBcc $p,$q,$p\t! p' = p-q\n\t" format %{ "SUBcc $p,$q,$p\t! p' = p-q\n\t"
"ADD $p,$y,$tmp\t! g3=p-q+y\n\t" "ADD $p,$y,$tmp\t! g3=p-q+y\n\t"
"MOVl $tmp,$p\t! p' < 0 ? p'+y : p'" %} "MOVlt $tmp,$p\t! p' < 0 ? p'+y : p'" %}
ins_encode( enc_cadd_cmpLTMask(p, q, y, tmp) );
ins_pipe( cadd_cmpltmask );
%}
instruct cadd_cmpLTMask2( iRegI p, iRegI q, iRegI y, iRegI tmp, flagsReg ccr ) %{
match(Set p (AddI (SubI p q) (AndI (CmpLTMask p q) y)));
effect( KILL ccr, TEMP tmp);
ins_cost(DEFAULT_COST*3);
format %{ "SUBcc $p,$q,$p\t! p' = p-q\n\t"
"ADD $p,$y,$tmp\t! g3=p-q+y\n\t"
"MOVl $tmp,$p\t! p' < 0 ? p'+y : p'" %}
ins_encode( enc_cadd_cmpLTMask(p, q, y, tmp) ); ins_encode( enc_cadd_cmpLTMask(p, q, y, tmp) );
ins_pipe( cadd_cmpltmask ); ins_pipe( cadd_cmpltmask );
%} %}

View File

@ -2349,6 +2349,17 @@ void Assembler::prefix(Prefix p) {
a_byte(p); a_byte(p);
} }
void Assembler::por(XMMRegister dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
emit_byte(0x66);
int encode = prefix_and_encode(dst->encoding(), src->encoding());
emit_byte(0x0F);
emit_byte(0xEB);
emit_byte(0xC0 | encode);
}
void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) { void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) {
assert(isByte(mode), "invalid value"); assert(isByte(mode), "invalid value");
NOT_LP64(assert(VM_Version::supports_sse2(), "")); NOT_LP64(assert(VM_Version::supports_sse2(), ""));
@ -6528,20 +6539,39 @@ int MacroAssembler::load_unsigned_short(Register dst, Address src) {
return off; return off;
} }
void MacroAssembler::load_sized_value(Register dst, Address src, void MacroAssembler::load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed, Register dst2) {
size_t size_in_bytes, bool is_signed) {
switch (size_in_bytes) { switch (size_in_bytes) {
#ifndef _LP64 #ifndef _LP64
// For case 8, caller is responsible for manually loading case 8:
// the second word into another register. assert(dst2 != noreg, "second dest register required");
case 8: movl(dst, src); break; movl(dst, src);
movl(dst2, src.plus_disp(BytesPerInt));
break;
#else #else
case 8: movq(dst, src); break; case 8: movq(dst, src); break;
#endif #endif
case 4: movl(dst, src); break; case 4: movl(dst, src); break;
case 2: is_signed ? load_signed_short(dst, src) : load_unsigned_short(dst, src); break; case 2: is_signed ? load_signed_short(dst, src) : load_unsigned_short(dst, src); break;
case 1: is_signed ? load_signed_byte( dst, src) : load_unsigned_byte( dst, src); break; case 1: is_signed ? load_signed_byte( dst, src) : load_unsigned_byte( dst, src); break;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
}
}
void MacroAssembler::store_sized_value(Address dst, Register src, size_t size_in_bytes, Register src2) {
switch (size_in_bytes) {
#ifndef _LP64
case 8:
assert(src2 != noreg, "second source register required");
movl(dst, src);
movl(dst.plus_disp(BytesPerInt), src2);
break;
#else
case 8: movq(dst, src); break;
#endif
case 4: movl(dst, src); break;
case 2: movw(dst, src); break;
case 1: movb(dst, src); break;
default: ShouldNotReachHere();
} }
} }
@ -8636,7 +8666,7 @@ void MacroAssembler::string_indexof(Register str1, Register str2,
// Compare strings. // Compare strings.
void MacroAssembler::string_compare(Register str1, Register str2, void MacroAssembler::string_compare(Register str1, Register str2,
Register cnt1, Register cnt2, Register result, Register cnt1, Register cnt2, Register result,
XMMRegister vec1, XMMRegister vec2) { XMMRegister vec1) {
Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL; Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL;
// Compute the minimum of the string lengths and the // Compute the minimum of the string lengths and the
@ -8683,62 +8713,85 @@ void MacroAssembler::string_compare(Register str1, Register str2,
bind(LSkip2); bind(LSkip2);
} }
// Advance to next character Address::ScaleFactor scale = Address::times_2;
addptr(str1, 2); int stride = 8;
addptr(str2, 2);
// Advance to next element
addptr(str1, 16/stride);
addptr(str2, 16/stride);
if (UseSSE42Intrinsics) { if (UseSSE42Intrinsics) {
// With SSE4.2, use double quad vector compare Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_TAIL;
Label COMPARE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_TAIL; int pcmpmask = 0x19;
// Setup to compare 16-byte vectors // Setup to compare 16-byte vectors
movl(cnt1, cnt2); movl(result, cnt2);
andl(cnt2, 0xfffffff8); // cnt2 holds the vector count andl(cnt2, ~(stride - 1)); // cnt2 holds the vector count
andl(cnt1, 0x00000007); // cnt1 holds the tail count
testl(cnt2, cnt2);
jccb(Assembler::zero, COMPARE_TAIL); jccb(Assembler::zero, COMPARE_TAIL);
lea(str2, Address(str2, cnt2, Address::times_2)); lea(str1, Address(str1, result, scale));
lea(str1, Address(str1, cnt2, Address::times_2)); lea(str2, Address(str2, result, scale));
negptr(cnt2); negptr(result);
bind(COMPARE_VECTORS); // pcmpestri
movdqu(vec1, Address(str1, cnt2, Address::times_2)); // inputs:
movdqu(vec2, Address(str2, cnt2, Address::times_2)); // vec1- substring
pxor(vec1, vec2); // rax - negative string length (elements count)
ptest(vec1, vec1); // mem - scaned string
jccb(Assembler::notZero, VECTOR_NOT_EQUAL); // rdx - string length (elements count)
addptr(cnt2, 8); // pcmpmask - cmp mode: 11000 (string compare with negated result)
jcc(Assembler::notZero, COMPARE_VECTORS); // + 00 (unsigned bytes) or + 01 (unsigned shorts)
jmpb(COMPARE_TAIL); // outputs:
// rcx - first mismatched element index
assert(result == rax && cnt2 == rdx && cnt1 == rcx, "pcmpestri");
bind(COMPARE_WIDE_VECTORS);
movdqu(vec1, Address(str1, result, scale));
pcmpestri(vec1, Address(str2, result, scale), pcmpmask);
// After pcmpestri cnt1(rcx) contains mismatched element index
jccb(Assembler::below, VECTOR_NOT_EQUAL); // CF==1
addptr(result, stride);
subptr(cnt2, stride);
jccb(Assembler::notZero, COMPARE_WIDE_VECTORS);
// compare wide vectors tail
testl(result, result);
jccb(Assembler::zero, LENGTH_DIFF_LABEL);
movl(cnt2, stride);
movl(result, stride);
negptr(result);
movdqu(vec1, Address(str1, result, scale));
pcmpestri(vec1, Address(str2, result, scale), pcmpmask);
jccb(Assembler::aboveEqual, LENGTH_DIFF_LABEL);
// Mismatched characters in the vectors // Mismatched characters in the vectors
bind(VECTOR_NOT_EQUAL); bind(VECTOR_NOT_EQUAL);
lea(str1, Address(str1, cnt2, Address::times_2)); addptr(result, cnt1);
lea(str2, Address(str2, cnt2, Address::times_2)); movptr(cnt2, result);
movl(cnt1, 8); load_unsigned_short(result, Address(str1, cnt2, scale));
load_unsigned_short(cnt1, Address(str2, cnt2, scale));
subl(result, cnt1);
jmpb(POP_LABEL);
// Compare tail (< 8 chars), or rescan last vectors to bind(COMPARE_TAIL); // limit is zero
// find 1st mismatched characters movl(cnt2, result);
bind(COMPARE_TAIL);
testl(cnt1, cnt1);
jccb(Assembler::zero, LENGTH_DIFF_LABEL);
movl(cnt2, cnt1);
// Fallthru to tail compare // Fallthru to tail compare
} }
// Shift str2 and str1 to the end of the arrays, negate min // Shift str2 and str1 to the end of the arrays, negate min
lea(str1, Address(str1, cnt2, Address::times_2, 0)); lea(str1, Address(str1, cnt2, scale, 0));
lea(str2, Address(str2, cnt2, Address::times_2, 0)); lea(str2, Address(str2, cnt2, scale, 0));
negptr(cnt2); negptr(cnt2);
// Compare the rest of the characters // Compare the rest of the elements
bind(WHILE_HEAD_LABEL); bind(WHILE_HEAD_LABEL);
load_unsigned_short(result, Address(str1, cnt2, Address::times_2, 0)); load_unsigned_short(result, Address(str1, cnt2, scale, 0));
load_unsigned_short(cnt1, Address(str2, cnt2, Address::times_2, 0)); load_unsigned_short(cnt1, Address(str2, cnt2, scale, 0));
subl(result, cnt1); subl(result, cnt1);
jccb(Assembler::notZero, POP_LABEL); jccb(Assembler::notZero, POP_LABEL);
increment(cnt2); increment(cnt2);
jcc(Assembler::notZero, WHILE_HEAD_LABEL); jccb(Assembler::notZero, WHILE_HEAD_LABEL);
// Strings are equal up to min length. Return the length difference. // Strings are equal up to min length. Return the length difference.
bind(LENGTH_DIFF_LABEL); bind(LENGTH_DIFF_LABEL);
@ -8747,7 +8800,7 @@ void MacroAssembler::string_compare(Register str1, Register str2,
// Discard the stored length difference // Discard the stored length difference
bind(POP_LABEL); bind(POP_LABEL);
addptr(rsp, wordSize); pop(cnt1);
// That's it // That's it
bind(DONE_LABEL); bind(DONE_LABEL);
@ -8795,6 +8848,7 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist
if (UseSSE42Intrinsics) { if (UseSSE42Intrinsics) {
// With SSE4.2, use double quad vector compare // With SSE4.2, use double quad vector compare
Label COMPARE_WIDE_VECTORS, COMPARE_TAIL; Label COMPARE_WIDE_VECTORS, COMPARE_TAIL;
// Compare 16-byte vectors // Compare 16-byte vectors
andl(result, 0x0000000e); // tail count (in bytes) andl(result, 0x0000000e); // tail count (in bytes)
andl(limit, 0xfffffff0); // vector count (in bytes) andl(limit, 0xfffffff0); // vector count (in bytes)
@ -8808,11 +8862,23 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist
movdqu(vec1, Address(ary1, limit, Address::times_1)); movdqu(vec1, Address(ary1, limit, Address::times_1));
movdqu(vec2, Address(ary2, limit, Address::times_1)); movdqu(vec2, Address(ary2, limit, Address::times_1));
pxor(vec1, vec2); pxor(vec1, vec2);
ptest(vec1, vec1); ptest(vec1, vec1);
jccb(Assembler::notZero, FALSE_LABEL); jccb(Assembler::notZero, FALSE_LABEL);
addptr(limit, 16); addptr(limit, 16);
jcc(Assembler::notZero, COMPARE_WIDE_VECTORS); jcc(Assembler::notZero, COMPARE_WIDE_VECTORS);
testl(result, result);
jccb(Assembler::zero, TRUE_LABEL);
movdqu(vec1, Address(ary1, result, Address::times_1, -16));
movdqu(vec2, Address(ary2, result, Address::times_1, -16));
pxor(vec1, vec2);
ptest(vec1, vec1);
jccb(Assembler::notZero, FALSE_LABEL);
jmpb(TRUE_LABEL);
bind(COMPARE_TAIL); // limit is zero bind(COMPARE_TAIL); // limit is zero
movl(limit, result); movl(limit, result);
// Fallthru to tail compare // Fallthru to tail compare

View File

@ -1277,6 +1277,9 @@ private:
void prefetcht2(Address src); void prefetcht2(Address src);
void prefetchw(Address src); void prefetchw(Address src);
// POR - Bitwise logical OR
void por(XMMRegister dst, XMMRegister src);
// Shuffle Packed Doublewords // Shuffle Packed Doublewords
void pshufd(XMMRegister dst, XMMRegister src, int mode); void pshufd(XMMRegister dst, XMMRegister src, int mode);
void pshufd(XMMRegister dst, Address src, int mode); void pshufd(XMMRegister dst, Address src, int mode);
@ -1522,8 +1525,9 @@ class MacroAssembler: public Assembler {
// Support for sign-extension (hi:lo = extend_sign(lo)) // Support for sign-extension (hi:lo = extend_sign(lo))
void extend_sign(Register hi, Register lo); void extend_sign(Register hi, Register lo);
// Loading values by size and signed-ness // Load and store values by size and signed-ness
void load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed); void load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed, Register dst2 = noreg);
void store_sized_value(Address dst, Register src, size_t size_in_bytes, Register src2 = noreg);
// Support for inc/dec with optimal instruction selection depending on value // Support for inc/dec with optimal instruction selection depending on value
@ -2293,7 +2297,7 @@ public:
// Compare strings. // Compare strings.
void string_compare(Register str1, Register str2, void string_compare(Register str1, Register str2,
Register cnt1, Register cnt2, Register result, Register cnt1, Register cnt2, Register result,
XMMRegister vec1, XMMRegister vec2); XMMRegister vec1);
// Compare char[] arrays. // Compare char[] arrays.
void char_arrays_equals(bool is_array_equ, Register ary1, Register ary2, void char_arrays_equals(bool is_array_equ, Register ary1, Register ary2,

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1899,8 +1899,6 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
Label do_double; Label do_double;
Label done_conv; Label done_conv;
address compiled_entry = __ pc();
// The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases
if (UseSSE < 2) { if (UseSSE < 2) {
__ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter)));
@ -1934,15 +1932,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
__ jmp(done_conv); __ jmp(done_conv);
} }
#if 0
// emit a sentinel we can test for when converting an interpreter
// entry point to a compiled entry point.
__ a_long(Interpreter::return_sentinel);
__ a_long((int)compiled_entry);
#endif
// Return point to interpreter from compiled/native method // Return point to interpreter from compiled/native method
InternalAddress return_from_native_method(__ pc()); InternalAddress return_from_native_method(__ pc());
__ bind(done_conv); __ bind(done_conv);

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,14 +26,6 @@
#define CPU_X86_VM_INTERPRETER_X86_HPP #define CPU_X86_VM_INTERPRETER_X86_HPP
public: public:
// Sentinel placed in the code for interpreter returns so
// that i2c adapters and osr code can recognize an interpreter
// return address and convert the return to a specialized
// block of code to handle compiedl return values and cleaning
// the fpu stack.
static const int return_sentinel;
static Address::ScaleFactor stackElementScale() { return Address::times_4; } static Address::ScaleFactor stackElementScale() { return Address::times_4; }
// Offset from rsp (which points to the last stack element) // Offset from rsp (which points to the last stack element)

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,9 +51,6 @@
#define __ _masm-> #define __ _masm->
// Initialize the sentinel used to distinguish an interpreter return address.
const int Interpreter::return_sentinel = 0xfeedbeed;
//------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------
address AbstractInterpreterGenerator::generate_slow_signature_handler() { address AbstractInterpreterGenerator::generate_slow_signature_handler() {

View File

@ -602,24 +602,18 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
// make room for the new argument: // make room for the new argument:
__ movl(rax_argslot, rcx_bmh_vmargslot); __ movl(rax_argslot, rcx_bmh_vmargslot);
__ lea(rax_argslot, __ argument_address(rax_argslot)); __ lea(rax_argslot, __ argument_address(rax_argslot));
insert_arg_slots(_masm, arg_slots * stack_move_unit(), arg_mask,
rax_argslot, rbx_temp, rdx_temp); insert_arg_slots(_masm, arg_slots * stack_move_unit(), arg_mask, rax_argslot, rbx_temp, rdx_temp);
// store bound argument into the new stack slot: // store bound argument into the new stack slot:
__ load_heap_oop(rbx_temp, rcx_bmh_argument); __ load_heap_oop(rbx_temp, rcx_bmh_argument);
Address prim_value_addr(rbx_temp, java_lang_boxing_object::value_offset_in_bytes(arg_type));
if (arg_type == T_OBJECT) { if (arg_type == T_OBJECT) {
__ movptr(Address(rax_argslot, 0), rbx_temp); __ movptr(Address(rax_argslot, 0), rbx_temp);
} else { } else {
__ load_sized_value(rdx_temp, prim_value_addr, Address prim_value_addr(rbx_temp, java_lang_boxing_object::value_offset_in_bytes(arg_type));
type2aelembytes(arg_type), is_signed_subword_type(arg_type)); const int arg_size = type2aelembytes(arg_type);
__ movptr(Address(rax_argslot, 0), rdx_temp); __ load_sized_value(rdx_temp, prim_value_addr, arg_size, is_signed_subword_type(arg_type), rbx_temp);
#ifndef _LP64 __ store_sized_value(Address(rax_argslot, 0), rdx_temp, arg_size, rbx_temp);
if (arg_slots == 2) {
__ movl(rdx_temp, prim_value_addr.plus_disp(wordSize));
__ movl(Address(rax_argslot, Interpreter::stackElementSize), rdx_temp);
}
#endif //_LP64
} }
if (direct_to_method) { if (direct_to_method) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -660,25 +660,6 @@ static void gen_i2c_adapter(MacroAssembler *masm,
int comp_args_on_stack, int comp_args_on_stack,
const BasicType *sig_bt, const BasicType *sig_bt,
const VMRegPair *regs) { const VMRegPair *regs) {
// we're being called from the interpreter but need to find the
// compiled return entry point. The return address on the stack
// should point at it and we just need to pull the old value out.
// load up the pointer to the compiled return entry point and
// rewrite our return pc. The code is arranged like so:
//
// .word Interpreter::return_sentinel
// .word address_of_compiled_return_point
// return_entry_point: blah_blah_blah
//
// So we can find the appropriate return point by loading up the word
// just prior to the current return address we have on the stack.
//
// We will only enter here from an interpreted frame and never from after
// passing thru a c2i. Azul allowed this but we do not. If we lose the
// race and use a c2i we will remain interpreted for the race loser(s).
// This removes all sorts of headaches on the x86 side and also eliminates
// the possibility of having c2i -> i2c -> c2i -> ... endless transitions.
// Note: rsi contains the senderSP on entry. We must preserve it since // Note: rsi contains the senderSP on entry. We must preserve it since
// we may do a i2c -> c2i transition if we lose a race where compiled // we may do a i2c -> c2i transition if we lose a race where compiled
@ -687,40 +668,6 @@ static void gen_i2c_adapter(MacroAssembler *masm,
// Pick up the return address // Pick up the return address
__ movptr(rax, Address(rsp, 0)); __ movptr(rax, Address(rsp, 0));
// If UseSSE >= 2 then no cleanup is needed on the return to the
// interpreter so skip fixing up the return entry point unless
// VerifyFPU is enabled.
if (UseSSE < 2 || VerifyFPU) {
Label skip, chk_int;
// If we were called from the call stub we need to do a little bit different
// cleanup than if the interpreter returned to the call stub.
ExternalAddress stub_return_address(StubRoutines::_call_stub_return_address);
__ cmpptr(rax, stub_return_address.addr());
__ jcc(Assembler::notEqual, chk_int);
assert(StubRoutines::x86::get_call_stub_compiled_return() != NULL, "must be set");
__ lea(rax, ExternalAddress(StubRoutines::x86::get_call_stub_compiled_return()));
__ jmp(skip);
// It must be the interpreter since we never get here via a c2i (unlike Azul)
__ bind(chk_int);
#ifdef ASSERT
{
Label ok;
__ cmpl(Address(rax, -2*wordSize), Interpreter::return_sentinel);
__ jcc(Assembler::equal, ok);
__ int3();
__ bind(ok);
}
#endif // ASSERT
__ movptr(rax, Address(rax, -wordSize));
__ bind(skip);
}
// rax, now contains the compiled return entry point which will do an
// cleanup needed for the return from compiled to interpreted.
// Must preserve original SP for loading incoming arguments because // Must preserve original SP for loading incoming arguments because
// we need to align the outgoing SP for compiled code. // we need to align the outgoing SP for compiled code.
__ movptr(rdi, rsp); __ movptr(rdi, rsp);

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -610,14 +610,6 @@ static void gen_i2c_adapter(MacroAssembler *masm,
const BasicType *sig_bt, const BasicType *sig_bt,
const VMRegPair *regs) { const VMRegPair *regs) {
//
// We will only enter here from an interpreted frame and never from after
// passing thru a c2i. Azul allowed this but we do not. If we lose the
// race and use a c2i we will remain interpreted for the race loser(s).
// This removes all sorts of headaches on the x86 side and also eliminates
// the possibility of having c2i -> i2c -> c2i -> ... endless transitions.
// Note: r13 contains the senderSP on entry. We must preserve it since // Note: r13 contains the senderSP on entry. We must preserve it since
// we may do a i2c -> c2i transition if we lose a race where compiled // we may do a i2c -> c2i transition if we lose a race where compiled
// code goes non-entrant while we get args ready. // code goes non-entrant while we get args ready.
@ -627,6 +619,7 @@ static void gen_i2c_adapter(MacroAssembler *masm,
// save code can segv when fxsave instructions find improperly // save code can segv when fxsave instructions find improperly
// aligned stack pointer. // aligned stack pointer.
// Pick up the return address
__ movptr(rax, Address(rsp, 0)); __ movptr(rax, Address(rsp, 0));
// Must preserve original SP for loading incoming arguments because // Must preserve original SP for loading incoming arguments because

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -240,9 +240,30 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("call_stub_return_address:"); BLOCK_COMMENT("call_stub_return_address:");
return_address = __ pc(); return_address = __ pc();
Label common_return; #ifdef COMPILER2
{
Label L_skip;
if (UseSSE >= 2) {
__ verify_FPU(0, "call_stub_return");
} else {
for (int i = 1; i < 8; i++) {
__ ffree(i);
}
__ BIND(common_return); // UseSSE <= 1 so double result should be left on TOS
__ movl(rsi, result_type);
__ cmpl(rsi, T_DOUBLE);
__ jcc(Assembler::equal, L_skip);
if (UseSSE == 0) {
// UseSSE == 0 so float result should be left on TOS
__ cmpl(rsi, T_FLOAT);
__ jcc(Assembler::equal, L_skip);
}
__ ffree(0);
}
__ BIND(L_skip);
}
#endif // COMPILER2
// store result depending on type // store result depending on type
// (everything that is not T_LONG, T_FLOAT or T_DOUBLE is treated as T_INT) // (everything that is not T_LONG, T_FLOAT or T_DOUBLE is treated as T_INT)
@ -305,37 +326,6 @@ class StubGenerator: public StubCodeGenerator {
} }
__ jmp(exit); __ jmp(exit);
// If we call compiled code directly from the call stub we will
// need to adjust the return back to the call stub to a specialized
// piece of code that can handle compiled results and cleaning the fpu
// stack. compiled code will be set to return here instead of the
// return above that handles interpreter returns.
BLOCK_COMMENT("call_stub_compiled_return:");
StubRoutines::x86::set_call_stub_compiled_return( __ pc());
#ifdef COMPILER2
if (UseSSE >= 2) {
__ verify_FPU(0, "call_stub_compiled_return");
} else {
for (int i = 1; i < 8; i++) {
__ ffree(i);
}
// UseSSE <= 1 so double result should be left on TOS
__ movl(rsi, result_type);
__ cmpl(rsi, T_DOUBLE);
__ jcc(Assembler::equal, common_return);
if (UseSSE == 0) {
// UseSSE == 0 so float result should be left on TOS
__ cmpl(rsi, T_FLOAT);
__ jcc(Assembler::equal, common_return);
}
__ ffree(0);
}
#endif /* COMPILER2 */
__ jmp(common_return);
return start; return start;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,6 +39,5 @@
// Implementation of the platform-specific part of StubRoutines - for // Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file. // a description of how to extend it, see the stubRoutines.hpp file.
address StubRoutines::x86::_verify_mxcsr_entry = NULL; address StubRoutines::x86::_verify_mxcsr_entry = NULL;
address StubRoutines::x86::_verify_fpu_cntrl_wrd_entry= NULL; address StubRoutines::x86::_verify_fpu_cntrl_wrd_entry = NULL;
address StubRoutines::x86::_call_stub_compiled_return = NULL;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,24 +44,14 @@ class x86 {
friend class VMStructs; friend class VMStructs;
private: private:
// If we call compiled code directly from the call stub we will
// need to adjust the return back to the call stub to a specialized
// piece of code that can handle compiled results and cleaning the fpu
// stack. The variable holds that location.
static address _call_stub_compiled_return;
static address _verify_mxcsr_entry; static address _verify_mxcsr_entry;
static address _verify_fpu_cntrl_wrd_entry; static address _verify_fpu_cntrl_wrd_entry;
static jint _mxcsr_std;
public: public:
static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } static address verify_mxcsr_entry() { return _verify_mxcsr_entry; }
static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; } static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; }
static address get_call_stub_compiled_return() { return _call_stub_compiled_return; }
static void set_call_stub_compiled_return(address ret) { _call_stub_compiled_return = ret; }
}; };
static bool returns_to_call_stub(address return_pc) { return (return_pc == _call_stub_return_address) || static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
return_pc == x86::get_call_stub_compiled_return(); }
#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP #endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP

View File

@ -177,9 +177,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state)
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
TosState incoming_state = state; TosState incoming_state = state;
address entry = __ pc();
Label interpreter_entry;
address compiled_entry = __ pc();
#ifdef COMPILER2 #ifdef COMPILER2
// The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases
@ -197,14 +195,6 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled");
} }
__ jmp(interpreter_entry, relocInfo::none);
// emit a sentinel we can test for when converting an interpreter
// entry point to a compiled entry point.
__ a_long(Interpreter::return_sentinel);
__ a_long((int)compiled_entry);
address entry = __ pc();
__ bind(interpreter_entry);
// In SSE mode, interpreter returns FP results in xmm0 but they need // In SSE mode, interpreter returns FP results in xmm0 but they need
// to end up back on the FPU so it can operate on them. // to end up back on the FPU so it can operate on them.
if (incoming_state == ftos && UseSSE >= 1) { if (incoming_state == ftos && UseSSE >= 1) {

View File

@ -190,13 +190,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state)
} }
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
int step) {
// amd64 doesn't need to do anything special about compiled returns
// to the interpreter so the code that exists on x86 to place a sentinel
// here and the specialized cleanup code is not needed here.
address entry = __ pc(); address entry = __ pc();
// Restore stack bottom in case i2c adjusted stack // Restore stack bottom in case i2c adjusted stack

View File

@ -1710,39 +1710,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ pop(rdi); // get return address __ pop(rdi); // get return address
__ mov(rsp, rdx); // set sp to sender sp __ mov(rsp, rdx); // set sp to sender sp
Label skip;
Label chkint;
// The interpreter frame we have removed may be returning to
// either the callstub or the interpreter. Since we will
// now be returning from a compiled (OSR) nmethod we must
// adjust the return to the return were it can handler compiled
// results and clean the fpu stack. This is very similar to
// what a i2c adapter must do.
// Are we returning to the call stub?
__ cmp32(rdi, ExternalAddress(StubRoutines::_call_stub_return_address));
__ jcc(Assembler::notEqual, chkint);
// yes adjust to the specialized call stub return.
assert(StubRoutines::x86::get_call_stub_compiled_return() != NULL, "must be set");
__ lea(rdi, ExternalAddress(StubRoutines::x86::get_call_stub_compiled_return()));
__ jmp(skip);
__ bind(chkint);
// Are we returning to the interpreter? Look for sentinel
__ cmpl(Address(rdi, -2*wordSize), Interpreter::return_sentinel);
__ jcc(Assembler::notEqual, skip);
// Adjust to compiled return back to interpreter
__ movptr(rdi, Address(rdi, -wordSize));
__ bind(skip);
// Align stack pointer for compiled code (note that caller is // Align stack pointer for compiled code (note that caller is
// responsible for undoing this fixup by remembering the old SP // responsible for undoing this fixup by remembering the old SP
// in an rbp,-relative location) // in an rbp,-relative location)

View File

@ -12629,16 +12629,16 @@ instruct rep_stos(eCXRegI cnt, eDIRegP base, eAXRegI zero, Universe dummy, eFlag
ins_pipe( pipe_slow ); ins_pipe( pipe_slow );
%} %}
instruct string_compare(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eBXRegI cnt2, instruct string_compare(eDIRegP str1, eCXRegI cnt1, eSIRegP str2, eDXRegI cnt2,
eAXRegI result, regXD tmp1, regXD tmp2, eFlagsReg cr) %{ eAXRegI result, regXD tmp1, eFlagsReg cr) %{
match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1, $tmp2" %} format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %}
ins_encode %{ ins_encode %{
__ string_compare($str1$$Register, $str2$$Register, __ string_compare($str1$$Register, $str2$$Register,
$cnt1$$Register, $cnt2$$Register, $result$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register,
$tmp1$$XMMRegister, $tmp2$$XMMRegister); $tmp1$$XMMRegister);
%} %}
ins_pipe( pipe_slow ); ins_pipe( pipe_slow );
%} %}

View File

@ -11583,17 +11583,17 @@ instruct rep_stos(rcx_RegL cnt, rdi_RegP base, rax_RegI zero, Universe dummy,
ins_pipe(pipe_slow); ins_pipe(pipe_slow);
%} %}
instruct string_compare(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rbx_RegI cnt2, instruct string_compare(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
rax_RegI result, regD tmp1, regD tmp2, rFlagsReg cr) rax_RegI result, regD tmp1, rFlagsReg cr)
%{ %{
match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
effect(TEMP tmp1, TEMP tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); effect(TEMP tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr);
format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1, $tmp2" %} format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1" %}
ins_encode %{ ins_encode %{
__ string_compare($str1$$Register, $str2$$Register, __ string_compare($str1$$Register, $str2$$Register,
$cnt1$$Register, $cnt2$$Register, $result$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register,
$tmp1$$XMMRegister, $tmp2$$XMMRegister); $tmp1$$XMMRegister);
%} %}
ins_pipe( pipe_slow ); ins_pipe( pipe_slow );
%} %}

View File

@ -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.
* Copyright 2008, 2009 Red Hat, Inc. * Copyright 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -30,7 +30,3 @@
#ifdef TARGET_OS_FAMILY_linux #ifdef TARGET_OS_FAMILY_linux
# include "thread_linux.inline.hpp" # include "thread_linux.inline.hpp"
#endif #endif
#ifdef IA32
address StubRoutines::x86::_call_stub_compiled_return = NULL;
#endif // IA32

View File

@ -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.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -48,13 +48,4 @@
method_handles_adapters_code_size = 0 method_handles_adapters_code_size = 0
}; };
#ifdef IA32
class x86 {
friend class VMStructs;
private:
static address _call_stub_compiled_return;
};
#endif // IA32
#endif // CPU_ZERO_VM_STUBROUTINES_ZERO_HPP #endif // CPU_ZERO_VM_STUBROUTINES_ZERO_HPP

View File

@ -1975,7 +1975,11 @@ bool os::dll_address_to_function_name(address addr, char *buf,
#ifndef RTLD_DL_SYMENT #ifndef RTLD_DL_SYMENT
#define RTLD_DL_SYMENT 1 #define RTLD_DL_SYMENT 1
#endif #endif
Sym * info; #ifdef _LP64
Elf64_Sym * info;
#else
Elf32_Sym * info;
#endif
if (dladdr1_func((void *)addr, &dlinfo, (void **)&info, if (dladdr1_func((void *)addr, &dlinfo, (void **)&info,
RTLD_DL_SYMENT)) { RTLD_DL_SYMENT)) {
if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) { if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) {
@ -6424,4 +6428,3 @@ int os::bind(int fd, struct sockaddr *him, int len) {
INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\ INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\
os::Solaris::clear_interrupted); os::Solaris::clear_interrupted);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -298,8 +298,8 @@ static char* get_user_name() {
static char* get_user_name_slow(int vmid) { static char* get_user_name_slow(int vmid) {
// directory search // directory search
char* oldest_user = NULL; char* latest_user = NULL;
time_t oldest_ctime = 0; time_t latest_ctime = 0;
const char* tmpdirname = os::get_temp_directory(); const char* tmpdirname = os::get_temp_directory();
@ -375,18 +375,29 @@ static char* get_user_name_slow(int vmid) {
continue; continue;
} }
// compare and save filename with latest creation time // If we found a matching file with a newer creation time, then
if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) { // 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 (statbuf.st_ctime > oldest_ctime) { if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user);
char* user = strchr(dentry->d_name, '_') + 1; latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user); strcpy(latest_user, user);
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1); latest_ctime = statbuf.st_ctime;
strcpy(oldest_user, user);
oldest_ctime = statbuf.st_ctime;
}
} }
FREE_C_HEAP_ARRAY(char, filename); FREE_C_HEAP_ARRAY(char, filename);
@ -399,7 +410,7 @@ static char* get_user_name_slow(int vmid) {
os::closedir(tmpdirp); os::closedir(tmpdirp);
FREE_C_HEAP_ARRAY(char, tdbuf); 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. // return the name of the user that owns the process identified by vmid.
@ -1339,6 +1350,38 @@ static HANDLE create_sharedmem_resources(const char* dirname, const char* filena
CloseHandle(fh); CloseHandle(fh);
fh = NULL; fh = NULL;
return 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 // the file has been successfully created and the file mapping

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008 Red Hat, Inc. * Copyright 2007, 2008, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -300,4 +300,18 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value,
(intptr_t) compare_value); (intptr_t) compare_value);
} }
inline jlong Atomic::load(volatile jlong* src) {
volatile jlong dest;
os::atomic_copy64(src, &dest);
return dest;
}
inline void Atomic::store(jlong store_value, jlong* dest) {
os::atomic_copy64((volatile jlong*)&store_value, (volatile jlong*)dest);
}
inline void Atomic::store(jlong store_value, volatile jlong* dest) {
os::atomic_copy64((volatile jlong*)&store_value, dest);
}
#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP #endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP

View File

@ -67,7 +67,6 @@ extern "C" void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst);
inline void Atomic_move_long(volatile jlong* src, volatile jlong* dst) { inline void Atomic_move_long(volatile jlong* src, volatile jlong* dst) {
#ifdef COMPILER2 #ifdef COMPILER2
// Compiler2 does not support v8, it is used only for v9. // Compiler2 does not support v8, it is used only for v9.
assert (VM_Version::v9_instructions_work(), "only supported on v9");
_Atomic_move_long_v9(src, dst); _Atomic_move_long_v9(src, dst);
#else #else
// The branch is cheaper then emulated LDD. // The branch is cheaper then emulated LDD.

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -189,14 +189,22 @@ int VM_Version::platform_features(int features) {
tty->print_cr("cpu_info.implementation: %s", implementation); tty->print_cr("cpu_info.implementation: %s", implementation);
} }
#endif #endif
if (strncmp(implementation, "SPARC64", 7) == 0) { // Convert to UPPER case before compare.
char* impl = strdup(implementation);
for (int i = 0; impl[i] != 0; i++)
impl[i] = (char)toupper((uint)impl[i]);
if (strstr(impl, "SPARC64") != NULL) {
features |= sparc64_family_m; features |= sparc64_family_m;
} else if (strncmp(implementation, "UltraSPARC-T", 12) == 0) { } else if (strstr(impl, "SPARC-T") != NULL) {
features |= T_family_m; features |= T_family_m;
if (strncmp(implementation, "UltraSPARC-T1", 13) == 0) { if (strstr(impl, "SPARC-T1") != NULL) {
features |= T1_model_m; features |= T1_model_m;
} }
} else {
assert(strstr(impl, "SPARC") != NULL, "should be sparc");
} }
free((void*)impl);
break; break;
} }
} // for( } // for(

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,7 +71,7 @@ typedef struct _DISPATCHER_CONTEXT {
PVOID HandlerData; PVOID HandlerData;
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
#if MSC_VER < 1500 #if _MSC_VER < 1500
/* Not needed for VS2008 compiler, comes from winnt.h. */ /* Not needed for VS2008 compiler, comes from winnt.h. */
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,12 +51,14 @@ class BuildConfig {
if (vars == null) vars = new Hashtable(); if (vars == null) vars = new Hashtable();
String flavourBuild = flavour + "_" + build; String flavourBuild = flavour + "_" + build;
String platformName = getFieldString(null, "PlatformName");
System.out.println(); System.out.println();
System.out.println(flavourBuild); System.out.println(flavourBuild);
put("Name", getCI().makeCfgName(flavourBuild)); put("Name", getCI().makeCfgName(flavourBuild, platformName));
put("Flavour", flavour); put("Flavour", flavour);
put("Build", build); put("Build", build);
put("PlatformName", platformName);
// ones mentioned above were needed to expand format // ones mentioned above were needed to expand format
String buildBase = expandFormat(getFieldString(null, "BuildBase")); String buildBase = expandFormat(getFieldString(null, "BuildBase"));
@ -93,7 +95,7 @@ class BuildConfig {
protected void initDefaultLinkerFlags() { protected void initDefaultLinkerFlags() {
Vector linkerFlags = new Vector(); 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); put("LinkerFlags", linkerFlags);
} }
@ -115,18 +117,15 @@ class BuildConfig {
} }
Vector getPreferredPaths(MacroDefinitions macros) { Vector getPreferredPaths() {
Vector preferredPaths = new Vector(); Vector preferredPaths = new Vector();
// In the case of multiple files with the same name in // In the case of multiple files with the same name in
// different subdirectories, prefer the versions specified in // different subdirectories, prefer these versions
// the platform file as the "os_family" and "arch" macros. preferredPaths.add("windows");
for (Iterator iter = macros.getMacros(); iter.hasNext(); ) { preferredPaths.add("x86");
Macro macro = (Macro) iter.next(); preferredPaths.add("closed");
if (macro.name.equals("os_family") ||
macro.name.equals("arch")) {
preferredPaths.add(macro.contents);
}
}
// Also prefer "opto" over "adlc" for adlcVMDeps.hpp // Also prefer "opto" over "adlc" for adlcVMDeps.hpp
preferredPaths.add("opto"); preferredPaths.add("opto");
@ -137,18 +136,7 @@ class BuildConfig {
void handleDB() { void handleDB() {
WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject"); WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
File incls = new File(get("OutputDir")+Util.sep+"incls"); putSpecificField("AllFilesHash", computeAllFiles(platform));
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));
} }
@ -190,10 +178,10 @@ class BuildConfig {
ht.put(expandFormat(key), expandFormat(value)); ht.put(expandFormat(key), expandFormat(value));
} }
Hashtable computeAllFiles(WinGammaPlatform platform, MacroDefinitions macros) { Hashtable computeAllFiles(WinGammaPlatform platform) {
Hashtable rv = new Hashtable(); Hashtable rv = new Hashtable();
DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt")); DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
Vector preferredPaths = getPreferredPaths(macros); Vector preferredPaths = getPreferredPaths();
// Hold errors until end // Hold errors until end
Vector filesNotFound = new Vector(); Vector filesNotFound = new Vector();
@ -228,8 +216,7 @@ class BuildConfig {
System.err.println("Error: some files were not found or " + System.err.println("Error: some files were not found or " +
"appeared in multiple subdirectories of " + "appeared in multiple subdirectories of " +
"directory " + get("SourceBase") + " and could not " + "directory " + get("SourceBase") + " and could not " +
"be resolved with the os_family and arch " + "be resolved with os_family and arch.");
"macros in the platform file.");
if (filesNotFound.size() != 0) { if (filesNotFound.size() != 0) {
System.err.println("Files not found:"); System.err.println("Files not found:");
for (Iterator iter = filesNotFound.iterator(); for (Iterator iter = filesNotFound.iterator();
@ -254,10 +241,14 @@ class BuildConfig {
Vector sysDefines = new Vector(); Vector sysDefines = new Vector();
sysDefines.add("WIN32"); sysDefines.add("WIN32");
sysDefines.add("_WINDOWS"); 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("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
sysDefines.add("_JNI_IMPLEMENTATION_"); 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); sysDefines.addAll(defines);
@ -710,7 +701,7 @@ class KernelProductConfig extends ProductConfig {
} }
abstract class CompilerInterface { abstract class CompilerInterface {
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); 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 getDebugCompilerFlags(String opt);
abstract Vector getDebugLinkerFlags(); abstract Vector getDebugLinkerFlags();
abstract void getAdditionalNonKernelLinkerFlags(Vector rv); abstract void getAdditionalNonKernelLinkerFlags(Vector rv);
@ -718,7 +709,7 @@ abstract class CompilerInterface {
abstract Vector getProductLinkerFlags(); abstract Vector getProductLinkerFlags();
abstract String getOptFlag(); abstract String getOptFlag();
abstract String getNoOptFlag(); abstract String getNoOptFlag();
abstract String makeCfgName(String flavourBuild); abstract String makeCfgName(String flavourBuild, String platformName);
void addAttr(Vector receiver, String attr, String value) { void addAttr(Vector receiver, String attr, String value) {
receiver.add(attr); receiver.add(value); receiver.add(attr); receiver.add(value);

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -55,6 +55,9 @@ public class DirectoryTree {
private Vector nodes = new Vector(); private Vector nodes = new Vector();
public FileIterator(Node rootNode) { public FileIterator(Node rootNode) {
if(rootNode == null) {
return;
}
nodes.add(rootNode); nodes.add(rootNode);
prune(); prune();
} }
@ -112,10 +115,7 @@ public class DirectoryTree {
throws IllegalArgumentException { throws IllegalArgumentException {
File root = new File(Util.normalize(baseDirectory)); File root = new File(Util.normalize(baseDirectory));
if (!root.isDirectory()) { if (!root.isDirectory()) {
throw new IllegalArgumentException("baseDirectory \"" + return;
baseDirectory +
"\" does not exist or " +
"is not a directory");
} }
try { try {
root = root.getCanonicalFile(); root = root.getCanonicalFile();

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 class FileFormatException extends Exception {
public FileFormatException() { public FileFormatException() {
super(); super();
} }

View File

@ -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();
}
}

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,7 @@ public class Util {
return sb.toString(); return sb.toString();
} }
static String join(String padder, String v[]) { static String join(String padder, String v[]) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (int i=0; i<v.length; i++) { for (int i=0; i<v.length; i++) {
@ -80,9 +80,16 @@ public class Util {
static String normalize(String file) { static String normalize(String file) {
return file.replace('\\', '/'); file = file.replace('\\', '/');
if (file.length() > 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 sep = File.separator;
static String os = "Win32"; //System.getProperty("os.name");
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -235,13 +235,6 @@ public abstract class WinGammaPlatform {
(locationsInTree.size() == 0)) { (locationsInTree.size() == 0)) {
filesNotFound.add(fileName); filesNotFound.add(fileName);
} else if (locationsInTree.size() > 1) { } 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 // Iterate through them, trying to find one with a
// preferred path // preferred path
search: search:
@ -336,7 +329,7 @@ public abstract class WinGammaPlatform {
String projectName = getProjectName(projectFileName, ext); String projectName = getProjectName(projectFileName, ext);
writeProjectFile(projectFileName, projectName, createAllConfigs()); writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
} }
protected void writePrologue(String[] args) { protected void writePrologue(String[] args) {
@ -376,7 +369,13 @@ public abstract class WinGammaPlatform {
HsArgHandler.STRING HsArgHandler.STRING
), ),
new HsArgRule("-projectFileName", new HsArgRule("-platformName",
"PlatformName",
null,
HsArgHandler.STRING
),
new HsArgRule("-projectFileName",
"ProjectFileName", "ProjectFileName",
null, null,
HsArgHandler.STRING HsArgHandler.STRING
@ -394,12 +393,6 @@ public abstract class WinGammaPlatform {
HsArgHandler.STRING HsArgHandler.STRING
), ),
new HsArgRule("-platform",
"Platform",
null,
HsArgHandler.STRING
),
new HsArgRule("-absoluteInclude", new HsArgRule("-absoluteInclude",
"AbsoluteInclude", "AbsoluteInclude",
null, null,
@ -590,28 +583,27 @@ public abstract class WinGammaPlatform {
BuildConfig.putField(null, "PlatformObject", this); BuildConfig.putField(null, "PlatformObject", this);
} }
Vector createAllConfigs() { Vector createAllConfigs(String platform) {
Vector allConfigs = new Vector(); Vector allConfigs = new Vector();
allConfigs.add(new C1DebugConfig()); allConfigs.add(new C1DebugConfig());
boolean b = true; allConfigs.add(new C1FastDebugConfig());
if (b) { allConfigs.add(new C1ProductConfig());
allConfigs.add(new C1FastDebugConfig());
allConfigs.add(new C1ProductConfig());
allConfigs.add(new C2DebugConfig()); allConfigs.add(new C2DebugConfig());
allConfigs.add(new C2FastDebugConfig()); allConfigs.add(new C2FastDebugConfig());
allConfigs.add(new C2ProductConfig()); allConfigs.add(new C2ProductConfig());
allConfigs.add(new TieredDebugConfig()); allConfigs.add(new TieredDebugConfig());
allConfigs.add(new TieredFastDebugConfig()); allConfigs.add(new TieredFastDebugConfig());
allConfigs.add(new TieredProductConfig()); allConfigs.add(new TieredProductConfig());
allConfigs.add(new CoreDebugConfig()); allConfigs.add(new CoreDebugConfig());
allConfigs.add(new CoreFastDebugConfig()); allConfigs.add(new CoreFastDebugConfig());
allConfigs.add(new CoreProductConfig()); allConfigs.add(new CoreProductConfig());
if (platform.equals("Win32")) {
allConfigs.add(new KernelDebugConfig()); allConfigs.add(new KernelDebugConfig());
allConfigs.add(new KernelFastDebugConfig()); allConfigs.add(new KernelFastDebugConfig());
allConfigs.add(new KernelProductConfig()); allConfigs.add(new KernelProductConfig());

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -223,7 +223,7 @@ class CompilerInterfaceVC6 extends CompilerInterface {
return rv; return rv;
} }
Vector getBaseLinkerFlags(String outDir, String outDll) { Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
Vector rv = new Vector(); Vector rv = new Vector();
rv.add("PROP Ignore_Export_Lib 0"); rv.add("PROP Ignore_Export_Lib 0");
@ -231,8 +231,12 @@ class CompilerInterfaceVC6 extends CompilerInterface {
rv.add("ADD CPP /MD"); rv.add("ADD CPP /MD");
rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " + rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " +
" advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.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+"\" "+ rv.add("ADD LINK32 /out:\""+outDll+"\" "+
" /nologo /subsystem:windows /machine:I386" + " /nologo /subsystem:windows /machine:" + machine +
" /nologo /base:\"0x8000000\" /subsystem:windows /dll" + " /nologo /base:\"0x8000000\" /subsystem:windows /dll" +
" /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+ " /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+
" /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+ " /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+
@ -287,7 +291,7 @@ class CompilerInterfaceVC6 extends CompilerInterface {
return "d"; return "d";
} }
String makeCfgName(String flavourBuild) { String makeCfgName(String flavourBuild, String platform) {
return "vm - "+ Util.os + " " + flavourBuild; return "vm - "+ platform + " " + flavourBuild;
} }
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,7 +37,7 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
public void writeProjectFile(String projectFileName, String projectName, public void writeProjectFile(String projectFileName, String projectName,
Vector allConfigs) throws IOException { Vector allConfigs) throws IOException {
System.out.println(); 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 // If we got this far without an error, we're safe to actually
// write the .vcproj file // write the .vcproj file
printWriter = new PrintWriter(new FileWriter(projectFileName)); printWriter = new PrintWriter(new FileWriter(projectFileName));
@ -54,9 +54,8 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
"SccLocalPath", "" "SccLocalPath", ""
} }
); );
startTag("Platforms", null); startTag("Platforms", null);
tag("Platform", new String[] {"Name", Util.os}); tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")});
endTag("Platforms"); endTag("Platforms");
startTag("Configurations", null); startTag("Configurations", null);
@ -81,12 +80,47 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
abstract class NameFilter { abstract class NameFilter {
protected String fname; protected String fname;
abstract boolean match(FileInfo fi); abstract boolean match(FileInfo fi);
String filterString() { return ""; } String filterString() { return ""; }
String name() { return this.fname;} 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 { class DirectoryFilter extends NameFilter {
@ -109,9 +143,50 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
boolean match(FileInfo fi) { boolean match(FileInfo fi) {
int lastSlashIndex = fi.full.lastIndexOf('/'); int lastSlashIndex = fi.full.lastIndexOf('/');
String fullDir = fi.full.substring(0, lastSlashIndex); String fullDir = fi.full.substring(0, lastSlashIndex);
return fullDir.endsWith(dir); 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 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
DirectoryFilter container = null; DirectoryFilter container = null;
for(FileInfo fileInfo : files) { for(FileInfo fileInfo : files) {
if (!fileInfo.full.startsWith(sbase)) { if (!fileInfo.full.startsWith(sbase)) {
continue; continue;
} }
int lastSlash = fileInfo.full.lastIndexOf('/'); int lastSlash = fileInfo.full.lastIndexOf('/');
String dir = fileInfo.full.substring(sbase.length(), lastSlash); String dir = fileInfo.full.substring(sbase.length(), lastSlash);
if(dir.equals("share/vm")) { if(dir.equals("share/vm")) {
// skip files directly in share/vm - should only be precompiled.hpp which is handled below // skip files directly in share/vm - should only be precompiled.hpp which is handled below
continue; continue;
} }
if (!dir.equals(currentDir)) { if (!dir.equals(currentDir)) {
currentDir = dir; currentDir = dir;
if (container != null) { if (container != null && !rv.contains(container)) {
rv.add(container); rv.add(container);
} }
// remove "share/vm/" from names // remove "share/vm/" from names
String name = dir; String name = dir;
if (dir.startsWith("share/vm/")) { if (dir.startsWith("share/vm/")) {
name = dir.substring("share/vm/".length(), dir.length()); name = dir.substring("share/vm/".length(), dir.length());
} }
container = new DirectoryFilter(name, dir, sbase); 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) { if (container != null && !rv.contains(container)) {
rv.add(container); rv.add(container);
} }
ContainerFilter generated = new ContainerFilter("Generated"); ContainerFilter generated = new ContainerFilter("Generated");
@ -583,7 +665,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
return rv; return rv;
} }
Vector getBaseLinkerFlags(String outDir, String outDll) { Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
Vector rv = new Vector(); Vector rv = new Vector();
addAttr(rv, "Name", "VCLinkerTool"); addAttr(rv, "Name", "VCLinkerTool");
@ -610,8 +692,13 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "SubSystem", "2"); addAttr(rv, "SubSystem", "2");
addAttr(rv, "BaseAddress", "0x8000000"); addAttr(rv, "BaseAddress", "0x8000000");
addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib"); addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
// Set /MACHINE option. 1 is machineX86 if(platformName.equals("Win32")) {
addAttr(rv, "TargetMachine", "1"); // Set /MACHINE option. 1 is X86
addAttr(rv, "TargetMachine", "1");
} else {
// Set /MACHINE option. 17 is X64
addAttr(rv, "TargetMachine", "17");
}
return rv; return rv;
} }
@ -656,12 +743,6 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "Optimization", "2"); addAttr(rv, "Optimization", "2");
// Set /Oy- option // Set /Oy- option
addAttr(rv, "OmitFramePointers", "FALSE"); addAttr(rv, "OmitFramePointers", "FALSE");
}
Vector getProductCompilerFlags() {
Vector rv = new Vector();
getProductCompilerFlags_common(rv);
// Set /Ob option. 1 is expandOnlyInline // Set /Ob option. 1 is expandOnlyInline
addAttr(rv, "InlineFunctionExpansion", "1"); addAttr(rv, "InlineFunctionExpansion", "1");
// Set /GF option. // Set /GF option.
@ -670,6 +751,12 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "RuntimeLibrary", "2"); addAttr(rv, "RuntimeLibrary", "2");
// Set /Gy option // Set /Gy option
addAttr(rv, "EnableFunctionLevelLinking", "TRUE"); addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
}
Vector getProductCompilerFlags() {
Vector rv = new Vector();
getProductCompilerFlags_common(rv);
return rv; return rv;
} }
@ -693,7 +780,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
return "0"; return "0";
} }
String makeCfgName(String flavourBuild) { String makeCfgName(String flavourBuild, String platform) {
return flavourBuild + "|" + Util.os; return flavourBuild + "|" + platform;
} }
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,11 +42,6 @@
using namespace std; using namespace std;
#endif #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 #if _MSC_VER >= 1400
#define strdup _strdup #define strdup _strdup
#endif #endif

View File

@ -1698,7 +1698,75 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
fprintf(fp,"\n"); fprintf(fp,"\n");
} // done generating expand rule } // done generating expand rule
else if( node->_matrule != NULL ) { // Generate projections for instruction's additional DEFs and KILLs
if( ! node->expands() && (node->needs_projections() || node->has_temps())) {
// Get string representing the MachNode that projections point at
const char *machNode = "this";
// Generate the projections
fprintf(fp," // Add projection edges for additional defs or kills\n");
// Examine each component to see if it is a DEF or KILL
node->_components.reset();
// Skip the first component, if already handled as (SET dst (...))
Component *comp = NULL;
// For kills, the choice of projection numbers is arbitrary
int proj_no = 1;
bool declared_def = false;
bool declared_kill = false;
while( (comp = node->_components.iter()) != NULL ) {
// Lookup register class associated with operand type
Form *form = (Form*)_globalNames[comp->_type];
assert( form, "component type must be a defined form");
OperandForm *op = form->is_operand();
if (comp->is(Component::TEMP)) {
fprintf(fp, " // TEMP %s\n", comp->_name);
if (!declared_def) {
// Define the variable "def" to hold new MachProjNodes
fprintf(fp, " MachTempNode *def;\n");
declared_def = true;
}
if (op && op->_interface && op->_interface->is_RegInterface()) {
fprintf(fp," def = new (C) MachTempNode(state->MachOperGenerator( %s, C ));\n",
machOperEnum(op->_ident));
fprintf(fp," add_req(def);\n");
// The operand for TEMP is already constructed during
// this mach node construction, see buildMachNode().
//
// int idx = node->operand_position_format(comp->_name);
// fprintf(fp," set_opnd_array(%d, state->MachOperGenerator( %s, C ));\n",
// idx, machOperEnum(op->_ident));
} else {
assert(false, "can't have temps which aren't registers");
}
} else if (comp->isa(Component::KILL)) {
fprintf(fp, " // DEF/KILL %s\n", comp->_name);
if (!declared_kill) {
// Define the variable "kill" to hold new MachProjNodes
fprintf(fp, " MachProjNode *kill;\n");
declared_kill = true;
}
assert( op, "Support additional KILLS for base operands");
const char *regmask = reg_mask(*op);
const char *ideal_type = op->ideal_type(_globalNames, _register);
if (!op->is_bound_register()) {
syntax_err(node->_linenum, "In %s only bound registers can be killed: %s %s\n",
node->_ident, comp->_type, comp->_name);
}
fprintf(fp," kill = ");
fprintf(fp,"new (C, 1) MachProjNode( %s, %d, (%s), Op_%s );\n",
machNode, proj_no++, regmask, ideal_type);
fprintf(fp," proj_list.push(kill);\n");
}
}
}
if( !node->expands() && node->_matrule != NULL ) {
// Remove duplicated operands and inputs which use the same name. // Remove duplicated operands and inputs which use the same name.
// Seach through match operands for the same name usage. // Seach through match operands for the same name usage.
uint cur_num_opnds = node->num_opnds(); uint cur_num_opnds = node->num_opnds();
@ -1752,72 +1820,6 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
} }
} }
// Generate projections for instruction's additional DEFs and KILLs
if( ! node->expands() && (node->needs_projections() || node->has_temps())) {
// Get string representing the MachNode that projections point at
const char *machNode = "this";
// Generate the projections
fprintf(fp," // Add projection edges for additional defs or kills\n");
// Examine each component to see if it is a DEF or KILL
node->_components.reset();
// Skip the first component, if already handled as (SET dst (...))
Component *comp = NULL;
// For kills, the choice of projection numbers is arbitrary
int proj_no = 1;
bool declared_def = false;
bool declared_kill = false;
while( (comp = node->_components.iter()) != NULL ) {
// Lookup register class associated with operand type
Form *form = (Form*)_globalNames[comp->_type];
assert( form, "component type must be a defined form");
OperandForm *op = form->is_operand();
if (comp->is(Component::TEMP)) {
fprintf(fp, " // TEMP %s\n", comp->_name);
if (!declared_def) {
// Define the variable "def" to hold new MachProjNodes
fprintf(fp, " MachTempNode *def;\n");
declared_def = true;
}
if (op && op->_interface && op->_interface->is_RegInterface()) {
fprintf(fp," def = new (C) MachTempNode(state->MachOperGenerator( %s, C ));\n",
machOperEnum(op->_ident));
fprintf(fp," add_req(def);\n");
int idx = node->operand_position_format(comp->_name);
fprintf(fp," set_opnd_array(%d, state->MachOperGenerator( %s, C ));\n",
idx, machOperEnum(op->_ident));
} else {
assert(false, "can't have temps which aren't registers");
}
} else if (comp->isa(Component::KILL)) {
fprintf(fp, " // DEF/KILL %s\n", comp->_name);
if (!declared_kill) {
// Define the variable "kill" to hold new MachProjNodes
fprintf(fp, " MachProjNode *kill;\n");
declared_kill = true;
}
assert( op, "Support additional KILLS for base operands");
const char *regmask = reg_mask(*op);
const char *ideal_type = op->ideal_type(_globalNames, _register);
if (!op->is_bound_register()) {
syntax_err(node->_linenum, "In %s only bound registers can be killed: %s %s\n",
node->_ident, comp->_type, comp->_name);
}
fprintf(fp," kill = ");
fprintf(fp,"new (C, 1) MachProjNode( %s, %d, (%s), Op_%s );\n",
machNode, proj_no++, regmask, ideal_type);
fprintf(fp," proj_list.push(kill);\n");
}
}
}
// If the node is a MachConstantNode, insert the MachConstantBaseNode edge. // If the node is a MachConstantNode, insert the MachConstantBaseNode edge.
// NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input). // NOTE: this edge must be the last input (see MachConstantNode::mach_constant_base_node_input).
if (node->is_mach_constant()) { if (node->is_mach_constant()) {
@ -3776,12 +3778,10 @@ void ArchDesc::buildMachNode(FILE *fp_cpp, InstructForm *inst, const char *inden
} }
dont_care = true; dont_care = true;
// For each operand not in the match rule, call MachOperGenerator // For each operand not in the match rule, call MachOperGenerator
// with the enum for the opcode that needs to be built // with the enum for the opcode that needs to be built.
// and the node just built, the parent of the operand.
ComponentList clist = inst->_components; ComponentList clist = inst->_components;
int index = clist.operand_position(comp->_name, comp->_usedef); int index = clist.operand_position(comp->_name, comp->_usedef);
const char *opcode = machOperEnum(comp->_type); const char *opcode = machOperEnum(comp->_type);
const char *parent = "node";
fprintf(fp_cpp, "%s node->set_opnd_array(%d, ", indent, index); fprintf(fp_cpp, "%s node->set_opnd_array(%d, ", indent, index);
fprintf(fp_cpp, "MachOperGenerator(%s, C));\n", opcode); fprintf(fp_cpp, "MachOperGenerator(%s, C));\n", opcode);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -491,10 +491,11 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
// to start profiling on its own. // to start profiling on its own.
_method->ensure_method_data(); _method->ensure_method_data();
} }
} else if (is_profiling() && _would_profile) { } else if (is_profiling()) {
ciMethodData *md = method->method_data_or_null(); ciMethodData *md = method->method_data_or_null();
assert(md != NULL, "Sanity"); if (md != NULL) {
md->set_would_profile(_would_profile); md->set_would_profile(_would_profile);
}
} }
} }

View File

@ -412,13 +412,17 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
fail_type = _unloaded_ciinstance_klass; fail_type = _unloaded_ciinstance_klass;
} }
KlassHandle found_klass; KlassHandle found_klass;
if (!require_local) { {
klassOop kls = SystemDictionary::find_constrained_instance_or_array_klass( ttyUnlocker ttyul; // release tty lock to avoid ordering problems
sym, loader, KILL_COMPILE_ON_FATAL_(fail_type)); MutexLocker ml(Compile_lock);
found_klass = KlassHandle(THREAD, kls); klassOop kls;
} else { if (!require_local) {
klassOop kls = SystemDictionary::find_instance_or_array_klass( kls = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader,
sym, loader, domain, KILL_COMPILE_ON_FATAL_(fail_type)); KILL_COMPILE_ON_FATAL_(fail_type));
} else {
kls = SystemDictionary::find_instance_or_array_klass(sym, loader, domain,
KILL_COMPILE_ON_FATAL_(fail_type));
}
found_klass = KlassHandle(THREAD, kls); found_klass = KlassHandle(THREAD, kls);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -212,9 +212,9 @@ void ciField::initialize_from(fieldDescriptor* fd) {
// may change. The three examples are java.lang.System.in, // may change. The three examples are java.lang.System.in,
// java.lang.System.out, and java.lang.System.err. // java.lang.System.out, and java.lang.System.err.
klassOop k = _holder->get_klassOop(); Handle k = _holder->get_klassOop();
assert( SystemDictionary::System_klass() != NULL, "Check once per vm"); assert( SystemDictionary::System_klass() != NULL, "Check once per vm");
if( k == SystemDictionary::System_klass() ) { if( k() == SystemDictionary::System_klass() ) {
// Check offsets for case 2: System.in, System.out, or System.err // Check offsets for case 2: System.in, System.out, or System.err
if( _offset == java_lang_System::in_offset_in_bytes() || if( _offset == java_lang_System::in_offset_in_bytes() ||
_offset == java_lang_System::out_offset_in_bytes() || _offset == java_lang_System::out_offset_in_bytes() ||

View File

@ -46,6 +46,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
ciKlass(h_k), _non_static_fields(NULL) ciKlass(h_k), _non_static_fields(NULL)
{ {
assert(get_Klass()->oop_is_instance(), "wrong type"); assert(get_Klass()->oop_is_instance(), "wrong type");
assert(get_instanceKlass()->is_loaded(), "must be at least loaded");
instanceKlass* ik = get_instanceKlass(); instanceKlass* ik = get_instanceKlass();
AccessFlags access_flags = ik->access_flags(); AccessFlags access_flags = ik->access_flags();

View File

@ -331,7 +331,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
length, CHECK_(nullHandle)); length, CHECK_(nullHandle));
constantPoolOop constant_pool = constantPoolOop constant_pool =
oopFactory::new_constantPool(length, oopFactory::new_constantPool(length,
methodOopDesc::IsSafeConc, oopDesc::IsSafeConc,
CHECK_(nullHandle)); CHECK_(nullHandle));
constantPoolHandle cp (THREAD, constant_pool); constantPoolHandle cp (THREAD, constant_pool);
@ -1929,10 +1929,9 @@ methodHandle ClassFileParser::parse_method(constantPoolHandle cp, bool is_interf
} }
// All sizing information for a methodOop is finally available, now create it // All sizing information for a methodOop is finally available, now create it
methodOop m_oop = oopFactory::new_method( methodOop m_oop = oopFactory::new_method(code_length, access_flags, linenumber_table_length,
code_length, access_flags, linenumber_table_length, total_lvt_length, checked_exceptions_length,
total_lvt_length, checked_exceptions_length, oopDesc::IsSafeConc, CHECK_(nullHandle));
methodOopDesc::IsSafeConc, CHECK_(nullHandle));
methodHandle m (THREAD, m_oop); methodHandle m (THREAD, m_oop);
ClassLoadingService::add_class_method_size(m_oop->size()*HeapWordSize); ClassLoadingService::add_class_method_size(m_oop->size()*HeapWordSize);

View File

@ -1290,6 +1290,15 @@ void ClassLoader::compile_the_world() {
int ClassLoader::_compile_the_world_counter = 0; int ClassLoader::_compile_the_world_counter = 0;
static int _codecache_sweep_counter = 0; static int _codecache_sweep_counter = 0;
// Filter out all exceptions except OOMs
static void clear_pending_exception_if_not_oom(TRAPS) {
if (HAS_PENDING_EXCEPTION &&
!PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
CLEAR_PENDING_EXCEPTION;
}
// The CHECK at the caller will propagate the exception out
}
void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
int len = (int)strlen(name); int len = (int)strlen(name);
if (len > 6 && strcmp(".class", name + len - 6) == 0) { if (len > 6 && strcmp(".class", name + len - 6) == 0) {
@ -1312,12 +1321,12 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
k->initialize(THREAD); k->initialize(THREAD);
} }
bool exception_occurred = HAS_PENDING_EXCEPTION; bool exception_occurred = HAS_PENDING_EXCEPTION;
CLEAR_PENDING_EXCEPTION; clear_pending_exception_if_not_oom(CHECK);
if (CompileTheWorldPreloadClasses && k.not_null()) { if (CompileTheWorldPreloadClasses && k.not_null()) {
constantPoolKlass::preload_and_initialize_all_classes(k->constants(), THREAD); constantPoolKlass::preload_and_initialize_all_classes(k->constants(), THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
// If something went wrong in preloading we just ignore it // If something went wrong in preloading we just ignore it
CLEAR_PENDING_EXCEPTION; clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_counter, buffer); tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_counter, buffer);
} }
} }
@ -1344,7 +1353,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_initial_compile, CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_initial_compile,
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string());
} }
if (TieredCompilation) { if (TieredCompilation) {
@ -1358,7 +1367,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization, CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization,
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION; clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string());
} }
} }

View File

@ -322,8 +322,14 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
klassOop LoaderConstraintTable::find_constrained_klass(Symbol* name, klassOop LoaderConstraintTable::find_constrained_klass(Symbol* name,
Handle loader) { Handle loader) {
LoaderConstraintEntry *p = *(find_loader_constraint(name, loader)); LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
if (p != NULL && p->klass() != NULL) if (p != NULL && p->klass() != NULL) {
if (Klass::cast(p->klass())->oop_is_instance() && !instanceKlass::cast(p->klass())->is_loaded()) {
// Only return fully loaded classes. Classes found through the
// constraints might still be in the process of loading.
return NULL;
}
return p->klass(); return p->klass();
}
// No constraints, or else no klass loaded yet. // No constraints, or else no klass loaded yet.
return NULL; return NULL;

View File

@ -1690,6 +1690,8 @@ klassOop SystemDictionary::try_get_next_class() {
void SystemDictionary::add_to_hierarchy(instanceKlassHandle k, TRAPS) { void SystemDictionary::add_to_hierarchy(instanceKlassHandle k, TRAPS) {
assert(k.not_null(), "just checking"); assert(k.not_null(), "just checking");
assert_locked_or_safepoint(Compile_lock);
// Link into hierachy. Make sure the vtables are initialized before linking into // Link into hierachy. Make sure the vtables are initialized before linking into
k->append_to_sibling_list(); // add to superklass/sibling list k->append_to_sibling_list(); // add to superklass/sibling list
k->process_interfaces(THREAD); // handle all "implements" declarations k->process_interfaces(THREAD); // handle all "implements" declarations
@ -2152,6 +2154,9 @@ void SystemDictionary::update_dictionary(int d_index, unsigned int d_hash,
} }
// Try to find a class name using the loader constraints. The
// loader constraints might know about a class that isn't fully loaded
// yet and these will be ignored.
klassOop SystemDictionary::find_constrained_instance_or_array_klass( klassOop SystemDictionary::find_constrained_instance_or_array_klass(
Symbol* class_name, Handle class_loader, TRAPS) { Symbol* class_name, Handle class_loader, TRAPS) {

View File

@ -768,7 +768,9 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue
// Initialize the compilation queue // Initialize the compilation queue
void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler_count) { void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler_count) {
EXCEPTION_MARK; EXCEPTION_MARK;
#ifndef ZERO
assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?"); assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?");
#endif // !ZERO
if (c2_compiler_count > 0) { if (c2_compiler_count > 0) {
_c2_method_queue = new CompileQueue("C2MethodQueue", MethodCompileQueue_lock); _c2_method_queue = new CompileQueue("C2MethodQueue", MethodCompileQueue_lock);
} }

View File

@ -1040,9 +1040,10 @@ const {
} else { } else {
// must read from what 'p' points to in each loop. // must read from what 'p' points to in each loop.
klassOop k = ((volatile oopDesc*)p)->klass_or_null(); klassOop k = ((volatile oopDesc*)p)->klass_or_null();
if (k != NULL && // We trust the size of any object that has a non-NULL
((oopDesc*)p)->is_parsable() && // klass and (for those in the perm gen) is parsable
((oopDesc*)p)->is_conc_safe()) { // -- irrespective of its conc_safe-ty.
if (k != NULL && ((oopDesc*)p)->is_parsable()) {
assert(k->is_oop(), "Should really be klass oop."); assert(k->is_oop(), "Should really be klass oop.");
oop o = (oop)p; oop o = (oop)p;
assert(o->is_oop(), "Should be an oop"); assert(o->is_oop(), "Should be an oop");
@ -1051,6 +1052,7 @@ const {
assert(res != 0, "Block size should not be 0"); assert(res != 0, "Block size should not be 0");
return res; return res;
} else { } else {
// May return 0 if P-bits not present.
return c->block_size_if_printezis_bits(p); return c->block_size_if_printezis_bits(p);
} }
} }

View File

@ -6360,18 +6360,16 @@ size_t CMSCollector::block_size_using_printezis_bits(HeapWord* addr) const {
// A variant of the above (block_size_using_printezis_bits()) except // A variant of the above (block_size_using_printezis_bits()) except
// that we return 0 if the P-bits are not yet set. // that we return 0 if the P-bits are not yet set.
size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const { size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const {
if (_markBitMap.isMarked(addr)) { if (_markBitMap.isMarked(addr + 1)) {
assert(_markBitMap.isMarked(addr + 1), "Missing Printezis bit?"); assert(_markBitMap.isMarked(addr), "P-bit can be set only for marked objects");
HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2); HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2);
size_t size = pointer_delta(nextOneAddr + 1, addr); size_t size = pointer_delta(nextOneAddr + 1, addr);
assert(size == CompactibleFreeListSpace::adjustObjectSize(size), assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
"alignment problem"); "alignment problem");
assert(size >= 3, "Necessary for Printezis marks to work"); assert(size >= 3, "Necessary for Printezis marks to work");
return size; 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 { HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
@ -9212,7 +9210,6 @@ bool MarkRefsIntoAndScanClosure::take_from_overflow_list() {
size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) { size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) {
size_t res = _sp->block_size_no_stall(addr, _collector); 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 (_sp->block_is_obj(addr)) {
if (_live_bit_map->isMarked(addr)) { if (_live_bit_map->isMarked(addr)) {
// It can't have been dead in a previous cycle // It can't have been dead in a previous cycle
@ -9221,6 +9218,7 @@ size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) {
_dead_bit_map->mark(addr); // mark the dead object _dead_bit_map->mark(addr); // mark the dead object
} }
} }
// Could be 0, if the block size could not be computed without stalling.
return res; return res;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -132,8 +132,7 @@ class VM_GenCollectFullConcurrent: public VM_GC_Operation {
VM_GenCollectFullConcurrent(unsigned int gc_count_before, VM_GenCollectFullConcurrent(unsigned int gc_count_before,
unsigned int full_gc_count_before, unsigned int full_gc_count_before,
GCCause::Cause gc_cause) GCCause::Cause gc_cause)
: VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) { : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */) {
_gc_cause = gc_cause;
assert(FullGCCount_lock != NULL, "Error"); assert(FullGCCount_lock != NULL, "Error");
assert(UseAsyncConcMarkSweepGC, "Else will hang caller"); assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ protected:
public: public:
VM_G1OperationWithAllocRequest(unsigned int gc_count_before, VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
size_t word_size) 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) { } _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
HeapWord* result() { return _result; } HeapWord* result() { return _result; }
bool pause_succeeded() { return _pause_succeeded; } bool pause_succeeded() { return _pause_succeeded; }
@ -55,9 +55,7 @@ public:
VM_G1CollectFull(unsigned int gc_count_before, VM_G1CollectFull(unsigned int gc_count_before,
unsigned int full_gc_count_before, unsigned int full_gc_count_before,
GCCause::Cause cause) GCCause::Cause cause)
: VM_GC_Operation(gc_count_before, full_gc_count_before) { : VM_GC_Operation(gc_count_before, cause, full_gc_count_before) { }
_gc_cause = cause;
}
virtual VMOp_Type type() const { return VMOp_G1CollectFull; } virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
virtual void doit(); virtual void doit();
virtual const char* name() const { virtual const char* name() const {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -112,9 +112,12 @@ jint ParallelScavengeHeap::initialize() {
yg_cur_size = MAX2(yg_cur_size, yg_min_size); yg_cur_size = MAX2(yg_cur_size, yg_min_size);
og_min_size = align_size_up(og_min_size, og_align); og_min_size = align_size_up(og_min_size, og_align);
og_max_size = align_size_up(og_max_size, og_align); // Align old gen size down to preserve specified heap size.
assert(og_align == yg_align, "sanity");
og_max_size = align_size_down(og_max_size, og_align);
og_max_size = MAX2(og_max_size, og_min_size);
size_t og_cur_size = size_t og_cur_size =
align_size_up(_collector_policy->old_gen_size(), og_align); align_size_down(_collector_policy->old_gen_size(), og_align);
og_cur_size = MAX2(og_cur_size, og_min_size); og_cur_size = MAX2(og_cur_size, og_min_size);
pg_min_size = align_size_up(pg_min_size, pg_align); pg_min_size = align_size_up(pg_min_size, pg_align);

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1196,11 +1196,6 @@ class PSParallelCompact : AllStatic {
static inline void adjust_pointer(oop* p) { adjust_pointer(p, false); } static inline void adjust_pointer(oop* p) { adjust_pointer(p, false); }
static inline void adjust_pointer(narrowOop* p) { adjust_pointer(p, false); } static inline void adjust_pointer(narrowOop* p) { adjust_pointer(p, false); }
template <class T>
static inline void adjust_pointer(T* p,
HeapWord* beg_addr,
HeapWord* end_addr);
// Reference Processing // Reference Processing
static ReferenceProcessor* const ref_processor() { return _ref_processor; } static ReferenceProcessor* const ref_processor() { return _ref_processor; }
@ -1408,15 +1403,6 @@ inline bool PSParallelCompact::should_update_klass(klassOop k) {
return ((HeapWord*) k) >= dense_prefix(perm_space_id); return ((HeapWord*) k) >= dense_prefix(perm_space_id);
} }
template <class T>
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 #ifdef ASSERT
inline void inline void
PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr) PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr)

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 // The following methods are used by the parallel scavenge collector
VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size, VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
bool is_tlab, unsigned int gc_count) : bool is_tlab, unsigned int gc_count) :
VM_GC_Operation(gc_count), VM_GC_Operation(gc_count, GCCause::_allocation_failure),
_size(size), _size(size),
_is_tlab(is_tlab), _is_tlab(is_tlab),
_result(NULL) _result(NULL)
@ -57,7 +57,7 @@ void VM_ParallelGCFailedAllocation::doit() {
VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size, VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size,
unsigned int gc_count, unsigned int full_gc_count) : 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), _size(size),
_result(NULL) _result(NULL)
{ {
@ -80,9 +80,8 @@ void VM_ParallelGCFailedPermanentAllocation::doit() {
VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count, VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
unsigned int full_gc_count, unsigned int full_gc_count,
GCCause::Cause gc_cause) : 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() { void VM_ParallelGCSystemGC::doit() {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,6 +87,8 @@ bool VM_GC_Operation::skip_operation() const {
bool VM_GC_Operation::doit_prologue() { bool VM_GC_Operation::doit_prologue() {
assert(Thread::current()->is_Java_thread(), "just checking"); 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(); acquire_pending_list_lock();
// If the GC count has changed someone beat us to the collection // If the GC count has changed someone beat us to the collection

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -85,6 +85,7 @@ class VM_GC_Operation: public VM_Operation {
public: public:
VM_GC_Operation(unsigned int gc_count_before, VM_GC_Operation(unsigned int gc_count_before,
GCCause::Cause _cause,
unsigned int full_gc_count_before = 0, unsigned int full_gc_count_before = 0,
bool full = false) { bool full = false) {
_full = full; _full = full;
@ -92,7 +93,7 @@ class VM_GC_Operation: public VM_Operation {
_gc_count_before = gc_count_before; _gc_count_before = gc_count_before;
// A subclass constructor will likely overwrite the following // A subclass constructor will likely overwrite the following
_gc_cause = GCCause::_no_cause_specified; _gc_cause = _cause;
_gc_locked = false; _gc_locked = false;
@ -136,6 +137,7 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
VM_GC_HeapInspection(outputStream* out, bool request_full_gc, VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
bool need_prologue) : bool need_prologue) :
VM_GC_Operation(0 /* total collections, dummy, ignored */, VM_GC_Operation(0 /* total collections, dummy, ignored */,
GCCause::_heap_inspection /* GC Cause */,
0 /* total full collections, dummy, ignored */, 0 /* total full collections, dummy, ignored */,
request_full_gc) { request_full_gc) {
_out = out; _out = out;
@ -160,7 +162,7 @@ class VM_GenCollectForAllocation: public VM_GC_Operation {
VM_GenCollectForAllocation(size_t size, VM_GenCollectForAllocation(size_t size,
bool tlab, bool tlab,
unsigned int gc_count_before) unsigned int gc_count_before)
: VM_GC_Operation(gc_count_before), : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
_size(size), _size(size),
_tlab(tlab) { _tlab(tlab) {
_res = NULL; _res = NULL;
@ -182,9 +184,8 @@ class VM_GenCollectFull: public VM_GC_Operation {
unsigned int full_gc_count_before, unsigned int full_gc_count_before,
GCCause::Cause gc_cause, GCCause::Cause gc_cause,
int max_level) int max_level)
: VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */), : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
_max_level(max_level) _max_level(max_level) { }
{ _gc_cause = gc_cause; }
~VM_GenCollectFull() {} ~VM_GenCollectFull() {}
virtual VMOp_Type type() const { return VMOp_GenCollectFull; } virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
virtual void doit(); virtual void doit();
@ -199,7 +200,7 @@ class VM_GenCollectForPermanentAllocation: public VM_GC_Operation {
unsigned int gc_count_before, unsigned int gc_count_before,
unsigned int full_gc_count_before, unsigned int full_gc_count_before,
GCCause::Cause gc_cause) 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) { _size(size) {
_res = NULL; _res = NULL;
_gc_cause = gc_cause; _gc_cause = gc_cause;

View File

@ -100,8 +100,7 @@ void CollectedHeap::check_for_bad_heap_word_value(HeapWord* addr, size_t size) {
} }
} }
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) { if (CheckMemoryInitialization && ZapUnusedHeapArea) {
for (size_t slot = 0; slot < size; slot += 1) { for (size_t slot = 0; slot < size; slot += 1) {
assert((*(intptr_t*) (addr + slot)) == ((intptr_t) badHeapWordVal), assert((*(intptr_t*) (addr + slot)) == ((intptr_t) badHeapWordVal),

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -92,28 +92,3 @@ const char* GCCause::to_string(GCCause::Cause cause) {
} }
ShouldNotReachHere(); 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

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -85,8 +85,6 @@ class GCCause : public AllStatic {
// Return a string describing the GCCause. // Return a string describing the GCCause.
static const char* to_string(GCCause::Cause cause); 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 #endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP

View File

@ -1942,7 +1942,7 @@ run:
constantPoolOop constants = istate->method()->constants(); constantPoolOop constants = istate->method()->constants();
if (!constants->tag_at(index).is_unresolved_klass()) { if (!constants->tag_at(index).is_unresolved_klass()) {
// Make sure klass is initialized and doesn't have a finalizer // Make sure klass is initialized and doesn't have a finalizer
oop entry = (klassOop) *constants->obj_at_addr(index); oop entry = constants->slot_at(index).get_oop();
assert(entry->is_klass(), "Should be resolved klass"); assert(entry->is_klass(), "Should be resolved klass");
klassOop k_entry = (klassOop) entry; klassOop k_entry = (klassOop) entry;
assert(k_entry->klass_part()->oop_is_instance(), "Should be instanceKlass"); assert(k_entry->klass_part()->oop_is_instance(), "Should be instanceKlass");
@ -2032,7 +2032,7 @@ run:
if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { if (METHOD->constants()->tag_at(index).is_unresolved_klass()) {
CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception);
} }
klassOop klassOf = (klassOop) *(METHOD->constants()->obj_at_addr(index)); klassOop klassOf = (klassOop) METHOD->constants()->slot_at(index).get_oop();
klassOop objKlassOop = STACK_OBJECT(-1)->klass(); //ebx klassOop objKlassOop = STACK_OBJECT(-1)->klass(); //ebx
// //
// Check for compatibilty. This check must not GC!! // Check for compatibilty. This check must not GC!!
@ -2067,7 +2067,7 @@ run:
if (METHOD->constants()->tag_at(index).is_unresolved_klass()) { if (METHOD->constants()->tag_at(index).is_unresolved_klass()) {
CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception); CALL_VM(InterpreterRuntime::quicken_io_cc(THREAD), handle_exception);
} }
klassOop klassOf = (klassOop) *(METHOD->constants()->obj_at_addr(index)); klassOop klassOf = (klassOop) METHOD->constants()->slot_at(index).get_oop();
klassOop objKlassOop = STACK_OBJECT(-1)->klass(); klassOop objKlassOop = STACK_OBJECT(-1)->klass();
// //
// Check for compatibilty. This check must not GC!! // Check for compatibilty. This check must not GC!!

View File

@ -67,13 +67,11 @@ void Rewriter::compute_index_maps() {
// Creates a constant pool cache given a CPC map // 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) { void Rewriter::make_constant_pool_cache(TRAPS) {
const int length = _cp_cache_map.length(); const int length = _cp_cache_map.length();
constantPoolCacheOop cache = constantPoolCacheOop cache =
oopFactory::new_constantPoolCache(length, methodOopDesc::IsUnsafeConc, CHECK); oopFactory::new_constantPoolCache(length, CHECK);
No_Safepoint_Verifier nsv;
cache->initialize(_cp_cache_map); cache->initialize(_cp_cache_map);
// Don't bother with the next pass if there is no JVM_CONSTANT_InvokeDynamic. // Don't bother with the next pass if there is no JVM_CONSTANT_InvokeDynamic.

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -350,28 +350,11 @@ int VectorSet::hash() const
return (int)_xor; return (int)_xor;
} }
//------------------------------iterate----------------------------------------
SetI_ *VectorSet::iterate(uint &elem) const
{
VSetI_ *foo = (new(ResourceObj::C_HEAP) VSetI_(this));
elem = foo->next();
return foo;
}
//============================================================================= //=============================================================================
//------------------------------VSetI_-----------------------------------------
// Initialize the innards of a VectorSet iterator
VSetI_::VSetI_( const VectorSet *vset ) : s(vset)
{
i = (uint)-1L;
j = (uint)-1L;
mask = (unsigned)(1L<<31);
}
//------------------------------next------------------------------------------- //------------------------------next-------------------------------------------
// Find and return the next element of a vector set, or return garbage and // Find and return the next element of a vector set, or return garbage and
// make "VSetI_::test()" fail. // make "VectorSetI::test()" fail.
uint VSetI_::next(void) uint VectorSetI::next(void)
{ {
j++; // Next element in word j++; // Next element in word
mask = (mask & max_jint) << 1;// Next bit in word mask = (mask & max_jint) << 1;// Next bit in word

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -98,6 +98,9 @@ public:
uint Size(void) const; // Number of elements in the Set. uint Size(void) const; // Number of elements in the Set.
void Sort(void); // Sort before iterating void Sort(void); // Sort before iterating
int hash() const; // Hash function int hash() const; // Hash function
void Reset(void) { // Reset a set
memset( data, 0, size*sizeof(uint32) );
}
/* Removed for MCC BUG /* Removed for MCC BUG
operator const VectorSet* (void) const { return this; } */ operator const VectorSet* (void) const { return this; } */
@ -148,8 +151,7 @@ public:
private: private:
friend class VSetI_; SetI_ *iterate(uint&) const { ShouldNotCallThis(); return NULL; } // Removed
SetI_ *iterate(uint&) const;
}; };
//------------------------------Iteration-------------------------------------- //------------------------------Iteration--------------------------------------
@ -158,22 +160,26 @@ private:
// or may not be iterated over; untouched elements will be affected once. // or may not be iterated over; untouched elements will be affected once.
// Usage: for( VectorSetI i(s); i.test(); i++ ) { body = i.elem; } // Usage: for( VectorSetI i(s); i.test(); i++ ) { body = i.elem; }
class VSetI_ : public SetI_ { class VectorSetI : public StackObj {
friend class VectorSet; friend class VectorSet;
friend class VectorSetI;
const VectorSet *s; const VectorSet *s;
uint i, j; uint i, j;
uint32 mask; uint32 mask;
VSetI_(const VectorSet *vset);
uint next(void); uint next(void);
public:
uint elem; // The publically accessible element
VectorSetI( const VectorSet *vset ) :
s(vset),
i((uint)-1L),
j((uint)-1L),
mask((unsigned)(1L<<31)) {
elem = next();
}
void operator ++(void) { elem = next(); }
int test(void) { return i < s->size; } int test(void) { return i < s->size; }
}; };
class VectorSetI : public SetI {
public:
VectorSetI( const VectorSet *s ) : SetI(s) { }
void operator ++(void) { elem = ((VSetI_*)impl)->next(); }
int test(void) { return ((VSetI_*)impl)->test(); }
};
#endif // SHARE_VM_LIBADT_VECTSET_HPP #endif // SHARE_VM_LIBADT_VECTSET_HPP

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -157,7 +157,7 @@ ResourceObj::~ResourceObj() {
void trace_heap_malloc(size_t size, const char* name, void* p) { void trace_heap_malloc(size_t size, const char* name, void* p) {
// A lock is not needed here - tty uses a lock internally // A lock is not needed here - tty uses a lock internally
tty->print_cr("Heap malloc " INTPTR_FORMAT " %7d %s", p, size, name == NULL ? "" : name); tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name);
} }
@ -573,22 +573,27 @@ void AllocatedObj::print_value_on(outputStream* st) const {
st->print("AllocatedObj(" INTPTR_FORMAT ")", this); st->print("AllocatedObj(" INTPTR_FORMAT ")", this);
} }
size_t Arena::_bytes_allocated = 0; julong Arena::_bytes_allocated = 0;
void Arena::inc_bytes_allocated(size_t x) { inc_stat_counter(&_bytes_allocated, x); }
AllocStats::AllocStats() { AllocStats::AllocStats() {
start_mallocs = os::num_mallocs; start_mallocs = os::num_mallocs;
start_frees = os::num_frees; start_frees = os::num_frees;
start_malloc_bytes = os::alloc_bytes; start_malloc_bytes = os::alloc_bytes;
start_res_bytes = Arena::_bytes_allocated; start_mfree_bytes = os::free_bytes;
start_res_bytes = Arena::_bytes_allocated;
} }
int AllocStats::num_mallocs() { return os::num_mallocs - start_mallocs; } julong AllocStats::num_mallocs() { return os::num_mallocs - start_mallocs; }
size_t AllocStats::alloc_bytes() { return os::alloc_bytes - start_malloc_bytes; } julong AllocStats::alloc_bytes() { return os::alloc_bytes - start_malloc_bytes; }
size_t AllocStats::resource_bytes() { return Arena::_bytes_allocated - start_res_bytes; } julong AllocStats::num_frees() { return os::num_frees - start_frees; }
int AllocStats::num_frees() { return os::num_frees - start_frees; } julong AllocStats::free_bytes() { return os::free_bytes - start_mfree_bytes; }
julong AllocStats::resource_bytes() { return Arena::_bytes_allocated - start_res_bytes; }
void AllocStats::print() { void AllocStats::print() {
tty->print("%d mallocs (%ldK), %d frees, %ldK resrc", tty->print_cr(UINT64_FORMAT " mallocs (" UINT64_FORMAT "MB), "
num_mallocs(), alloc_bytes()/K, num_frees(), resource_bytes()/K); UINT64_FORMAT" frees (" UINT64_FORMAT "MB), " UINT64_FORMAT "MB resrc",
num_mallocs(), alloc_bytes()/M, num_frees(), free_bytes()/M, resource_bytes()/M);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -202,10 +202,11 @@ protected:
char *_hwm, *_max; // High water mark and max in current chunk char *_hwm, *_max; // High water mark and max in current chunk
void* grow(size_t x); // Get a new Chunk of at least size x void* grow(size_t x); // Get a new Chunk of at least size x
NOT_PRODUCT(size_t _size_in_bytes;) // Size of arena (used for memory usage tracing) NOT_PRODUCT(size_t _size_in_bytes;) // Size of arena (used for memory usage tracing)
NOT_PRODUCT(static size_t _bytes_allocated;) // total #bytes allocated since start NOT_PRODUCT(static julong _bytes_allocated;) // total #bytes allocated since start
friend class AllocStats; friend class AllocStats;
debug_only(void* malloc(size_t size);) debug_only(void* malloc(size_t size);)
debug_only(void* internal_malloc_4(size_t x);) debug_only(void* internal_malloc_4(size_t x);)
NOT_PRODUCT(void inc_bytes_allocated(size_t x);)
public: public:
Arena(); Arena();
Arena(size_t init_size); Arena(size_t init_size);
@ -219,7 +220,7 @@ protected:
assert(is_power_of_2(ARENA_AMALLOC_ALIGNMENT) , "should be a power of 2"); assert(is_power_of_2(ARENA_AMALLOC_ALIGNMENT) , "should be a power of 2");
x = ARENA_ALIGN(x); x = ARENA_ALIGN(x);
debug_only(if (UseMallocOnly) return malloc(x);) debug_only(if (UseMallocOnly) return malloc(x);)
NOT_PRODUCT(_bytes_allocated += x); NOT_PRODUCT(inc_bytes_allocated(x);)
if (_hwm + x > _max) { if (_hwm + x > _max) {
return grow(x); return grow(x);
} else { } else {
@ -232,7 +233,7 @@ protected:
void *Amalloc_4(size_t x) { void *Amalloc_4(size_t x) {
assert( (x&(sizeof(char*)-1)) == 0, "misaligned size" ); assert( (x&(sizeof(char*)-1)) == 0, "misaligned size" );
debug_only(if (UseMallocOnly) return malloc(x);) debug_only(if (UseMallocOnly) return malloc(x);)
NOT_PRODUCT(_bytes_allocated += x); NOT_PRODUCT(inc_bytes_allocated(x);)
if (_hwm + x > _max) { if (_hwm + x > _max) {
return grow(x); return grow(x);
} else { } else {
@ -252,7 +253,7 @@ protected:
size_t delta = (((size_t)_hwm + DALIGN_M1) & ~DALIGN_M1) - (size_t)_hwm; size_t delta = (((size_t)_hwm + DALIGN_M1) & ~DALIGN_M1) - (size_t)_hwm;
x += delta; x += delta;
#endif #endif
NOT_PRODUCT(_bytes_allocated += x); NOT_PRODUCT(inc_bytes_allocated(x);)
if (_hwm + x > _max) { if (_hwm + x > _max) {
return grow(x); // grow() returns a result aligned >= 8 bytes. return grow(x); // grow() returns a result aligned >= 8 bytes.
} else { } else {
@ -406,15 +407,16 @@ extern bool warn_new_operator;
// for statistics // for statistics
#ifndef PRODUCT #ifndef PRODUCT
class AllocStats : StackObj { class AllocStats : StackObj {
int start_mallocs, start_frees; julong start_mallocs, start_frees;
size_t start_malloc_bytes, start_res_bytes; julong start_malloc_bytes, start_mfree_bytes, start_res_bytes;
public: public:
AllocStats(); AllocStats();
int num_mallocs(); // since creation of receiver julong num_mallocs(); // since creation of receiver
size_t alloc_bytes(); julong alloc_bytes();
size_t resource_bytes(); julong num_frees();
int num_frees(); julong free_bytes();
julong resource_bytes();
void print(); void print();
}; };
#endif #endif

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,6 +32,20 @@
void trace_heap_malloc(size_t size, const char* name, void *p); void trace_heap_malloc(size_t size, const char* name, void *p);
void trace_heap_free(void *p); void trace_heap_free(void *p);
#ifndef PRODUCT
// Increments unsigned long value for statistics (not atomic on MP).
inline void inc_stat_counter(volatile julong* dest, julong add_value) {
#if defined(SPARC) || defined(X86)
// Sparc and X86 have atomic jlong (8 bytes) instructions
julong value = Atomic::load((volatile jlong*)dest);
value += add_value;
Atomic::store((jlong)value, (volatile jlong*)dest);
#else
// possible word-tearing during load/store
*dest += add_value;
#endif
}
#endif
// allocate using malloc; will fail if no memory available // allocate using malloc; will fail if no memory available
inline char* AllocateHeap(size_t size, const char* name = NULL) { inline char* AllocateHeap(size_t size, const char* name = NULL) {

View File

@ -111,10 +111,9 @@ constantPoolOop oopFactory::new_constantPool(int length,
constantPoolCacheOop oopFactory::new_constantPoolCache(int length, constantPoolCacheOop oopFactory::new_constantPoolCache(int length,
bool is_conc_safe,
TRAPS) { TRAPS) {
constantPoolCacheKlass* ck = constantPoolCacheKlass::cast(Universe::constantPoolCacheKlassObj()); constantPoolCacheKlass* ck = constantPoolCacheKlass::cast(Universe::constantPoolCacheKlassObj());
return ck->allocate(length, is_conc_safe, CHECK_NULL); return ck->allocate(length, CHECK_NULL);
} }

View File

@ -69,7 +69,6 @@ class oopFactory: AllStatic {
bool is_conc_safe, bool is_conc_safe,
TRAPS); TRAPS);
static constantPoolCacheOop new_constantPoolCache(int length, static constantPoolCacheOop new_constantPoolCache(int length,
bool is_conc_safe,
TRAPS); TRAPS);
// Instance classes // Instance classes

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -128,27 +128,6 @@ int arrayKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
} }
return klassKlass::oop_update_pointers(cm, obj); 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 #endif // SERIALGC
// Printing // Printing

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -145,21 +145,6 @@ int compiledICHolderKlass::oop_update_pointers(ParCompactionManager* cm,
PSParallelCompact::adjust_pointer(c->adr_holder_klass()); PSParallelCompact::adjust_pointer(c->adr_holder_klass());
return c->object_size(); 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 #endif // SERIALGC
// Printing // Printing

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -184,21 +184,6 @@ int constMethodKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
} }
return cm_oop->object_size(); 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 #endif // SERIALGC
// Printing // Printing

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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) { constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) {
int size = constantPoolOopDesc::object_size(length); int size = constantPoolOopDesc::object_size(length);
KlassHandle klass (THREAD, as_klassOop()); KlassHandle klass (THREAD, as_klassOop());
constantPoolOop c = assert(klass()->is_oop(), "Can't be null, else handlizing of c below won't work");
(constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); 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); pool->set_length(length);
c->set_tags(NULL); pool->set_tags(NULL);
c->set_cache(NULL); pool->set_cache(NULL);
c->set_operands(NULL); pool->set_operands(NULL);
c->set_pool_holder(NULL); pool->set_pool_holder(NULL);
c->set_flags(0); pool->set_flags(0);
// only set to non-zero if constant pool is merged by RedefineClasses // 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 // if constant pool may change during RedefineClasses, it is created
// unsafe for GC concurrent processing. // 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 // 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 // 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); typeArrayOop t_oop = oopFactory::new_permanent_byteArray(length, CHECK_NULL);
typeArrayHandle tags (THREAD, t_oop); typeArrayHandle tags (THREAD, t_oop);
for (int index = 0; index < length; index++) { for (int index = 0; index < length; index++) {
@ -82,6 +91,8 @@ constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS
} }
pool->set_tags(tags()); pool->set_tags(tags());
// Check that our size was stable at its old value.
assert(size == pool->size(), "size() changed");
return pool(); return pool();
} }
@ -271,40 +282,6 @@ int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
return cp->object_size(); 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) { void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
assert(obj->is_constantPool(), "should be constant pool"); assert(obj->is_constantPool(), "should be constant pool");
constantPoolOop cp = (constantPoolOop) obj; constantPoolOop cp = (constantPoolOop) obj;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,43 +49,31 @@ int constantPoolCacheKlass::oop_size(oop obj) const {
constantPoolCacheOop constantPoolCacheKlass::allocate(int length, constantPoolCacheOop constantPoolCacheKlass::allocate(int length,
bool is_conc_safe,
TRAPS) { TRAPS) {
// allocate memory // allocate memory
int size = constantPoolCacheOopDesc::object_size(length); int size = constantPoolCacheOopDesc::object_size(length);
KlassHandle klass (THREAD, as_klassOop()); KlassHandle klass (THREAD, as_klassOop());
// This is the original code. The code from permanent_obj_allocate() // Commented out below is the original code. The code from
// was in-lined to allow the setting of is_conc_safe before the klass // permanent_obj_allocate() was in-lined so that we could
// is installed. // set the _length field, necessary to correctly compute its
// size(), before setting its klass word further below.
// constantPoolCacheOop cache = (constantPoolCacheOop) // constantPoolCacheOop cache = (constantPoolCacheOop)
// CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); // CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL);
oop obj = CollectedHeap::permanent_obj_allocate_no_klass_install(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, NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value((HeapWord*) obj,
size)); size));
constantPoolCacheOop cache = (constantPoolCacheOop) obj;
// The length field affects the size of the object. The allocation assert(!UseConcMarkSweepGC || obj->klass_or_null() == NULL,
// above allocates the correct size (see calculation of "size") but "klass should be NULL here when using CMS");
// the size() method of the constant pool cache oop will not reflect cache->set_length(length); // should become visible before klass is set below.
// that size until the correct length is set.
cache->set_length(length);
// 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); cache->set_constant_pool(NULL);
OrderAccess::storestore();
obj->set_klass(klass());
assert(cache->size() == size, "Incorrect cache->size()");
return cache; return cache;
} }
@ -176,11 +164,6 @@ int constantPoolCacheKlass::oop_adjust_pointers(oop obj) {
return size; 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 #ifndef SERIALGC
void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm, void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
oop obj) { oop obj) {
@ -220,25 +203,6 @@ constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
return cache->object_size(); 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 #endif // SERIALGC
void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) { void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {

View File

@ -39,7 +39,7 @@ class constantPoolCacheKlass: public Klass {
// Allocation // Allocation
DEFINE_ALLOCATE_PERMANENT(constantPoolCacheKlass); DEFINE_ALLOCATE_PERMANENT(constantPoolCacheKlass);
constantPoolCacheOop allocate(int length, bool is_conc_safe, TRAPS); constantPoolCacheOop allocate(int length, TRAPS);
static klassOop create_klass(TRAPS); static klassOop create_klass(TRAPS);
// Casting from klassOop // Casting from klassOop
@ -55,7 +55,6 @@ class constantPoolCacheKlass: public Klass {
// Garbage collection // Garbage collection
void oop_follow_contents(oop obj); void oop_follow_contents(oop obj);
int oop_adjust_pointers(oop obj); int oop_adjust_pointers(oop obj);
virtual bool oop_is_conc_safe(oop obj) const;
// Parallel Scavenge and Parallel Old // Parallel Scavenge and Parallel Old
PARALLEL_GC_DECLS PARALLEL_GC_DECLS

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -98,15 +98,15 @@ void ConstantPoolCacheEntry::set_bytecode_2(Bytecodes::Code code) {
// Atomically sets f1 if it is still NULL, otherwise it keeps the // Atomically sets f1 if it is still NULL, otherwise it keeps the
// current value. // current value.
void ConstantPoolCacheEntry::set_f1_if_null_atomic(oop f1) { void ConstantPoolCacheEntry::set_f1_if_null_atomic(oop f1) {
// Use barriers as in oop_store // Use barriers as in oop_store
HeapWord* f1_addr = (HeapWord*) &_f1; oop* f1_addr = (oop*) &_f1;
update_barrier_set_pre(f1_addr, f1); update_barrier_set_pre(f1_addr, f1);
void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL); void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL);
bool success = (result == NULL); bool success = (result == NULL);
if (success) { if (success) {
update_barrier_set((void*) f1_addr, f1); update_barrier_set(f1_addr, f1);
}
} }
}
#ifdef ASSERT #ifdef ASSERT
// It is possible to have two different dummy methodOops created // It is possible to have two different dummy methodOops created
@ -368,16 +368,6 @@ void ConstantPoolCacheEntry::update_pointers() {
PSParallelCompact::adjust_pointer((oop*)&_f2); 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 #endif // SERIALGC
// RedefineClasses() API support: // RedefineClasses() API support:

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -287,7 +287,6 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
#endif // SERIALGC #endif // SERIALGC
void update_pointers(); void update_pointers();
void update_pointers(HeapWord* beg_addr, HeapWord* end_addr);
// RedefineClasses() API support: // RedefineClasses() API support:
// If this constantPoolCacheEntry refers to old_method then update it // If this constantPoolCacheEntry refers to old_method then update it
@ -321,9 +320,6 @@ class constantPoolCacheOopDesc: public oopDesc {
private: private:
int _length; int _length;
constantPoolOop _constant_pool; // the corresponding constant pool 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 // Sizing
debug_only(friend class ClassVerifier;) debug_only(friend class ClassVerifier;)
@ -390,12 +386,6 @@ class constantPoolCacheOopDesc: public oopDesc {
return entry_at(primary_index); 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 // Code generation
static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); } static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
static ByteSize entry_offset(int raw_index) { static ByteSize entry_offset(int raw_index) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1736,14 +1736,6 @@ void instanceKlass::update_static_fields() {
PSParallelCompact::adjust_pointer(p), \ PSParallelCompact::adjust_pointer(p), \
assert_nothing) 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 #endif // SERIALGC
void instanceKlass::oop_follow_contents(oop obj) { void instanceKlass::oop_follow_contents(oop obj) {
@ -1876,15 +1868,6 @@ int instanceKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
return size_helper(); 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) { void instanceKlass::push_static_fields(PSPromotionManager* pm) {
InstanceKlass_OOP_ITERATE( \ InstanceKlass_OOP_ITERATE( \
start_of_static_fields(), static_oop_field_size(), \ start_of_static_fields(), static_oop_field_size(), \

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -740,7 +740,6 @@ class instanceKlass: public Klass {
void follow_static_fields(ParCompactionManager* cm); void follow_static_fields(ParCompactionManager* cm);
void copy_static_fields(ParCompactionManager* cm); void copy_static_fields(ParCompactionManager* cm);
void update_static_fields(); void update_static_fields();
void update_static_fields(HeapWord* beg_addr, HeapWord* end_addr);
#endif // SERIALGC #endif // SERIALGC
// Naming // Naming

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -353,35 +353,6 @@ int instanceKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
return ik->object_size(); 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 #endif // SERIALGC
klassOop klassOop

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -344,33 +344,6 @@ int instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
} }
return size_helper(); return size_helper();
} }
template <class T> 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<narrowOop>(cm, obj, beg_addr, end_addr);
} else {
specialized_oop_update_pointers<oop>(cm, obj, beg_addr, end_addr);
}
return size_helper();
}
#endif // SERIALGC #endif // SERIALGC
void instanceRefKlass::update_nonstatic_oop_maps(klassOop k) { void instanceRefKlass::update_nonstatic_oop_maps(klassOop k) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -188,19 +188,6 @@ int klassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
return oop_size(obj); 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 #endif // SERIALGC

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 \ objects that do (or may) cross chunk boundaries; it updates only those \
oops that are in the region [beg_addr, end_addr). */ \ oops that are in the region [beg_addr, end_addr). */ \
virtual void oop_follow_contents(ParCompactionManager* cm, oop obj); \ 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);
virtual int oop_update_pointers(ParCompactionManager* cm, oop obj, \
HeapWord* beg_addr, HeapWord* end_addr);
// Pure virtual version for klass.hpp // Pure virtual version for klass.hpp
#define PARALLEL_GC_DECLS_PV \ #define PARALLEL_GC_DECLS_PV \
virtual void oop_push_contents(PSPromotionManager* pm, oop obj) = 0; \ virtual void oop_push_contents(PSPromotionManager* pm, oop obj) = 0; \
virtual void oop_follow_contents(ParCompactionManager* cm, 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) = 0;
virtual int oop_update_pointers(ParCompactionManager* cm, oop obj, \
HeapWord* beg_addr, HeapWord* end_addr) = 0;
#else // SERIALGC #else // SERIALGC
#define PARALLEL_GC_DECLS #define PARALLEL_GC_DECLS
#define PARALLEL_GC_DECLS_PV #define PARALLEL_GC_DECLS_PV

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -677,25 +677,6 @@ void klassVtable::oop_update_pointers(ParCompactionManager* cm) {
PSParallelCompact::adjust_pointer(adr_method_at(i)); 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 #endif // SERIALGC
// Iterators // Iterators
@ -820,25 +801,6 @@ void klassItable::oop_update_pointers(ParCompactionManager* cm) {
ime++; 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 #endif // SERIALGC
// Iterators // Iterators

Some files were not shown because too many files have changed in this diff Show More