This commit is contained in:
Andy Herrick 2010-08-20 14:48:10 -04:00
commit 6ee7ad5fe7
969 changed files with 35976 additions and 3445 deletions

View File

@ -77,3 +77,7 @@ c4c8a5bc54f66abc68cd185d9294042121922154 jdk7-b99
2d6ba7a221915bdf0311acc5641c7f3875cb793e jdk7-b100
2548ac036b8fca3326d058d758e6df8355a42469 jdk7-b101
88db80c8e49cea352c2900f689600dc410761c1f jdk7-b102
64770970865839b0443066370e7d476ef47e90cd jdk7-b103
10bc903a228d3a8efdf46fb8c3fcf82a59b88bc5 jdk7-b104
1ce7938efb03224ccc8b3cdd7803eb39e889539c jdk7-b105
6bdae472f77205046703b685eff2ac4f7a0ecf4e jdk7-b106

View File

@ -77,3 +77,7 @@ e7f18db469a3e947b7096bfd12e87380e5a042cd jdk7-b99
b218a53ec7d3d42be61d31d6917a6c5c037b6f56 jdk7-b100
4193eaf5f1b82794c6a0fb1a8d11af43d1b1d611 jdk7-b101
a136a51f5113da4dad3853b74a8536ab583ab112 jdk7-b102
be2aedc4e3b1751c1310f334242ba69e90867f38 jdk7-b103
f8be576feefce0c6695f188ef97ec16b73ad9cfd jdk7-b104
9f96a4269d7727dad68864eaab795eafce270311 jdk7-b105
43096cccf1cee749c2f4e7714ee71f4e9e0f4d7f jdk7-b106

View File

@ -77,3 +77,7 @@ edc2a2659c77dabc55cb55bb617bad89e3a05bb3 jdk7-b96
a56d734a1e970e1a21a8f4feb13053e9a33674c7 jdk7-b100
86a239832646a74811695428984b6947c0bd6dc8 jdk7-b101
78561a95779090b5106c8d0f1a75360a027ef087 jdk7-b102
11e7678c3eb169b77d9a9892fe5e3dfa1d1a0d51 jdk7-b103
9607213481d400ac477183191cc080e1bef6f475 jdk7-b104
6f21b030092fb61244cc8a0aedf8058f7c022b81 jdk7-b105
519daea48888196af76a975a3b31258efa860bad jdk7-b106

View File

@ -107,3 +107,10 @@ ad1977f08c4d69162a0775fe3f9576b9fd521d10 jdk7-b100
6c3a919105b68c15b7db923ec9a00006e9560910 jdk7-b101
ad1977f08c4d69162a0775fe3f9576b9fd521d10 hs19-b03
c5cadf1a07717955cf60dbaec16e35b529fd2cb0 jdk7-b102
cb4250ef73b21de6c487ea14e2b0b99eed67b4b6 jdk7-b103
e55900b5c1b865cac17e18abc639c7dc50de7fd8 hs19-b04
b4acf10eb134fe930802c97e36db65e7ccb544b5 jdk7-b104
6709c14587c2cc6faca208767335afeb01e33de5 jdk7-b105
1b81ca701fa5fc30adc4cfdaa4bdd153df5e6c86 jdk7-b106
cc3fdfeb54b049f18edcf3463e6ab051d0b7b609 hs19-b05
688a538aa65412178286ae2a6b0c00b6711e121b hs19-b06

View File

@ -253,7 +253,11 @@ static bool read_lib_info(struct ps_prochandle* ph) {
if (nwords > 5 && find_lib(ph, word[5]) == false) {
intptr_t base;
lib_info* lib;
#ifdef _LP64
sscanf(word[0], "%lx", &base);
#else
sscanf(word[0], "%x", &base);
#endif
if ((lib = add_lib_info(ph, word[5], (uintptr_t)base)) == NULL)
continue; // ignore, add_lib_info prints error

View File

@ -297,6 +297,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType";
case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle";
case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType";
case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic";
case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid";
case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass";
case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError";
@ -355,6 +356,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_NameAndType:
case JVM_CONSTANT_MethodHandle:
case JVM_CONSTANT_MethodType:
case JVM_CONSTANT_InvokeDynamic:
visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
break;
}
@ -517,6 +519,18 @@ public class ConstantPool extends Oop implements ClassConstants {
+ ", type = " + signatureIndex);
break;
}
case JVM_CONSTANT_InvokeDynamic: {
dos.writeByte(cpConstType);
int value = getIntAt(ci);
short bootstrapMethodIndex = (short) extractLowShortFromInt(value);
short nameAndTypeIndex = (short) extractHighShortFromInt(value);
dos.writeShort(bootstrapMethodIndex);
dos.writeShort(nameAndTypeIndex);
if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex
+ ", N&T = " + nameAndTypeIndex);
break;
}
default:
throw new InternalError("unknown tag: " + cpConstType);
} // switch

View File

@ -42,6 +42,7 @@ public interface ClassConstants
public static final int JVM_CONSTANT_NameAndType = 12;
public static final int JVM_CONSTANT_MethodHandle = 15;
public static final int JVM_CONSTANT_MethodType = 16;
public static final int JVM_CONSTANT_InvokeDynamic = 17;
// JVM_CONSTANT_MethodHandle subtypes
public static final int JVM_REF_getField = 1;

View File

@ -303,12 +303,12 @@ public class ClassWriter implements /* imports */ ClassConstants
case JVM_CONSTANT_MethodHandle: {
dos.writeByte(cpConstType);
int value = cpool.getIntAt(ci);
short refIndex = (short) extractHighShortFromInt(value);
byte refKind = (byte) extractLowShortFromInt(value);
dos.writeByte(refKind);
dos.writeShort(refIndex);
if (DEBUG) debugMessage("CP[" + ci + "] = MH index = " + refIndex
+ ", kind = " + refKind);
short bootstrapMethodIndex = (short) extractLowShortFromInt(value);
short nameAndTypeIndex = (short) extractHighShortFromInt(value);
dos.writeShort(bootstrapMethodIndex);
dos.writeShort(nameAndTypeIndex);
if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " +
bootstrapMethodIndex + ", N&T = " + nameAndTypeIndex);
break;
}
@ -321,6 +321,15 @@ public class ClassWriter implements /* imports */ ClassConstants
break;
}
case JVM_CONSTANT_InvokeDynamic: {
dos.writeByte(cpConstType);
int value = cpool.getIntAt(ci);
short refIndex = (short) value;
dos.writeShort(refIndex);
if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex);
break;
}
default:
throw new InternalError("Unknown tag: " + cpConstType);
} // switch

View File

@ -582,6 +582,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.cell(Integer.toString(cpool.getIntAt(index)));
break;
case JVM_CONSTANT_InvokeDynamic:
buf.cell("JVM_CONSTANT_InvokeDynamic");
buf.cell(genLowHighShort(cpool.getIntAt(index)));
break;
default:
throw new InternalError("unknown tag: " + ctag);
}

View File

@ -40,6 +40,7 @@ public class ConstantTag {
private static int JVM_CONSTANT_NameAndType = 12;
private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292
private static int JVM_CONSTANT_MethodType = 16; // JSR 292
private static int JVM_CONSTANT_InvokeDynamic = 17; // JSR 292
private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization
private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use
private static int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool
@ -78,6 +79,7 @@ public class ConstantTag {
public boolean isUtf8() { return tag == JVM_CONSTANT_Utf8; }
public boolean isMethodHandle() { return tag == JVM_CONSTANT_MethodHandle; }
public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; }
public boolean isInvokeDynamic() { return tag == JVM_CONSTANT_InvokeDynamic; }
public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; }

View File

@ -85,14 +85,21 @@ C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
C2_VM_TARGETS=product fastdebug optimized jvmg
KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
# JDK directory list
JDK_DIRS=bin include jre lib demo
all: all_product all_fastdebug
ifndef BUILD_CLIENT_ONLY
all_product: product product1 productkernel docs export_product
all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
all_debug: jvmg jvmg1 jvmgkernel docs export_debug
else
all_product: product1 docs export_product
all_fastdebug: fastdebug1 docs export_fastdebug
all_debug: jvmg1 docs export_debug
endif
all_optimized: optimized optimized1 optimizedkernel docs export_optimized
allzero: all_productzero all_fastdebugzero
@ -101,6 +108,12 @@ all_fastdebugzero: fastdebugzero docs export_fastdebug
all_debugzero: jvmgzero docs export_debug
all_optimizedzero: optimizedzero docs export_optimized
allshark: all_productshark all_fastdebugshark
all_productshark: productshark docs export_product
all_fastdebugshark: fastdebugshark docs export_fastdebug
all_debugshark: jvmgshark docs export_debug
all_optimizedshark: optimizedshark docs export_optimized
# Do everything
world: all create_jdk
@ -131,6 +144,10 @@ $(ZERO_VM_TARGETS):
$(CD) $(GAMMADIR)/make; \
$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
$(SHARK_VM_TARGETS):
$(CD) $(GAMMADIR)/make; \
$(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
# Build compiler1 (client) rule, different for platforms
generic_build1:
$(MKDIR) -p $(OUTPUTDIR)
@ -197,6 +214,12 @@ generic_buildzero:
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
generic_buildshark:
$(MKDIR) -p $(OUTPUTDIR)
$(CD) $(OUTPUTDIR); \
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
# Export file rule
generic_export: $(EXPORT_LIST)
export_product:
@ -228,15 +251,22 @@ C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
# Misc files and generated files need to come from C1 or C2 area
ifeq ($(ZERO_BUILD), true)
ifeq ($(SHARK_BUILD), true)
MISC_DIR=$(SHARK_DIR)
GEN_DIR=$(SHARK_BASE_DIR)/generated
else
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
else
ifeq ($(ARCH_DATA_MODEL), 32)
MISC_DIR=$(C1_DIR)
@ -290,11 +320,20 @@ endif
# Shared Library
ifneq ($(OSNAME),windows)
ifeq ($(ZERO_BUILD), true)
ifeq ($(SHARK_BUILD), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
$(install-file)
$(EXPORT_SERVER_DIR)/%.so: $(SHARK_DIR)/%.so
$(install-file)
else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
$(install-file)
$(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
$(install-file)
endif
else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
$(install-file)
$(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
@ -348,6 +387,7 @@ clean_build:
$(RM) -r $(C2_DIR)
$(RM) -r $(KERNEL_DIR)
$(RM) -r $(ZERO_DIR)
$(RM) -r $(SHARK_DIR)
clean_export:
$(RM) -r $(EXPORT_PATH)
clean_jdk:

View File

@ -192,13 +192,16 @@ ifneq ($(OSNAME),windows)
# Use uname output for SRCARCH, but deal with platform differences. If ARCH
# is not explicitly listed below, it is treated as x86.
SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 zero,$(ARCH)))
SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
ARCH/ = x86
ARCH/sparc = sparc
ARCH/sparc64= sparc
ARCH/ia64 = ia64
ARCH/amd64 = x86
ARCH/x86_64 = x86
ARCH/ppc64 = ppc
ARCH/ppc = ppc
ARCH/arm = arm
ARCH/zero = zero
# BUILDARCH is usually the same as SRCARCH, except for sparcv9
@ -223,6 +226,9 @@ ifneq ($(OSNAME),windows)
LIBARCH/sparc = sparc
LIBARCH/sparcv9 = sparcv9
LIBARCH/ia64 = ia64
LIBARCH/ppc64 = ppc
LIBARCH/ppc = ppc
LIBARCH/arm = arm
LIBARCH/zero = $(ZERO_LIBARCH)
LP64_ARCH = sparcv9 amd64 ia64 zero

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2010
HS_MAJOR_VER=19
HS_MINOR_VER=0
HS_BUILD_NUMBER=04
HS_BUILD_NUMBER=06
JDK_MAJOR_VER=1
JDK_MINOR_VER=7

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# 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
@ -168,6 +168,13 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# profiledzero zero <os>_<arch>_zero/profiled
# productzero zero <os>_<arch>_zero/product
#
# debugshark shark <os>_<arch>_shark/debug
# fastdebugshark shark <os>_<arch>_shark/fastdebug
# jvmgshark shark <os>_<arch>_shark/jvmg
# optimizedshark shark <os>_<arch>_shark/optimized
# profiledshark shark <os>_<arch>_shark/profiled
# productshark shark <os>_<arch>_shark/product
#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@ -191,12 +198,14 @@ SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS))
TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@ -213,6 +222,7 @@ all:
@echo " $(TARGETS_C1)"
@echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
@echo " $(TARGETS_SHARK)"
checks: check_os_version check_j2se_version
@ -266,6 +276,10 @@ $(SUBDIRS_ZERO): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
$(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
@ -306,11 +320,19 @@ ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
@ -327,20 +349,22 @@ core: jvmgcore productcore
zero: jvmgzero productzero
shark: jvmgshark productshark
clean_docs:
rm -rf $(SUBDIR_DOCS)
clean_compiler1 clean_compiler2 clean_core clean_zero:
clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_docs
clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
#-------------------------------------------------------------------------------
.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO)
.PHONY: tree tree1 treecore treezero
.PHONY: all compiler1 compiler2 core zero
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero docs clean_docs
.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version

View File

@ -1,5 +1,12 @@
#!/bin/sh
nm --defined-only $* | awk '
# If we're cross compiling use that path for nm
if [ "$ALT_COMPILER_PATH" != "" ]; then
NM=$ALT_COMPILER_PATH/nm
else
NM=nm
fi
$NM --defined-only $* | awk '
{ if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" }
'

View File

@ -339,12 +339,16 @@ JAVA_FLAG/64 = -d64
WRONG_DATA_MODE_MSG = \
echo "JAVA_HOME must point to $(DATA_MODE)bit JDK."
CROSS_COMPILING_MSG = \
echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@echo Creating $@ ...
$(QUIETLY) ( \
echo '#!/bin/sh'; \
$(BUILDTREE_COMMENT); \
echo '. ./env.sh'; \
echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \
echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \
echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \
echo "then"; \

View File

@ -98,6 +98,22 @@ ifeq ($(ARCH), i686)
HS_ARCH = x86
endif
# ARM
ifeq ($(ARCH), arm)
ARCH_DATA_MODEL = 32
PLATFORM = linux-arm
VM_PLATFORM = linux_arm
HS_ARCH = arm
endif
# PPC
ifeq ($(ARCH), ppc)
ARCH_DATA_MODEL = 32
PLATFORM = linux-ppc
VM_PLATFORM = linux_ppc
HS_ARCH = ppc
endif
JDK_INCLUDE_SUBDIR=linux
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
@ -107,22 +123,32 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
ifndef BUILD_CLIENT_ONLY
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
endif
ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
else
ifeq ($(ARCH),ia64)
else
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
endif
endif
endif
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ia64 =
ADD_SA_BINARIES/arm =
ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
# 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
@ -25,8 +25,14 @@
#------------------------------------------------------------------------
# CC, CPP & AS
ifdef ALT_COMPILER_PATH
CPP = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
else
CPP = g++
CC = gcc
endif
AS = $(CC) -c
# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
@ -55,6 +61,9 @@ VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
ifeq ($(ZERO_BUILD), true)
CFLAGS += $(LIBFFI_CFLAGS)
endif
ifeq ($(SHARK_BUILD), true)
CFLAGS += $(LLVM_CFLAGS)
endif
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions
@ -67,18 +76,31 @@ ARCHFLAG/amd64 = -m64
ARCHFLAG/ia64 =
ARCHFLAG/sparc = -m32 -mcpu=v9
ARCHFLAG/sparcv9 = -m64 -mcpu=v9
ARCHFLAG/arm = -fsigned-char
ARCHFLAG/zero = $(ZERO_ARCHFLAG)
ifndef E500V2
ARCHFLAG/ppc = -mcpu=powerpc
endif
CFLAGS += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LFLAGS += $(ARCHFLAG)
ASFLAGS += $(ARCHFLAG)
ifdef E500V2
CFLAGS += -DE500V2
endif
# Use C++ Interpreter
ifdef CC_INTERP
CFLAGS += -DCC_INTERP
endif
# Build for embedded targets
ifdef JAVASE_EMBEDDED
CFLAGS += -DJAVASE_EMBEDDED
endif
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@ -171,6 +193,8 @@ AOUT_FLAGS += -export-dynamic
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
DEBUG_CFLAGS/arm = -g
DEBUG_CFLAGS/ppc = -g
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
@ -181,3 +205,15 @@ ifeq ($(DEBUG_BINARIES), true)
DEBUG_CFLAGS = -g
CFLAGS += $(DEBUG_CFLAGS)
endif
# If we are building HEADLESS, pass on to VM
# so it can set the java.awt.headless property
ifdef HEADLESS
CFLAGS += -DHEADLESS
endif
# We are building Embedded for a small device
# favor code space over speed
ifdef MINIMIZE_RAM_USAGE
CFLAGS += -DMINIMIZE_RAM_USAGE
endif

View File

@ -46,7 +46,11 @@ VERSION = optimized
# use -g to strip library as -x will discard its symbol table; -x is fine for
# executables.
STRIP = strip
ifdef CROSS_COMPILE_ARCH
STRIP = $(ALT_COMPILER_PATH)/strip
else
STRIP = strip
endif
STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
STRIP_AOUT = $(STRIP) -x $@ || exit 1;

View File

@ -55,10 +55,13 @@ SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VE
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
# also, we don't build SA on Itanium, PowerPC, ARM or zero.
all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "arm" \
-a "$(SRCARCH)" != "ppc" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi

View File

@ -53,10 +53,10 @@ ifeq ($(DEBUG_BINARIES), true)
endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
# also, we don't build SA on Itanium, PPC, ARM or zero.
checkAndBuildSA:
$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f vm.make $(LIBSAPROC); \
fi

View File

@ -0,0 +1,32 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# Copyright 2008, 2010 Red Hat, Inc.
# 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.
#
#
# Sets make macros for making Shark version of VM
TYPE = SHARK
VM_SUBDIR = server
CFLAGS += -DSHARK

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# 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
@ -75,6 +75,7 @@ Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
Include_DBs/ZERO = $(Include_DBs/CORE) $(VM)/includeDB_zero
Include_DBs/SHARK = $(Include_DBs/ZERO) $(VM)/includeDB_shark
Include_DBs = $(Include_DBs/$(TYPE))
Cached_plat = $(GENERATED)/platform.current

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# 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
@ -98,6 +98,7 @@ CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
CFLAGS += $(EXTRA_CFLAGS)
LFLAGS += $(EXTRA_CFLAGS)
LIBS += -lm -ldl -lpthread
@ -136,10 +137,14 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files)
sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
ifeq ($(ZERO_LIBARCH), ppc64)
ifeq ($(SHARK_BUILD), true)
STATIC_CXX = false
else
STATIC_CXX = true
ifeq ($(ZERO_LIBARCH), ppc64)
STATIC_CXX = false
else
STATIC_CXX = true
endif
endif
ifeq ($(LINK_INTO),AOUT)
@ -167,6 +172,10 @@ endif
ifeq ($(ZERO_BUILD), true)
LIBS_VM += $(LIBFFI_LIBS)
endif
ifeq ($(SHARK_BUILD), true)
LFLAGS_VM += $(LLVM_LDFLAGS)
LIBS_VM += $(LLVM_LIBS)
endif
LINK_VM = $(LINK_LIB.c)
@ -210,15 +219,17 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
$(LINK_LIB.CC/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
[ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
if [ -x /usr/sbin/selinuxenabled ] ; then \
/usr/sbin/selinuxenabled; \
if [ $$? = 0 ] ; then \
/usr/bin/chcon -t textrel_shlib_t $@; \
if [ $$? != 0 ]; then \
echo "ERROR: Cannot chcon $@"; \
fi \
fi \
fi \
if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \
if [ -x /usr/sbin/selinuxenabled ] ; then \
/usr/sbin/selinuxenabled; \
if [ $$? = 0 ] ; then \
/usr/bin/chcon -t textrel_shlib_t $@; \
if [ $$? != 0 ]; then \
echo "ERROR: Cannot chcon $@"; \
fi \
fi \
fi \
fi \
}
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)

View File

@ -70,20 +70,24 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
ifneq ($(BUILD_CLIENT_ONLY),true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so
endif
ifeq ($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.so
ifneq ($(BUILD_CLIENT_ONLY), true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
endif
endif
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so

View File

@ -145,11 +145,20 @@ OPT_CFLAGS/SLOWER=-xO3
OPT_CFLAGS/O2=-xO2
OPT_CFLAGS/NOOPT=-xO1
#################################################
# Begin current (>=5.9) Forte compiler options #
#################################################
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
ifeq ($(Platform_arch), x86)
OPT_CFLAGS/NO_TAIL_CALL_OPT = -Wu,-O~yz
OPT_CCFLAGS/NO_TAIL_CALL_OPT = -Qoption ube -O~yz
OPT_CFLAGS/stubGenerator_x86_32.o = $(OPT_CFLAGS) -xspace
OPT_CFLAGS/stubGenerator_x86_64.o = $(OPT_CFLAGS) -xspace
endif # Platform_arch == x86
ifeq ("${Platform_arch}", "sparc")
OPT_CFLAGS/stubGenerator_sparc.o = $(OPT_CFLAGS) -xspace
endif
endif # COMPILER_REV_NUMERIC >= 509
#################################################

View File

@ -626,7 +626,7 @@ void MacroAssembler::jmp(Register r1, int offset, const char* file, int line ) {
}
// This code sequence is relocatable to any address, even on LP64.
void MacroAssembler::jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) {
void MacroAssembler::jumpl(const AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) {
assert_not_delayed();
// Force fixed length sethi because NativeJump and NativeFarCall don't handle
// variable length instruction streams.
@ -672,7 +672,7 @@ void MacroAssembler::jumpl(AddressLiteral& addrlit, Register temp, Register d, i
}
}
void MacroAssembler::jump(AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
void MacroAssembler::jump(const AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
jumpl(addrlit, temp, G0, offset, file, line);
}

View File

@ -1974,12 +1974,12 @@ public:
// address pseudos: make these names unlike instruction names to avoid confusion
inline intptr_t load_pc_address( Register reg, int bytes_to_skip );
inline void load_contents(AddressLiteral& addrlit, Register d, int offset = 0);
inline void load_ptr_contents(AddressLiteral& addrlit, Register d, int offset = 0);
inline void store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
inline void store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
inline void jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
inline void jump_to(AddressLiteral& addrlit, Register temp, int offset = 0);
inline void load_contents(const AddressLiteral& addrlit, Register d, int offset = 0);
inline void load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset = 0);
inline void store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset = 0);
inline void store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset = 0);
inline void jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
inline void jump_to(const AddressLiteral& addrlit, Register temp, int offset = 0);
inline void jump_indirect_to(Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0);
// ring buffer traceable jumps
@ -1987,8 +1987,8 @@ public:
void jmp2( Register r1, Register r2, const char* file, int line );
void jmp ( Register r1, int offset, const char* file, int line );
void jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
void jump (AddressLiteral& addrlit, Register temp, int offset, const char* file, int line);
void jumpl(const AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
void jump (const AddressLiteral& addrlit, Register temp, int offset, const char* file, int line);
// argument pseudos:

View File

@ -650,28 +650,28 @@ inline intptr_t MacroAssembler::load_pc_address( Register reg, int bytes_to_skip
}
inline void MacroAssembler::load_contents(AddressLiteral& addrlit, Register d, int offset) {
inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) {
assert_not_delayed();
sethi(addrlit, d);
ld(d, addrlit.low10() + offset, d);
}
inline void MacroAssembler::load_ptr_contents(AddressLiteral& addrlit, Register d, int offset) {
inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) {
assert_not_delayed();
sethi(addrlit, d);
ld_ptr(d, addrlit.low10() + offset, d);
}
inline void MacroAssembler::store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) {
assert_not_delayed();
sethi(addrlit, temp);
st(s, temp, addrlit.low10() + offset);
}
inline void MacroAssembler::store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) {
assert_not_delayed();
sethi(addrlit, temp);
st_ptr(s, temp, addrlit.low10() + offset);
@ -679,7 +679,7 @@ inline void MacroAssembler::store_ptr_contents(Register s, AddressLiteral& addrl
// This code sequence is relocatable to any address, even on LP64.
inline void MacroAssembler::jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset) {
inline void MacroAssembler::jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset) {
assert_not_delayed();
// Force fixed length sethi because NativeJump and NativeFarCall don't handle
// variable length instruction streams.
@ -688,7 +688,7 @@ inline void MacroAssembler::jumpl_to(AddressLiteral& addrlit, Register temp, Reg
}
inline void MacroAssembler::jump_to(AddressLiteral& addrlit, Register temp, int offset) {
inline void MacroAssembler::jump_to(const AddressLiteral& addrlit, Register temp, int offset) {
jumpl_to(addrlit, temp, G0, offset);
}

View File

@ -236,19 +236,19 @@ inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
}
inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
return op1 << op2;
return op1 << (op2 & 0x1f);
}
inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
return op1 >> op2; // QQ op2 & 0x1f??
return op1 >> (op2 & 0x1f);
}
inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
return op1 - op2;
}
inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
return ((juint) op1) >> op2; // QQ op2 & 0x1f??
inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
return ((juint) op1) >> (op2 & 0x1f);
}
inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {

View File

@ -409,7 +409,7 @@ void LIRGenerator::do_MonitorExit(MonitorExit* x) {
LIR_Opr lock = FrameMap::G1_opr;
LIR_Opr hdr = FrameMap::G3_opr;
LIR_Opr obj_temp = FrameMap::G4_opr;
monitor_exit(obj_temp, lock, hdr, x->monitor_no());
monitor_exit(obj_temp, lock, hdr, LIR_OprFact::illegalOpr, x->monitor_no());
}

View File

@ -1031,3 +1031,7 @@ void Runtime1::generate_handle_exception(StubAssembler* sasm, OopMapSet* oop_map
#undef __
#define __ masm->
const char *Runtime1::pd_name_for_address(address entry) {
return "<unknown function>";
}

View File

@ -56,14 +56,18 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
}
#ifdef _LP64
void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
Argument jni_arg(jni_offset(), false);
#ifdef _LP64
FloatRegister Rtmp = F0;
__ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
__ store_float_argument(Rtmp, jni_arg);
}
#else
Register Rtmp = O0;
__ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
__ store_argument(Rtmp, jni_arg);
#endif
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
@ -185,6 +189,13 @@ class SlowSignatureHandler: public NativeSignatureIterator {
_from -= 2*Interpreter::stackElementSize;
add_signature( non_float );
}
virtual void pass_float() {
*_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
_from -= Interpreter::stackElementSize;
add_signature( non_float );
}
#endif // _LP64
virtual void add_signature( intptr_t sig_type ) {

View File

@ -76,6 +76,8 @@ public:
void set_last_Java_sp(intptr_t* sp) { _last_Java_sp = sp; }
address last_Java_pc(void) { return _last_Java_pc; }
// These are only used by friends
private:

View File

@ -1007,9 +1007,9 @@ class StubGenerator: public StubCodeGenerator {
__ brx(Assembler::lessEqualUnsigned, false, Assembler::pt, (*NOLp));
__ delayed()->cmp(to_from, byte_count);
if (NOLp == NULL)
__ brx(Assembler::greaterEqual, false, Assembler::pt, no_overlap_target);
__ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target);
else
__ brx(Assembler::greaterEqual, false, Assembler::pt, (*NOLp));
__ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp));
__ delayed()->nop();
}

View File

@ -3236,12 +3236,14 @@ void TemplateTable::_new() {
__ get_2_byte_integer_at_bcp(1, Rscratch, Roffset, InterpreterMacroAssembler::Unsigned);
__ get_cpool_and_tags(Rscratch, G3_scratch);
// make sure the class we're about to instantiate has been resolved
// This is done before loading instanceKlass to be consistent with the order
// how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
__ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch);
__ ldub(G3_scratch, Roffset, G3_scratch);
__ cmp(G3_scratch, JVM_CONSTANT_Class);
__ br(Assembler::notEqual, false, Assembler::pn, slow_case);
__ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
// get instanceKlass
//__ sll(Roffset, LogBytesPerWord, Roffset); // executed in delay slot
__ add(Roffset, sizeof(constantPoolOopDesc), Roffset);
__ ld_ptr(Rscratch, Roffset, RinstanceKlass);

View File

@ -7151,7 +7151,7 @@ void MacroAssembler::tlab_refill(Label& retry,
subptr(t1, typeArrayOopDesc::header_size(T_INT));
addptr(t1, (int32_t)ThreadLocalAllocBuffer::alignment_reserve());
shlptr(t1, log2_intptr(HeapWordSize/sizeof(jint)));
movptr(Address(top, arrayOopDesc::length_offset_in_bytes()), t1);
movl(Address(top, arrayOopDesc::length_offset_in_bytes()), t1);
// set klass to intArrayKlass
// dubious reloc why not an oop reloc?
movptr(t1, ExternalAddress((address) Universe::intArrayKlassObj_addr()));
@ -7568,21 +7568,27 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
// Scan RCX words at [RDI] for an occurrence of RAX.
// Set NZ/Z based on last compare.
// Z flag value will not be set by 'repne' if RCX == 0 since 'repne' does
// not change flags (only scas instruction which is repeated sets flags).
// Set Z = 0 (not equal) before 'repne' to indicate that class was not found.
#ifdef _LP64
// This part is tricky, as values in supers array could be 32 or 64 bit wide
// and we store values in objArrays always encoded, thus we need to encode
// the value of rax before repne. Note that rax is dead after the repne.
if (UseCompressedOops) {
encode_heap_oop_not_null(rax);
encode_heap_oop_not_null(rax); // Changes flags.
// The superclass is never null; it would be a basic system error if a null
// pointer were to sneak in here. Note that we have already loaded the
// Klass::super_check_offset from the super_klass in the fast path,
// so if there is a null in that register, we are already in the afterlife.
testl(rax,rax); // Set Z = 0
repne_scanl();
} else
#endif // _LP64
{
testptr(rax,rax); // Set Z = 0
repne_scan();
}
// Unspill the temp. registers:
if (pushed_rdi) pop(rdi);
if (pushed_rcx) pop(rcx);
@ -8257,30 +8263,35 @@ void MacroAssembler::store_heap_oop_null(Address dst) {
}
}
// Algorithm must match oop.inline.hpp encode_heap_oop.
void MacroAssembler::encode_heap_oop(Register r) {
#ifdef ASSERT
void MacroAssembler::verify_heapbase(const char* msg) {
assert (UseCompressedOops, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
if (CheckCompressedOops) {
Label ok;
push(rscratch1); // cmpptr trashes rscratch1
cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
jcc(Assembler::equal, ok);
stop(msg);
bind(ok);
pop(rscratch1);
}
}
#endif
// Algorithm must match oop.inline.hpp encode_heap_oop.
void MacroAssembler::encode_heap_oop(Register r) {
#ifdef ASSERT
verify_heapbase("MacroAssembler::encode_heap_oop: heap base corrupted?");
#endif
verify_oop(r, "broken oop in encode_heap_oop");
if (Universe::narrow_oop_base() == NULL) {
verify_oop(r, "broken oop in encode_heap_oop");
if (Universe::narrow_oop_shift() != 0) {
assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
shrq(r, LogMinObjAlignmentInBytes);
}
return;
}
#ifdef ASSERT
if (CheckCompressedOops) {
Label ok;
push(rscratch1); // cmpptr trashes rscratch1
cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
jcc(Assembler::equal, ok);
stop("MacroAssembler::encode_heap_oop: heap base corrupted?");
bind(ok);
pop(rscratch1);
}
#endif
verify_oop(r, "broken oop in encode_heap_oop");
testq(r, r);
cmovq(Assembler::equal, r, r12_heapbase);
subq(r, r12_heapbase);
@ -8288,9 +8299,8 @@ void MacroAssembler::encode_heap_oop(Register r) {
}
void MacroAssembler::encode_heap_oop_not_null(Register r) {
assert (UseCompressedOops, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
#ifdef ASSERT
verify_heapbase("MacroAssembler::encode_heap_oop_not_null: heap base corrupted?");
if (CheckCompressedOops) {
Label ok;
testq(r, r);
@ -8310,9 +8320,8 @@ void MacroAssembler::encode_heap_oop_not_null(Register r) {
}
void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) {
assert (UseCompressedOops, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
#ifdef ASSERT
verify_heapbase("MacroAssembler::encode_heap_oop_not_null2: heap base corrupted?");
if (CheckCompressedOops) {
Label ok;
testq(src, src);
@ -8335,40 +8344,21 @@ void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) {
}
void MacroAssembler::decode_heap_oop(Register r) {
assert (UseCompressedOops, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
#ifdef ASSERT
verify_heapbase("MacroAssembler::decode_heap_oop: heap base corrupted?");
#endif
if (Universe::narrow_oop_base() == NULL) {
if (Universe::narrow_oop_shift() != 0) {
assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
shlq(r, LogMinObjAlignmentInBytes);
}
verify_oop(r, "broken oop in decode_heap_oop");
return;
} else {
Label done;
shlq(r, LogMinObjAlignmentInBytes);
jccb(Assembler::equal, done);
addq(r, r12_heapbase);
bind(done);
}
#ifdef ASSERT
if (CheckCompressedOops) {
Label ok;
push(rscratch1);
cmpptr(r12_heapbase,
ExternalAddress((address)Universe::narrow_oop_base_addr()));
jcc(Assembler::equal, ok);
stop("MacroAssembler::decode_heap_oop: heap base corrupted?");
bind(ok);
pop(rscratch1);
}
#endif
Label done;
shlq(r, LogMinObjAlignmentInBytes);
jccb(Assembler::equal, done);
addq(r, r12_heapbase);
#if 0
// alternate decoding probably a wash.
testq(r, r);
jccb(Assembler::equal, done);
leaq(r, Address(r12_heapbase, r, Address::times_8, 0));
#endif
bind(done);
verify_oop(r, "broken oop in decode_heap_oop");
}
@ -8410,9 +8400,11 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
addq(dst, r12_heapbase);
}
}
} else if (dst != src) {
} else {
assert (Universe::narrow_oop_base() == NULL, "sanity");
movq(dst, src);
if (dst != src) {
movq(dst, src);
}
}
}

View File

@ -1714,6 +1714,9 @@ class MacroAssembler: public Assembler {
// if heap base register is used - reinit it with the correct value
void reinit_heapbase();
DEBUG_ONLY(void verify_heapbase(const char* msg);)
#endif // _LP64
// Int division/remainder for Java

View File

@ -236,11 +236,11 @@ inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
}
inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
return op1 << op2;
return op1 << op2;
}
inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
return op1 >> op2; // QQ op2 & 0x1f??
return op1 >> (op2 & 0x1f);
}
inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
@ -248,7 +248,7 @@ inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
}
inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
return ((juint) op1) >> op2; // QQ op2 & 0x1f??
return ((juint) op1) >> (op2 & 0x1f);
}
inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {

View File

@ -349,7 +349,7 @@ void LIRGenerator::do_MonitorExit(MonitorExit* x) {
LIR_Opr lock = new_register(T_INT);
LIR_Opr obj_temp = new_register(T_INT);
set_no_result(x);
monitor_exit(obj_temp, lock, syncTempOpr(), x->monitor_no());
monitor_exit(obj_temp, lock, syncTempOpr(), LIR_OprFact::illegalOpr, x->monitor_no());
}

View File

@ -1779,3 +1779,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
}
#undef __
const char *Runtime1::pd_name_for_address(address entry) {
return "<unknown function>";
}

View File

@ -575,8 +575,8 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {
#ifdef CC_INTERP
// Needed for JVMTI. The result should always be in the interpreterState object
assert(false, "NYI");
// Needed for JVMTI. The result should always be in the
// interpreterState object
interpreterState istate = get_interpreterState();
#endif // CC_INTERP
assert(is_interpreted_frame(), "interpreted frame expected");

View File

@ -34,6 +34,10 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
move(offset(), jni_offset() + 1);
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
move(offset(), jni_offset() + 1);
}
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
move(offset(), jni_offset() + 2);
move(offset() + 1, jni_offset() + 1);
@ -91,6 +95,11 @@ class SlowSignatureHandler: public NativeSignatureIterator {
_from -= Interpreter::stackElementSize;
}
virtual void pass_float() {
*_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
_from -= Interpreter::stackElementSize;
}
virtual void pass_long() {
_to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
_to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0));

View File

@ -66,6 +66,8 @@ public:
intptr_t* last_Java_sp(void) const { return _last_Java_sp; }
address last_Java_pc(void) { return _last_Java_pc; }
private:
static ByteSize last_Java_fp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_fp); }

View File

@ -3112,22 +3112,25 @@ void TemplateTable::_new() {
transition(vtos, atos);
__ get_unsigned_2_byte_index_at_bcp(rdx, 1);
Label slow_case;
Label slow_case_no_pop;
Label done;
Label initialize_header;
Label initialize_object; // including clearing the fields
Label allocate_shared;
__ get_cpool_and_tags(rcx, rax);
// Make sure the class we're about to instantiate has been resolved.
// This is done before loading instanceKlass to be consistent with the order
// how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
__ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
__ jcc(Assembler::notEqual, slow_case_no_pop);
// get instanceKlass
__ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(constantPoolOopDesc)));
__ push(rcx); // save the contexts of klass for initializing the header
// make sure the class we're about to instantiate has been resolved.
// Note: slow_case does a pop of stack, which is why we loaded class/pushed above
const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
__ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
__ jcc(Assembler::notEqual, slow_case);
// make sure klass is initialized & doesn't have finalizer
// make sure klass is fully initialized
__ cmpl(Address(rcx, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), instanceKlass::fully_initialized);
@ -3255,6 +3258,7 @@ void TemplateTable::_new() {
// slow case
__ bind(slow_case);
__ pop(rcx); // restore stack pointer to what it was when we came in.
__ bind(slow_case_no_pop);
__ get_constant_pool(rax);
__ get_unsigned_2_byte_index_at_bcp(rdx, 1);
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), rax, rdx);

View File

@ -3126,18 +3126,18 @@ void TemplateTable::_new() {
Label allocate_shared;
__ get_cpool_and_tags(rsi, rax);
// get instanceKlass
__ movptr(rsi, Address(rsi, rdx,
Address::times_8, sizeof(constantPoolOopDesc)));
// make sure the class we're about to instantiate has been
// resolved. Note: slow_case does a pop of stack, which is why we
// loaded class/pushed above
// Make sure the class we're about to instantiate has been resolved.
// This is done before loading instanceKlass to be consistent with the order
// how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
__ cmpb(Address(rax, rdx, Address::times_1, tags_offset),
JVM_CONSTANT_Class);
__ jcc(Assembler::notEqual, slow_case);
// get instanceKlass
__ movptr(rsi, Address(rsi, rdx,
Address::times_8, sizeof(constantPoolOopDesc)));
// make sure klass is initialized & doesn't have finalizer
// make sure klass is fully initialized
__ cmpl(Address(rsi,

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* Copyright 2007, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,13 +23,10 @@
*
*/
// The disassembler prints out zero code annotated
// with Java specific information.
static int pd_instruction_alignment() {
ShouldNotCallThis();
return 1;
}
static const char* pd_cpu_opts() {
ShouldNotCallThis();
return "";
}

View File

@ -0,0 +1,62 @@
/*
* Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* 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.
*
*/
// Set the default values for platform dependent flags used by the
// Shark compiler. See globals.hpp for details of what they do.
define_pd_global(bool, BackgroundCompilation, true );
define_pd_global(bool, UseTLAB, true );
define_pd_global(bool, ResizeTLAB, true );
define_pd_global(bool, InlineIntrinsics, false);
define_pd_global(bool, PreferInterpreterNativeStubs, false);
define_pd_global(bool, ProfileTraps, false);
define_pd_global(bool, UseOnStackReplacement, true );
define_pd_global(bool, TieredCompilation, false);
define_pd_global(intx, CompileThreshold, 1500);
define_pd_global(intx, Tier2CompileThreshold, 1500);
define_pd_global(intx, Tier3CompileThreshold, 2500);
define_pd_global(intx, Tier4CompileThreshold, 4500);
define_pd_global(intx, BackEdgeThreshold, 100000);
define_pd_global(intx, Tier2BackEdgeThreshold, 100000);
define_pd_global(intx, Tier3BackEdgeThreshold, 100000);
define_pd_global(intx, Tier4BackEdgeThreshold, 100000);
define_pd_global(intx, OnStackReplacePercentage, 933 );
define_pd_global(intx, FreqInlineSize, 325 );
define_pd_global(intx, InlineSmallCode, 1000 );
define_pd_global(intx, NewRatio, 12 );
define_pd_global(intx, NewSizeThreadIncrease, 4*K );
define_pd_global(intx, InitialCodeCacheSize, 160*K);
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
define_pd_global(bool, ProfileInterpreter, false);
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
define_pd_global(uintx, CodeCacheMinBlockLength, 1 );
define_pd_global(uintx, PermSize, 12*M );
define_pd_global(uintx, MaxPermSize, 64*M );
define_pd_global(bool, NeverActAsServerClassMachine, true );
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
define_pd_global(bool, CICompileOSR, true );

View File

@ -79,6 +79,10 @@
# define ARCH "i386"
# elif defined(__sparc)
# define ARCH "sparc"
# elif defined(arm)
# define ARCH "arm"
# elif defined(PPC)
# define ARCH "ppc"
# endif
#endif /* _LP64 */

View File

@ -32,11 +32,15 @@
#include <sys/un.h>
#include <sys/stat.h>
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *)0)->sun_path)
#endif
// The attach mechanism on Linux uses a UNIX domain socket. An attach listener
// thread is created at startup or is created on-demand via a signal from
// the client tool. The attach listener creates a socket and binds it to a file
// in the filesystem. The attach listener then acts as a simple (single-
// threaded) server - tt waits for a client to connect, reads the request,
// threaded) server - it waits for a client to connect, reads the request,
// executes it, and returns the response to the client via the socket
// connection.
//
@ -54,7 +58,7 @@ class LinuxAttachOperation;
class LinuxAttachListener: AllStatic {
private:
// the path to which we bind the UNIX domain socket
static char _path[PATH_MAX+1];
static char _path[UNIX_PATH_MAX];
static bool _has_path;
// the file descriptor for the listening socket
@ -64,8 +68,8 @@ class LinuxAttachListener: AllStatic {
if (path == NULL) {
_has_path = false;
} else {
strncpy(_path, path, PATH_MAX);
_path[PATH_MAX] = '\0';
strncpy(_path, path, UNIX_PATH_MAX);
_path[UNIX_PATH_MAX-1] = '\0';
_has_path = true;
}
}
@ -113,7 +117,7 @@ class LinuxAttachOperation: public AttachOperation {
};
// statics
char LinuxAttachListener::_path[PATH_MAX+1];
char LinuxAttachListener::_path[UNIX_PATH_MAX];
bool LinuxAttachListener::_has_path;
int LinuxAttachListener::_listener = -1;
@ -163,54 +167,53 @@ extern "C" {
// Initialization - create a listener socket and bind it to a file
int LinuxAttachListener::init() {
char path[PATH_MAX+1]; // socket file
int listener; // listener socket (file descriptor)
char path[UNIX_PATH_MAX]; // socket file
char initial_path[UNIX_PATH_MAX]; // socket file during setup
int listener; // listener socket (file descriptor)
// register function to cleanup
::atexit(listener_cleanup);
int n = snprintf(path, UNIX_PATH_MAX, "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
if (n <= (int)UNIX_PATH_MAX) {
n = snprintf(initial_path, UNIX_PATH_MAX, "%s.tmp", path);
}
if (n > (int)UNIX_PATH_MAX) {
return -1;
}
// create the listener socket
listener = ::socket(PF_UNIX, SOCK_STREAM, 0);
if (listener == -1) {
return -1;
}
int res = -1;
// bind socket
struct sockaddr_un addr;
addr.sun_family = AF_UNIX;
// FIXME: Prior to b39 the tool-side API expected to find the well
// known file in the working directory. To allow this libjvm.so work with
// a pre-b39 SDK we create it in the working directory if
// +StartAttachListener is used is used. All unit tests for this feature
// currently used this flag. Once b39 SDK has been promoted we can remove
// this code.
if (StartAttachListener) {
sprintf(path, ".java_pid%d", os::current_process_id());
strcpy(addr.sun_path, path);
::unlink(path);
res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
}
strcpy(addr.sun_path, initial_path);
::unlink(initial_path);
int res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
if (res == -1) {
snprintf(path, PATH_MAX+1, "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
strcpy(addr.sun_path, path);
::unlink(path);
res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
RESTARTABLE(::close(listener), res);
return -1;
}
// put in listen mode, set permissions, and rename into place
res = ::listen(listener, 5);
if (res == 0) {
RESTARTABLE(::chmod(initial_path, S_IREAD|S_IWRITE), res);
if (res == 0) {
res = ::rename(initial_path, path);
}
}
if (res == -1) {
RESTARTABLE(::close(listener), res);
::unlink(initial_path);
return -1;
}
set_path(path);
// put in listen mode and set permission
if ((::listen(listener, 5) == -1) || (::chmod(path, S_IREAD|S_IWRITE) == -1)) {
RESTARTABLE(::close(listener), res);
::unlink(path);
set_path(NULL);
return -1;
}
set_listener(listener);
return 0;

View File

@ -29,9 +29,10 @@
product(bool, UseOprofile, false, \
"enable support for Oprofile profiler") \
\
product(bool, UseLinuxPosixThreadCPUClocks, false, \
"enable fast Linux Posix clocks where available") \
product(bool, UseLinuxPosixThreadCPUClocks, true, \
"enable fast Linux Posix clocks where available")
// NB: The default value of UseLinuxPosixThreadCPUClocks may be
// overridden in Arguments::parse_each_vm_init_arg.
//
// Defines Linux-specific default values. The flags are available on all

View File

@ -30,6 +30,8 @@
// put OS-includes here
# include <sys/types.h>
# include <sys/mman.h>
# include <sys/stat.h>
# include <sys/select.h>
# include <pthread.h>
# include <signal.h>
# include <errno.h>
@ -188,6 +190,10 @@ static char cpu_arch[] = "ia64";
static char cpu_arch[] = "i386";
#elif defined(AMD64)
static char cpu_arch[] = "amd64";
#elif defined(ARM)
static char cpu_arch[] = "arm";
#elif defined(PPC)
static char cpu_arch[] = "ppc";
#elif defined(SPARC)
# ifdef _LP64
static char cpu_arch[] = "sparcv9";
@ -1137,8 +1143,8 @@ void os::Linux::capture_initial_stack(size_t max_size) {
long it_real;
uintptr_t start;
uintptr_t vsize;
uintptr_t rss;
unsigned long rsslim;
intptr_t rss;
uintptr_t rsslim;
uintptr_t scodes;
uintptr_t ecode;
int i;
@ -1168,12 +1174,12 @@ void os::Linux::capture_initial_stack(size_t max_size) {
// Skip blank chars
do s++; while (isspace(*s));
/* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 */
/* 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 */
i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld "
UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT
" %lu "
UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT,
#define _UFM UINTX_FORMAT
#define _DFM INTX_FORMAT
/* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 */
/* 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 */
i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld " _UFM _UFM _DFM _UFM _UFM _UFM _UFM,
&state, /* 3 %c */
&ppid, /* 4 %d */
&pgrp, /* 5 %d */
@ -1193,15 +1199,18 @@ void os::Linux::capture_initial_stack(size_t max_size) {
&nice, /* 19 %ld */
&junk, /* 20 %ld */
&it_real, /* 21 %ld */
&start, /* 22 UINTX_FORMAT */
&vsize, /* 23 UINTX_FORMAT */
&rss, /* 24 UINTX_FORMAT */
&rsslim, /* 25 %lu */
&scodes, /* 26 UINTX_FORMAT */
&ecode, /* 27 UINTX_FORMAT */
&stack_start); /* 28 UINTX_FORMAT */
&start, /* 22 UINTX_FORMAT */
&vsize, /* 23 UINTX_FORMAT */
&rss, /* 24 INTX_FORMAT */
&rsslim, /* 25 UINTX_FORMAT */
&scodes, /* 26 UINTX_FORMAT */
&ecode, /* 27 UINTX_FORMAT */
&stack_start); /* 28 UINTX_FORMAT */
}
#undef _UFM
#undef _DFM
if (i != 28 - 2) {
assert(false, "Bad conversion from /proc/self/stat");
// product mode - assume we are the initial thread, good luck in the
@ -1336,13 +1345,15 @@ void os::Linux::clock_init() {
#if defined(IA32) || defined(AMD64)
#define SYS_clock_getres IA32_ONLY(266) AMD64_ONLY(229)
#else
#error Value of SYS_clock_getres not known on this platform
#endif
#endif
#define sys_clock_getres(x,y) ::syscall(SYS_clock_getres, x, y)
#else
#warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
#define sys_clock_getres(x,y) -1
#endif
#else
#define sys_clock_getres(x,y) ::syscall(SYS_clock_getres, x, y)
#endif
void os::Linux::fast_thread_clock_init() {
if (!UseLinuxPosixThreadCPUClocks) {
@ -1905,7 +1916,9 @@ void os::print_os_info(outputStream* st) {
!_print_ascii_file("/etc/SuSE-release", st) &&
!_print_ascii_file("/etc/turbolinux-release", st) &&
!_print_ascii_file("/etc/gentoo-release", st) &&
!_print_ascii_file("/etc/debian_version", st)) {
!_print_ascii_file("/etc/debian_version", st) &&
!_print_ascii_file("/etc/ltib-release", st) &&
!_print_ascii_file("/etc/angstrom-version", st)) {
st->print("Linux");
}
st->cr();
@ -1971,6 +1984,11 @@ void os::print_os_info(outputStream* st) {
os::loadavg(loadavg, 3);
st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
st->cr();
// meminfo
st->print("\n/proc/meminfo:\n");
_print_ascii_file("/proc/meminfo", st);
st->cr();
}
void os::print_memory_info(outputStream* st) {
@ -2097,7 +2115,8 @@ void os::jvm_path(char *buf, jint buflen) {
CAST_FROM_FN_PTR(address, os::jvm_path),
dli_fname, sizeof(dli_fname), NULL);
assert(ret != 0, "cannot locate libjvm");
if (realpath(dli_fname, buf) == NULL)
char *rp = realpath(dli_fname, buf);
if (rp == NULL)
return;
if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
@ -2125,7 +2144,8 @@ void os::jvm_path(char *buf, jint buflen) {
assert(strstr(p, "/libjvm") == p, "invalid library name");
p = strstr(p, "_g") ? "_g" : "";
if (realpath(java_home_var, buf) == NULL)
rp = realpath(java_home_var, buf);
if (rp == NULL)
return;
// determine if this is a legacy image or modules image
@ -2147,7 +2167,8 @@ void os::jvm_path(char *buf, jint buflen) {
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
} else {
// Go back to path of .so
if (realpath(dli_fname, buf) == NULL)
rp = realpath(dli_fname, buf);
if (rp == NULL)
return;
}
}
@ -2508,9 +2529,9 @@ os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
unsigned long* os::Linux::_numa_all_nodes;
bool os::uncommit_memory(char* addr, size_t size) {
return ::mmap(addr, size, PROT_NONE,
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0)
!= MAP_FAILED;
uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
return res != (uintptr_t) MAP_FAILED;
}
// Linux uses a growable mapping for the stack, and if the mapping for
@ -2718,7 +2739,8 @@ bool os::large_page_init() {
// the processor.
#ifndef ZERO
_large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M);
_large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
ARM_ONLY(2 * M) PPC_ONLY(4 * M);
#endif // ZERO
FILE *fp = fopen("/proc/meminfo", "r");
@ -3981,6 +4003,9 @@ jint os::init_2(void)
return JNI_OK;
}
// this is called at the end of vm_initialization
void os::init_3(void) { }
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
if( !guard_memory((char*)_polling_page, Linux::page_size()) )
@ -4061,7 +4086,6 @@ int os::Linux::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mute
////////////////////////////////////////////////////////////////////////////////
// debug support
#ifndef PRODUCT
static address same_page(address x, address y) {
int page_bits = -os::vm_page_size();
if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
@ -4072,26 +4096,26 @@ static address same_page(address x, address y) {
return (address)(intptr_t(y) & page_bits);
}
bool os::find(address addr) {
bool os::find(address addr, outputStream* st) {
Dl_info dlinfo;
memset(&dlinfo, 0, sizeof(dlinfo));
if (dladdr(addr, &dlinfo)) {
tty->print(PTR_FORMAT ": ", addr);
st->print(PTR_FORMAT ": ", addr);
if (dlinfo.dli_sname != NULL) {
tty->print("%s+%#x", dlinfo.dli_sname,
st->print("%s+%#x", dlinfo.dli_sname,
addr - (intptr_t)dlinfo.dli_saddr);
} else if (dlinfo.dli_fname) {
tty->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
} else {
tty->print("<absolute address>");
st->print("<absolute address>");
}
if (dlinfo.dli_fname) {
tty->print(" in %s", dlinfo.dli_fname);
st->print(" in %s", dlinfo.dli_fname);
}
if (dlinfo.dli_fbase) {
tty->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
}
tty->cr();
st->cr();
if (Verbose) {
// decode some bytes around the PC
@ -4104,15 +4128,13 @@ bool os::find(address addr) {
if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
&& end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
end = (address) dlinfo2.dli_saddr;
Disassembler::decode(begin, end);
Disassembler::decode(begin, end, st);
}
return true;
}
return false;
}
#endif
////////////////////////////////////////////////////////////////////////////////
// misc
@ -4321,6 +4343,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
int count;
long sys_time, user_time;
char string[64];
char cdummy;
int idummy;
long ldummy;
FILE *fp;
@ -4381,11 +4404,11 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
// Skip blank chars
do s++; while (isspace(*s));
count = sscanf(s,"%*c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
&idummy, &idummy, &idummy, &idummy, &idummy,
count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
&cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
&ldummy, &ldummy, &ldummy, &ldummy, &ldummy,
&user_time, &sys_time);
if ( count != 12 ) return -1;
if ( count != 13 ) return -1;
if (user_sys_cpu_time) {
return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec);
} else {
@ -4980,3 +5003,43 @@ int os::fork_and_exec(char* cmd) {
}
}
}
// is_headless_jre()
//
// Test for the existence of libmawt in motif21 or xawt directories
// in order to report if we are running in a headless jre
//
bool os::is_headless_jre() {
struct stat statbuf;
char buf[MAXPATHLEN];
char libmawtpath[MAXPATHLEN];
const char *xawtstr = "/xawt/libmawt.so";
const char *motifstr = "/motif21/libmawt.so";
char *p;
// Get path to libjvm.so
os::jvm_path(buf, sizeof(buf));
// Get rid of libjvm.so
p = strrchr(buf, '/');
if (p == NULL) return false;
else *p = '\0';
// Get rid of client or server
p = strrchr(buf, '/');
if (p == NULL) return false;
else *p = '\0';
// check xawt/libmawt.so
strcpy(libmawtpath, buf);
strcat(libmawtpath, xawtstr);
if (::stat(libmawtpath, &statbuf) == 0) return false;
// check motif21/libmawt.so
strcpy(libmawtpath, buf);
strcat(libmawtpath, motifstr);
if (::stat(libmawtpath, &statbuf) == 0) return false;
return true;
}

View File

@ -364,6 +364,7 @@ extern "C" {
// Create the door
int SolarisAttachListener::create_door() {
char door_path[PATH_MAX+1];
char initial_path[PATH_MAX+1];
int fd, res;
// register exit function
@ -375,36 +376,46 @@ int SolarisAttachListener::create_door() {
return -1;
}
// create initial file to attach door descriptor
snprintf(door_path, sizeof(door_path), "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
RESTARTABLE(::creat(door_path, S_IRUSR | S_IWUSR), fd);
snprintf(initial_path, sizeof(initial_path), "%s.tmp", door_path);
RESTARTABLE(::creat(initial_path, S_IRUSR | S_IWUSR), fd);
if (fd == -1) {
debug_only(warning("attempt to create %s failed", door_path));
debug_only(warning("attempt to create %s failed", initial_path));
::door_revoke(dd);
return -1;
}
assert(fd >= 0, "bad file descriptor");
set_door_path(door_path);
RESTARTABLE(::close(fd), res);
// attach the door descriptor to the file
if ((res = ::fattach(dd, door_path)) == -1) {
if ((res = ::fattach(dd, initial_path)) == -1) {
// if busy then detach and try again
if (errno == EBUSY) {
::fdetach(door_path);
res = ::fattach(dd, door_path);
::fdetach(initial_path);
res = ::fattach(dd, initial_path);
}
if (res == -1) {
::door_revoke(dd);
dd = -1;
}
}
// rename file so that clients can attach
if (dd >= 0) {
if (::rename(initial_path, door_path) == -1) {
RESTARTABLE(::close(dd), res);
::fdetach(initial_path);
dd = -1;
}
}
if (dd >= 0) {
set_door_descriptor(dd);
set_door_path(door_path);
} else {
// unable to create door or attach it to the file
::unlink(door_path);
set_door_path(NULL);
// unable to create door, attach it to file, or rename file into place
::unlink(initial_path);
return -1;
}

View File

@ -1839,8 +1839,8 @@ void os::dll_build_name(char* buffer, size_t buflen,
// Quietly truncate on buffer overflow. Should be an error.
if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
*buffer = '\0';
return;
*buffer = '\0';
return;
}
if (pnamelen == 0) {
@ -2051,7 +2051,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
{EM_SPARC32PLUS, EM_SPARC, ELFCLASS32, ELFDATA2MSB, (char*)"Sparc 32"},
{EM_SPARCV9, EM_SPARCV9, ELFCLASS64, ELFDATA2MSB, (char*)"Sparc v9 64"},
{EM_PPC, EM_PPC, ELFCLASS32, ELFDATA2MSB, (char*)"Power PC 32"},
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"}
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"},
{EM_ARM, EM_ARM, ELFCLASS32, ELFDATA2LSB, (char*)"ARM 32"}
};
#if (defined IA32)
@ -2068,9 +2069,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
static Elf32_Half running_arch_code=EM_PPC64;
#elif (defined __powerpc__)
static Elf32_Half running_arch_code=EM_PPC;
#elif (defined ARM)
static Elf32_Half running_arch_code=EM_ARM;
#else
#error Method os::dll_load requires that one of following is defined:\
IA32, AMD64, IA64, __sparc, __powerpc__
IA32, AMD64, IA64, __sparc, __powerpc__, ARM, ARM
#endif
// Identify compatability class for VM's architecture and library's architecture
@ -3149,7 +3152,8 @@ bool os::Solaris::ism_sanity_check(bool warn, size_t * page_size) {
// ISM is only recommended on old Solaris where there is no MPSS support.
// Simply choose a conservative value as default.
*page_size = LargePageSizeInBytes ? LargePageSizeInBytes :
SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M);
SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M)
ARM_ONLY(2 * M);
// ISM is available on all supported Solaris versions
return true;
@ -5007,6 +5011,9 @@ jint os::init_2(void) {
return JNI_OK;
}
void os::init_3(void) {
return;
}
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
@ -5412,7 +5419,6 @@ int os::loadavg(double loadavg[], int nelem) {
}
//---------------------------------------------------------------------------------
#ifndef PRODUCT
static address same_page(address x, address y) {
intptr_t page_bits = -os::vm_page_size();
@ -5424,28 +5430,28 @@ static address same_page(address x, address y) {
return (address)(intptr_t(y) & page_bits);
}
bool os::find(address addr) {
bool os::find(address addr, outputStream* st) {
Dl_info dlinfo;
memset(&dlinfo, 0, sizeof(dlinfo));
if (dladdr(addr, &dlinfo)) {
#ifdef _LP64
tty->print("0x%016lx: ", addr);
st->print("0x%016lx: ", addr);
#else
tty->print("0x%08x: ", addr);
st->print("0x%08x: ", addr);
#endif
if (dlinfo.dli_sname != NULL)
tty->print("%s+%#lx", dlinfo.dli_sname, addr-(intptr_t)dlinfo.dli_saddr);
st->print("%s+%#lx", dlinfo.dli_sname, addr-(intptr_t)dlinfo.dli_saddr);
else if (dlinfo.dli_fname)
tty->print("<offset %#lx>", addr-(intptr_t)dlinfo.dli_fbase);
st->print("<offset %#lx>", addr-(intptr_t)dlinfo.dli_fbase);
else
tty->print("<absolute address>");
if (dlinfo.dli_fname) tty->print(" in %s", dlinfo.dli_fname);
st->print("<absolute address>");
if (dlinfo.dli_fname) st->print(" in %s", dlinfo.dli_fname);
#ifdef _LP64
if (dlinfo.dli_fbase) tty->print(" at 0x%016lx", dlinfo.dli_fbase);
if (dlinfo.dli_fbase) st->print(" at 0x%016lx", dlinfo.dli_fbase);
#else
if (dlinfo.dli_fbase) tty->print(" at 0x%08x", dlinfo.dli_fbase);
if (dlinfo.dli_fbase) st->print(" at 0x%08x", dlinfo.dli_fbase);
#endif
tty->cr();
st->cr();
if (Verbose) {
// decode some bytes around the PC
@ -5458,16 +5464,13 @@ bool os::find(address addr) {
if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
&& end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
end = (address) dlinfo2.dli_saddr;
Disassembler::decode(begin, end);
Disassembler::decode(begin, end, st);
}
return true;
}
return false;
}
#endif
// Following function has been added to support HotSparc's libjvm.so running
// under Solaris production JDK 1.2.2 / 1.3.0. These came from
// src/solaris/hpi/native_threads in the EVM codebase.
@ -5910,7 +5913,6 @@ void Parker::park(bool isAbsolute, jlong time) {
if (jt->handle_special_suspend_equivalent_condition()) {
jt->java_suspend_self();
}
OrderAccess::fence();
}
@ -5997,3 +5999,44 @@ int os::fork_and_exec(char* cmd) {
}
}
}
// is_headless_jre()
//
// Test for the existence of libmawt in motif21 or xawt directories
// in order to report if we are running in a headless jre
//
bool os::is_headless_jre() {
struct stat statbuf;
char buf[MAXPATHLEN];
char libmawtpath[MAXPATHLEN];
const char *xawtstr = "/xawt/libmawt.so";
const char *motifstr = "/motif21/libmawt.so";
char *p;
// Get path to libjvm.so
os::jvm_path(buf, sizeof(buf));
// Get rid of libjvm.so
p = strrchr(buf, '/');
if (p == NULL) return false;
else *p = '\0';
// Get rid of client or server
p = strrchr(buf, '/');
if (p == NULL) return false;
else *p = '\0';
// check xawt/libmawt.so
strcpy(libmawtpath, buf);
strcat(libmawtpath, xawtstr);
if (::stat(libmawtpath, &statbuf) == 0) return false;
// check motif21/libmawt.so
strcpy(libmawtpath, buf);
strcat(libmawtpath, motifstr);
if (::stat(libmawtpath, &statbuf) == 0) return false;
return true;
}

View File

@ -3444,6 +3444,9 @@ jint os::init_2(void) {
return JNI_OK;
}
void os::init_3(void) {
return;
}
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
@ -4105,12 +4108,10 @@ bool os::check_heap(bool force) {
}
#ifndef PRODUCT
bool os::find(address addr) {
bool os::find(address addr, outputStream* st) {
// Nothing yet
return false;
}
#endif
LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
DWORD exception_code = e->ExceptionRecord->ExceptionCode;
@ -4164,3 +4165,8 @@ static int getLastErrorString(char *buf, size_t len)
}
return 0;
}
// We don't build a headless jre for Windows
bool os::is_headless_jre() { return false; }

View File

@ -105,3 +105,6 @@ bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
// nothing else to try
return false;
}
void JavaThread::cache_global_variables() { }

View File

@ -718,6 +718,11 @@ void os::print_context(outputStream *st, void *context) {
ucontext_t *uc = (ucontext_t*)context;
st->print_cr("Registers:");
// this is horrendously verbose but the layout of the registers in the
// context does not match how we defined our abstract Register set, so
// we can't just iterate through the gregs area
#ifdef AMD64
st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
@ -745,6 +750,63 @@ void os::print_context(outputStream *st, void *context) {
st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]);
st->cr();
st->print(" TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
st->cr();
st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
st->cr();
st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
st->cr();
st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
st->cr();
st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
st->cr();
st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
print_location(st, uc->uc_mcontext.gregs[REG_RBP]);
st->cr();
st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
st->cr();
st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
st->cr();
st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
print_location(st, uc->uc_mcontext.gregs[REG_R8]);
st->cr();
st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
print_location(st, uc->uc_mcontext.gregs[REG_R9]);
st->cr();
st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
print_location(st, uc->uc_mcontext.gregs[REG_R10]);
st->cr();
st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
print_location(st, uc->uc_mcontext.gregs[REG_R11]);
st->cr();
st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
print_location(st, uc->uc_mcontext.gregs[REG_R12]);
st->cr();
st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
print_location(st, uc->uc_mcontext.gregs[REG_R13]);
st->cr();
st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
print_location(st, uc->uc_mcontext.gregs[REG_R14]);
st->cr();
st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
print_location(st, uc->uc_mcontext.gregs[REG_R15]);
#else
st->print( "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
@ -759,6 +821,39 @@ void os::print_context(outputStream *st, void *context) {
st->print( "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
print_location(st, uc->uc_mcontext.gregs[REG_EAX]);
st->cr();
st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
print_location(st, uc->uc_mcontext.gregs[REG_EBX]);
st->cr();
st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
print_location(st, uc->uc_mcontext.gregs[REG_ECX]);
st->cr();
st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
print_location(st, uc->uc_mcontext.gregs[REG_EDX]);
st->cr();
st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESP]);
print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
st->cr();
st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]);
print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
st->cr();
st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]);
print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
st->cr();
st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
#endif // AMD64
st->cr();
st->cr();

View File

@ -79,3 +79,6 @@ bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
// nothing else to try
return false;
}
void JavaThread::cache_global_variables() { }

View File

@ -24,3 +24,5 @@
*/
// This file is intentionally empty
void JavaThread::cache_global_variables() { }

View File

@ -587,6 +587,61 @@ void os::print_context(outputStream *st, void *context) {
st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT,
uc->uc_mcontext.gregs[REG_PC],
uc->uc_mcontext.gregs[REG_nPC]);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("O0=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O0]);
print_location(st, uc->uc_mcontext.gregs[REG_O0]);
st->cr();
st->print_cr("O1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O1]);
print_location(st, uc->uc_mcontext.gregs[REG_O1]);
st->cr();
st->print_cr("O2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O2]);
print_location(st, uc->uc_mcontext.gregs[REG_O2]);
st->cr();
st->print_cr("O3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O3]);
print_location(st, uc->uc_mcontext.gregs[REG_O3]);
st->cr();
st->print_cr("O4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O4]);
print_location(st, uc->uc_mcontext.gregs[REG_O4]);
st->cr();
st->print_cr("O5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O5]);
print_location(st, uc->uc_mcontext.gregs[REG_O5]);
st->cr();
st->print_cr("O6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O6]);
print_location(st, uc->uc_mcontext.gregs[REG_O6]);
st->cr();
st->print_cr("O7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O7]);
print_location(st, uc->uc_mcontext.gregs[REG_O7]);
st->cr();
st->print_cr("G1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G1]);
print_location(st, uc->uc_mcontext.gregs[REG_G1]);
st->cr();
st->print_cr("G2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G2]);
print_location(st, uc->uc_mcontext.gregs[REG_G2]);
st->cr();
st->print_cr("G3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G3]);
print_location(st, uc->uc_mcontext.gregs[REG_G3]);
st->cr();
st->print_cr("G4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G4]);
print_location(st, uc->uc_mcontext.gregs[REG_G4]);
st->cr();
st->print_cr("G5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G5]);
print_location(st, uc->uc_mcontext.gregs[REG_G5]);
st->cr();
st->print_cr("G6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G6]);
print_location(st, uc->uc_mcontext.gregs[REG_G6]);
st->cr();
st->print_cr("G7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G7]);
print_location(st, uc->uc_mcontext.gregs[REG_G7]);
st->cr();
st->cr();

View File

@ -140,3 +140,6 @@ bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
*fr_addr = ret_frame;
return true;
}
void JavaThread::cache_global_variables() { }

View File

@ -719,6 +719,11 @@ void os::print_context(outputStream *st, void *context) {
ucontext_t *uc = (ucontext_t*)context;
st->print_cr("Registers:");
// this is horrendously verbose but the layout of the registers in the
// context does not match how we defined our abstract Register set, so
// we can't just iterate through the gregs area
#ifdef AMD64
st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
@ -742,6 +747,63 @@ void os::print_context(outputStream *st, void *context) {
st->cr();
st->print( "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]);
st->print(", RFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RFL]);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
st->cr();
st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
st->cr();
st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
st->cr();
st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
st->cr();
st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
st->cr();
st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
st->cr();
st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
st->cr();
st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
st->cr();
st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
print_location(st, uc->uc_mcontext.gregs[REG_R8]);
st->cr();
st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
print_location(st, uc->uc_mcontext.gregs[REG_R9]);
st->cr();
st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
print_location(st, uc->uc_mcontext.gregs[REG_R10]);
st->cr();
st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
print_location(st, uc->uc_mcontext.gregs[REG_R11]);
st->cr();
st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
print_location(st, uc->uc_mcontext.gregs[REG_R12]);
st->cr();
st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
print_location(st, uc->uc_mcontext.gregs[REG_R13]);
st->cr();
st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
print_location(st, uc->uc_mcontext.gregs[REG_R14]);
st->cr();
st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
print_location(st, uc->uc_mcontext.gregs[REG_R15]);
#else
st->print( "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
@ -755,6 +817,39 @@ void os::print_context(outputStream *st, void *context) {
st->cr();
st->print( "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EIP]);
st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EFL]);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
print_location(st, uc->uc_mcontext.gregs[EAX]);
st->cr();
st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
print_location(st, uc->uc_mcontext.gregs[EBX]);
st->cr();
st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]);
print_location(st, uc->uc_mcontext.gregs[ECX]);
st->cr();
st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]);
print_location(st, uc->uc_mcontext.gregs[EDX]);
st->cr();
st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[UESP]);
print_location(st, uc->uc_mcontext.gregs[UESP]);
st->cr();
st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBP]);
print_location(st, uc->uc_mcontext.gregs[EBP]);
st->cr();
st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]);
print_location(st, uc->uc_mcontext.gregs[ESI]);
st->cr();
st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]);
print_location(st, uc->uc_mcontext.gregs[EDI]);
#endif // AMD64
st->cr();
st->cr();
@ -773,6 +868,7 @@ void os::print_context(outputStream *st, void *context) {
print_hex_dump(st, pc - 16, pc + 16, sizeof(char));
}
#ifdef AMD64
void os::Solaris::init_thread_fpu_state(void) {
// Nothing to do

View File

@ -82,3 +82,6 @@ bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
return true;
}
void JavaThread::cache_global_variables() { }

View File

@ -377,18 +377,84 @@ void os::print_context(outputStream *st, void *context) {
st->print_cr("Registers:");
#ifdef AMD64
st->print( "EAX=" INTPTR_FORMAT, uc->Rax);
st->print(", EBX=" INTPTR_FORMAT, uc->Rbx);
st->print(", ECX=" INTPTR_FORMAT, uc->Rcx);
st->print(", EDX=" INTPTR_FORMAT, uc->Rdx);
st->print( "RAX=" INTPTR_FORMAT, uc->Rax);
st->print(", RBX=" INTPTR_FORMAT, uc->Rbx);
st->print(", RCX=" INTPTR_FORMAT, uc->Rcx);
st->print(", RDX=" INTPTR_FORMAT, uc->Rdx);
st->cr();
st->print( "ESP=" INTPTR_FORMAT, uc->Rsp);
st->print(", EBP=" INTPTR_FORMAT, uc->Rbp);
st->print(", ESI=" INTPTR_FORMAT, uc->Rsi);
st->print(", EDI=" INTPTR_FORMAT, uc->Rdi);
st->print( "RSP=" INTPTR_FORMAT, uc->Rsp);
st->print(", RBP=" INTPTR_FORMAT, uc->Rbp);
st->print(", RSI=" INTPTR_FORMAT, uc->Rsi);
st->print(", RDI=" INTPTR_FORMAT, uc->Rdi);
st->cr();
st->print( "EIP=" INTPTR_FORMAT, uc->Rip);
st->print( "R8=" INTPTR_FORMAT, uc->R8);
st->print(", R9=" INTPTR_FORMAT, uc->R9);
st->print(", R10=" INTPTR_FORMAT, uc->R10);
st->print(", R11=" INTPTR_FORMAT, uc->R11);
st->cr();
st->print( "R12=" INTPTR_FORMAT, uc->R12);
st->print(", R13=" INTPTR_FORMAT, uc->R13);
st->print(", R14=" INTPTR_FORMAT, uc->R14);
st->print(", R15=" INTPTR_FORMAT, uc->R15);
st->cr();
st->print( "RIP=" INTPTR_FORMAT, uc->Rip);
st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("RAX=" INTPTR_FORMAT, uc->Rax);
print_location(st, uc->Rax);
st->cr();
st->print_cr("RBX=" INTPTR_FORMAT, uc->Rbx);
print_location(st, uc->Rbx);
st->cr();
st->print_cr("RCX=" INTPTR_FORMAT, uc->Rcx);
print_location(st, uc->Rcx);
st->cr();
st->print_cr("RDX=" INTPTR_FORMAT, uc->Rdx);
print_location(st, uc->Rdx);
st->cr();
st->print_cr("RSP=" INTPTR_FORMAT, uc->Rsp);
print_location(st, uc->Rsp);
st->cr();
st->print_cr("RBP=" INTPTR_FORMAT, uc->Rbp);
print_location(st, uc->Rbp);
st->cr();
st->print_cr("RSI=" INTPTR_FORMAT, uc->Rsi);
print_location(st, uc->Rsi);
st->cr();
st->print_cr("RDI=" INTPTR_FORMAT, uc->Rdi);
print_location(st, uc->Rdi);
st->cr();
st->print_cr("R8 =" INTPTR_FORMAT, uc->R8);
print_location(st, uc->R8);
st->cr();
st->print_cr("R9 =" INTPTR_FORMAT, uc->R9);
print_location(st, uc->R9);
st->cr();
st->print_cr("R10=" INTPTR_FORMAT, uc->R10);
print_location(st, uc->R10);
st->cr();
st->print_cr("R11=" INTPTR_FORMAT, uc->R11);
print_location(st, uc->R11);
st->cr();
st->print_cr("R12=" INTPTR_FORMAT, uc->R12);
print_location(st, uc->R12);
st->cr();
st->print_cr("R13=" INTPTR_FORMAT, uc->R13);
print_location(st, uc->R13);
st->cr();
st->print_cr("R14=" INTPTR_FORMAT, uc->R14);
print_location(st, uc->R14);
st->cr();
st->print_cr("R15=" INTPTR_FORMAT, uc->R15);
print_location(st, uc->R15);
#else
st->print( "EAX=" INTPTR_FORMAT, uc->Eax);
st->print(", EBX=" INTPTR_FORMAT, uc->Ebx);
@ -402,6 +468,38 @@ void os::print_context(outputStream *st, void *context) {
st->cr();
st->print( "EIP=" INTPTR_FORMAT, uc->Eip);
st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
st->cr();
st->cr();
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
st->print_cr("EAX=" INTPTR_FORMAT, uc->Eax);
print_location(st, uc->Eax);
st->cr();
st->print_cr("EBX=" INTPTR_FORMAT, uc->Ebx);
print_location(st, uc->Ebx);
st->cr();
st->print_cr("ECX=" INTPTR_FORMAT, uc->Ecx);
print_location(st, uc->Ecx);
st->cr();
st->print_cr("EDX=" INTPTR_FORMAT, uc->Edx);
print_location(st, uc->Edx);
st->cr();
st->print_cr("ESP=" INTPTR_FORMAT, uc->Esp);
print_location(st, uc->Esp);
st->cr();
st->print_cr("EBP=" INTPTR_FORMAT, uc->Ebp);
print_location(st, uc->Ebp);
st->cr();
st->print_cr("ESI=" INTPTR_FORMAT, uc->Esi);
print_location(st, uc->Esi);
st->cr();
st->print_cr("EDI=" INTPTR_FORMAT, uc->Edi);
print_location(st, uc->Edi);
#endif // AMD64
st->cr();
st->cr();

View File

@ -84,3 +84,6 @@ bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
// nothing else to try
return false;
}
void JavaThread::cache_global_variables() { }

View File

@ -128,7 +128,11 @@ CodeBuffer::~CodeBuffer() {
delete _overflow_arena;
#ifdef ASSERT
// Save allocation type to execute assert in ~ResourceObj()
// which is called after this destructor.
ResourceObj::allocation_type at = _default_oop_recorder.get_allocation_type();
Copy::fill_to_bytes(this, sizeof(*this), badResourceValue);
ResourceObj::set_allocation_type((address)(&_default_oop_recorder), at);
#endif
}

View File

@ -102,7 +102,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
_locs_point = NULL;
_locs_own = false;
_frozen = false;
debug_only(_index = -1);
debug_only(_index = (char)-1);
debug_only(_outer = (CodeBuffer*)badAddress);
}
@ -278,7 +278,7 @@ class CodeBuffer: public StackObj {
// special case during expansion which is handled internally. This
// is done to guarantee proper cleanup of resources.
void* operator new(size_t size) { return ResourceObj::operator new(size); }
void operator delete(void* p) { ResourceObj::operator delete(p); }
void operator delete(void* p) { ShouldNotCallThis(); }
public:
typedef int csize_t; // code size type; would be size_t except for history

View File

@ -448,6 +448,10 @@ class SimpleExceptionStub: public CodeStub {
_obj(obj), _info(info), _stub(stub) {
}
void set_obj(LIR_Opr obj) {
_obj = obj;
}
virtual void emit_code(LIR_Assembler* e);
virtual CodeEmitInfo* info() const { return _info; }
virtual bool is_exception_throw_stub() const { return true; }

View File

@ -220,11 +220,13 @@ void Compilation::emit_code_epilog(LIR_Assembler* assembler) {
code_offsets->set_value(CodeOffsets::Deopt, assembler->emit_deopt_handler());
CHECK_BAILOUT();
// Generate code for MethodHandle deopt handler. We can use the
// same code as for the normal deopt handler, we just need a
// different entry point address.
code_offsets->set_value(CodeOffsets::DeoptMH, assembler->emit_deopt_handler());
CHECK_BAILOUT();
// Emit the MethodHandle deopt handler code (if required).
if (has_method_handle_invokes()) {
// We can use the same code as for the normal deopt handler, we
// just need a different entry point address.
code_offsets->set_value(CodeOffsets::DeoptMH, assembler->emit_deopt_handler());
CHECK_BAILOUT();
}
// Emit the handler to remove the activation from the stack and
// dispatch to the caller.
@ -446,6 +448,7 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
, _has_exception_handlers(false)
, _has_fpu_code(true) // pessimistic assumption
, _has_unsafe_access(false)
, _has_method_handle_invokes(false)
, _bailout_msg(NULL)
, _exception_info_list(NULL)
, _allocator(NULL)

View File

@ -69,6 +69,7 @@ class Compilation: public StackObj {
bool _has_exception_handlers;
bool _has_fpu_code;
bool _has_unsafe_access;
bool _has_method_handle_invokes; // True if this method has MethodHandle invokes.
const char* _bailout_msg;
ExceptionInfoList* _exception_info_list;
ExceptionHandlerTable _exception_handler_table;
@ -147,6 +148,10 @@ class Compilation: public StackObj {
// Statistics gathering
void notice_inlined_method(ciMethod* method);
// JSR 292
bool has_method_handle_invokes() const { return _has_method_handle_invokes; }
void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }
DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info();
Dependencies* dependency_recorder() const; // = _env->dependencies()
ImplicitExceptionTable* implicit_exception_table() { return &_implicit_exception_table; }
@ -168,10 +173,19 @@ class Compilation: public StackObj {
const char* bailout_msg() const { return _bailout_msg; }
static int desired_max_code_buffer_size() {
#ifndef PPC
return (int) NMethodSizeLimit; // default 256K or 512K
#else
// conditional branches on PPC are restricted to 16 bit signed
return MAX2((unsigned int)NMethodSizeLimit,32*K);
#endif
}
static int desired_max_constant_size() {
#ifndef PPC
return (int) NMethodSizeLimit / 10; // about 25K
#else
return (MAX2((unsigned int)NMethodSizeLimit, 32*K)) / 10;
#endif
}
static void setup_code_buffer(CodeBuffer* cb, int call_stub_estimate);

View File

@ -90,7 +90,7 @@ CallingConvention* FrameMap::java_calling_convention(const BasicTypeArray* signa
if (outgoing) {
// update the space reserved for arguments.
update_reserved_argument_area_size(out_preserve);
update_reserved_argument_area_size(out_preserve * BytesPerWord);
}
return new CallingConvention(args, out_preserve);
}
@ -138,7 +138,7 @@ CallingConvention* FrameMap::c_calling_convention(const BasicTypeArray* signatur
}
assert(args->length() == signature->length(), "size mismatch");
out_preserve += SharedRuntime::out_preserve_stack_slots();
update_reserved_argument_area_size(out_preserve);
update_reserved_argument_area_size(out_preserve * BytesPerWord);
return new CallingConvention(args, out_preserve);
}

View File

@ -154,7 +154,6 @@ class FrameMap : public CompilationResourceObj {
static LIR_Opr method_handle_invoke_SP_save_opr();
static BasicTypeArray* signature_type_array_for(const ciMethod* method);
static BasicTypeArray* signature_type_array_for(const char * signature);
// for outgoing calls, these also update the reserved area to
// include space for arguments and any ABI area.

View File

@ -50,8 +50,7 @@ XMMRegister LIR_OprDesc::as_xmm_double_reg() const {
#endif // X86
#ifdef SPARC
#if defined(SPARC) || defined(PPC)
FloatRegister LIR_OprDesc::as_float_reg() const {
return FrameMap::nr2floatreg(fpu_regnr());
@ -63,6 +62,19 @@ FloatRegister LIR_OprDesc::as_double_reg() const {
#endif
#ifdef ARM
FloatRegister LIR_OprDesc::as_float_reg() const {
return as_FloatRegister(fpu_regnr());
}
FloatRegister LIR_OprDesc::as_double_reg() const {
return as_FloatRegister(fpu_regnrLo());
}
#endif
LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal();
LIR_Opr LIR_OprFact::value_type(ValueType* type) {
@ -119,10 +131,14 @@ LIR_Address::Scale LIR_Address::scale(BasicType type) {
#ifndef PRODUCT
void LIR_Address::verify() const {
#ifdef SPARC
assert(scale() == times_1, "Scaled addressing mode not available on SPARC and should not be used");
#if defined(SPARC) || defined(PPC)
assert(scale() == times_1, "Scaled addressing mode not available on SPARC/PPC and should not be used");
assert(disp() == 0 || index()->is_illegal(), "can't have both");
#endif
#ifdef ARM
assert(disp() == 0 || index()->is_illegal(), "can't have both");
assert(-4096 < disp() && disp() < 4096, "architecture constraint");
#endif
#ifdef _LP64
assert(base()->is_cpu_register(), "wrong base operand");
assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
@ -173,13 +189,22 @@ void LIR_OprDesc::validate_type() const {
if (!is_pointer() && !is_illegal()) {
switch (as_BasicType(type_field())) {
case T_LONG:
assert((kind_field() == cpu_register || kind_field() == stack_value) && size_field() == double_size, "must match");
assert((kind_field() == cpu_register || kind_field() == stack_value) &&
size_field() == double_size, "must match");
break;
case T_FLOAT:
assert((kind_field() == fpu_register || kind_field() == stack_value) && size_field() == single_size, "must match");
// FP return values can be also in CPU registers on ARM and PPC (softfp ABI)
assert((kind_field() == fpu_register || kind_field() == stack_value
ARM_ONLY(|| kind_field() == cpu_register)
PPC_ONLY(|| kind_field() == cpu_register) ) &&
size_field() == single_size, "must match");
break;
case T_DOUBLE:
assert((kind_field() == fpu_register || kind_field() == stack_value) && size_field() == double_size, "must match");
// FP return values can be also in CPU registers on ARM and PPC (softfp ABI)
assert((kind_field() == fpu_register || kind_field() == stack_value
ARM_ONLY(|| kind_field() == cpu_register)
PPC_ONLY(|| kind_field() == cpu_register) ) &&
size_field() == double_size, "must match");
break;
case T_BOOLEAN:
case T_CHAR:
@ -188,7 +213,8 @@ void LIR_OprDesc::validate_type() const {
case T_INT:
case T_OBJECT:
case T_ARRAY:
assert((kind_field() == cpu_register || kind_field() == stack_value) && size_field() == single_size, "must match");
assert((kind_field() == cpu_register || kind_field() == stack_value) &&
size_field() == single_size, "must match");
break;
case T_ILLEGAL:
@ -503,6 +529,10 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
assert(opConvert->_info == NULL, "must be");
if (opConvert->_opr->is_valid()) do_input(opConvert->_opr);
if (opConvert->_result->is_valid()) do_output(opConvert->_result);
#ifdef PPC
if (opConvert->_tmp1->is_valid()) do_temp(opConvert->_tmp1);
if (opConvert->_tmp2->is_valid()) do_temp(opConvert->_tmp2);
#endif
do_stub(opConvert->_stub);
break;
@ -530,7 +560,9 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
LIR_OpAllocObj* opAllocObj = (LIR_OpAllocObj*)op;
if (opAllocObj->_info) do_info(opAllocObj->_info);
if (opAllocObj->_opr->is_valid()) do_input(opAllocObj->_opr);
if (opAllocObj->_opr->is_valid()) { do_input(opAllocObj->_opr);
do_temp(opAllocObj->_opr);
}
if (opAllocObj->_tmp1->is_valid()) do_temp(opAllocObj->_tmp1);
if (opAllocObj->_tmp2->is_valid()) do_temp(opAllocObj->_tmp2);
if (opAllocObj->_tmp3->is_valid()) do_temp(opAllocObj->_tmp3);
@ -826,10 +858,16 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
assert(op->as_OpCompareAndSwap() != NULL, "must be");
LIR_OpCompareAndSwap* opCompareAndSwap = (LIR_OpCompareAndSwap*)op;
assert(opCompareAndSwap->_addr->is_valid(), "used");
assert(opCompareAndSwap->_cmp_value->is_valid(), "used");
assert(opCompareAndSwap->_new_value->is_valid(), "used");
if (opCompareAndSwap->_info) do_info(opCompareAndSwap->_info);
if (opCompareAndSwap->_addr->is_valid()) do_input(opCompareAndSwap->_addr);
if (opCompareAndSwap->_cmp_value->is_valid()) do_input(opCompareAndSwap->_cmp_value);
if (opCompareAndSwap->_new_value->is_valid()) do_input(opCompareAndSwap->_new_value);
do_input(opCompareAndSwap->_addr);
do_temp(opCompareAndSwap->_addr);
do_input(opCompareAndSwap->_cmp_value);
do_temp(opCompareAndSwap->_cmp_value);
do_input(opCompareAndSwap->_new_value);
do_temp(opCompareAndSwap->_new_value);
if (opCompareAndSwap->_tmp1->is_valid()) do_temp(opCompareAndSwap->_tmp1);
if (opCompareAndSwap->_tmp2->is_valid()) do_temp(opCompareAndSwap->_tmp2);
if (opCompareAndSwap->_result->is_valid()) do_output(opCompareAndSwap->_result);
@ -1303,13 +1341,13 @@ void LIR_List::lock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scrat
info));
}
void LIR_List::unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, CodeStub* stub) {
void LIR_List::unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub) {
append(new LIR_OpLock(
lir_unlock,
hdr,
obj,
lock,
LIR_OprFact::illegalOpr,
scratch,
stub,
NULL));
}
@ -1342,22 +1380,19 @@ void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr
}
void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
// Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
// implying successful swap of new_value into addr
append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2));
void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2, result));
}
void LIR_List::cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
// Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
// implying successful swap of new_value into addr
append(new LIR_OpCompareAndSwap(lir_cas_obj, addr, cmp_value, new_value, t1, t2));
void LIR_List::cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
append(new LIR_OpCompareAndSwap(lir_cas_obj, addr, cmp_value, new_value, t1, t2, result));
}
void LIR_List::cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
// Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
// implying successful swap of new_value into addr
append(new LIR_OpCompareAndSwap(lir_cas_int, addr, cmp_value, new_value, t1, t2));
void LIR_List::cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
append(new LIR_OpCompareAndSwap(lir_cas_int, addr, cmp_value, new_value, t1, t2, result));
}
@ -1400,6 +1435,11 @@ void LIR_OprDesc::print(outputStream* out) const {
out->print("fpu%d", fpu_regnr());
} else if (is_double_fpu()) {
out->print("fpu%d", fpu_regnrLo());
#elif defined(ARM)
} else if (is_single_fpu()) {
out->print("s%d", fpu_regnr());
} else if (is_double_fpu()) {
out->print("d%d", fpu_regnrLo() >> 1);
#else
} else if (is_single_fpu()) {
out->print(as_float_reg()->name());
@ -1756,6 +1796,12 @@ void LIR_OpConvert::print_instr(outputStream* out) const {
print_bytecode(out, bytecode());
in_opr()->print(out); out->print(" ");
result_opr()->print(out); out->print(" ");
#ifdef PPC
if(tmp1()->is_valid()) {
tmp1()->print(out); out->print(" ");
tmp2()->print(out); out->print(" ");
}
#endif
}
void LIR_OpConvert::print_bytecode(outputStream* out, Bytecodes::Code code) {

View File

@ -432,8 +432,7 @@ class LIR_OprDesc: public CompilationResourceObj {
// for compatibility with RInfo
int fpu () const { return lo_reg_half(); }
#endif // X86
#ifdef SPARC
#if defined(SPARC) || defined(ARM) || defined(PPC)
FloatRegister as_float_reg () const;
FloatRegister as_double_reg () const;
#endif
@ -519,14 +518,14 @@ class LIR_Address: public LIR_OprPtr {
, _type(type)
, _disp(0) { verify(); }
#ifdef X86
#if defined(X86) || defined(ARM)
LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
_base(base)
, _index(index)
, _scale(scale)
, _type(type)
, _disp(disp) { verify(); }
#endif // X86
#endif // X86 || ARM
LIR_Opr base() const { return _base; }
LIR_Opr index() const { return _index; }
@ -566,7 +565,11 @@ class LIR_OprFact: public AllStatic {
LIR_OprDesc::float_type |
LIR_OprDesc::fpu_register |
LIR_OprDesc::single_size); }
#if defined(ARM)
static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::fpu_register | LIR_OprDesc::double_size); }
static LIR_Opr single_softfp(int reg) { return (LIR_Opr)((reg << LIR_OprDesc::reg1_shift) | LIR_OprDesc::float_type | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); }
static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::cpu_register | LIR_OprDesc::double_size); }
#endif
#ifdef SPARC
static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
(reg2 << LIR_OprDesc::reg2_shift) |
@ -593,7 +596,22 @@ class LIR_OprFact: public AllStatic {
LIR_OprDesc::double_size |
LIR_OprDesc::is_xmm_mask); }
#endif // X86
#ifdef PPC
static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) |
(reg << LIR_OprDesc::reg2_shift) |
LIR_OprDesc::double_type |
LIR_OprDesc::fpu_register |
LIR_OprDesc::double_size); }
static LIR_Opr single_softfp(int reg) { return (LIR_Opr)((reg << LIR_OprDesc::reg1_shift) |
LIR_OprDesc::float_type |
LIR_OprDesc::cpu_register |
LIR_OprDesc::single_size); }
static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg2 << LIR_OprDesc::reg1_shift) |
(reg1 << LIR_OprDesc::reg2_shift) |
LIR_OprDesc::double_type |
LIR_OprDesc::cpu_register |
LIR_OprDesc::double_size); }
#endif // PPC
static LIR_Opr virtual_register(int index, BasicType type) {
LIR_Opr res;
@ -623,6 +641,22 @@ class LIR_OprFact: public AllStatic {
LIR_OprDesc::virtual_mask);
break;
#ifdef __SOFTFP__
case T_FLOAT:
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
LIR_OprDesc::float_type |
LIR_OprDesc::cpu_register |
LIR_OprDesc::single_size |
LIR_OprDesc::virtual_mask);
break;
case T_DOUBLE:
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
LIR_OprDesc::double_type |
LIR_OprDesc::cpu_register |
LIR_OprDesc::double_size |
LIR_OprDesc::virtual_mask);
break;
#else // __SOFTFP__
case T_FLOAT:
res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
LIR_OprDesc::float_type |
@ -638,7 +672,7 @@ class LIR_OprFact: public AllStatic {
LIR_OprDesc::double_size |
LIR_OprDesc::virtual_mask);
break;
#endif // __SOFTFP__
default: ShouldNotReachHere(); res = illegalOpr;
}
@ -650,11 +684,18 @@ class LIR_OprFact: public AllStatic {
// old-style calculation; check if old and new method are equal
LIR_OprDesc::OprType t = as_OprType(type);
#ifdef __SOFTFP__
LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
t |
LIR_OprDesc::cpu_register |
LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask);
#else // __SOFTFP__
LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | t |
((type == T_FLOAT || type == T_DOUBLE) ? LIR_OprDesc::fpu_register : LIR_OprDesc::cpu_register) |
LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask);
assert(res == old_res, "old and new method not equal");
#endif
#endif // __SOFTFP__
#endif // ASSERT
return res;
}
@ -1306,15 +1347,37 @@ class LIR_OpConvert: public LIR_Op1 {
private:
Bytecodes::Code _bytecode;
ConversionStub* _stub;
#ifdef PPC
LIR_Opr _tmp1;
LIR_Opr _tmp2;
#endif
public:
LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub)
: LIR_Op1(lir_convert, opr, result)
, _stub(stub)
#ifdef PPC
, _tmp1(LIR_OprDesc::illegalOpr())
, _tmp2(LIR_OprDesc::illegalOpr())
#endif
, _bytecode(code) {}
#ifdef PPC
LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
,LIR_Opr tmp1, LIR_Opr tmp2)
: LIR_Op1(lir_convert, opr, result)
, _stub(stub)
, _tmp1(tmp1)
, _tmp2(tmp2)
, _bytecode(code) {}
#endif
Bytecodes::Code bytecode() const { return _bytecode; }
ConversionStub* stub() const { return _stub; }
#ifdef PPC
LIR_Opr tmp1() const { return _tmp1; }
LIR_Opr tmp2() const { return _tmp2; }
#endif
virtual void emit_code(LIR_Assembler* masm);
virtual LIR_OpConvert* as_OpConvert() { return this; }
@ -1502,6 +1565,9 @@ class LIR_Op2: public LIR_Op {
LIR_Condition condition() const {
assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); return _condition;
}
void set_condition(LIR_Condition condition) {
assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); _condition = condition;
}
void set_fpu_stack_size(int size) { _fpu_stack_size = size; }
int fpu_stack_size() const { return _fpu_stack_size; }
@ -1650,8 +1716,9 @@ class LIR_OpCompareAndSwap : public LIR_Op {
LIR_Opr _tmp2;
public:
LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2)
: LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info
LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result)
: LIR_Op(code, result, NULL) // no result, no info
, _addr(addr)
, _cmp_value(cmp_value)
, _new_value(new_value)
@ -1832,6 +1899,9 @@ class LIR_List: public CompilationResourceObj {
void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); }
#ifdef PPC
void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
#endif
void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); }
void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); }
@ -1867,9 +1937,12 @@ class LIR_List: public CompilationResourceObj {
append(new LIR_Op2(lir_cmove, condition, src1, src2, dst));
}
void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); }
void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); }
@ -1950,7 +2023,7 @@ class LIR_List: public CompilationResourceObj {
}
void load_stack_address_monitor(int monitor_ix, LIR_Opr dst) { append(new LIR_Op1(lir_monaddr, LIR_OprFact::intConst(monitor_ix), dst)); }
void unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, CodeStub* stub);
void unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub);
void lock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub, CodeEmitInfo* info);
void set_24bit_fpu() { append(new LIR_Op0(lir_24bit_FPU )); }

View File

@ -438,6 +438,12 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
default: ShouldNotReachHere();
}
// JSR 292
// Record if this method has MethodHandle invokes.
if (op->is_method_handle_invoke()) {
compilation()->set_has_method_handle_invokes(true);
}
#if defined(X86) && defined(TIERED)
// C2 leave fpu stack dirty clean it
if (UseSSE < 2) {

View File

@ -31,6 +31,12 @@
#define __ gen()->lir()->
#endif
// TODO: ARM - Use some recognizable constant which still fits architectural constraints
#ifdef ARM
#define PATCHED_ADDR (204)
#else
#define PATCHED_ADDR (max_jint)
#endif
void PhiResolverState::reset(int max_vregs) {
// Initialize array sizes
@ -225,13 +231,13 @@ void LIRItem::load_for_store(BasicType type) {
void LIRItem::load_item_force(LIR_Opr reg) {
LIR_Opr r = result();
if (r != reg) {
#if !defined(ARM) && !defined(E500V2)
if (r->type() != reg->type()) {
// moves between different types need an intervening spill slot
LIR_Opr tmp = _gen->force_to_spill(r, reg->type());
__ move(tmp, reg);
} else {
__ move(r, reg);
r = _gen->force_to_spill(r, reg->type());
}
#endif
__ move(r, reg);
_result = reg;
}
}
@ -628,14 +634,14 @@ void LIRGenerator::monitor_enter(LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_
}
void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, int monitor_no) {
void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, LIR_Opr scratch, int monitor_no) {
if (!GenerateSynchronizationCode) return;
// setup registers
LIR_Opr hdr = lock;
lock = new_hdr;
CodeStub* slow_path = new MonitorExitStub(lock, UseFastLocking, monitor_no);
__ load_stack_address_monitor(monitor_no, lock);
__ unlock_object(hdr, object, lock, slow_path);
__ unlock_object(hdr, object, lock, scratch, slow_path);
}
@ -1400,6 +1406,25 @@ void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc*
}
assert(addr->is_register(), "must be a register at this point");
#ifdef ARM
// TODO: ARM - move to platform-dependent code
LIR_Opr tmp = FrameMap::R14_opr;
if (VM_Version::supports_movw()) {
__ move((LIR_Opr)card_table_base, tmp);
} else {
__ move(new LIR_Address(FrameMap::Rthread_opr, in_bytes(JavaThread::card_table_base_offset()), T_ADDRESS), tmp);
}
CardTableModRefBS* ct = (CardTableModRefBS*)_bs;
LIR_Address *card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTableModRefBS::card_shift, 0, T_BYTE);
if(((int)ct->byte_map_base & 0xff) == 0) {
__ move(tmp, card_addr);
} else {
LIR_Opr tmp_zero = new_register(T_INT);
__ move(LIR_OprFact::intConst(0), tmp_zero);
__ move(tmp_zero, card_addr);
}
#else // ARM
LIR_Opr tmp = new_pointer_register();
if (TwoOperandLIRForm) {
__ move(addr, tmp);
@ -1415,6 +1440,7 @@ void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc*
new LIR_Address(tmp, load_constant(card_table_base),
T_BYTE));
}
#endif // ARM
}
@ -1507,7 +1533,7 @@ void LIRGenerator::do_StoreField(StoreField* x) {
// generate_address to try to be smart about emitting the -1.
// Otherwise the patching code won't know how to find the
// instruction to patch.
address = new LIR_Address(object.result(), max_jint, field_type);
address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
} else {
address = generate_address(object.result(), x->offset(), field_type);
}
@ -1584,7 +1610,7 @@ void LIRGenerator::do_LoadField(LoadField* x) {
// generate_address to try to be smart about emitting the -1.
// Otherwise the patching code won't know how to find the
// instruction to patch.
address = new LIR_Address(object.result(), max_jint, field_type);
address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
} else {
address = generate_address(object.result(), x->offset(), field_type);
}
@ -1844,6 +1870,8 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) {
}
#endif
addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type);
#elif defined(ARM)
addr = generate_address(base_op, index_op, log2_scale, 0, dst_type);
#else
if (index_op->is_illegal() || log2_scale == 0) {
#ifdef _LP64
@ -1916,6 +1944,7 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
__ convert(Bytecodes::_i2l, idx.result(), index_op);
} else {
#endif
// TODO: ARM also allows embedded shift in the address
__ move(idx.result(), index_op);
#ifdef _LP64
}
@ -2204,7 +2233,10 @@ void LIRGenerator::do_Base(Base* x) {
// Assign new location to Local instruction for this local
Local* local = x->state()->local_at(java_index)->as_Local();
assert(local != NULL, "Locals for incoming arguments must have been created");
#ifndef __SOFTFP__
// The java calling convention passes double as long and float as int.
assert(as_ValueType(t)->tag() == local->type()->tag(), "check");
#endif // __SOFTFP__
local->set_operand(dest);
_instruction_for_operand.at_put_grow(dest->vreg_number(), local, NULL);
java_index += type2size[t];

View File

@ -314,7 +314,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
void logic_op (Bytecodes::Code code, LIR_Opr dst_reg, LIR_Opr left, LIR_Opr right);
void monitor_enter (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_Opr scratch, int monitor_no, CodeEmitInfo* info_for_exception, CodeEmitInfo* info);
void monitor_exit (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, int monitor_no);
void monitor_exit (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_Opr scratch, int monitor_no);
void new_instance (LIR_Opr dst, ciInstanceKlass* klass, LIR_Opr scratch1, LIR_Opr scratch2, LIR_Opr scratch3, LIR_Opr scratch4, LIR_Opr klass_reg, CodeEmitInfo* info);
@ -338,6 +338,9 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
}
LIR_Address* emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, BasicType type, bool needs_card_mark);
// the helper for generate_address
void add_large_constant(LIR_Opr src, int c, LIR_Opr dest);
// machine preferences and characteristics
bool can_inline_as_constant(Value i) const;
bool can_inline_as_constant(LIR_Const* c) const;
@ -393,6 +396,10 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
return l;
}
#ifdef __SOFTFP__
void do_soft_float_compare(If *x);
#endif // __SOFTFP__
void init();
SwitchRangeArray* create_lookup_ranges(TableSwitch* x);
@ -444,6 +451,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
static LIR_Opr remOutOpr();
static LIR_Opr shiftCountOpr();
LIR_Opr syncTempOpr();
LIR_Opr atomicLockOpr();
// returns a register suitable for saving the thread in a
// call_runtime_leaf if one is needed.

View File

@ -169,7 +169,11 @@ bool LinearScan::is_precolored_cpu_interval(const Interval* i) {
}
bool LinearScan::is_virtual_cpu_interval(const Interval* i) {
#if defined(__SOFTFP__) || defined(E500V2)
return i->reg_num() >= LIR_OprDesc::vreg_base;
#else
return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() != T_FLOAT && i->type() != T_DOUBLE);
#endif // __SOFTFP__ or E500V2
}
bool LinearScan::is_precolored_fpu_interval(const Interval* i) {
@ -177,7 +181,11 @@ bool LinearScan::is_precolored_fpu_interval(const Interval* i) {
}
bool LinearScan::is_virtual_fpu_interval(const Interval* i) {
#if defined(__SOFTFP__) || defined(E500V2)
return false;
#else
return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() == T_FLOAT || i->type() == T_DOUBLE);
#endif // __SOFTFP__ or E500V2
}
bool LinearScan::is_in_fpu_register(const Interval* i) {
@ -2010,12 +2018,18 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
return LIR_OprFact::single_cpu_oop(assigned_reg);
}
#ifdef __SOFTFP__
case T_FLOAT: // fall through
#endif // __SOFTFP__
case T_INT: {
assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register");
assert(interval->assigned_regHi() == any_reg, "must not have hi register");
return LIR_OprFact::single_cpu(assigned_reg);
}
#ifdef __SOFTFP__
case T_DOUBLE: // fall through
#endif // __SOFTFP__
case T_LONG: {
int assigned_regHi = interval->assigned_regHi();
assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register");
@ -2033,7 +2047,7 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
#ifdef _LP64
return LIR_OprFact::double_cpu(assigned_reg, assigned_reg);
#else
#ifdef SPARC
#if defined(SPARC) || defined(PPC)
return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg);
#else
return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi);
@ -2041,6 +2055,7 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
#endif // LP64
}
#ifndef __SOFTFP__
case T_FLOAT: {
#ifdef X86
if (UseSSE >= 1) {
@ -2069,6 +2084,11 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
LIR_Opr result = LIR_OprFact::double_fpu(interval->assigned_regHi() - pd_first_fpu_reg, assigned_reg - pd_first_fpu_reg);
#elif defined(ARM)
assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
LIR_Opr result = LIR_OprFact::double_fpu(assigned_reg - pd_first_fpu_reg, interval->assigned_regHi() - pd_first_fpu_reg);
#else
assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
assert(interval->assigned_regHi() == any_reg, "must not have hi register (double fpu values are stored in one register on Intel)");
@ -2076,6 +2096,7 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
#endif
return result;
}
#endif // __SOFTFP__
default: {
ShouldNotReachHere();
@ -2638,6 +2659,12 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArray<ScopeV
#ifdef SPARC
assert(opr->fpu_regnrLo() == opr->fpu_regnrHi() + 1, "assumed in calculation (only fpu_regnrHi is used)");
#endif
#ifdef ARM
assert(opr->fpu_regnrHi() == opr->fpu_regnrLo() + 1, "assumed in calculation (only fpu_regnrLo is used)");
#endif
#ifdef PPC
assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrHi is used)");
#endif
VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrHi());
#ifdef _LP64
@ -6135,6 +6162,17 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) {
assert(prev_op->as_OpBranch() != NULL, "branch must be of type LIR_OpBranch");
LIR_OpBranch* prev_branch = (LIR_OpBranch*)prev_op;
LIR_Op2* prev_cmp = NULL;
for(int j = instructions->length() - 3; j >= 0 && prev_cmp == NULL; j--) {
prev_op = instructions->at(j);
if(prev_op->code() == lir_cmp) {
assert(prev_op->as_Op2() != NULL, "branch must be of type LIR_Op2");
prev_cmp = (LIR_Op2*)prev_op;
assert(prev_branch->cond() == prev_cmp->condition(), "should be the same");
}
}
assert(prev_cmp != NULL, "should have found comp instruction for branch");
if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) {
TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id()));
@ -6142,6 +6180,7 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) {
// eliminate a conditional branch to the immediate successor
prev_branch->change_block(last_branch->block());
prev_branch->negate_cond();
prev_cmp->set_condition(prev_branch->cond());
instructions->truncate(instructions->length() - 1);
}
}

View File

@ -144,7 +144,7 @@ void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) {
#ifndef TIERED
case counter_overflow_id: // Not generated outside the tiered world
#endif
#ifdef SPARC
#if defined(SPARC) || defined(PPC)
case handle_exception_nofpu_id: // Unused on sparc
#endif
break;
@ -240,7 +240,8 @@ const char* Runtime1::name_for_address(address entry) {
#undef FUNCTION_CASE
return "<unknown function>";
// Soft float adds more runtime names.
return pd_name_for_address(entry);
}
@ -896,7 +897,10 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
} else {
// patch the instruction <move reg, klass>
NativeMovConstReg* n_copy = nativeMovConstReg_at(copy_buff);
assert(n_copy->data() == 0, "illegal init value");
assert(n_copy->data() == 0 ||
n_copy->data() == (int)Universe::non_oop_word(),
"illegal init value");
assert(load_klass() != NULL, "klass not set");
n_copy->set_data((intx) (load_klass()));
@ -904,7 +908,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
Disassembler::decode(copy_buff, copy_buff + *byte_count, tty);
}
#ifdef SPARC
#if defined(SPARC) || defined(PPC)
// Update the oop location in the nmethod with the proper
// oop. When the code was generated, a NULL was stuffed
// in the oop table and that table needs to be update to
@ -934,6 +938,14 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
if (do_patch) {
// replace instructions
// first replace the tail, then the call
#ifdef ARM
if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) {
copy_buff -= *byte_count;
NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff);
n_copy2->set_data((intx) (load_klass()), instr_pc);
}
#endif
for (int i = NativeCall::instruction_size; i < *byte_count; i++) {
address ptr = copy_buff + i;
int a_byte = (*ptr) & 0xFF;
@ -960,6 +972,12 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
RelocIterator iter2(nm, instr_pc2, instr_pc2 + 1);
relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2,
relocInfo::none, relocInfo::oop_type);
#endif
#ifdef PPC
{ address instr_pc2 = instr_pc + NativeMovConstReg::lo_offset;
RelocIterator iter2(nm, instr_pc2, instr_pc2 + 1);
relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2, relocInfo::none, relocInfo::oop_type);
}
#endif
}

View File

@ -159,6 +159,9 @@ class Runtime1: public AllStatic {
static const char* name_for (StubID id);
static const char* name_for_address(address entry);
// platform might add runtime names.
static const char* pd_name_for_address(address entry);
// method tracing
static void trace_block_entry(jint block_id);

View File

@ -728,8 +728,8 @@ ciMethod* ciEnv::get_fake_invokedynamic_method_impl(constantPoolHandle cpool,
}
// Get the invoker methodOop from the constant pool.
intptr_t f2_value = cpool->cache()->main_entry_at(index)->f2();
methodOop signature_invoker = methodOop(f2_value);
oop f1_value = cpool->cache()->main_entry_at(index)->f1();
methodOop signature_invoker = methodOop(f1_value);
assert(signature_invoker != NULL && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(),
"correct result from LinkResolver::resolve_invokedynamic");

View File

@ -339,7 +339,7 @@ void ciField::print() {
if (_type != NULL) _type->print_name();
else tty->print("(reference)");
tty->print(" is_constant=%s", bool_to_str(_is_constant));
if (_is_constant) {
if (_is_constant && is_static()) {
tty->print(" constant_value=");
_constant_value.print();
}

View File

@ -403,8 +403,9 @@ GrowableArray<ciField*>* ciInstanceKlass::non_static_fields() {
instanceKlass* ik = get_instanceKlass();
int max_n_fields = ik->fields()->length()/instanceKlass::next_offset;
Arena* arena = curEnv->arena();
_non_static_fields =
new (curEnv->arena()) GrowableArray<ciField*>(max_n_fields);
new (arena) GrowableArray<ciField*>(arena, max_n_fields, 0, NULL);
NonStaticFieldFiller filler(curEnv, _non_static_fields);
ik->do_nonstatic_fields(&filler);
}

View File

@ -55,10 +55,10 @@ ciMethod::ciMethod(methodHandle h_m) : ciObject(h_m) {
_exception_handlers = NULL;
_liveness = NULL;
_method_blocks = NULL;
#ifdef COMPILER2
#if defined(COMPILER2) || defined(SHARK)
_flow = NULL;
_bcea = NULL;
#endif // COMPILER2
#endif // COMPILER2 || SHARK
ciEnv *env = CURRENT_ENV;
if (env->jvmti_can_hotswap_or_post_breakpoint() && _is_compilable) {
@ -123,10 +123,10 @@ ciMethod::ciMethod(ciInstanceKlass* holder,
_can_be_statically_bound = false;
_method_blocks = NULL;
_method_data = NULL;
#ifdef COMPILER2
#if defined(COMPILER2) || defined(SHARK)
_flow = NULL;
_bcea = NULL;
#endif // COMPILER2
#endif // COMPILER2 || SHARK
}
@ -229,6 +229,20 @@ int ciMethod::vtable_index() {
}
#ifdef SHARK
// ------------------------------------------------------------------
// ciMethod::itable_index
//
// Get the position of this method's entry in the itable, if any.
int ciMethod::itable_index() {
check_is_loaded();
assert(holder()->is_linked(), "must be linked");
VM_ENTRY_MARK;
return klassItable::compute_itable_index(get_methodOop());
}
#endif // SHARK
// ------------------------------------------------------------------
// ciMethod::native_entry
//
@ -294,34 +308,34 @@ bool ciMethod::has_balanced_monitors() {
// ------------------------------------------------------------------
// ciMethod::get_flow_analysis
ciTypeFlow* ciMethod::get_flow_analysis() {
#ifdef COMPILER2
#if defined(COMPILER2) || defined(SHARK)
if (_flow == NULL) {
ciEnv* env = CURRENT_ENV;
_flow = new (env->arena()) ciTypeFlow(env, this);
_flow->do_flow();
}
return _flow;
#else // COMPILER2
#else // COMPILER2 || SHARK
ShouldNotReachHere();
return NULL;
#endif // COMPILER2
#endif // COMPILER2 || SHARK
}
// ------------------------------------------------------------------
// ciMethod::get_osr_flow_analysis
ciTypeFlow* ciMethod::get_osr_flow_analysis(int osr_bci) {
#ifdef COMPILER2
#if defined(COMPILER2) || defined(SHARK)
// OSR entry points are always place after a call bytecode of some sort
assert(osr_bci >= 0, "must supply valid OSR entry point");
ciEnv* env = CURRENT_ENV;
ciTypeFlow* flow = new (env->arena()) ciTypeFlow(env, this, osr_bci);
flow->do_flow();
return flow;
#else // COMPILER2
#else // COMPILER2 || SHARK
ShouldNotReachHere();
return NULL;
#endif // COMPILER2
#endif // COMPILER2 || SHARK
}
// ------------------------------------------------------------------
@ -694,30 +708,21 @@ int ciMethod::scale_count(int count, float prof_factor) {
// ------------------------------------------------------------------
// ciMethod::is_method_handle_invoke
//
// Return true if the method is a MethodHandle target.
// Return true if the method is an instance of one of the two
// signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric.
bool ciMethod::is_method_handle_invoke() const {
bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
methodOopDesc::is_method_handle_invoke_name(name()->sid()));
#ifdef ASSERT
if (is_loaded()) {
bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
{
VM_ENTRY_MARK;
bool flag3 = get_methodOop()->is_method_handle_invoke();
assert(flag2 == flag3, "consistent");
assert(flag == flag3, "consistent");
}
}
#endif //ASSERT
return flag;
if (!is_loaded()) return false;
VM_ENTRY_MARK;
return get_methodOop()->is_method_handle_invoke();
}
// ------------------------------------------------------------------
// ciMethod::is_method_handle_adapter
//
// Return true if the method is a generated MethodHandle adapter.
// These are built by MethodHandleCompiler.
bool ciMethod::is_method_handle_adapter() const {
check_is_loaded();
if (!is_loaded()) return false;
VM_ENTRY_MARK;
return get_methodOop()->is_method_handle_adapter();
}

View File

@ -70,7 +70,7 @@ class ciMethod : public ciObject {
// Optional liveness analyzer.
MethodLiveness* _liveness;
#ifdef COMPILER2
#if defined(COMPILER2) || defined(SHARK)
ciTypeFlow* _flow;
BCEscapeAnalyzer* _bcea;
#endif
@ -141,6 +141,9 @@ class ciMethod : public ciObject {
// Runtime information.
int vtable_index();
#ifdef SHARK
int itable_index();
#endif // SHARK
address native_entry();
address interpreter_entry();

View File

@ -252,7 +252,7 @@ ciMethodBlocks::ciMethodBlocks(Arena *arena, ciMethod *meth): _method(meth),
_arena(arena), _num_blocks(0), _code_size(meth->code_size()) {
int block_estimate = _code_size / 8;
_blocks = new(_arena) GrowableArray<ciBlock *>(block_estimate);
_blocks = new(_arena) GrowableArray<ciBlock *>(_arena, block_estimate, 0, NULL);
int b2bsize = _code_size * sizeof(ciBlock **);
_bci_to_block = (ciBlock **) arena->Amalloc(b2bsize);
Copy::zero_to_words((HeapWord*) _bci_to_block, b2bsize / sizeof(HeapWord));

View File

@ -2591,7 +2591,7 @@ void ciTypeFlow::df_flow_types(Block* start,
StateVector* temp_vector,
JsrSet* temp_set) {
int dft_len = 100;
GrowableArray<Block*> stk(arena(), dft_len, 0, NULL);
GrowableArray<Block*> stk(dft_len);
ciBlock* dummy = _methodBlocks->make_dummy_block();
JsrSet* root_set = new JsrSet(NULL, 0);

View File

@ -62,6 +62,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
ClassFileStream cfs1 = *cfs0;
ClassFileStream* cfs = &cfs1;
#ifdef ASSERT
assert(cfs->allocated_on_stack(),"should be local");
u1* old_current = cfs0->current();
#endif
@ -122,7 +123,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
if (!EnableMethodHandles ||
_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
classfile_parse_error(
(!EnableInvokeDynamic ?
(!EnableMethodHandles ?
"This JVM does not support constant tag %u in class file %s" :
"Class file version does not support constant tag %u in class file %s"),
tag, CHECK);
@ -140,6 +141,22 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
ShouldNotReachHere();
}
break;
case JVM_CONSTANT_InvokeDynamic :
{
if (!EnableInvokeDynamic ||
_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
classfile_parse_error(
(!EnableInvokeDynamic ?
"This JVM does not support constant tag %u in class file %s" :
"Class file version does not support constant tag %u in class file %s"),
tag, CHECK);
}
cfs->guarantee_more(5, CHECK); // bsm_index, name_and_type_index, tag/access_flags
u2 bootstrap_method_index = cfs->get_u2_fast();
u2 name_and_type_index = cfs->get_u2_fast();
cp->invoke_dynamic_at_put(index, bootstrap_method_index, name_and_type_index);
}
break;
case JVM_CONSTANT_Integer :
{
cfs->guarantee_more(5, CHECK); // bytes, tag/access_flags
@ -414,6 +431,24 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
ref_index, CHECK_(nullHandle));
}
break;
case JVM_CONSTANT_InvokeDynamic :
{
int bootstrap_method_ref_index = cp->invoke_dynamic_bootstrap_method_ref_index_at(index);
int name_and_type_ref_index = cp->invoke_dynamic_name_and_type_ref_index_at(index);
check_property((bootstrap_method_ref_index == 0 && AllowTransitionalJSR292)
||
(valid_cp_range(bootstrap_method_ref_index, length) &&
cp->tag_at(bootstrap_method_ref_index).is_method_handle()),
"Invalid constant pool index %u in class file %s",
bootstrap_method_ref_index,
CHECK_(nullHandle));
check_property(valid_cp_range(name_and_type_ref_index, length) &&
cp->tag_at(name_and_type_ref_index).is_name_and_type(),
"Invalid constant pool index %u in class file %s",
name_and_type_ref_index,
CHECK_(nullHandle));
break;
}
default:
fatal(err_msg("bad constant pool tag value %u",
cp->tag_at(index).value()));

View File

@ -2507,6 +2507,10 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
int caller_bci,
TRAPS) {
Handle empty;
guarantee(bootstrap_method.not_null() &&
java_dyn_MethodHandle::is_instance(bootstrap_method()),
"caller must supply a valid BSM");
Handle caller_mname = MethodHandles::new_MemberName(CHECK_(empty));
MethodHandles::init_MemberName(caller_mname(), caller_method());
@ -2537,20 +2541,61 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
return call_site_oop;
}
Handle SystemDictionary::find_bootstrap_method(KlassHandle caller, TRAPS) {
Handle SystemDictionary::find_bootstrap_method(methodHandle caller_method, int caller_bci,
int cache_index, TRAPS) {
Handle empty;
if (!caller->oop_is_instance()) return empty;
instanceKlassHandle ik(THREAD, caller());
constantPoolHandle pool;
{
klassOop caller = caller_method->method_holder();
if (!Klass::cast(caller)->oop_is_instance()) return empty;
pool = constantPoolHandle(THREAD, instanceKlass::cast(caller)->constants());
}
oop boot_method_oop = ik->bootstrap_method();
if (boot_method_oop != NULL) {
if (TraceMethodHandles) {
tty->print_cr("bootstrap method for "PTR_FORMAT" cached as "PTR_FORMAT":", ik(), boot_method_oop);
int constant_pool_index = pool->cache()->entry_at(cache_index)->constant_pool_index();
constantTag tag = pool->tag_at(constant_pool_index);
if (tag.is_invoke_dynamic()) {
// JVM_CONSTANT_InvokeDynamic is an ordered pair of [bootm, name&type]
// The bootm, being a JVM_CONSTANT_MethodHandle, has its own cache entry.
int bsm_index = pool->invoke_dynamic_bootstrap_method_ref_index_at(constant_pool_index);
if (bsm_index != 0) {
int bsm_index_in_cache = pool->cache()->entry_at(cache_index)->bootstrap_method_index_in_cache();
DEBUG_ONLY(int bsm_index_2 = pool->cache()->entry_at(bsm_index_in_cache)->constant_pool_index());
assert(bsm_index == bsm_index_2, "BSM constant lifted to cache");
if (TraceMethodHandles) {
tty->print_cr("resolving bootstrap method for "PTR_FORMAT" at %d at cache[%d]CP[%d]...",
(intptr_t) caller_method(), caller_bci, cache_index, constant_pool_index);
}
oop bsm_oop = pool->resolve_cached_constant_at(bsm_index_in_cache, CHECK_(empty));
if (TraceMethodHandles) {
tty->print_cr("bootstrap method for "PTR_FORMAT" at %d retrieved as "PTR_FORMAT":",
(intptr_t) caller_method(), caller_bci, (intptr_t) bsm_oop);
}
assert(bsm_oop->is_oop()
&& java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane");
return Handle(THREAD, bsm_oop);
}
assert(boot_method_oop->is_oop()
&& java_dyn_MethodHandle::is_instance(boot_method_oop), "must be sane");
return Handle(THREAD, boot_method_oop);
// else null BSM; fall through
} else if (tag.is_name_and_type()) {
// JSR 292 EDR does not have JVM_CONSTANT_InvokeDynamic
// a bare name&type defaults its BSM to null, so fall through...
} else {
ShouldNotReachHere(); // verifier does not allow this
}
// Fall through to pick up the per-class bootstrap method.
// This mechanism may go away in the PFD.
assert(AllowTransitionalJSR292, "else the verifier should have stopped us already");
oop bsm_oop = instanceKlass::cast(caller_method->method_holder())->bootstrap_method();
if (bsm_oop != NULL) {
if (TraceMethodHandles) {
tty->print_cr("bootstrap method for "PTR_FORMAT" registered as "PTR_FORMAT":",
(intptr_t) caller_method(), (intptr_t) bsm_oop);
}
assert(bsm_oop->is_oop()
&& java_dyn_MethodHandle::is_instance(bsm_oop), "must be sane");
return Handle(THREAD, bsm_oop);
}
return empty;

View File

@ -492,7 +492,10 @@ public:
TRAPS);
// coordinate with Java about bootstrap methods
static Handle find_bootstrap_method(KlassHandle caller, TRAPS);
static Handle find_bootstrap_method(methodHandle caller_method,
int caller_bci, // N.B. must be an invokedynamic
int cache_index, // must be corresponding main_entry
TRAPS);
// Utility for printing loader "name" as part of tracing constraints
static const char* loader_name(oop loader) {

View File

@ -70,7 +70,9 @@ bool VerificationType::is_reference_assignable_from(
} else if (is_array() && from.is_array()) {
VerificationType comp_this = get_component(CHECK_false);
VerificationType comp_from = from.get_component(CHECK_false);
return comp_this.is_assignable_from(comp_from, context, CHECK_false);
if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
return comp_this.is_assignable_from(comp_from, context, CHECK_false);
}
}
return false;
}
@ -98,7 +100,7 @@ VerificationType VerificationType::get_component(TRAPS) const {
CHECK_(VerificationType::bogus_type()));
return VerificationType::reference_type(component);
default:
ShouldNotReachHere();
// Met an invalid type signature, e.g. [X
return VerificationType::bogus_type();
}
}

View File

@ -1847,12 +1847,8 @@ void ClassVerifier::verify_invoke_init(
if (type == VerificationType::uninitialized_this_type()) {
// The method must be an <init> method of either this class, or one of its
// superclasses
klassOop oop = current_class()();
Klass* klass = oop->klass_part();
while (klass != NULL && ref_class_type.name() != klass->name()) {
klass = klass->super()->klass_part();
}
if (klass == NULL) {
if (ref_class_type.name() != current_class()->name() &&
!name_in_supers(ref_class_type.name(), current_class())) {
verify_error(bci, "Bad <init> method call");
return;
}
@ -1913,7 +1909,8 @@ void ClassVerifier::verify_invoke_instructions(
unsigned int types = (opcode == Bytecodes::_invokeinterface
? 1 << JVM_CONSTANT_InterfaceMethodref
: opcode == Bytecodes::_invokedynamic
? 1 << JVM_CONSTANT_NameAndType
? (1 << JVM_CONSTANT_NameAndType
|1 << JVM_CONSTANT_InvokeDynamic)
: 1 << JVM_CONSTANT_Methodref);
verify_cp_type(index, cp, types, CHECK_VERIFY(this));

View File

@ -202,6 +202,11 @@ void BufferBlob::free( BufferBlob *blob ) {
//----------------------------------------------------------------------------------------------------
// Implementation of AdapterBlob
AdapterBlob::AdapterBlob(int size, CodeBuffer* cb) :
BufferBlob("I2C/C2I adapters", size, cb) {
CodeCache::commit(this);
}
AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
@ -210,7 +215,6 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) AdapterBlob(size, cb);
CodeCache::commit(blob);
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();
@ -560,72 +564,53 @@ void CodeBlob::verify() {
ShouldNotReachHere();
}
#ifndef PRODUCT
void CodeBlob::print() const {
tty->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
tty->print_cr("Framesize: %d", _frame_size);
void CodeBlob::print_on(outputStream* st) const {
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
st->print_cr("Framesize: %d", _frame_size);
}
void CodeBlob::print_value_on(outputStream* st) const {
st->print_cr("[CodeBlob]");
}
#endif
void BufferBlob::verify() {
// unimplemented
}
#ifndef PRODUCT
void BufferBlob::print() const {
CodeBlob::print();
print_value_on(tty);
void BufferBlob::print_on(outputStream* st) const {
CodeBlob::print_on(st);
print_value_on(st);
}
void BufferBlob::print_value_on(outputStream* st) const {
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", this, name());
}
#endif
void RuntimeStub::verify() {
// unimplemented
}
#ifndef PRODUCT
void RuntimeStub::print() const {
CodeBlob::print();
tty->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
tty->print_cr(name());
Disassembler::decode((CodeBlob*)this);
void RuntimeStub::print_on(outputStream* st) const {
CodeBlob::print_on(st);
st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
st->print_cr(name());
Disassembler::decode((CodeBlob*)this, st);
}
void RuntimeStub::print_value_on(outputStream* st) const {
st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
}
#endif
void SingletonBlob::verify() {
// unimplemented
}
#ifndef PRODUCT
void SingletonBlob::print() const {
CodeBlob::print();
tty->print_cr(name());
Disassembler::decode((CodeBlob*)this);
void SingletonBlob::print_on(outputStream* st) const {
CodeBlob::print_on(st);
st->print_cr(name());
Disassembler::decode((CodeBlob*)this, st);
}
void SingletonBlob::print_value_on(outputStream* st) const {
st->print_cr(name());
}
@ -633,5 +618,3 @@ void SingletonBlob::print_value_on(outputStream* st) const {
void DeoptimizationBlob::print_value_on(outputStream* st) const {
st->print_cr("Deoptimization (frame not available)");
}
#endif // PRODUCT

View File

@ -163,8 +163,9 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
// Debugging
virtual void verify();
virtual void print() const PRODUCT_RETURN;
virtual void print_value_on(outputStream* st) const PRODUCT_RETURN;
void print() const { print_on(tty); }
virtual void print_on(outputStream* st) const;
virtual void print_value_on(outputStream* st) const;
// Print the comment associated with offset on stream, if there is one
virtual void print_block_comment(outputStream* stream, address block_begin) {
@ -209,8 +210,8 @@ class BufferBlob: public CodeBlob {
bool is_alive() const { return true; }
void verify();
void print() const PRODUCT_RETURN;
void print_value_on(outputStream* st) const PRODUCT_RETURN;
void print_on(outputStream* st) const;
void print_value_on(outputStream* st) const;
};
@ -219,8 +220,7 @@ class BufferBlob: public CodeBlob {
class AdapterBlob: public BufferBlob {
private:
AdapterBlob(int size) : BufferBlob("I2C/C2I adapters", size) {}
AdapterBlob(int size, CodeBuffer* cb) : BufferBlob("I2C/C2I adapters", size, cb) {}
AdapterBlob(int size, CodeBuffer* cb);
public:
// Creation
@ -293,8 +293,8 @@ class RuntimeStub: public CodeBlob {
bool is_alive() const { return true; }
void verify();
void print() const PRODUCT_RETURN;
void print_value_on(outputStream* st) const PRODUCT_RETURN;
void print_on(outputStream* st) const;
void print_value_on(outputStream* st) const;
};
@ -318,8 +318,8 @@ class SingletonBlob: public CodeBlob {
bool is_alive() const { return true; }
void verify(); // does nothing
void print() const PRODUCT_RETURN;
void print_value_on(outputStream* st) const PRODUCT_RETURN;
void print_on(outputStream* st) const;
void print_value_on(outputStream* st) const;
};
@ -374,7 +374,7 @@ class DeoptimizationBlob: public SingletonBlob {
void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
// Printing
void print_value_on(outputStream* st) const PRODUCT_RETURN;
void print_value_on(outputStream* st) const;
address unpack() const { return instructions_begin() + _unpack_offset; }
address unpack_with_exception() const { return instructions_begin() + _unpack_with_exception; }

View File

@ -65,6 +65,11 @@ bool nmethod::is_compiled_by_c2() const {
if (is_native_method()) return false;
return compiler()->is_c2();
}
bool nmethod::is_compiled_by_shark() const {
if (is_native_method()) return false;
assert(compiler() != NULL, "must be");
return compiler()->is_shark();
}
@ -1353,6 +1358,10 @@ void nmethod::flush() {
CodeCache::remove_saved_code(this);
}
#ifdef SHARK
((SharkCompiler *) compiler())->free_compiled_method(instructions_begin());
#endif // SHARK
((CodeBlob*)(this))->flush();
CodeCache::free(this);
@ -1769,6 +1778,7 @@ bool nmethod::detect_scavenge_root_oops() {
// Method that knows how to preserve outgoing arguments at call. This method must be
// called with a frame corresponding to a Java invoke
void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
#ifndef SHARK
if (!method()->is_native()) {
SimpleScopeDesc ssd(this, fr.pc());
Bytecode_invoke* call = Bytecode_invoke_at(ssd.method(), ssd.bci());
@ -1776,6 +1786,7 @@ void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map
symbolOop signature = call->signature();
fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f);
}
#endif // !SHARK
}
@ -2279,6 +2290,8 @@ void nmethod::print() const {
tty->print("(c1) ");
} else if (is_compiled_by_c2()) {
tty->print("(c2) ");
} else if (is_compiled_by_shark()) {
tty->print("(shark) ");
} else {
tty->print("(nm) ");
}
@ -2472,8 +2485,12 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) {
if (block_begin == exception_begin()) stream->print_cr("[Exception Handler]");
if (block_begin == stub_begin()) stream->print_cr("[Stub Code]");
if (block_begin == deopt_handler_begin()) stream->print_cr("[Deopt Handler Code]");
if (block_begin == deopt_mh_handler_begin()) stream->print_cr("[Deopt MH Handler Code]");
if (has_method_handle_invokes())
if (block_begin == deopt_mh_handler_begin()) stream->print_cr("[Deopt MH Handler Code]");
if (block_begin == consts_begin()) stream->print_cr("[Constants]");
if (block_begin == entry_point()) {
methodHandle m = method();
if (m.not_null()) {

View File

@ -329,6 +329,7 @@ class nmethod : public CodeBlob {
bool is_compiled_by_c1() const;
bool is_compiled_by_c2() const;
bool is_compiled_by_shark() const;
// boundaries for different parts
address code_begin () const { return _entry_point; }
@ -606,6 +607,8 @@ public:
void print_nul_chk_table() PRODUCT_RETURN;
void print_nmethod(bool print_code);
// need to re-define this from CodeBlob else the overload hides it
virtual void print_on(outputStream* st) const { CodeBlob::print_on(st); }
void print_on(outputStream* st, const char* title) const;
// Logging

View File

@ -67,8 +67,8 @@ void* VtableStub::operator new(size_t size, int code_size) {
}
void VtableStub::print() {
tty->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
void VtableStub::print_on(outputStream* st) const {
st->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
index(), receiver_location(), code_begin(), code_end());
}

View File

@ -86,7 +86,9 @@ class VtableStub {
bool is_abstract_method_error(address epc) { return epc == code_begin()+_ame_offset; }
bool is_null_pointer_exception(address epc) { return epc == code_begin()+_npe_offset; }
void print();
void print_on(outputStream* st) const;
void print() const { print_on(tty); }
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
* 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
@ -45,18 +45,26 @@ class AbstractCompiler : public CHeapObj {
// Missing feature tests
virtual bool supports_native() { return true; }
virtual bool supports_osr () { return true; }
#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2))
#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK))
virtual bool is_c1 () { return false; }
virtual bool is_c2 () { return false; }
virtual bool is_shark() { return false; }
#else
#ifdef COMPILER1
bool is_c1 () { return true; }
bool is_c2 () { return false; }
bool is_shark() { return false; }
#endif // COMPILER1
#ifdef COMPILER2
bool is_c1 () { return false; }
bool is_c2 () { return true; }
bool is_shark() { return false; }
#endif // COMPILER2
#ifdef SHARK
bool is_c1 () { return false; }
bool is_c2 () { return false; }
bool is_shark() { return true; }
#endif // SHARK
#endif // TIERED
// Customization

View File

@ -568,6 +568,14 @@ void CompileBroker::compilation_init() {
#endif
#endif // COMPILER2
#ifdef SHARK
#if defined(COMPILER1) || defined(COMPILER2)
#error "Can't use COMPILER1 or COMPILER2 with shark"
#endif
_compilers[0] = new SharkCompiler();
_compilers[1] = _compilers[0];
#endif
// Initialize the CompileTask free list
_task_free_list = NULL;

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