mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-12 17:03:14 +00:00
Merge
This commit is contained in:
commit
2bf8eb7e4f
2
.hgtags
2
.hgtags
@ -194,3 +194,5 @@ adb5171c554e14cd86f618b5584f6e3d693d5889 jdk8-b69
|
||||
0d625373c69e2ad6f546fd88ab50c6c9aad01271 jdk8-b70
|
||||
a41ada2ed4ef735449531c6ebe6cec593d890a1c jdk8-b71
|
||||
6725b3961f987cf40f446d1c11cd324a3bec545f jdk8-b72
|
||||
fe94b40ffd9390f6cffcdf51c0389b0e6dde0c13 jdk8-b73
|
||||
f627eff819628822a0777af8062244352f2a29cf jdk8-b74
|
||||
|
||||
@ -195,3 +195,4 @@ cdb401a60cea6ad5ef3f498725ed1decf8dda1ea jdk8-b68
|
||||
51ad2a34342055333eb5f36e2fb514b027895708 jdk8-b71
|
||||
c1be681d80a1f1c848dc671d664fccb19e046a12 jdk8-b72
|
||||
93b9664f97eeb6f89397a8842318ebacaac9feb9 jdk8-b73
|
||||
b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
|
||||
|
||||
@ -2928,6 +2928,32 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
|
||||
|
||||
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
|
||||
#
|
||||
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
@ -3698,7 +3724,7 @@ fi
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1358165331
|
||||
DATE_WHEN_GENERATED=1359376859
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
||||
@ -389,7 +389,8 @@ if test "x$with_milestone" = xyes; then
|
||||
AC_MSG_ERROR([Milestone must have a value])
|
||||
elif test "x$with_milestone" != x; then
|
||||
MILESTONE="$with_milestone"
|
||||
else
|
||||
fi
|
||||
if test "x$MILESTONE" = x; then
|
||||
MILESTONE=internal
|
||||
fi
|
||||
|
||||
|
||||
@ -136,6 +136,12 @@ fi
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
|
||||
# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
|
||||
# this doesn't make sense so we remove it.
|
||||
if test "x$COMPILE_TYPE" = xcross; then
|
||||
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
|
||||
fi
|
||||
|
||||
if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([x11])
|
||||
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
|
||||
|
||||
@ -887,6 +887,17 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
||||
./jre/bin/unpack200.exe
|
||||
"
|
||||
|
||||
# jabswitch.exe is compiled and linked with incremental turned on in the old
|
||||
# build. This makes no sense, so it's turned off in the new build.
|
||||
ACCEPTED_SIZE_DIFF="
|
||||
./bin/jabswitch.exe
|
||||
./jre/bin/jabswitch.exe
|
||||
"
|
||||
ACCEPTED_DIS_DIFF="
|
||||
./bin/jabswitch.exe
|
||||
./jre/bin/jabswitch.exe
|
||||
"
|
||||
|
||||
# On windows, there are unavoidable allignment issues making
|
||||
# a perfect disasm diff impossible. Filter out the following:
|
||||
# * Random parts of C++ symbols (this is a bit greedy, but does the trick)
|
||||
|
||||
@ -43,24 +43,20 @@ endef
|
||||
|
||||
BUILD_DIR_ROOT:=$(root_dir)/build
|
||||
|
||||
# Appears to be an open build
|
||||
OPEN_BUILD := \
|
||||
$(shell \
|
||||
if [ -d $(root_dir)/jdk/src/closed \
|
||||
-o -d $(root_dir)/jdk/make/closed \
|
||||
-o -d $(root_dir)/jdk/test/closed \
|
||||
-o -d $(root_dir)/hotspot/src/closed \
|
||||
-o -d $(root_dir)/hotspot/make/closed \
|
||||
-o -d $(root_dir)/hotspot/test/closed ] ; then \
|
||||
echo "false"; \
|
||||
else \
|
||||
echo "true"; \
|
||||
fi \
|
||||
)
|
||||
ifdef OPENJDK
|
||||
OPEN_BUILD=true
|
||||
else
|
||||
OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \
|
||||
$(wildcard $(root_dir)/jdk/make/closed), \
|
||||
$(wildcard $(root_dir)/jdk/test/closed), \
|
||||
$(wildcard $(root_dir)/hotspot/src/closed), \
|
||||
$(wildcard $(root_dir)/hotspot/make/closed), \
|
||||
$(wildcard $(root_dir)/hotspot/test/closed)), \
|
||||
false,true)
|
||||
endif
|
||||
|
||||
HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false)
|
||||
|
||||
###########################################################################
|
||||
# To help in adoption of the new configure&&make build process, a bridge
|
||||
# build will use the old settings to run configure and do the build.
|
||||
@ -103,6 +99,11 @@ endif
|
||||
ifdef ALT_FREETYPE_HEADERS_PATH
|
||||
@$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
|
||||
endif
|
||||
ifeq ($(HOTSPOT_AVAILABLE),false)
|
||||
ifdef ALT_JDK_IMPORT_PATH
|
||||
@$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp
|
||||
endif
|
||||
endif
|
||||
ifeq ($(OPEN_BUILD),true)
|
||||
@$(ECHO) " --enable-openjdk-only " >> $@.tmp
|
||||
else
|
||||
@ -128,6 +129,9 @@ else
|
||||
ifdef ALT_SLASH_JAVA
|
||||
@$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp
|
||||
endif
|
||||
ifdef ALT_SPARKLE_FRAMEWORK_DIR
|
||||
@$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp
|
||||
endif
|
||||
endif
|
||||
@if [ -f $@ ] ; then \
|
||||
if ! $(CMP) $@ $@.tmp > /dev/null ; then \
|
||||
@ -146,6 +150,9 @@ PHONY_LIST += bridge2configure bridgeBuild
|
||||
ifndef JPRT_ARCHIVE_BUNDLE
|
||||
JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
|
||||
endif
|
||||
ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
|
||||
JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
|
||||
endif
|
||||
|
||||
# These targets execute in a SPEC free context, before calling bridgeBuild
|
||||
# to generate the SPEC.
|
||||
@ -184,6 +191,9 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
else
|
||||
$(CD) $(JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2sdk-image.zip .
|
||||
$(CD) $(JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2re-image.zip .
|
||||
if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
|
||||
$(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
|
||||
fi
|
||||
endif
|
||||
@$(call TargetExit)
|
||||
|
||||
|
||||
@ -194,3 +194,5 @@ d54dc53e223ed9ce7d5f4d2cd02ad9d5def3c2db jdk8-b59
|
||||
603cceb495c8133d47b26a7502d51c7d8a67d76b jdk8-b70
|
||||
8171d23e914d758836527b80b06debcfdb718f2d jdk8-b71
|
||||
cb40427f47145b01b7e53c3e02b38ff7625efbda jdk8-b72
|
||||
191afde59e7be0e1a1d76d06f2a32ff17444f0ec jdk8-b73
|
||||
2132845cf5f717ff5c240a2431c0c0e03e66e3a5 jdk8-b74
|
||||
|
||||
@ -306,3 +306,8 @@ cb8a4e04bc8c104de8a2f67463c7e31232bf8d68 jdk8-b69
|
||||
e94068d4ff52849c8aa0786a53a59b63d1312a39 jdk8-b70
|
||||
0847210f85480bf3848dc90bc2ab23c0a4791b55 jdk8-b71
|
||||
d5cb5830f570d1304ea4b196dde672a291b55f29 jdk8-b72
|
||||
1e129851479e4f5df439109fca2c7be1f1613522 hs25-b15
|
||||
11619f33cd683c2f1d6ef72f1c6ff3dacf5a9f1c jdk8-b73
|
||||
70c89bd6b895a10d25ca70e08093c09ff2005fda hs25-b16
|
||||
1a3e54283c54aaa8b3437813e8507fbdc966e5b6 jdk8-b74
|
||||
b4391649e91ea8d37f66317a03d6d2573a93d10d hs25-b17
|
||||
|
||||
@ -52,6 +52,9 @@ public class InstanceKlass extends Klass {
|
||||
private static int LOW_OFFSET;
|
||||
private static int HIGH_OFFSET;
|
||||
private static int FIELD_SLOTS;
|
||||
private static short FIELDINFO_TAG_SIZE;
|
||||
private static short FIELDINFO_TAG_MASK;
|
||||
private static short FIELDINFO_TAG_OFFSET;
|
||||
|
||||
// ClassState constants
|
||||
private static int CLASS_STATE_ALLOCATED;
|
||||
@ -96,9 +99,13 @@ public class InstanceKlass extends Klass {
|
||||
NAME_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::name_index_offset").intValue();
|
||||
SIGNATURE_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::signature_index_offset").intValue();
|
||||
INITVAL_INDEX_OFFSET = db.lookupIntConstant("FieldInfo::initval_index_offset").intValue();
|
||||
LOW_OFFSET = db.lookupIntConstant("FieldInfo::low_offset").intValue();
|
||||
HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_offset").intValue();
|
||||
LOW_OFFSET = db.lookupIntConstant("FieldInfo::low_packed_offset").intValue();
|
||||
HIGH_OFFSET = db.lookupIntConstant("FieldInfo::high_packed_offset").intValue();
|
||||
FIELD_SLOTS = db.lookupIntConstant("FieldInfo::field_slots").intValue();
|
||||
FIELDINFO_TAG_SIZE = db.lookupIntConstant("FIELDINFO_TAG_SIZE").shortValue();
|
||||
FIELDINFO_TAG_MASK = db.lookupIntConstant("FIELDINFO_TAG_MASK").shortValue();
|
||||
FIELDINFO_TAG_OFFSET = db.lookupIntConstant("FIELDINFO_TAG_OFFSET").shortValue();
|
||||
|
||||
// read ClassState constants
|
||||
CLASS_STATE_ALLOCATED = db.lookupIntConstant("InstanceKlass::allocated").intValue();
|
||||
CLASS_STATE_LOADED = db.lookupIntConstant("InstanceKlass::loaded").intValue();
|
||||
@ -314,8 +321,12 @@ public class InstanceKlass extends Klass {
|
||||
|
||||
public int getFieldOffset(int index) {
|
||||
U2Array fields = getFields();
|
||||
return VM.getVM().buildIntFromShorts(fields.at(index * FIELD_SLOTS + LOW_OFFSET),
|
||||
fields.at(index * FIELD_SLOTS + HIGH_OFFSET));
|
||||
short lo = fields.at(index * FIELD_SLOTS + LOW_OFFSET);
|
||||
short hi = fields.at(index * FIELD_SLOTS + HIGH_OFFSET);
|
||||
if ((lo & FIELDINFO_TAG_MASK) == FIELDINFO_TAG_OFFSET) {
|
||||
return VM.getVM().buildIntFromShorts(lo, hi) >> FIELDINFO_TAG_SIZE;
|
||||
}
|
||||
throw new RuntimeException("should not reach here");
|
||||
}
|
||||
|
||||
// Accessors for declared fields
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#
|
||||
# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35
|
||||
# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2013, 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
|
||||
@ -126,8 +126,9 @@ SUNWprivate_1.1 {
|
||||
JVM_GetClassModifiers;
|
||||
JVM_GetClassName;
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetClassTypeAnnotations;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
@ -154,6 +155,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
@ -203,7 +205,6 @@ SUNWprivate_1.1 {
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_PrintStackTrace;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
@ -283,7 +284,7 @@ SUNWprivate_1.1 {
|
||||
# This is for Forte Analyzer profiling support.
|
||||
AsyncGetCallTrace;
|
||||
|
||||
# INSERT VTABLE SYMBOLS HERE
|
||||
# INSERT VTABLE SYMBOLS HERE
|
||||
|
||||
local:
|
||||
*;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -128,6 +128,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetClassTypeAnnotations;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
@ -154,6 +155,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
@ -203,7 +205,6 @@ SUNWprivate_1.1 {
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_PrintStackTrace;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 2013, 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
|
||||
@ -31,11 +31,11 @@
|
||||
#
|
||||
|
||||
# Don't put quotes (fail windows build).
|
||||
HOTSPOT_VM_COPYRIGHT=Copyright 2012
|
||||
HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
||||
|
||||
HS_MAJOR_VER=25
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=14
|
||||
HS_BUILD_NUMBER=17
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=8
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2013, 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
|
||||
@ -124,6 +124,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetClassTypeAnnotations;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
@ -150,6 +151,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
@ -199,7 +201,6 @@ SUNWprivate_1.1 {
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_PrintStackTrace;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2013, 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
|
||||
@ -124,6 +124,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetClassTypeAnnotations;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
@ -150,6 +151,7 @@ SUNWprivate_1.1 {
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
@ -199,7 +201,6 @@ SUNWprivate_1.1 {
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_PrintStackTrace;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2013, 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
|
||||
@ -26,235 +26,236 @@
|
||||
|
||||
SUNWprivate_1.1 {
|
||||
global:
|
||||
# JNI
|
||||
# JNI
|
||||
JNI_CreateJavaVM;
|
||||
JNI_GetCreatedJavaVMs;
|
||||
JNI_GetDefaultJavaVMInitArgs;
|
||||
|
||||
# JVM
|
||||
JVM_Accept;
|
||||
JVM_ActiveProcessorCount;
|
||||
JVM_AllocateNewArray;
|
||||
JVM_AllocateNewObject;
|
||||
JVM_ArrayCopy;
|
||||
JVM_AssertionStatusDirectives;
|
||||
JVM_Available;
|
||||
JVM_Bind;
|
||||
JVM_ClassDepth;
|
||||
JVM_ClassLoaderDepth;
|
||||
JVM_Clone;
|
||||
JVM_Close;
|
||||
JVM_CX8Field;
|
||||
JVM_CompileClass;
|
||||
JVM_CompileClasses;
|
||||
JVM_CompilerCommand;
|
||||
JVM_Connect;
|
||||
JVM_ConstantPoolGetClassAt;
|
||||
JVM_ConstantPoolGetClassAtIfLoaded;
|
||||
JVM_ConstantPoolGetDoubleAt;
|
||||
JVM_ConstantPoolGetFieldAt;
|
||||
JVM_ConstantPoolGetFieldAtIfLoaded;
|
||||
JVM_ConstantPoolGetFloatAt;
|
||||
JVM_ConstantPoolGetIntAt;
|
||||
JVM_ConstantPoolGetLongAt;
|
||||
JVM_ConstantPoolGetMethodAt;
|
||||
JVM_ConstantPoolGetMethodAtIfLoaded;
|
||||
JVM_ConstantPoolGetMemberRefInfoAt;
|
||||
JVM_ConstantPoolGetSize;
|
||||
JVM_ConstantPoolGetStringAt;
|
||||
JVM_ConstantPoolGetUTF8At;
|
||||
JVM_CountStackFrames;
|
||||
JVM_CurrentClassLoader;
|
||||
JVM_CurrentLoadedClass;
|
||||
JVM_CurrentThread;
|
||||
JVM_CurrentTimeMillis;
|
||||
JVM_DefineClass;
|
||||
JVM_DefineClassWithSource;
|
||||
JVM_DefineClassWithSourceCond;
|
||||
JVM_DesiredAssertionStatus;
|
||||
JVM_DisableCompiler;
|
||||
JVM_DoPrivileged;
|
||||
JVM_DTraceGetVersion;
|
||||
JVM_DTraceActivate;
|
||||
JVM_DTraceIsProbeEnabled;
|
||||
JVM_DTraceIsSupported;
|
||||
JVM_DTraceDispose;
|
||||
JVM_DumpAllStacks;
|
||||
JVM_DumpThreads;
|
||||
JVM_EnableCompiler;
|
||||
JVM_Exit;
|
||||
JVM_FillInStackTrace;
|
||||
JVM_FindClassFromClass;
|
||||
JVM_FindClassFromClassLoader;
|
||||
JVM_FindClassFromBootLoader;
|
||||
JVM_FindLibraryEntry;
|
||||
JVM_FindLoadedClass;
|
||||
JVM_FindPrimitiveClass;
|
||||
JVM_FindSignal;
|
||||
JVM_FreeMemory;
|
||||
JVM_GC;
|
||||
JVM_GetAllThreads;
|
||||
JVM_GetArrayElement;
|
||||
JVM_GetArrayLength;
|
||||
JVM_GetCPClassNameUTF;
|
||||
JVM_GetCPFieldClassNameUTF;
|
||||
JVM_GetCPFieldModifiers;
|
||||
JVM_GetCPFieldNameUTF;
|
||||
JVM_GetCPFieldSignatureUTF;
|
||||
JVM_GetCPMethodClassNameUTF;
|
||||
JVM_GetCPMethodModifiers;
|
||||
JVM_GetCPMethodNameUTF;
|
||||
JVM_GetCPMethodSignatureUTF;
|
||||
JVM_GetCallerClass;
|
||||
JVM_GetClassAccessFlags;
|
||||
JVM_GetClassAnnotations;
|
||||
JVM_GetClassCPEntriesCount;
|
||||
JVM_GetClassCPTypes;
|
||||
JVM_GetClassConstantPool;
|
||||
JVM_GetClassContext;
|
||||
JVM_GetClassDeclaredConstructors;
|
||||
JVM_GetClassDeclaredFields;
|
||||
JVM_GetClassDeclaredMethods;
|
||||
JVM_GetClassFieldsCount;
|
||||
JVM_GetClassInterfaces;
|
||||
JVM_GetClassLoader;
|
||||
JVM_GetClassMethodsCount;
|
||||
JVM_GetClassModifiers;
|
||||
JVM_GetClassName;
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
JVM_GetLastErrorString;
|
||||
JVM_GetManagement;
|
||||
JVM_GetMethodAnnotations;
|
||||
JVM_GetMethodDefaultAnnotationValue;
|
||||
JVM_GetMethodIxArgsSize;
|
||||
JVM_GetMethodIxByteCode;
|
||||
JVM_GetMethodIxByteCodeLength;
|
||||
JVM_GetMethodIxExceptionIndexes;
|
||||
JVM_GetMethodIxExceptionTableEntry;
|
||||
JVM_GetMethodIxExceptionTableLength;
|
||||
JVM_GetMethodIxExceptionsCount;
|
||||
JVM_GetMethodIxLocalsCount;
|
||||
JVM_GetMethodIxMaxStack;
|
||||
JVM_GetMethodIxModifiers;
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
JVM_GetSockOpt;
|
||||
JVM_GetStackAccessControlContext;
|
||||
JVM_GetStackTraceDepth;
|
||||
JVM_GetStackTraceElement;
|
||||
JVM_GetSystemPackage;
|
||||
JVM_GetSystemPackages;
|
||||
JVM_GetThreadStateNames;
|
||||
JVM_GetThreadStateValues;
|
||||
JVM_GetVersionInfo;
|
||||
JVM_Halt;
|
||||
JVM_HoldsLock;
|
||||
JVM_IHashCode;
|
||||
JVM_InitAgentProperties;
|
||||
JVM_InitProperties;
|
||||
JVM_InitializeCompiler;
|
||||
JVM_InitializeSocketLibrary;
|
||||
JVM_InternString;
|
||||
JVM_Interrupt;
|
||||
JVM_InvokeMethod;
|
||||
JVM_IsArrayClass;
|
||||
JVM_IsConstructorIx;
|
||||
JVM_IsInterface;
|
||||
JVM_IsInterrupted;
|
||||
JVM_IsNaN;
|
||||
JVM_IsPrimitiveClass;
|
||||
JVM_IsSameClassPackage;
|
||||
JVM_IsSilentCompiler;
|
||||
JVM_IsSupportedJNIVersion;
|
||||
JVM_IsThreadAlive;
|
||||
JVM_LatestUserDefinedLoader;
|
||||
JVM_Listen;
|
||||
JVM_LoadClass0;
|
||||
JVM_LoadLibrary;
|
||||
JVM_Lseek;
|
||||
JVM_MaxObjectInspectionAge;
|
||||
JVM_MaxMemory;
|
||||
JVM_MonitorNotify;
|
||||
JVM_MonitorNotifyAll;
|
||||
JVM_MonitorWait;
|
||||
JVM_NativePath;
|
||||
JVM_NanoTime;
|
||||
JVM_NewArray;
|
||||
JVM_NewInstanceFromConstructor;
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_PrintStackTrace;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
JVM_RawMonitorEnter;
|
||||
JVM_RawMonitorExit;
|
||||
JVM_Read;
|
||||
JVM_Recv;
|
||||
JVM_RecvFrom;
|
||||
JVM_RegisterSignal;
|
||||
JVM_ReleaseUTF;
|
||||
JVM_ResolveClass;
|
||||
JVM_ResumeThread;
|
||||
JVM_Send;
|
||||
JVM_SendTo;
|
||||
JVM_SetArrayElement;
|
||||
JVM_SetClassSigners;
|
||||
JVM_SetLength;
|
||||
|
||||
# JVM
|
||||
JVM_Accept;
|
||||
JVM_ActiveProcessorCount;
|
||||
JVM_AllocateNewArray;
|
||||
JVM_AllocateNewObject;
|
||||
JVM_ArrayCopy;
|
||||
JVM_AssertionStatusDirectives;
|
||||
JVM_Available;
|
||||
JVM_Bind;
|
||||
JVM_ClassDepth;
|
||||
JVM_ClassLoaderDepth;
|
||||
JVM_Clone;
|
||||
JVM_Close;
|
||||
JVM_CX8Field;
|
||||
JVM_CompileClass;
|
||||
JVM_CompileClasses;
|
||||
JVM_CompilerCommand;
|
||||
JVM_Connect;
|
||||
JVM_ConstantPoolGetClassAt;
|
||||
JVM_ConstantPoolGetClassAtIfLoaded;
|
||||
JVM_ConstantPoolGetDoubleAt;
|
||||
JVM_ConstantPoolGetFieldAt;
|
||||
JVM_ConstantPoolGetFieldAtIfLoaded;
|
||||
JVM_ConstantPoolGetFloatAt;
|
||||
JVM_ConstantPoolGetIntAt;
|
||||
JVM_ConstantPoolGetLongAt;
|
||||
JVM_ConstantPoolGetMethodAt;
|
||||
JVM_ConstantPoolGetMethodAtIfLoaded;
|
||||
JVM_ConstantPoolGetMemberRefInfoAt;
|
||||
JVM_ConstantPoolGetSize;
|
||||
JVM_ConstantPoolGetStringAt;
|
||||
JVM_ConstantPoolGetUTF8At;
|
||||
JVM_CountStackFrames;
|
||||
JVM_CurrentClassLoader;
|
||||
JVM_CurrentLoadedClass;
|
||||
JVM_CurrentThread;
|
||||
JVM_CurrentTimeMillis;
|
||||
JVM_DefineClass;
|
||||
JVM_DefineClassWithSource;
|
||||
JVM_DefineClassWithSourceCond;
|
||||
JVM_DesiredAssertionStatus;
|
||||
JVM_DisableCompiler;
|
||||
JVM_DoPrivileged;
|
||||
JVM_DTraceGetVersion;
|
||||
JVM_DTraceActivate;
|
||||
JVM_DTraceIsProbeEnabled;
|
||||
JVM_DTraceIsSupported;
|
||||
JVM_DTraceDispose;
|
||||
JVM_DumpAllStacks;
|
||||
JVM_DumpThreads;
|
||||
JVM_EnableCompiler;
|
||||
JVM_Exit;
|
||||
JVM_FillInStackTrace;
|
||||
JVM_FindClassFromClass;
|
||||
JVM_FindClassFromClassLoader;
|
||||
JVM_FindClassFromBootLoader;
|
||||
JVM_FindLibraryEntry;
|
||||
JVM_FindLoadedClass;
|
||||
JVM_FindPrimitiveClass;
|
||||
JVM_FindSignal;
|
||||
JVM_FreeMemory;
|
||||
JVM_GC;
|
||||
JVM_GetAllThreads;
|
||||
JVM_GetArrayElement;
|
||||
JVM_GetArrayLength;
|
||||
JVM_GetCPClassNameUTF;
|
||||
JVM_GetCPFieldClassNameUTF;
|
||||
JVM_GetCPFieldModifiers;
|
||||
JVM_GetCPFieldNameUTF;
|
||||
JVM_GetCPFieldSignatureUTF;
|
||||
JVM_GetCPMethodClassNameUTF;
|
||||
JVM_GetCPMethodModifiers;
|
||||
JVM_GetCPMethodNameUTF;
|
||||
JVM_GetCPMethodSignatureUTF;
|
||||
JVM_GetCallerClass;
|
||||
JVM_GetClassAccessFlags;
|
||||
JVM_GetClassAnnotations;
|
||||
JVM_GetClassCPEntriesCount;
|
||||
JVM_GetClassCPTypes;
|
||||
JVM_GetClassConstantPool;
|
||||
JVM_GetClassContext;
|
||||
JVM_GetClassDeclaredConstructors;
|
||||
JVM_GetClassDeclaredFields;
|
||||
JVM_GetClassDeclaredMethods;
|
||||
JVM_GetClassFieldsCount;
|
||||
JVM_GetClassInterfaces;
|
||||
JVM_GetClassLoader;
|
||||
JVM_GetClassMethodsCount;
|
||||
JVM_GetClassModifiers;
|
||||
JVM_GetClassName;
|
||||
JVM_GetClassNameUTF;
|
||||
JVM_GetClassSignature;
|
||||
JVM_GetClassSigners;
|
||||
JVM_GetComponentType;
|
||||
JVM_GetClassTypeAnnotations;
|
||||
JVM_GetDeclaredClasses;
|
||||
JVM_GetDeclaringClass;
|
||||
JVM_GetEnclosingMethodInfo;
|
||||
JVM_GetFieldAnnotations;
|
||||
JVM_GetFieldIxModifiers;
|
||||
JVM_GetHostName;
|
||||
JVM_GetInheritedAccessControlContext;
|
||||
JVM_GetInterfaceVersion;
|
||||
JVM_GetLastErrorString;
|
||||
JVM_GetManagement;
|
||||
JVM_GetMethodAnnotations;
|
||||
JVM_GetMethodDefaultAnnotationValue;
|
||||
JVM_GetMethodIxArgsSize;
|
||||
JVM_GetMethodIxByteCode;
|
||||
JVM_GetMethodIxByteCodeLength;
|
||||
JVM_GetMethodIxExceptionIndexes;
|
||||
JVM_GetMethodIxExceptionTableEntry;
|
||||
JVM_GetMethodIxExceptionTableLength;
|
||||
JVM_GetMethodIxExceptionsCount;
|
||||
JVM_GetMethodIxLocalsCount;
|
||||
JVM_GetMethodIxMaxStack;
|
||||
JVM_GetMethodIxModifiers;
|
||||
JVM_GetMethodIxNameUTF;
|
||||
JVM_GetMethodIxSignatureUTF;
|
||||
JVM_GetMethodParameterAnnotations;
|
||||
JVM_GetMethodParameters;
|
||||
JVM_GetPrimitiveArrayElement;
|
||||
JVM_GetProtectionDomain;
|
||||
JVM_GetSockName;
|
||||
JVM_GetSockOpt;
|
||||
JVM_GetStackAccessControlContext;
|
||||
JVM_GetStackTraceDepth;
|
||||
JVM_GetStackTraceElement;
|
||||
JVM_GetSystemPackage;
|
||||
JVM_GetSystemPackages;
|
||||
JVM_GetThreadStateNames;
|
||||
JVM_GetThreadStateValues;
|
||||
JVM_GetVersionInfo;
|
||||
JVM_Halt;
|
||||
JVM_HoldsLock;
|
||||
JVM_IHashCode;
|
||||
JVM_InitAgentProperties;
|
||||
JVM_InitProperties;
|
||||
JVM_InitializeCompiler;
|
||||
JVM_InitializeSocketLibrary;
|
||||
JVM_InternString;
|
||||
JVM_Interrupt;
|
||||
JVM_InvokeMethod;
|
||||
JVM_IsArrayClass;
|
||||
JVM_IsConstructorIx;
|
||||
JVM_IsInterface;
|
||||
JVM_IsInterrupted;
|
||||
JVM_IsNaN;
|
||||
JVM_IsPrimitiveClass;
|
||||
JVM_IsSameClassPackage;
|
||||
JVM_IsSilentCompiler;
|
||||
JVM_IsSupportedJNIVersion;
|
||||
JVM_IsThreadAlive;
|
||||
JVM_LatestUserDefinedLoader;
|
||||
JVM_Listen;
|
||||
JVM_LoadClass0;
|
||||
JVM_LoadLibrary;
|
||||
JVM_Lseek;
|
||||
JVM_MaxObjectInspectionAge;
|
||||
JVM_MaxMemory;
|
||||
JVM_MonitorNotify;
|
||||
JVM_MonitorNotifyAll;
|
||||
JVM_MonitorWait;
|
||||
JVM_NativePath;
|
||||
JVM_NanoTime;
|
||||
JVM_NewArray;
|
||||
JVM_NewInstanceFromConstructor;
|
||||
JVM_NewMultiArray;
|
||||
JVM_OnExit;
|
||||
JVM_Open;
|
||||
JVM_RaiseSignal;
|
||||
JVM_RawMonitorCreate;
|
||||
JVM_RawMonitorDestroy;
|
||||
JVM_RawMonitorEnter;
|
||||
JVM_RawMonitorExit;
|
||||
JVM_Read;
|
||||
JVM_Recv;
|
||||
JVM_RecvFrom;
|
||||
JVM_RegisterSignal;
|
||||
JVM_ReleaseUTF;
|
||||
JVM_ResolveClass;
|
||||
JVM_ResumeThread;
|
||||
JVM_Send;
|
||||
JVM_SendTo;
|
||||
JVM_SetArrayElement;
|
||||
JVM_SetClassSigners;
|
||||
JVM_SetLength;
|
||||
JVM_SetNativeThreadName;
|
||||
JVM_SetPrimitiveArrayElement;
|
||||
JVM_SetProtectionDomain;
|
||||
JVM_SetSockOpt;
|
||||
JVM_SetThreadPriority;
|
||||
JVM_Sleep;
|
||||
JVM_Socket;
|
||||
JVM_SocketAvailable;
|
||||
JVM_SocketClose;
|
||||
JVM_SocketShutdown;
|
||||
JVM_StartThread;
|
||||
JVM_StopThread;
|
||||
JVM_SuspendThread;
|
||||
JVM_SupportsCX8;
|
||||
JVM_Sync;
|
||||
JVM_Timeout;
|
||||
JVM_TotalMemory;
|
||||
JVM_TraceInstructions;
|
||||
JVM_TraceMethodCalls;
|
||||
JVM_UnloadLibrary;
|
||||
JVM_Write;
|
||||
JVM_Yield;
|
||||
JVM_handle_solaris_signal;
|
||||
JVM_SetPrimitiveArrayElement;
|
||||
JVM_SetProtectionDomain;
|
||||
JVM_SetSockOpt;
|
||||
JVM_SetThreadPriority;
|
||||
JVM_Sleep;
|
||||
JVM_Socket;
|
||||
JVM_SocketAvailable;
|
||||
JVM_SocketClose;
|
||||
JVM_SocketShutdown;
|
||||
JVM_StartThread;
|
||||
JVM_StopThread;
|
||||
JVM_SuspendThread;
|
||||
JVM_SupportsCX8;
|
||||
JVM_Sync;
|
||||
JVM_Timeout;
|
||||
JVM_TotalMemory;
|
||||
JVM_TraceInstructions;
|
||||
JVM_TraceMethodCalls;
|
||||
JVM_UnloadLibrary;
|
||||
JVM_Write;
|
||||
JVM_Yield;
|
||||
JVM_handle_solaris_signal;
|
||||
|
||||
# miscellaneous functions
|
||||
jio_fprintf;
|
||||
jio_printf;
|
||||
jio_snprintf;
|
||||
jio_vfprintf;
|
||||
jio_vsnprintf;
|
||||
# miscellaneous functions
|
||||
jio_fprintf;
|
||||
jio_printf;
|
||||
jio_snprintf;
|
||||
jio_vfprintf;
|
||||
jio_vsnprintf;
|
||||
|
||||
# Needed because there is no JVM interface for this.
|
||||
sysThreadAvailableStackWithSlack;
|
||||
# Needed because there is no JVM interface for this.
|
||||
sysThreadAvailableStackWithSlack;
|
||||
|
||||
# This is for Forte Analyzer profiling support.
|
||||
AsyncGetCallTrace;
|
||||
# This is for Forte Analyzer profiling support.
|
||||
AsyncGetCallTrace;
|
||||
|
||||
# INSERT VTABLE SYMBOLS HERE
|
||||
# INSERT VTABLE SYMBOLS HERE
|
||||
|
||||
local:
|
||||
*;
|
||||
|
||||
@ -675,8 +675,8 @@ public:
|
||||
AbstractAssembler::flush();
|
||||
}
|
||||
|
||||
inline void emit_long(int); // shadows AbstractAssembler::emit_long
|
||||
inline void emit_data(int x) { emit_long(x); }
|
||||
inline void emit_int32(int); // shadows AbstractAssembler::emit_int32
|
||||
inline void emit_data(int x) { emit_int32(x); }
|
||||
inline void emit_data(int, RelocationHolder const&);
|
||||
inline void emit_data(int, relocInfo::relocType rtype);
|
||||
// helper for above fcns
|
||||
@ -691,12 +691,12 @@ public:
|
||||
inline void add(Register s1, Register s2, Register d );
|
||||
inline void add(Register s1, int simm13a, Register d );
|
||||
|
||||
void addcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void addcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void addc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void addc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void addccc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void addccc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void addcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void addcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void addc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void addc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
|
||||
// pp 136
|
||||
@ -749,76 +749,76 @@ public:
|
||||
// at address s1 is swapped with the data in d. If the values are not equal,
|
||||
// the the contents of memory at s1 is loaded into d, without the swap.
|
||||
|
||||
void casa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); }
|
||||
void casxa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); }
|
||||
void casa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); }
|
||||
void casxa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); }
|
||||
|
||||
// pp 152
|
||||
|
||||
void udiv( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | rs2(s2)); }
|
||||
void udiv( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdiv( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | rs2(s2)); }
|
||||
void sdiv( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void udivcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
|
||||
void udivcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdivcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
|
||||
void sdivcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void udiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | rs2(s2)); }
|
||||
void udiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | rs2(s2)); }
|
||||
void sdiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
|
||||
void udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
|
||||
void sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 155
|
||||
|
||||
void done() { v9_only(); cti(); emit_long( op(arith_op) | fcn(0) | op3(done_op3) ); }
|
||||
void retry() { v9_only(); cti(); emit_long( op(arith_op) | fcn(1) | op3(retry_op3) ); }
|
||||
void done() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); }
|
||||
void retry() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); }
|
||||
|
||||
// pp 156
|
||||
|
||||
void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); }
|
||||
void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); }
|
||||
void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); }
|
||||
void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); }
|
||||
|
||||
// pp 157
|
||||
|
||||
void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_long( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); }
|
||||
void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_long( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); }
|
||||
void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); }
|
||||
void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); }
|
||||
|
||||
// pp 159
|
||||
|
||||
void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_long( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); }
|
||||
void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_long( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); }
|
||||
void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); }
|
||||
void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); }
|
||||
|
||||
// pp 160
|
||||
|
||||
void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_long( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); }
|
||||
void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); }
|
||||
|
||||
// pp 161
|
||||
|
||||
void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); }
|
||||
void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); }
|
||||
void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); }
|
||||
void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); }
|
||||
|
||||
// pp 162
|
||||
|
||||
void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); }
|
||||
void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); }
|
||||
|
||||
void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); }
|
||||
void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); }
|
||||
|
||||
// page 144 sparc v8 architecture (double prec works on v8 if the source and destination registers are the same). fnegs is the only instruction available
|
||||
// on v8 to do negation of single, double and quad precision floats.
|
||||
|
||||
void fneg( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_long( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(sd, w)); else emit_long( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x05) | fs2(sd, w)); }
|
||||
void fneg( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(sd, w)); else emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x05) | fs2(sd, w)); }
|
||||
|
||||
void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); }
|
||||
void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); }
|
||||
|
||||
// page 144 sparc v8 architecture (double prec works on v8 if the source and destination registers are the same). fabss is the only instruction available
|
||||
// on v8 to do abs operation on single/double/quad precision floats.
|
||||
|
||||
void fabs( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_long( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(sd, w)); else emit_long( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x09) | fs2(sd, w)); }
|
||||
void fabs( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(sd, w)); else emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x09) | fs2(sd, w)); }
|
||||
|
||||
// pp 163
|
||||
|
||||
void fmul( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x48 + w) | fs2(s2, w)); }
|
||||
void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_long( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); }
|
||||
void fdiv( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x4c + w) | fs2(s2, w)); }
|
||||
void fmul( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x48 + w) | fs2(s2, w)); }
|
||||
void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); }
|
||||
void fdiv( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x4c + w) | fs2(s2, w)); }
|
||||
|
||||
// pp 164
|
||||
|
||||
void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_long( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); }
|
||||
void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); }
|
||||
|
||||
// pp 165
|
||||
|
||||
@ -827,22 +827,22 @@ public:
|
||||
|
||||
// pp 167
|
||||
|
||||
void flushw() { v9_only(); emit_long( op(arith_op) | op3(flushw_op3) ); }
|
||||
void flushw() { v9_only(); emit_int32( op(arith_op) | op3(flushw_op3) ); }
|
||||
|
||||
// pp 168
|
||||
|
||||
void illtrap( int const22a) { if (const22a != 0) v9_only(); emit_long( op(branch_op) | u_field(const22a, 21, 0) ); }
|
||||
void illtrap( int const22a) { if (const22a != 0) v9_only(); emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); }
|
||||
// v8 unimp == illtrap(0)
|
||||
|
||||
// pp 169
|
||||
|
||||
void impdep1( int id1, int const19a ) { v9_only(); emit_long( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); }
|
||||
void impdep2( int id1, int const19a ) { v9_only(); emit_long( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); }
|
||||
void impdep1( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); }
|
||||
void impdep2( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); }
|
||||
|
||||
// pp 149 (v8)
|
||||
|
||||
void cpop1( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_long( op(arith_op) | fcn(crd) | op3(impdep1_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); }
|
||||
void cpop2( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_long( op(arith_op) | fcn(crd) | op3(impdep2_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); }
|
||||
void cpop1( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_int32( op(arith_op) | fcn(crd) | op3(impdep1_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); }
|
||||
void cpop2( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_int32( op(arith_op) | fcn(crd) | op3(impdep2_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); }
|
||||
|
||||
// pp 170
|
||||
|
||||
@ -872,8 +872,8 @@ public:
|
||||
|
||||
// 173
|
||||
|
||||
void ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only(); emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldfa( FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d ) { v9_only(); emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldfa( FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 175, lduw is ld on v8
|
||||
|
||||
@ -896,22 +896,22 @@ public:
|
||||
|
||||
// pp 177
|
||||
|
||||
void ldsba( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldsba( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldsha( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldsha( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldswa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldswa( Register s1, int simm13a, Register d ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduba( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduba( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduha( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduha( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduwa( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduwa( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldxa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldxa( Register s1, int simm13a, Register d ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldda( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldda( Register s1, int simm13a, Register d ) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldsba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldsba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldsha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldsha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldswa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldswa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void lduwa( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void lduwa( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldxa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldxa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldda( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldda( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 179
|
||||
|
||||
@ -920,111 +920,111 @@ public:
|
||||
|
||||
// pp 180
|
||||
|
||||
void ldstuba( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldstuba( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void ldstuba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void ldstuba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 181
|
||||
|
||||
void and3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void and3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void andcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andn( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void andn( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andncc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void andncc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void or3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void or3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orn( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orn( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orncc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orncc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xor3( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void xor3( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xorcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void xorcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xnor( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void xnor( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xnorcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void xnorcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void and3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void and3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void andcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void andn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void andncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void andncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void or3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void or3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void orncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void orncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xor3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void xor3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void xorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xnor( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void xnor( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void xnorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void xnorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 183
|
||||
|
||||
void membar( Membar_mask_bits const7a ) { v9_only(); emit_long( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); }
|
||||
void membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); }
|
||||
|
||||
// pp 185
|
||||
|
||||
void fmov( FloatRegisterImpl::Width w, Condition c, bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only(); emit_long( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); }
|
||||
void fmov( FloatRegisterImpl::Width w, Condition c, bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); }
|
||||
|
||||
// pp 189
|
||||
|
||||
void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1, FloatRegister s2, FloatRegister d ) { v9_only(); emit_long( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); }
|
||||
void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); }
|
||||
|
||||
// pp 191
|
||||
|
||||
void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); }
|
||||
void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); }
|
||||
void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); }
|
||||
void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); }
|
||||
|
||||
// pp 195
|
||||
|
||||
void movr( RCondition c, Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); }
|
||||
void movr( RCondition c, Register s1, int simm10a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); }
|
||||
void movr( RCondition c, Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); }
|
||||
void movr( RCondition c, Register s1, int simm10a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); }
|
||||
|
||||
// pp 196
|
||||
|
||||
void mulx( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void mulx( Register s1, int simm13a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void udivx( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void mulx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void mulx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 197
|
||||
|
||||
void umul( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void umul( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void smul( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void smul( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void umulcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void umulcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void smulcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void smulcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void umul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void umul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void smul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void smul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 199
|
||||
|
||||
void mulscc( Register s1, Register s2, Register d ) { v9_dep(); emit_long( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void mulscc( Register s1, int simm13a, Register d ) { v9_dep(); emit_long( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void mulscc( Register s1, Register s2, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void mulscc( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 201
|
||||
|
||||
void nop() { emit_long( op(branch_op) | op2(sethi_op2) ); }
|
||||
void nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); }
|
||||
|
||||
|
||||
// pp 202
|
||||
|
||||
void popc( Register s, Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); }
|
||||
void popc( int simm13a, Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); }
|
||||
void popc( Register s, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); }
|
||||
void popc( int simm13a, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
// pp 203
|
||||
|
||||
void prefetch( Register s1, Register s2, PrefetchFcn f) { v9_only(); emit_long( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void prefetch( Register s1, Register s2, PrefetchFcn f) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void prefetch( Register s1, int simm13a, PrefetchFcn f) { v9_only(); emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
void prefetcha( Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only(); emit_long( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void prefetcha( Register s1, int simm13a, PrefetchFcn f ) { v9_only(); emit_long( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void prefetcha( Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void prefetcha( Register s1, int simm13a, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 208
|
||||
|
||||
// not implementing read privileged register
|
||||
|
||||
inline void rdy( Register d) { v9_dep(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); }
|
||||
inline void rdccr( Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); }
|
||||
inline void rdasi( Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); }
|
||||
inline void rdtick( Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon!
|
||||
inline void rdpc( Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); }
|
||||
inline void rdfprs( Register d) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); }
|
||||
inline void rdy( Register d) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); }
|
||||
inline void rdccr( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); }
|
||||
inline void rdasi( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); }
|
||||
inline void rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon!
|
||||
inline void rdpc( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); }
|
||||
inline void rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); }
|
||||
|
||||
// pp 213
|
||||
|
||||
@ -1033,47 +1033,47 @@ public:
|
||||
|
||||
// pp 214
|
||||
|
||||
void save( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void save( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void save( Register s1, int simm13a, Register d ) {
|
||||
// make sure frame is at least large enough for the register save area
|
||||
assert(-simm13a >= 16 * wordSize, "frame too small");
|
||||
emit_long( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
|
||||
emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
|
||||
}
|
||||
|
||||
void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void restore( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void restore( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 216
|
||||
|
||||
void saved() { v9_only(); emit_long( op(arith_op) | fcn(0) | op3(saved_op3)); }
|
||||
void restored() { v9_only(); emit_long( op(arith_op) | fcn(1) | op3(saved_op3)); }
|
||||
void saved() { v9_only(); emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); }
|
||||
void restored() { v9_only(); emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); }
|
||||
|
||||
// pp 217
|
||||
|
||||
inline void sethi( int imm22a, Register d, RelocationHolder const& rspec = RelocationHolder() );
|
||||
// pp 218
|
||||
|
||||
void sll( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void sll( Register s1, int imm5a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
void srl( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void srl( Register s1, int imm5a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
void sra( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void sra( Register s1, int imm5a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
void sll( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void sll( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
void srl( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void srl( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
void sra( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
|
||||
void sra( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
|
||||
|
||||
void sllx( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void sllx( Register s1, int imm6a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
void srlx( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void srlx( Register s1, int imm6a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
void srax( Register s1, Register s2, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void srax( Register s1, int imm6a, Register d ) { v9_only(); emit_long( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
void sllx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void sllx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
void srlx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void srlx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
void srax( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
|
||||
void srax( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
|
||||
|
||||
// pp 220
|
||||
|
||||
void sir( int simm13a ) { emit_long( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); }
|
||||
void sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
// pp 221
|
||||
|
||||
void stbar() { emit_long( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); }
|
||||
void stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); }
|
||||
|
||||
// pp 222
|
||||
|
||||
@ -1087,8 +1087,8 @@ public:
|
||||
|
||||
// pp 224
|
||||
|
||||
void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only(); emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a ) { v9_only(); emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// p 226
|
||||
|
||||
@ -1105,16 +1105,16 @@ public:
|
||||
|
||||
// pp 177
|
||||
|
||||
void stba( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stba( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stha( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stha( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stwa( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stwa( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stxa( Register d, Register s1, Register s2, int ia ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stxa( Register d, Register s1, int simm13a ) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stda( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stda( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stba( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stba( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stha( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stha( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stwa( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stwa( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stxa( Register d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stxa( Register d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void stda( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void stda( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 97 (v8)
|
||||
|
||||
@ -1129,15 +1129,15 @@ public:
|
||||
|
||||
// pp 230
|
||||
|
||||
void sub( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void sub( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void sub( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void sub( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
void subcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void subcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void subc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void subc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void subccc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void subccc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void subcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void subcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void subc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void subc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 231
|
||||
|
||||
@ -1146,55 +1146,55 @@ public:
|
||||
|
||||
// pp 232
|
||||
|
||||
void swapa( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void swapa( Register s1, int simm13a, Register d ) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void swapa( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
|
||||
void swapa( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 234, note op in book is wrong, see pp 268
|
||||
|
||||
void taddcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void taddcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void taddcctv( Register s1, Register s2, Register d ) { v9_dep(); emit_long( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void taddcctv( Register s1, int simm13a, Register d ) { v9_dep(); emit_long( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void taddcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void taddcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void taddcctv( Register s1, Register s2, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void taddcctv( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 235
|
||||
|
||||
void tsubcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void tsubcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void tsubcctv( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void tsubcctv( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void tsubcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
void tsubcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
void tsubcctv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | rs2(s2) ); }
|
||||
void tsubcctv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
// pp 237
|
||||
|
||||
void trap( Condition c, CC cc, Register s1, Register s2 ) { v8_no_cc(cc); emit_long( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); }
|
||||
void trap( Condition c, CC cc, Register s1, int trapa ) { v8_no_cc(cc); emit_long( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); }
|
||||
void trap( Condition c, CC cc, Register s1, Register s2 ) { v8_no_cc(cc); emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); }
|
||||
void trap( Condition c, CC cc, Register s1, int trapa ) { v8_no_cc(cc); emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); }
|
||||
// simple uncond. trap
|
||||
void trap( int trapa ) { trap( always, icc, G0, trapa ); }
|
||||
|
||||
// pp 239 omit write priv register for now
|
||||
|
||||
inline void wry( Register d) { v9_dep(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); }
|
||||
inline void wrccr(Register s) { v9_only(); emit_long( op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); }
|
||||
inline void wrccr(Register s, int simm13a) { v9_only(); emit_long( op(arith_op) |
|
||||
inline void wry( Register d) { v9_dep(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); }
|
||||
inline void wrccr(Register s) { v9_only(); emit_int32( op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); }
|
||||
inline void wrccr(Register s, int simm13a) { v9_only(); emit_int32( op(arith_op) |
|
||||
rs1(s) |
|
||||
op3(wrreg_op3) |
|
||||
u_field(2, 29, 25) |
|
||||
immed(true) |
|
||||
simm(simm13a, 13)); }
|
||||
inline void wrasi(Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
|
||||
inline void wrasi(Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
|
||||
// wrasi(d, imm) stores (d xor imm) to asi
|
||||
inline void wrasi(Register d, int simm13a) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) |
|
||||
inline void wrasi(Register d, int simm13a) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) |
|
||||
u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void wrfprs( Register d) { v9_only(); emit_long( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
|
||||
inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
|
||||
|
||||
|
||||
// VIS3 instructions
|
||||
|
||||
void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_long( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||
void movstouw( FloatRegister s, Register d ) { vis3_only(); emit_long( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||
void movdtox( FloatRegister s, Register d ) { vis3_only(); emit_long( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); }
|
||||
void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||
void movstouw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||
void movdtox( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); }
|
||||
|
||||
void movwtos( Register s, FloatRegister d ) { vis3_only(); emit_long( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); }
|
||||
void movxtod( Register s, FloatRegister d ) { vis3_only(); emit_long( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); }
|
||||
void movwtos( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); }
|
||||
void movxtod( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); }
|
||||
|
||||
// Creation
|
||||
Assembler(CodeBuffer* code) : AbstractAssembler(code) {
|
||||
|
||||
@ -35,24 +35,24 @@ inline void Assembler::check_delay() {
|
||||
# endif
|
||||
}
|
||||
|
||||
inline void Assembler::emit_long(int x) {
|
||||
inline void Assembler::emit_int32(int x) {
|
||||
check_delay();
|
||||
AbstractAssembler::emit_long(x);
|
||||
AbstractAssembler::emit_int32(x);
|
||||
}
|
||||
|
||||
inline void Assembler::emit_data(int x, relocInfo::relocType rtype) {
|
||||
relocate(rtype);
|
||||
emit_long(x);
|
||||
emit_int32(x);
|
||||
}
|
||||
|
||||
inline void Assembler::emit_data(int x, RelocationHolder const& rspec) {
|
||||
relocate(rspec);
|
||||
emit_long(x);
|
||||
emit_int32(x);
|
||||
}
|
||||
|
||||
|
||||
inline void Assembler::add(Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
inline void Assembler::add(Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
|
||||
|
||||
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt); has_delay_slot(); }
|
||||
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { bpr( c, a, p, s1, target(L)); }
|
||||
@ -79,93 +79,93 @@ inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label&
|
||||
inline void Assembler::call( address d, relocInfo::relocType rt ) { cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt); has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
|
||||
inline void Assembler::call( Label& L, relocInfo::relocType rt ) { call( target(L), rt); }
|
||||
|
||||
inline void Assembler::flush( Register s1, Register s2) { emit_long( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
|
||||
inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
|
||||
inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { cti(); emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
|
||||
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { cti(); emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
|
||||
inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { cti(); emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); }
|
||||
|
||||
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); }
|
||||
|
||||
inline void Assembler::ldfsr( Register s1, Register s2) { v9_dep(); emit_long( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldfsr( Register s1, Register s2) { v9_dep(); emit_int32( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::ldc( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldc( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::lddc( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lddc( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lddc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::ldcsr( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldcsr( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldcsr( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::ldsb( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsb( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsb( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::ldsh( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsh_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsh( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsh( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsh_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::ldsw( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsw( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldsw( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::ldub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldub_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldub( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::lduh( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(lduh_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lduh( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lduh( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(lduh_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::lduw( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(lduw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lduw( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::lduw( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(lduw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::ldx( Register s1, Register s2, Register d) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldx( Register s1, Register s2, Register d) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldx( Register s1, int simm13a, Register d) { v9_only(); emit_data( op(ldst_op) | rd(d) | op3(ldx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::ldd( Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_long( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldd( Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldd( Register s1, int simm13a, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::ldstub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::rett( Register s1, Register s2 ) { cti(); emit_long( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
|
||||
inline void Assembler::rett( Register s1, Register s2 ) { cti(); emit_int32( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
|
||||
inline void Assembler::rett( Register s1, int simm13a, relocInfo::relocType rt) { cti(); emit_data( op(arith_op) | op3(rett_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rt); has_delay_slot(); }
|
||||
|
||||
inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rspec ) { emit_data( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(imm22a), rspec); }
|
||||
|
||||
// pp 222
|
||||
|
||||
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
inline void Assembler::stfsr( Register s1, Register s2) { v9_dep(); emit_long( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stfsr( Register s1, Register s2) { v9_dep(); emit_int32( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::stxfsr( Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
// p 226
|
||||
|
||||
inline void Assembler::stb( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stb( Register d, Register s1, Register s2) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stb( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::sth( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::sth( Register d, Register s1, Register s2) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::sth( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(sth_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::stw( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(stw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stw( Register d, Register s1, Register s2) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stw( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(stw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
|
||||
inline void Assembler::stx( Register d, Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(stx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stx( Register d, Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stx( Register d, Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(d) | op3(stx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::std( Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_long( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::std( Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::std( Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
// v8 p 99
|
||||
|
||||
inline void Assembler::stc( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stc( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::stdc( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stdc( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stdc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::stcsr( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stcsr( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stcsr( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
// pp 231
|
||||
|
||||
inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); }
|
||||
inline void Assembler::swap( Register s1, int simm13a, Register d) { v9_dep(); emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
|
||||
|
||||
#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
|
||||
|
||||
@ -137,7 +137,7 @@ address CppInterpreterGenerator::generate_result_handler_for(BasicType type) {
|
||||
}
|
||||
__ ret(); // return from interpreter activation
|
||||
__ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame
|
||||
NOT_PRODUCT(__ emit_long(0);) // marker for disassembly
|
||||
NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly
|
||||
return entry;
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ address CppInterpreterGenerator::generate_tosca_to_stack_converter(BasicType typ
|
||||
}
|
||||
__ retl(); // return from interpreter activation
|
||||
__ delayed()->nop(); // schedule this better
|
||||
NOT_PRODUCT(__ emit_long(0);) // marker for disassembly
|
||||
NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly
|
||||
return entry;
|
||||
}
|
||||
|
||||
@ -1473,7 +1473,7 @@ static address interpreter_frame_manager = NULL;
|
||||
__ brx(Assembler::equal, false, Assembler::pt, skip); \
|
||||
__ delayed()->nop(); \
|
||||
__ breakpoint_trap(); \
|
||||
__ emit_long(marker); \
|
||||
__ emit_int32(marker); \
|
||||
__ bind(skip); \
|
||||
}
|
||||
#else
|
||||
|
||||
@ -1224,7 +1224,7 @@ void MacroAssembler::set_narrow_oop(jobject obj, Register d) {
|
||||
// Relocation with special format (see relocInfo_sparc.hpp).
|
||||
relocate(rspec, 1);
|
||||
// Assembler::sethi(0x3fffff, d);
|
||||
emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(0x3fffff) );
|
||||
emit_int32( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(0x3fffff) );
|
||||
// Don't add relocation for 'add'. Do patching during 'sethi' processing.
|
||||
add(d, 0x3ff, d);
|
||||
|
||||
@ -1240,7 +1240,7 @@ void MacroAssembler::set_narrow_klass(Klass* k, Register d) {
|
||||
// Relocation with special format (see relocInfo_sparc.hpp).
|
||||
relocate(rspec, 1);
|
||||
// Assembler::sethi(encoded_k, d);
|
||||
emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(encoded_k) );
|
||||
emit_int32( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(encoded_k) );
|
||||
// Don't add relocation for 'add'. Do patching during 'sethi' processing.
|
||||
add(d, low10(encoded_k), d);
|
||||
|
||||
|
||||
@ -259,7 +259,7 @@ address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type
|
||||
}
|
||||
__ ret(); // return from interpreter activation
|
||||
__ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame
|
||||
NOT_PRODUCT(__ emit_long(0);) // marker for disassembly
|
||||
NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* JavaCallWrapper */ \
|
||||
@ -37,22 +37,12 @@
|
||||
/******************************/ \
|
||||
/* JavaFrameAnchor */ \
|
||||
/******************************/ \
|
||||
volatile_nonstatic_field(JavaFrameAnchor, _flags, int) \
|
||||
\
|
||||
volatile_nonstatic_field(JavaFrameAnchor, _flags, int)
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type)
|
||||
|
||||
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
|
||||
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \
|
||||
/******************************/ \
|
||||
/* Register numbers (C2 only) */ \
|
||||
/******************************/ \
|
||||
@ -90,15 +80,6 @@
|
||||
declare_c2_constant(R_G6_num) \
|
||||
declare_c2_constant(R_G7_num)
|
||||
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
|
||||
|
||||
@ -259,6 +259,10 @@ void VM_Version::initialize() {
|
||||
if (!has_vis1()) // Drop to 0 if no VIS1 support
|
||||
UseVIS = 0;
|
||||
|
||||
if (FLAG_IS_DEFAULT(ContendedPaddingWidth) &&
|
||||
(cache_line_size > ContendedPaddingWidth))
|
||||
ContendedPaddingWidth = cache_line_size;
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintMiscellaneous && Verbose) {
|
||||
tty->print("Allocation");
|
||||
@ -286,6 +290,9 @@ void VM_Version::initialize() {
|
||||
if (PrefetchFieldsAhead > 0) {
|
||||
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
|
||||
}
|
||||
if (ContendedPaddingWidth > 0) {
|
||||
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
|
||||
}
|
||||
}
|
||||
#endif // PRODUCT
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ int AbstractAssembler::code_fill_byte() {
|
||||
// make this go away someday
|
||||
void Assembler::emit_data(jint data, relocInfo::relocType rtype, int format) {
|
||||
if (rtype == relocInfo::none)
|
||||
emit_long(data);
|
||||
emit_int32(data);
|
||||
else emit_data(data, Relocation::spec_simple(rtype), format);
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format)
|
||||
else
|
||||
code_section()->relocate(inst_mark(), rspec, format);
|
||||
}
|
||||
emit_long(data);
|
||||
emit_int32(data);
|
||||
}
|
||||
|
||||
static int encode(Register r) {
|
||||
@ -243,7 +243,7 @@ void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) {
|
||||
} else {
|
||||
emit_int8(op1);
|
||||
emit_int8(op2 | encode(dst));
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ void Assembler::emit_arith_imm32(int op1, int op2, Register dst, int32_t imm32)
|
||||
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
|
||||
emit_int8(op1);
|
||||
emit_int8(op2 | encode(dst));
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
// immediate-to-memory forms
|
||||
@ -268,7 +268,7 @@ void Assembler::emit_arith_operand(int op1, Register rm, Address adr, int32_t im
|
||||
} else {
|
||||
emit_int8(op1);
|
||||
emit_operand(rm, adr, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
}
|
||||
|
||||
@ -976,7 +976,7 @@ void Assembler::addr_nop_7() {
|
||||
emit_int8(0x1F);
|
||||
emit_int8((unsigned char)0x80);
|
||||
// emit_rm(cbuf, 0x2, EAX_enc, EAX_enc);
|
||||
emit_long(0); // 32-bits offset (4 bytes)
|
||||
emit_int32(0); // 32-bits offset (4 bytes)
|
||||
}
|
||||
|
||||
void Assembler::addr_nop_8() {
|
||||
@ -987,7 +987,7 @@ void Assembler::addr_nop_8() {
|
||||
emit_int8((unsigned char)0x84);
|
||||
// emit_rm(cbuf, 0x2, EAX_enc, 0x4);
|
||||
emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
|
||||
emit_long(0); // 32-bits offset (4 bytes)
|
||||
emit_int32(0); // 32-bits offset (4 bytes)
|
||||
}
|
||||
|
||||
void Assembler::addsd(XMMRegister dst, XMMRegister src) {
|
||||
@ -1076,7 +1076,7 @@ void Assembler::andl(Address dst, int32_t imm32) {
|
||||
prefix(dst);
|
||||
emit_int8((unsigned char)0x81);
|
||||
emit_operand(rsp, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::andl(Register dst, int32_t imm32) {
|
||||
@ -1204,7 +1204,7 @@ void Assembler::cmpl(Address dst, int32_t imm32) {
|
||||
prefix(dst);
|
||||
emit_int8((unsigned char)0x81);
|
||||
emit_operand(rdi, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::cmpl(Register dst, int32_t imm32) {
|
||||
@ -1408,7 +1408,7 @@ void Assembler::imull(Register dst, Register src, int value) {
|
||||
} else {
|
||||
emit_int8(0x69);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
emit_long(value);
|
||||
emit_int32(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1440,7 +1440,7 @@ void Assembler::jcc(Condition cc, Label& L, bool maybe_short) {
|
||||
"must be 32bit offset (call4)");
|
||||
emit_int8(0x0F);
|
||||
emit_int8((unsigned char)(0x80 | cc));
|
||||
emit_long(offs - long_size);
|
||||
emit_int32(offs - long_size);
|
||||
}
|
||||
} else {
|
||||
// Note: could eliminate cond. jumps to this jump if condition
|
||||
@ -1450,7 +1450,7 @@ void Assembler::jcc(Condition cc, Label& L, bool maybe_short) {
|
||||
L.add_patch_at(code(), locator());
|
||||
emit_int8(0x0F);
|
||||
emit_int8((unsigned char)(0x80 | cc));
|
||||
emit_long(0);
|
||||
emit_int32(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1498,7 +1498,7 @@ void Assembler::jmp(Label& L, bool maybe_short) {
|
||||
emit_int8((offs - short_size) & 0xFF);
|
||||
} else {
|
||||
emit_int8((unsigned char)0xE9);
|
||||
emit_long(offs - long_size);
|
||||
emit_int32(offs - long_size);
|
||||
}
|
||||
} else {
|
||||
// By default, forward jumps are always 32-bit displacements, since
|
||||
@ -1508,7 +1508,7 @@ void Assembler::jmp(Label& L, bool maybe_short) {
|
||||
InstructionMark im(this);
|
||||
L.add_patch_at(code(), locator());
|
||||
emit_int8((unsigned char)0xE9);
|
||||
emit_long(0);
|
||||
emit_int32(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1732,7 +1732,7 @@ void Assembler::vmovdqu(Address dst, XMMRegister src) {
|
||||
void Assembler::movl(Register dst, int32_t imm32) {
|
||||
int encode = prefix_and_encode(dst->encoding());
|
||||
emit_int8((unsigned char)(0xB8 | encode));
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::movl(Register dst, Register src) {
|
||||
@ -1753,7 +1753,7 @@ void Assembler::movl(Address dst, int32_t imm32) {
|
||||
prefix(dst);
|
||||
emit_int8((unsigned char)0xC7);
|
||||
emit_operand(rax, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::movl(Address dst, Register src) {
|
||||
@ -2263,6 +2263,18 @@ void Assembler::packuswb(XMMRegister dst, XMMRegister src) {
|
||||
emit_simd_arith(0x67, dst, src, VEX_SIMD_66);
|
||||
}
|
||||
|
||||
void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) {
|
||||
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
|
||||
emit_vex_arith(0x67, dst, nds, src, VEX_SIMD_66, vector256);
|
||||
}
|
||||
|
||||
void Assembler::vpermq(XMMRegister dst, XMMRegister src, int imm8, bool vector256) {
|
||||
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, true, vector256);
|
||||
emit_int8(0x00);
|
||||
emit_int8(0xC0 | encode);
|
||||
emit_int8(imm8);
|
||||
}
|
||||
|
||||
void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) {
|
||||
assert(VM_Version::supports_sse4_2(), "");
|
||||
InstructionMark im(this);
|
||||
@ -2468,6 +2480,26 @@ void Assembler::ptest(XMMRegister dst, XMMRegister src) {
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::vptest(XMMRegister dst, Address src) {
|
||||
assert(VM_Version::supports_avx(), "");
|
||||
InstructionMark im(this);
|
||||
bool vector256 = true;
|
||||
assert(dst != xnoreg, "sanity");
|
||||
int dst_enc = dst->encoding();
|
||||
// swap src<->dst for encoding
|
||||
vex_prefix(src, 0, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256);
|
||||
emit_int8(0x17);
|
||||
emit_operand(dst, src);
|
||||
}
|
||||
|
||||
void Assembler::vptest(XMMRegister dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx(), "");
|
||||
bool vector256 = true;
|
||||
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38);
|
||||
emit_int8(0x17);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::punpcklbw(XMMRegister dst, Address src) {
|
||||
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
|
||||
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
|
||||
@ -2499,7 +2531,7 @@ void Assembler::push(int32_t imm32) {
|
||||
// in 64bits we push 64bits onto the stack but only
|
||||
// take a 32bit immediate
|
||||
emit_int8(0x68);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::push(Register src) {
|
||||
@ -2544,12 +2576,18 @@ void Assembler::rep_mov() {
|
||||
emit_int8((unsigned char)0xA5);
|
||||
}
|
||||
|
||||
// sets rcx bytes with rax, value at [edi]
|
||||
void Assembler::rep_stosb() {
|
||||
emit_int8((unsigned char)0xF3); // REP
|
||||
LP64_ONLY(prefix(REX_W));
|
||||
emit_int8((unsigned char)0xAA); // STOSB
|
||||
}
|
||||
|
||||
// sets rcx pointer sized words with rax, value at [edi]
|
||||
// generic
|
||||
void Assembler::rep_set() { // rep_set
|
||||
emit_int8((unsigned char)0xF3);
|
||||
// STOSQ
|
||||
LP64_ONLY(prefix(REX_W));
|
||||
void Assembler::rep_stos() {
|
||||
emit_int8((unsigned char)0xF3); // REP
|
||||
LP64_ONLY(prefix(REX_W)); // LP64:STOSQ, LP32:STOSD
|
||||
emit_int8((unsigned char)0xAB);
|
||||
}
|
||||
|
||||
@ -2785,7 +2823,7 @@ void Assembler::testl(Register dst, int32_t imm32) {
|
||||
emit_int8((unsigned char)0xF7);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
}
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::testl(Register dst, Register src) {
|
||||
@ -3650,6 +3688,15 @@ void Assembler::vextracti128h(Address dst, XMMRegister src) {
|
||||
emit_int8(0x01);
|
||||
}
|
||||
|
||||
// duplicate 4-bytes integer data from src into 8 locations in dest
|
||||
void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx2(), "");
|
||||
bool vector256 = true;
|
||||
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38);
|
||||
emit_int8(0x58);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::vzeroupper() {
|
||||
assert(VM_Version::supports_avx(), "");
|
||||
(void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE);
|
||||
@ -4720,7 +4767,7 @@ void Assembler::andq(Address dst, int32_t imm32) {
|
||||
prefixq(dst);
|
||||
emit_int8((unsigned char)0x81);
|
||||
emit_operand(rsp, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::andq(Register dst, int32_t imm32) {
|
||||
@ -4793,7 +4840,7 @@ void Assembler::cmpq(Address dst, int32_t imm32) {
|
||||
prefixq(dst);
|
||||
emit_int8((unsigned char)0x81);
|
||||
emit_operand(rdi, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::cmpq(Register dst, int32_t imm32) {
|
||||
@ -4932,7 +4979,7 @@ void Assembler::imulq(Register dst, Register src, int value) {
|
||||
} else {
|
||||
emit_int8(0x69);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
emit_long(value);
|
||||
emit_int32(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5085,7 +5132,7 @@ void Assembler::movslq(Register dst, int32_t imm32) {
|
||||
InstructionMark im(this);
|
||||
int encode = prefixq_and_encode(dst->encoding());
|
||||
emit_int8((unsigned char)(0xC7 | encode));
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::movslq(Address dst, int32_t imm32) {
|
||||
@ -5094,7 +5141,7 @@ void Assembler::movslq(Address dst, int32_t imm32) {
|
||||
prefixq(dst);
|
||||
emit_int8((unsigned char)0xC7);
|
||||
emit_operand(rax, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::movslq(Register dst, Address src) {
|
||||
@ -5172,7 +5219,7 @@ void Assembler::orq(Address dst, int32_t imm32) {
|
||||
prefixq(dst);
|
||||
emit_int8((unsigned char)0x81);
|
||||
emit_operand(rcx, dst, 4);
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::orq(Register dst, int32_t imm32) {
|
||||
@ -5407,7 +5454,7 @@ void Assembler::testq(Register dst, int32_t imm32) {
|
||||
emit_int8((unsigned char)0xF7);
|
||||
emit_int8((unsigned char)(0xC0 | encode));
|
||||
}
|
||||
emit_long(imm32);
|
||||
emit_int32(imm32);
|
||||
}
|
||||
|
||||
void Assembler::testq(Register dst, Register src) {
|
||||
|
||||
@ -832,7 +832,8 @@ private:
|
||||
|
||||
// These do register sized moves/scans
|
||||
void rep_mov();
|
||||
void rep_set();
|
||||
void rep_stos();
|
||||
void rep_stosb();
|
||||
void repne_scan();
|
||||
#ifdef _LP64
|
||||
void repne_scanl();
|
||||
@ -1394,6 +1395,10 @@ private:
|
||||
// Pack with unsigned saturation
|
||||
void packuswb(XMMRegister dst, XMMRegister src);
|
||||
void packuswb(XMMRegister dst, Address src);
|
||||
void vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256);
|
||||
|
||||
// Pemutation of 64bit words
|
||||
void vpermq(XMMRegister dst, XMMRegister src, int imm8, bool vector256);
|
||||
|
||||
// SSE4.2 string instructions
|
||||
void pcmpestri(XMMRegister xmm1, XMMRegister xmm2, int imm8);
|
||||
@ -1443,9 +1448,12 @@ private:
|
||||
// Shift Right by bytes Logical DoubleQuadword Immediate
|
||||
void psrldq(XMMRegister dst, int shift);
|
||||
|
||||
// Logical Compare Double Quadword
|
||||
// Logical Compare 128bit
|
||||
void ptest(XMMRegister dst, XMMRegister src);
|
||||
void ptest(XMMRegister dst, Address src);
|
||||
// Logical Compare 256bit
|
||||
void vptest(XMMRegister dst, XMMRegister src);
|
||||
void vptest(XMMRegister dst, Address src);
|
||||
|
||||
// Interleave Low Bytes
|
||||
void punpcklbw(XMMRegister dst, XMMRegister src);
|
||||
@ -1753,6 +1761,9 @@ private:
|
||||
void vextractf128h(Address dst, XMMRegister src);
|
||||
void vextracti128h(Address dst, XMMRegister src);
|
||||
|
||||
// duplicate 4-bytes integer data from src into 8 locations in dest
|
||||
void vpbroadcastd(XMMRegister dst, XMMRegister src);
|
||||
|
||||
// AVX instruction which is used to clear upper 128 bits of YMM registers and
|
||||
// to avoid transaction penalty between AVX and SSE states. There is no
|
||||
// penalty if legacy SSE instructions are encoded using VEX prefix because
|
||||
|
||||
@ -120,6 +120,9 @@ define_pd_global(intx, CMSYoungGenPerWorker, 64*M); // default max size of CMS
|
||||
product(bool, UseUnalignedLoadStores, false, \
|
||||
"Use SSE2 MOVDQU instruction for Arraycopy") \
|
||||
\
|
||||
product(bool, UseFastStosb, false, \
|
||||
"Use fast-string operation for zeroing: rep stosb") \
|
||||
\
|
||||
/* assembler */ \
|
||||
product(bool, Use486InstrsOnly, false, \
|
||||
"Use 80486 Compliant instruction subset") \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -38,14 +38,9 @@
|
||||
|
||||
#define JNICALL
|
||||
typedef int jint;
|
||||
#if defined(_LP64) && !defined(__APPLE__)
|
||||
#if defined(_LP64)
|
||||
typedef long jlong;
|
||||
#else
|
||||
/*
|
||||
* On _LP64 __APPLE__ "long" and "long long" are both 64 bits,
|
||||
* but we use the "long long" typedef to avoid complaints from
|
||||
* the __APPLE__ compiler about fprintf formats.
|
||||
*/
|
||||
typedef long long jlong;
|
||||
#endif
|
||||
|
||||
|
||||
@ -2540,7 +2540,7 @@ void MacroAssembler::jump_cc(Condition cc, AddressLiteral dst) {
|
||||
// 0000 1111 1000 tttn #32-bit disp
|
||||
emit_int8(0x0F);
|
||||
emit_int8((unsigned char)(0x80 | cc));
|
||||
emit_long(offs - long_size);
|
||||
emit_int32(offs - long_size);
|
||||
}
|
||||
} else {
|
||||
#ifdef ASSERT
|
||||
@ -5224,6 +5224,22 @@ void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode
|
||||
|
||||
}
|
||||
|
||||
void MacroAssembler::clear_mem(Register base, Register cnt, Register tmp) {
|
||||
// cnt - number of qwords (8-byte words).
|
||||
// base - start address, qword aligned.
|
||||
assert(base==rdi, "base register must be edi for rep stos");
|
||||
assert(tmp==rax, "tmp register must be eax for rep stos");
|
||||
assert(cnt==rcx, "cnt register must be ecx for rep stos");
|
||||
|
||||
xorptr(tmp, tmp);
|
||||
if (UseFastStosb) {
|
||||
shlptr(cnt,3); // convert to number of bytes
|
||||
rep_stosb();
|
||||
} else {
|
||||
NOT_LP64(shlptr(cnt,1);) // convert to number of dwords for 32-bit VM
|
||||
rep_stos();
|
||||
}
|
||||
}
|
||||
|
||||
// IndexOf for constant substrings with size >= 8 chars
|
||||
// which don't need to be loaded through stack.
|
||||
@ -5659,42 +5675,114 @@ void MacroAssembler::string_compare(Register str1, Register str2,
|
||||
testl(cnt2, cnt2);
|
||||
jcc(Assembler::zero, LENGTH_DIFF_LABEL);
|
||||
|
||||
// Load first characters
|
||||
// Compare first characters
|
||||
load_unsigned_short(result, Address(str1, 0));
|
||||
load_unsigned_short(cnt1, Address(str2, 0));
|
||||
|
||||
// Compare first characters
|
||||
subl(result, cnt1);
|
||||
jcc(Assembler::notZero, POP_LABEL);
|
||||
decrementl(cnt2);
|
||||
jcc(Assembler::zero, LENGTH_DIFF_LABEL);
|
||||
cmpl(cnt2, 1);
|
||||
jcc(Assembler::equal, LENGTH_DIFF_LABEL);
|
||||
|
||||
{
|
||||
// Check after comparing first character to see if strings are equivalent
|
||||
Label LSkip2;
|
||||
// Check if the strings start at same location
|
||||
cmpptr(str1, str2);
|
||||
jccb(Assembler::notEqual, LSkip2);
|
||||
|
||||
// Check if the length difference is zero (from stack)
|
||||
cmpl(Address(rsp, 0), 0x0);
|
||||
jcc(Assembler::equal, LENGTH_DIFF_LABEL);
|
||||
|
||||
// Strings might not be equivalent
|
||||
bind(LSkip2);
|
||||
}
|
||||
// Check if the strings start at the same location.
|
||||
cmpptr(str1, str2);
|
||||
jcc(Assembler::equal, LENGTH_DIFF_LABEL);
|
||||
|
||||
Address::ScaleFactor scale = Address::times_2;
|
||||
int stride = 8;
|
||||
|
||||
// Advance to next element
|
||||
addptr(str1, 16/stride);
|
||||
addptr(str2, 16/stride);
|
||||
if (UseAVX >= 2) {
|
||||
Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_WIDE_TAIL, COMPARE_SMALL_STR;
|
||||
Label COMPARE_WIDE_VECTORS_LOOP, COMPARE_16_CHARS, COMPARE_INDEX_CHAR;
|
||||
Label COMPARE_TAIL_LONG;
|
||||
int pcmpmask = 0x19;
|
||||
|
||||
if (UseSSE42Intrinsics) {
|
||||
// Setup to compare 16-chars (32-bytes) vectors,
|
||||
// start from first character again because it has aligned address.
|
||||
int stride2 = 16;
|
||||
int adr_stride = stride << scale;
|
||||
int adr_stride2 = stride2 << scale;
|
||||
|
||||
assert(result == rax && cnt2 == rdx && cnt1 == rcx, "pcmpestri");
|
||||
// rax and rdx are used by pcmpestri as elements counters
|
||||
movl(result, cnt2);
|
||||
andl(cnt2, ~(stride2-1)); // cnt2 holds the vector count
|
||||
jcc(Assembler::zero, COMPARE_TAIL_LONG);
|
||||
|
||||
// fast path : compare first 2 8-char vectors.
|
||||
bind(COMPARE_16_CHARS);
|
||||
movdqu(vec1, Address(str1, 0));
|
||||
pcmpestri(vec1, Address(str2, 0), pcmpmask);
|
||||
jccb(Assembler::below, COMPARE_INDEX_CHAR);
|
||||
|
||||
movdqu(vec1, Address(str1, adr_stride));
|
||||
pcmpestri(vec1, Address(str2, adr_stride), pcmpmask);
|
||||
jccb(Assembler::aboveEqual, COMPARE_WIDE_VECTORS);
|
||||
addl(cnt1, stride);
|
||||
|
||||
// Compare the characters at index in cnt1
|
||||
bind(COMPARE_INDEX_CHAR); //cnt1 has the offset of the mismatching character
|
||||
load_unsigned_short(result, Address(str1, cnt1, scale));
|
||||
load_unsigned_short(cnt2, Address(str2, cnt1, scale));
|
||||
subl(result, cnt2);
|
||||
jmp(POP_LABEL);
|
||||
|
||||
// Setup the registers to start vector comparison loop
|
||||
bind(COMPARE_WIDE_VECTORS);
|
||||
lea(str1, Address(str1, result, scale));
|
||||
lea(str2, Address(str2, result, scale));
|
||||
subl(result, stride2);
|
||||
subl(cnt2, stride2);
|
||||
jccb(Assembler::zero, COMPARE_WIDE_TAIL);
|
||||
negptr(result);
|
||||
|
||||
// In a loop, compare 16-chars (32-bytes) at once using (vpxor+vptest)
|
||||
bind(COMPARE_WIDE_VECTORS_LOOP);
|
||||
vmovdqu(vec1, Address(str1, result, scale));
|
||||
vpxor(vec1, Address(str2, result, scale));
|
||||
vptest(vec1, vec1);
|
||||
jccb(Assembler::notZero, VECTOR_NOT_EQUAL);
|
||||
addptr(result, stride2);
|
||||
subl(cnt2, stride2);
|
||||
jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP);
|
||||
|
||||
// compare wide vectors tail
|
||||
bind(COMPARE_WIDE_TAIL);
|
||||
testptr(result, result);
|
||||
jccb(Assembler::zero, LENGTH_DIFF_LABEL);
|
||||
|
||||
movl(result, stride2);
|
||||
movl(cnt2, result);
|
||||
negptr(result);
|
||||
jmpb(COMPARE_WIDE_VECTORS_LOOP);
|
||||
|
||||
// Identifies the mismatching (higher or lower)16-bytes in the 32-byte vectors.
|
||||
bind(VECTOR_NOT_EQUAL);
|
||||
lea(str1, Address(str1, result, scale));
|
||||
lea(str2, Address(str2, result, scale));
|
||||
jmp(COMPARE_16_CHARS);
|
||||
|
||||
// Compare tail chars, length between 1 to 15 chars
|
||||
bind(COMPARE_TAIL_LONG);
|
||||
movl(cnt2, result);
|
||||
cmpl(cnt2, stride);
|
||||
jccb(Assembler::less, COMPARE_SMALL_STR);
|
||||
|
||||
movdqu(vec1, Address(str1, 0));
|
||||
pcmpestri(vec1, Address(str2, 0), pcmpmask);
|
||||
jcc(Assembler::below, COMPARE_INDEX_CHAR);
|
||||
subptr(cnt2, stride);
|
||||
jccb(Assembler::zero, LENGTH_DIFF_LABEL);
|
||||
lea(str1, Address(str1, result, scale));
|
||||
lea(str2, Address(str2, result, scale));
|
||||
negptr(cnt2);
|
||||
jmpb(WHILE_HEAD_LABEL);
|
||||
|
||||
bind(COMPARE_SMALL_STR);
|
||||
} else if (UseSSE42Intrinsics) {
|
||||
Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_TAIL;
|
||||
int pcmpmask = 0x19;
|
||||
// Setup to compare 16-byte vectors
|
||||
// Setup to compare 8-char (16-byte) vectors,
|
||||
// start from first character again because it has aligned address.
|
||||
movl(result, cnt2);
|
||||
andl(cnt2, ~(stride - 1)); // cnt2 holds the vector count
|
||||
jccb(Assembler::zero, COMPARE_TAIL);
|
||||
@ -5726,7 +5814,7 @@ void MacroAssembler::string_compare(Register str1, Register str2,
|
||||
jccb(Assembler::notZero, COMPARE_WIDE_VECTORS);
|
||||
|
||||
// compare wide vectors tail
|
||||
testl(result, result);
|
||||
testptr(result, result);
|
||||
jccb(Assembler::zero, LENGTH_DIFF_LABEL);
|
||||
|
||||
movl(cnt2, stride);
|
||||
@ -5738,21 +5826,20 @@ void MacroAssembler::string_compare(Register str1, Register str2,
|
||||
|
||||
// Mismatched characters in the vectors
|
||||
bind(VECTOR_NOT_EQUAL);
|
||||
addptr(result, cnt1);
|
||||
movptr(cnt2, result);
|
||||
load_unsigned_short(result, Address(str1, cnt2, scale));
|
||||
load_unsigned_short(cnt1, Address(str2, cnt2, scale));
|
||||
subl(result, cnt1);
|
||||
addptr(cnt1, result);
|
||||
load_unsigned_short(result, Address(str1, cnt1, scale));
|
||||
load_unsigned_short(cnt2, Address(str2, cnt1, scale));
|
||||
subl(result, cnt2);
|
||||
jmpb(POP_LABEL);
|
||||
|
||||
bind(COMPARE_TAIL); // limit is zero
|
||||
movl(cnt2, result);
|
||||
// Fallthru to tail compare
|
||||
}
|
||||
|
||||
// Shift str2 and str1 to the end of the arrays, negate min
|
||||
lea(str1, Address(str1, cnt2, scale, 0));
|
||||
lea(str2, Address(str2, cnt2, scale, 0));
|
||||
lea(str1, Address(str1, cnt2, scale));
|
||||
lea(str2, Address(str2, cnt2, scale));
|
||||
decrementl(cnt2); // first character was compared already
|
||||
negptr(cnt2);
|
||||
|
||||
// Compare the rest of the elements
|
||||
@ -5817,7 +5904,44 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist
|
||||
shll(limit, 1); // byte count != 0
|
||||
movl(result, limit); // copy
|
||||
|
||||
if (UseSSE42Intrinsics) {
|
||||
if (UseAVX >= 2) {
|
||||
// With AVX2, use 32-byte vector compare
|
||||
Label COMPARE_WIDE_VECTORS, COMPARE_TAIL;
|
||||
|
||||
// Compare 32-byte vectors
|
||||
andl(result, 0x0000001e); // tail count (in bytes)
|
||||
andl(limit, 0xffffffe0); // vector count (in bytes)
|
||||
jccb(Assembler::zero, COMPARE_TAIL);
|
||||
|
||||
lea(ary1, Address(ary1, limit, Address::times_1));
|
||||
lea(ary2, Address(ary2, limit, Address::times_1));
|
||||
negptr(limit);
|
||||
|
||||
bind(COMPARE_WIDE_VECTORS);
|
||||
vmovdqu(vec1, Address(ary1, limit, Address::times_1));
|
||||
vmovdqu(vec2, Address(ary2, limit, Address::times_1));
|
||||
vpxor(vec1, vec2);
|
||||
|
||||
vptest(vec1, vec1);
|
||||
jccb(Assembler::notZero, FALSE_LABEL);
|
||||
addptr(limit, 32);
|
||||
jcc(Assembler::notZero, COMPARE_WIDE_VECTORS);
|
||||
|
||||
testl(result, result);
|
||||
jccb(Assembler::zero, TRUE_LABEL);
|
||||
|
||||
vmovdqu(vec1, Address(ary1, result, Address::times_1, -32));
|
||||
vmovdqu(vec2, Address(ary2, result, Address::times_1, -32));
|
||||
vpxor(vec1, vec2);
|
||||
|
||||
vptest(vec1, vec1);
|
||||
jccb(Assembler::notZero, FALSE_LABEL);
|
||||
jmpb(TRUE_LABEL);
|
||||
|
||||
bind(COMPARE_TAIL); // limit is zero
|
||||
movl(limit, result);
|
||||
// Fallthru to tail compare
|
||||
} else if (UseSSE42Intrinsics) {
|
||||
// With SSE4.2, use double quad vector compare
|
||||
Label COMPARE_WIDE_VECTORS, COMPARE_TAIL;
|
||||
|
||||
@ -5995,29 +6119,53 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
{
|
||||
assert( UseSSE >= 2, "supported cpu only" );
|
||||
Label L_fill_32_bytes_loop, L_check_fill_8_bytes, L_fill_8_bytes_loop, L_fill_8_bytes;
|
||||
// Fill 32-byte chunks
|
||||
movdl(xtmp, value);
|
||||
pshufd(xtmp, xtmp, 0);
|
||||
if (UseAVX >= 2 && UseUnalignedLoadStores) {
|
||||
// Fill 64-byte chunks
|
||||
Label L_fill_64_bytes_loop, L_check_fill_32_bytes;
|
||||
vpbroadcastd(xtmp, xtmp);
|
||||
|
||||
subl(count, 8 << shift);
|
||||
jcc(Assembler::less, L_check_fill_8_bytes);
|
||||
align(16);
|
||||
subl(count, 16 << shift);
|
||||
jcc(Assembler::less, L_check_fill_32_bytes);
|
||||
align(16);
|
||||
|
||||
BIND(L_fill_32_bytes_loop);
|
||||
BIND(L_fill_64_bytes_loop);
|
||||
vmovdqu(Address(to, 0), xtmp);
|
||||
vmovdqu(Address(to, 32), xtmp);
|
||||
addptr(to, 64);
|
||||
subl(count, 16 << shift);
|
||||
jcc(Assembler::greaterEqual, L_fill_64_bytes_loop);
|
||||
|
||||
if (UseUnalignedLoadStores) {
|
||||
movdqu(Address(to, 0), xtmp);
|
||||
movdqu(Address(to, 16), xtmp);
|
||||
BIND(L_check_fill_32_bytes);
|
||||
addl(count, 8 << shift);
|
||||
jccb(Assembler::less, L_check_fill_8_bytes);
|
||||
vmovdqu(Address(to, 0), xtmp);
|
||||
addptr(to, 32);
|
||||
subl(count, 8 << shift);
|
||||
} else {
|
||||
movq(Address(to, 0), xtmp);
|
||||
movq(Address(to, 8), xtmp);
|
||||
movq(Address(to, 16), xtmp);
|
||||
movq(Address(to, 24), xtmp);
|
||||
}
|
||||
// Fill 32-byte chunks
|
||||
pshufd(xtmp, xtmp, 0);
|
||||
|
||||
addptr(to, 32);
|
||||
subl(count, 8 << shift);
|
||||
jcc(Assembler::greaterEqual, L_fill_32_bytes_loop);
|
||||
subl(count, 8 << shift);
|
||||
jcc(Assembler::less, L_check_fill_8_bytes);
|
||||
align(16);
|
||||
|
||||
BIND(L_fill_32_bytes_loop);
|
||||
|
||||
if (UseUnalignedLoadStores) {
|
||||
movdqu(Address(to, 0), xtmp);
|
||||
movdqu(Address(to, 16), xtmp);
|
||||
} else {
|
||||
movq(Address(to, 0), xtmp);
|
||||
movq(Address(to, 8), xtmp);
|
||||
movq(Address(to, 16), xtmp);
|
||||
movq(Address(to, 24), xtmp);
|
||||
}
|
||||
|
||||
addptr(to, 32);
|
||||
subl(count, 8 << shift);
|
||||
jcc(Assembler::greaterEqual, L_fill_32_bytes_loop);
|
||||
}
|
||||
BIND(L_check_fill_8_bytes);
|
||||
addl(count, 8 << shift);
|
||||
jccb(Assembler::zero, L_exit);
|
||||
@ -6061,6 +6209,128 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
}
|
||||
BIND(L_exit);
|
||||
}
|
||||
|
||||
// encode char[] to byte[] in ISO_8859_1
|
||||
void MacroAssembler::encode_iso_array(Register src, Register dst, Register len,
|
||||
XMMRegister tmp1Reg, XMMRegister tmp2Reg,
|
||||
XMMRegister tmp3Reg, XMMRegister tmp4Reg,
|
||||
Register tmp5, Register result) {
|
||||
// rsi: src
|
||||
// rdi: dst
|
||||
// rdx: len
|
||||
// rcx: tmp5
|
||||
// rax: result
|
||||
ShortBranchVerifier sbv(this);
|
||||
assert_different_registers(src, dst, len, tmp5, result);
|
||||
Label L_done, L_copy_1_char, L_copy_1_char_exit;
|
||||
|
||||
// set result
|
||||
xorl(result, result);
|
||||
// check for zero length
|
||||
testl(len, len);
|
||||
jcc(Assembler::zero, L_done);
|
||||
movl(result, len);
|
||||
|
||||
// Setup pointers
|
||||
lea(src, Address(src, len, Address::times_2)); // char[]
|
||||
lea(dst, Address(dst, len, Address::times_1)); // byte[]
|
||||
negptr(len);
|
||||
|
||||
if (UseSSE42Intrinsics || UseAVX >= 2) {
|
||||
Label L_chars_8_check, L_copy_8_chars, L_copy_8_chars_exit;
|
||||
Label L_chars_16_check, L_copy_16_chars, L_copy_16_chars_exit;
|
||||
|
||||
if (UseAVX >= 2) {
|
||||
Label L_chars_32_check, L_copy_32_chars, L_copy_32_chars_exit;
|
||||
movl(tmp5, 0xff00ff00); // create mask to test for Unicode chars in vector
|
||||
movdl(tmp1Reg, tmp5);
|
||||
vpbroadcastd(tmp1Reg, tmp1Reg);
|
||||
jmpb(L_chars_32_check);
|
||||
|
||||
bind(L_copy_32_chars);
|
||||
vmovdqu(tmp3Reg, Address(src, len, Address::times_2, -64));
|
||||
vmovdqu(tmp4Reg, Address(src, len, Address::times_2, -32));
|
||||
vpor(tmp2Reg, tmp3Reg, tmp4Reg, /* vector256 */ true);
|
||||
vptest(tmp2Reg, tmp1Reg); // check for Unicode chars in vector
|
||||
jccb(Assembler::notZero, L_copy_32_chars_exit);
|
||||
vpackuswb(tmp3Reg, tmp3Reg, tmp4Reg, /* vector256 */ true);
|
||||
vpermq(tmp4Reg, tmp3Reg, 0xD8, /* vector256 */ true);
|
||||
vmovdqu(Address(dst, len, Address::times_1, -32), tmp4Reg);
|
||||
|
||||
bind(L_chars_32_check);
|
||||
addptr(len, 32);
|
||||
jccb(Assembler::lessEqual, L_copy_32_chars);
|
||||
|
||||
bind(L_copy_32_chars_exit);
|
||||
subptr(len, 16);
|
||||
jccb(Assembler::greater, L_copy_16_chars_exit);
|
||||
|
||||
} else if (UseSSE42Intrinsics) {
|
||||
movl(tmp5, 0xff00ff00); // create mask to test for Unicode chars in vector
|
||||
movdl(tmp1Reg, tmp5);
|
||||
pshufd(tmp1Reg, tmp1Reg, 0);
|
||||
jmpb(L_chars_16_check);
|
||||
}
|
||||
|
||||
bind(L_copy_16_chars);
|
||||
if (UseAVX >= 2) {
|
||||
vmovdqu(tmp2Reg, Address(src, len, Address::times_2, -32));
|
||||
vptest(tmp2Reg, tmp1Reg);
|
||||
jccb(Assembler::notZero, L_copy_16_chars_exit);
|
||||
vpackuswb(tmp2Reg, tmp2Reg, tmp1Reg, /* vector256 */ true);
|
||||
vpermq(tmp3Reg, tmp2Reg, 0xD8, /* vector256 */ true);
|
||||
} else {
|
||||
if (UseAVX > 0) {
|
||||
movdqu(tmp3Reg, Address(src, len, Address::times_2, -32));
|
||||
movdqu(tmp4Reg, Address(src, len, Address::times_2, -16));
|
||||
vpor(tmp2Reg, tmp3Reg, tmp4Reg, /* vector256 */ false);
|
||||
} else {
|
||||
movdqu(tmp3Reg, Address(src, len, Address::times_2, -32));
|
||||
por(tmp2Reg, tmp3Reg);
|
||||
movdqu(tmp4Reg, Address(src, len, Address::times_2, -16));
|
||||
por(tmp2Reg, tmp4Reg);
|
||||
}
|
||||
ptest(tmp2Reg, tmp1Reg); // check for Unicode chars in vector
|
||||
jccb(Assembler::notZero, L_copy_16_chars_exit);
|
||||
packuswb(tmp3Reg, tmp4Reg);
|
||||
}
|
||||
movdqu(Address(dst, len, Address::times_1, -16), tmp3Reg);
|
||||
|
||||
bind(L_chars_16_check);
|
||||
addptr(len, 16);
|
||||
jccb(Assembler::lessEqual, L_copy_16_chars);
|
||||
|
||||
bind(L_copy_16_chars_exit);
|
||||
subptr(len, 8);
|
||||
jccb(Assembler::greater, L_copy_8_chars_exit);
|
||||
|
||||
bind(L_copy_8_chars);
|
||||
movdqu(tmp3Reg, Address(src, len, Address::times_2, -16));
|
||||
ptest(tmp3Reg, tmp1Reg);
|
||||
jccb(Assembler::notZero, L_copy_8_chars_exit);
|
||||
packuswb(tmp3Reg, tmp1Reg);
|
||||
movq(Address(dst, len, Address::times_1, -8), tmp3Reg);
|
||||
addptr(len, 8);
|
||||
jccb(Assembler::lessEqual, L_copy_8_chars);
|
||||
|
||||
bind(L_copy_8_chars_exit);
|
||||
subptr(len, 8);
|
||||
jccb(Assembler::zero, L_done);
|
||||
}
|
||||
|
||||
bind(L_copy_1_char);
|
||||
load_unsigned_short(tmp5, Address(src, len, Address::times_2, 0));
|
||||
testl(tmp5, 0xff00); // check if Unicode char
|
||||
jccb(Assembler::notZero, L_copy_1_char_exit);
|
||||
movb(Address(dst, len, Address::times_1, 0), tmp5);
|
||||
addptr(len, 1);
|
||||
jccb(Assembler::less, L_copy_1_char);
|
||||
|
||||
bind(L_copy_1_char_exit);
|
||||
addptr(result, len); // len is negative count of not processed elements
|
||||
bind(L_done);
|
||||
}
|
||||
|
||||
#undef BIND
|
||||
#undef BLOCK_COMMENT
|
||||
|
||||
|
||||
@ -1011,6 +1011,10 @@ public:
|
||||
Assembler::vxorpd(dst, nds, src, vector256);
|
||||
}
|
||||
|
||||
// Simple version for AVX2 256bit vectors
|
||||
void vpxor(XMMRegister dst, XMMRegister src) { Assembler::vpxor(dst, dst, src, true); }
|
||||
void vpxor(XMMRegister dst, Address src) { Assembler::vpxor(dst, dst, src, true); }
|
||||
|
||||
// Move packed integer values from low 128 bit to hign 128 bit in 256 bit vector.
|
||||
void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) {
|
||||
if (UseAVX > 1) // vinserti128h is available only in AVX2
|
||||
@ -1096,6 +1100,9 @@ public:
|
||||
// C2 compiled method's prolog code.
|
||||
void verified_entry(int framesize, bool stack_bang, bool fp_mode_24b);
|
||||
|
||||
// clear memory of size 'cnt' qwords, starting at 'base'.
|
||||
void clear_mem(Register base, Register cnt, Register rtmp);
|
||||
|
||||
// IndexOf strings.
|
||||
// Small strings are loaded through stack if they cross page boundary.
|
||||
void string_indexof(Register str1, Register str2,
|
||||
@ -1128,6 +1135,10 @@ public:
|
||||
Register to, Register value, Register count,
|
||||
Register rtmp, XMMRegister xtmp);
|
||||
|
||||
void encode_iso_array(Register src, Register dst, Register len,
|
||||
XMMRegister tmp1, XMMRegister tmp2, XMMRegister tmp3,
|
||||
XMMRegister tmp4, Register tmp5, Register result);
|
||||
|
||||
#undef VIRTUAL
|
||||
|
||||
};
|
||||
|
||||
@ -796,16 +796,22 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ align(OptoLoopAlignment);
|
||||
__ BIND(L_copy_64_bytes_loop);
|
||||
|
||||
if(UseUnalignedLoadStores) {
|
||||
__ movdqu(xmm0, Address(from, 0));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 0), xmm0);
|
||||
__ movdqu(xmm1, Address(from, 16));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 16), xmm1);
|
||||
__ movdqu(xmm2, Address(from, 32));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 32), xmm2);
|
||||
__ movdqu(xmm3, Address(from, 48));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 48), xmm3);
|
||||
|
||||
if (UseUnalignedLoadStores) {
|
||||
if (UseAVX >= 2) {
|
||||
__ vmovdqu(xmm0, Address(from, 0));
|
||||
__ vmovdqu(Address(from, to_from, Address::times_1, 0), xmm0);
|
||||
__ vmovdqu(xmm1, Address(from, 32));
|
||||
__ vmovdqu(Address(from, to_from, Address::times_1, 32), xmm1);
|
||||
} else {
|
||||
__ movdqu(xmm0, Address(from, 0));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 0), xmm0);
|
||||
__ movdqu(xmm1, Address(from, 16));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 16), xmm1);
|
||||
__ movdqu(xmm2, Address(from, 32));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 32), xmm2);
|
||||
__ movdqu(xmm3, Address(from, 48));
|
||||
__ movdqu(Address(from, to_from, Address::times_1, 48), xmm3);
|
||||
}
|
||||
} else {
|
||||
__ movq(xmm0, Address(from, 0));
|
||||
__ movq(Address(from, to_from, Address::times_1, 0), xmm0);
|
||||
|
||||
@ -1286,23 +1286,54 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// end_to - destination array end address
|
||||
// qword_count - 64-bits element count, negative
|
||||
// to - scratch
|
||||
// L_copy_32_bytes - entry label
|
||||
// L_copy_bytes - entry label
|
||||
// L_copy_8_bytes - exit label
|
||||
//
|
||||
void copy_32_bytes_forward(Register end_from, Register end_to,
|
||||
void copy_bytes_forward(Register end_from, Register end_to,
|
||||
Register qword_count, Register to,
|
||||
Label& L_copy_32_bytes, Label& L_copy_8_bytes) {
|
||||
Label& L_copy_bytes, Label& L_copy_8_bytes) {
|
||||
DEBUG_ONLY(__ stop("enter at entry label, not here"));
|
||||
Label L_loop;
|
||||
__ align(OptoLoopAlignment);
|
||||
__ BIND(L_loop);
|
||||
if(UseUnalignedLoadStores) {
|
||||
__ movdqu(xmm0, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, -24), xmm0);
|
||||
__ movdqu(xmm1, Address(end_from, qword_count, Address::times_8, - 8));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, - 8), xmm1);
|
||||
|
||||
if (UseUnalignedLoadStores) {
|
||||
Label L_end;
|
||||
// Copy 64-bytes per iteration
|
||||
__ BIND(L_loop);
|
||||
if (UseAVX >= 2) {
|
||||
__ vmovdqu(xmm0, Address(end_from, qword_count, Address::times_8, -56));
|
||||
__ vmovdqu(Address(end_to, qword_count, Address::times_8, -56), xmm0);
|
||||
__ vmovdqu(xmm1, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ vmovdqu(Address(end_to, qword_count, Address::times_8, -24), xmm1);
|
||||
} else {
|
||||
__ movdqu(xmm0, Address(end_from, qword_count, Address::times_8, -56));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, -56), xmm0);
|
||||
__ movdqu(xmm1, Address(end_from, qword_count, Address::times_8, -40));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, -40), xmm1);
|
||||
__ movdqu(xmm2, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, -24), xmm2);
|
||||
__ movdqu(xmm3, Address(end_from, qword_count, Address::times_8, - 8));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, - 8), xmm3);
|
||||
}
|
||||
__ BIND(L_copy_bytes);
|
||||
__ addptr(qword_count, 8);
|
||||
__ jcc(Assembler::lessEqual, L_loop);
|
||||
__ subptr(qword_count, 4); // sub(8) and add(4)
|
||||
__ jccb(Assembler::greater, L_end);
|
||||
// Copy trailing 32 bytes
|
||||
if (UseAVX >= 2) {
|
||||
__ vmovdqu(xmm0, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ vmovdqu(Address(end_to, qword_count, Address::times_8, -24), xmm0);
|
||||
} else {
|
||||
__ movdqu(xmm0, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, -24), xmm0);
|
||||
__ movdqu(xmm1, Address(end_from, qword_count, Address::times_8, - 8));
|
||||
__ movdqu(Address(end_to, qword_count, Address::times_8, - 8), xmm1);
|
||||
}
|
||||
__ addptr(qword_count, 4);
|
||||
__ BIND(L_end);
|
||||
} else {
|
||||
// Copy 32-bytes per iteration
|
||||
__ BIND(L_loop);
|
||||
__ movq(to, Address(end_from, qword_count, Address::times_8, -24));
|
||||
__ movq(Address(end_to, qword_count, Address::times_8, -24), to);
|
||||
__ movq(to, Address(end_from, qword_count, Address::times_8, -16));
|
||||
@ -1311,15 +1342,15 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ movq(Address(end_to, qword_count, Address::times_8, - 8), to);
|
||||
__ movq(to, Address(end_from, qword_count, Address::times_8, - 0));
|
||||
__ movq(Address(end_to, qword_count, Address::times_8, - 0), to);
|
||||
|
||||
__ BIND(L_copy_bytes);
|
||||
__ addptr(qword_count, 4);
|
||||
__ jcc(Assembler::lessEqual, L_loop);
|
||||
}
|
||||
__ BIND(L_copy_32_bytes);
|
||||
__ addptr(qword_count, 4);
|
||||
__ jcc(Assembler::lessEqual, L_loop);
|
||||
__ subptr(qword_count, 4);
|
||||
__ jcc(Assembler::less, L_copy_8_bytes); // Copy trailing qwords
|
||||
}
|
||||
|
||||
|
||||
// Copy big chunks backward
|
||||
//
|
||||
// Inputs:
|
||||
@ -1327,23 +1358,55 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// dest - destination array address
|
||||
// qword_count - 64-bits element count
|
||||
// to - scratch
|
||||
// L_copy_32_bytes - entry label
|
||||
// L_copy_bytes - entry label
|
||||
// L_copy_8_bytes - exit label
|
||||
//
|
||||
void copy_32_bytes_backward(Register from, Register dest,
|
||||
void copy_bytes_backward(Register from, Register dest,
|
||||
Register qword_count, Register to,
|
||||
Label& L_copy_32_bytes, Label& L_copy_8_bytes) {
|
||||
Label& L_copy_bytes, Label& L_copy_8_bytes) {
|
||||
DEBUG_ONLY(__ stop("enter at entry label, not here"));
|
||||
Label L_loop;
|
||||
__ align(OptoLoopAlignment);
|
||||
__ BIND(L_loop);
|
||||
if(UseUnalignedLoadStores) {
|
||||
__ movdqu(xmm0, Address(from, qword_count, Address::times_8, 16));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 16), xmm0);
|
||||
__ movdqu(xmm1, Address(from, qword_count, Address::times_8, 0));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 0), xmm1);
|
||||
if (UseUnalignedLoadStores) {
|
||||
Label L_end;
|
||||
// Copy 64-bytes per iteration
|
||||
__ BIND(L_loop);
|
||||
if (UseAVX >= 2) {
|
||||
__ vmovdqu(xmm0, Address(from, qword_count, Address::times_8, 32));
|
||||
__ vmovdqu(Address(dest, qword_count, Address::times_8, 32), xmm0);
|
||||
__ vmovdqu(xmm1, Address(from, qword_count, Address::times_8, 0));
|
||||
__ vmovdqu(Address(dest, qword_count, Address::times_8, 0), xmm1);
|
||||
} else {
|
||||
__ movdqu(xmm0, Address(from, qword_count, Address::times_8, 48));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 48), xmm0);
|
||||
__ movdqu(xmm1, Address(from, qword_count, Address::times_8, 32));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 32), xmm1);
|
||||
__ movdqu(xmm2, Address(from, qword_count, Address::times_8, 16));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 16), xmm2);
|
||||
__ movdqu(xmm3, Address(from, qword_count, Address::times_8, 0));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 0), xmm3);
|
||||
}
|
||||
__ BIND(L_copy_bytes);
|
||||
__ subptr(qword_count, 8);
|
||||
__ jcc(Assembler::greaterEqual, L_loop);
|
||||
|
||||
__ addptr(qword_count, 4); // add(8) and sub(4)
|
||||
__ jccb(Assembler::less, L_end);
|
||||
// Copy trailing 32 bytes
|
||||
if (UseAVX >= 2) {
|
||||
__ vmovdqu(xmm0, Address(from, qword_count, Address::times_8, 0));
|
||||
__ vmovdqu(Address(dest, qword_count, Address::times_8, 0), xmm0);
|
||||
} else {
|
||||
__ movdqu(xmm0, Address(from, qword_count, Address::times_8, 16));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 16), xmm0);
|
||||
__ movdqu(xmm1, Address(from, qword_count, Address::times_8, 0));
|
||||
__ movdqu(Address(dest, qword_count, Address::times_8, 0), xmm1);
|
||||
}
|
||||
__ subptr(qword_count, 4);
|
||||
__ BIND(L_end);
|
||||
} else {
|
||||
// Copy 32-bytes per iteration
|
||||
__ BIND(L_loop);
|
||||
__ movq(to, Address(from, qword_count, Address::times_8, 24));
|
||||
__ movq(Address(dest, qword_count, Address::times_8, 24), to);
|
||||
__ movq(to, Address(from, qword_count, Address::times_8, 16));
|
||||
@ -1352,10 +1415,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ movq(Address(dest, qword_count, Address::times_8, 8), to);
|
||||
__ movq(to, Address(from, qword_count, Address::times_8, 0));
|
||||
__ movq(Address(dest, qword_count, Address::times_8, 0), to);
|
||||
|
||||
__ BIND(L_copy_bytes);
|
||||
__ subptr(qword_count, 4);
|
||||
__ jcc(Assembler::greaterEqual, L_loop);
|
||||
}
|
||||
__ BIND(L_copy_32_bytes);
|
||||
__ subptr(qword_count, 4);
|
||||
__ jcc(Assembler::greaterEqual, L_loop);
|
||||
__ addptr(qword_count, 4);
|
||||
__ jcc(Assembler::greater, L_copy_8_bytes); // Copy trailing qwords
|
||||
}
|
||||
@ -1385,7 +1449,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes, L_copy_2_bytes;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes, L_copy_2_bytes;
|
||||
Label L_copy_byte, L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
@ -1417,7 +1481,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
|
||||
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
|
||||
__ negptr(qword_count); // make the count negative
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1460,8 +1524,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_forward(end_from, end_to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_forward(end_from, end_to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
__ jmp(L_copy_4_bytes);
|
||||
|
||||
return start;
|
||||
@ -1488,7 +1552,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes, L_copy_2_bytes;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes, L_copy_2_bytes;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register count = rdx; // elements count
|
||||
@ -1531,10 +1595,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Check for and copy trailing dword
|
||||
__ BIND(L_copy_4_bytes);
|
||||
__ testl(byte_count, 4);
|
||||
__ jcc(Assembler::zero, L_copy_32_bytes);
|
||||
__ jcc(Assembler::zero, L_copy_bytes);
|
||||
__ movl(rax, Address(from, qword_count, Address::times_8));
|
||||
__ movl(Address(to, qword_count, Address::times_8), rax);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1549,8 +1613,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_backward(from, to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_backward(from, to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
|
||||
restore_arg_regs();
|
||||
inc_counter_np(SharedRuntime::_jbyte_array_copy_ctr); // Update counter after rscratch1 is free
|
||||
@ -1585,7 +1649,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes,L_copy_2_bytes,L_exit;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes,L_copy_2_bytes,L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register count = rdx; // elements count
|
||||
@ -1616,7 +1680,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
|
||||
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
|
||||
__ negptr(qword_count);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1652,8 +1716,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_forward(end_from, end_to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_forward(end_from, end_to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
__ jmp(L_copy_4_bytes);
|
||||
|
||||
return start;
|
||||
@ -1700,7 +1764,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register count = rdx; // elements count
|
||||
@ -1735,10 +1799,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Check for and copy trailing dword
|
||||
__ BIND(L_copy_4_bytes);
|
||||
__ testl(word_count, 2);
|
||||
__ jcc(Assembler::zero, L_copy_32_bytes);
|
||||
__ jcc(Assembler::zero, L_copy_bytes);
|
||||
__ movl(rax, Address(from, qword_count, Address::times_8));
|
||||
__ movl(Address(to, qword_count, Address::times_8), rax);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1753,8 +1817,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_backward(from, to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_backward(from, to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
|
||||
restore_arg_regs();
|
||||
inc_counter_np(SharedRuntime::_jshort_array_copy_ctr); // Update counter after rscratch1 is free
|
||||
@ -1790,7 +1854,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes, L_exit;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_4_bytes, L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register count = rdx; // elements count
|
||||
@ -1826,7 +1890,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
|
||||
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
|
||||
__ negptr(qword_count);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1853,8 +1917,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy 32-bytes chunks
|
||||
copy_32_bytes_forward(end_from, end_to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_forward(end_from, end_to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
__ jmp(L_copy_4_bytes);
|
||||
|
||||
return start;
|
||||
@ -1882,7 +1946,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_copy_2_bytes, L_exit;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_copy_2_bytes, L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register count = rdx; // elements count
|
||||
@ -1916,10 +1980,10 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// Check for and copy trailing dword
|
||||
__ testl(dword_count, 1);
|
||||
__ jcc(Assembler::zero, L_copy_32_bytes);
|
||||
__ jcc(Assembler::zero, L_copy_bytes);
|
||||
__ movl(rax, Address(from, dword_count, Address::times_4, -4));
|
||||
__ movl(Address(to, dword_count, Address::times_4, -4), rax);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -1937,8 +2001,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ ret(0);
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_backward(from, to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_backward(from, to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
|
||||
__ bind(L_exit);
|
||||
if (is_oop) {
|
||||
@ -1976,7 +2040,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_exit;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register qword_count = rdx; // elements count
|
||||
@ -2008,7 +2072,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
|
||||
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
|
||||
__ negptr(qword_count);
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -2027,8 +2091,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ ret(0);
|
||||
}
|
||||
|
||||
// Copy 64-byte chunks
|
||||
copy_32_bytes_forward(end_from, end_to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_forward(end_from, end_to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
|
||||
if (is_oop) {
|
||||
__ BIND(L_exit);
|
||||
@ -2065,7 +2129,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
StubCodeMark mark(this, "StubRoutines", name);
|
||||
address start = __ pc();
|
||||
|
||||
Label L_copy_32_bytes, L_copy_8_bytes, L_exit;
|
||||
Label L_copy_bytes, L_copy_8_bytes, L_exit;
|
||||
const Register from = rdi; // source array address
|
||||
const Register to = rsi; // destination array address
|
||||
const Register qword_count = rdx; // elements count
|
||||
@ -2091,7 +2155,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
gen_write_ref_array_pre_barrier(to, saved_count, dest_uninitialized);
|
||||
}
|
||||
|
||||
__ jmp(L_copy_32_bytes);
|
||||
__ jmp(L_copy_bytes);
|
||||
|
||||
// Copy trailing qwords
|
||||
__ BIND(L_copy_8_bytes);
|
||||
@ -2110,8 +2174,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ ret(0);
|
||||
}
|
||||
|
||||
// Copy in 32-bytes chunks
|
||||
copy_32_bytes_backward(from, to, qword_count, rax, L_copy_32_bytes, L_copy_8_bytes);
|
||||
// Copy in multi-bytes chunks
|
||||
copy_bytes_backward(from, to, qword_count, rax, L_copy_bytes, L_copy_8_bytes);
|
||||
|
||||
if (is_oop) {
|
||||
__ BIND(L_exit);
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* JavaCallWrapper */ \
|
||||
@ -37,31 +37,14 @@
|
||||
/******************************/ \
|
||||
/* JavaFrameAnchor */ \
|
||||
/******************************/ \
|
||||
volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \
|
||||
\
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*)
|
||||
|
||||
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type)
|
||||
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP
|
||||
|
||||
@ -429,7 +429,7 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
|
||||
char buf[256];
|
||||
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
cores_per_cpu(), threads_per_core(),
|
||||
cpu_family(), _model, _stepping,
|
||||
(supports_cmov() ? ", cmov" : ""),
|
||||
@ -446,6 +446,7 @@ void VM_Version::get_processor_features() {
|
||||
(supports_avx() ? ", avx" : ""),
|
||||
(supports_avx2() ? ", avx2" : ""),
|
||||
(supports_aes() ? ", aes" : ""),
|
||||
(supports_erms() ? ", erms" : ""),
|
||||
(supports_mmx_ext() ? ", mmxext" : ""),
|
||||
(supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
|
||||
(supports_lzcnt() ? ", lzcnt": ""),
|
||||
@ -660,6 +661,14 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(COMPILER2) && defined(_ALLBSD_SOURCE)
|
||||
if (MaxVectorSize > 16) {
|
||||
// Limit vectors size to 16 bytes on BSD until it fixes
|
||||
// restoring upper 128bit of YMM registers on return
|
||||
// from signal handler.
|
||||
FLAG_SET_DEFAULT(MaxVectorSize, 16);
|
||||
}
|
||||
#endif // COMPILER2
|
||||
|
||||
// Use population count instruction if available.
|
||||
if (supports_popcnt()) {
|
||||
@ -671,6 +680,16 @@ void VM_Version::get_processor_features() {
|
||||
FLAG_SET_DEFAULT(UsePopCountInstruction, false);
|
||||
}
|
||||
|
||||
// Use fast-string operations if available.
|
||||
if (supports_erms()) {
|
||||
if (FLAG_IS_DEFAULT(UseFastStosb)) {
|
||||
UseFastStosb = true;
|
||||
}
|
||||
} else if (UseFastStosb) {
|
||||
warning("fast-string operations are not available on this CPU");
|
||||
FLAG_SET_DEFAULT(UseFastStosb, false);
|
||||
}
|
||||
|
||||
#ifdef COMPILER2
|
||||
if (FLAG_IS_DEFAULT(AlignVector)) {
|
||||
// Modern processors allow misaligned memory operations for vectors.
|
||||
@ -734,6 +753,10 @@ void VM_Version::get_processor_features() {
|
||||
PrefetchFieldsAhead = prefetch_fields_ahead();
|
||||
#endif
|
||||
|
||||
if (FLAG_IS_DEFAULT(ContendedPaddingWidth) &&
|
||||
(cache_line_size > ContendedPaddingWidth))
|
||||
ContendedPaddingWidth = cache_line_size;
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintMiscellaneous && Verbose) {
|
||||
tty->print_cr("Logical CPUs per core: %u",
|
||||
@ -780,6 +803,9 @@ void VM_Version::get_processor_features() {
|
||||
if (PrefetchFieldsAhead > 0) {
|
||||
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
|
||||
}
|
||||
if (ContendedPaddingWidth > 0) {
|
||||
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
|
||||
}
|
||||
}
|
||||
#endif // !PRODUCT
|
||||
}
|
||||
|
||||
@ -204,7 +204,8 @@ public:
|
||||
avx2 : 1,
|
||||
: 2,
|
||||
bmi2 : 1,
|
||||
: 23;
|
||||
erms : 1,
|
||||
: 22;
|
||||
} bits;
|
||||
};
|
||||
|
||||
@ -247,7 +248,8 @@ protected:
|
||||
CPU_TSCINV = (1 << 16),
|
||||
CPU_AVX = (1 << 17),
|
||||
CPU_AVX2 = (1 << 18),
|
||||
CPU_AES = (1 << 19)
|
||||
CPU_AES = (1 << 19),
|
||||
CPU_ERMS = (1 << 20) // enhanced 'rep movsb/stosb' instructions
|
||||
} cpuFeatureFlags;
|
||||
|
||||
enum {
|
||||
@ -425,6 +427,8 @@ protected:
|
||||
result |= CPU_TSCINV;
|
||||
if (_cpuid_info.std_cpuid1_ecx.bits.aes != 0)
|
||||
result |= CPU_AES;
|
||||
if (_cpuid_info.sef_cpuid7_ebx.bits.erms != 0)
|
||||
result |= CPU_ERMS;
|
||||
|
||||
// AMD features.
|
||||
if (is_amd()) {
|
||||
@ -489,7 +493,7 @@ public:
|
||||
return (_cpuid_info.std_max_function >= 0xB) &&
|
||||
// eax[4:0] | ebx[0:15] == 0 indicates invalid topology level.
|
||||
// Some cpus have max cpuid >= 0xB but do not support processor topology.
|
||||
((_cpuid_info.tpl_cpuidB0_eax & 0x1f | _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus) != 0);
|
||||
(((_cpuid_info.tpl_cpuidB0_eax & 0x1f) | _cpuid_info.tpl_cpuidB0_ebx.bits.logical_cpus) != 0);
|
||||
}
|
||||
|
||||
static uint cores_per_cpu() {
|
||||
@ -550,6 +554,7 @@ public:
|
||||
static bool supports_avx2() { return (_cpuFeatures & CPU_AVX2) != 0; }
|
||||
static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; }
|
||||
static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; }
|
||||
static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; }
|
||||
|
||||
// Intel features
|
||||
static bool is_intel_family_core() { return is_intel() &&
|
||||
|
||||
@ -11572,15 +11572,28 @@ instruct MoveL2D_reg_reg_sse(regD dst, eRegL src, regD tmp) %{
|
||||
// =======================================================================
|
||||
// fast clearing of an array
|
||||
instruct rep_stos(eCXRegI cnt, eDIRegP base, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
|
||||
predicate(!UseFastStosb);
|
||||
match(Set dummy (ClearArray cnt base));
|
||||
effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
|
||||
format %{ "SHL ECX,1\t# Convert doublewords to words\n\t"
|
||||
"XOR EAX,EAX\n\t"
|
||||
format %{ "XOR EAX,EAX\t# ClearArray:\n\t"
|
||||
"SHL ECX,1\t# Convert doublewords to words\n\t"
|
||||
"REP STOS\t# store EAX into [EDI++] while ECX--" %}
|
||||
opcode(0,0x4);
|
||||
ins_encode( Opcode(0xD1), RegOpc(ECX),
|
||||
OpcRegReg(0x33,EAX,EAX),
|
||||
Opcode(0xF3), Opcode(0xAB) );
|
||||
ins_encode %{
|
||||
__ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct rep_fast_stosb(eCXRegI cnt, eDIRegP base, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
|
||||
predicate(UseFastStosb);
|
||||
match(Set dummy (ClearArray cnt base));
|
||||
effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
|
||||
format %{ "XOR EAX,EAX\t# ClearArray:\n\t"
|
||||
"SHL ECX,3\t# Convert doublewords to bytes\n\t"
|
||||
"REP STOSB\t# store EAX into [EDI++] while ECX--" %}
|
||||
ins_encode %{
|
||||
__ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
@ -11674,6 +11687,23 @@ instruct array_equals(eDIRegP ary1, eSIRegP ary2, eAXRegI result,
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
// encode char[] to byte[] in ISO_8859_1
|
||||
instruct encode_iso_array(eSIRegP src, eDIRegP dst, eDXRegI len,
|
||||
regD tmp1, regD tmp2, regD tmp3, regD tmp4,
|
||||
eCXRegI tmp5, eAXRegI result, eFlagsReg cr) %{
|
||||
match(Set result (EncodeISOArray src (Binary dst len)));
|
||||
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
|
||||
|
||||
format %{ "Encode array $src,$dst,$len -> $result // KILL ECX, EDX, $tmp1, $tmp2, $tmp3, $tmp4, ESI, EDI " %}
|
||||
ins_encode %{
|
||||
__ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
|
||||
$tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister,
|
||||
$tmp4$$XMMRegister, $tmp5$$Register, $result$$Register);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
|
||||
//----------Control Flow Instructions------------------------------------------
|
||||
// Signed compare Instructions
|
||||
instruct compI_eReg(eFlagsReg cr, rRegI op1, rRegI op2) %{
|
||||
|
||||
@ -10374,16 +10374,33 @@ instruct MoveL2D_reg_reg(regD dst, rRegL src) %{
|
||||
instruct rep_stos(rcx_RegL cnt, rdi_RegP base, rax_RegI zero, Universe dummy,
|
||||
rFlagsReg cr)
|
||||
%{
|
||||
predicate(!UseFastStosb);
|
||||
match(Set dummy (ClearArray cnt base));
|
||||
effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
|
||||
|
||||
format %{ "xorl rax, rax\t# ClearArray:\n\t"
|
||||
"rep stosq\t# Store rax to *rdi++ while rcx--" %}
|
||||
ins_encode(opc_reg_reg(0x33, RAX, RAX), // xorl %eax, %eax
|
||||
Opcode(0xF3), Opcode(0x48), Opcode(0xAB)); // rep REX_W stos
|
||||
format %{ "xorq rax, rax\t# ClearArray:\n\t"
|
||||
"rep stosq\t# Store rax to *rdi++ while rcx--" %}
|
||||
ins_encode %{
|
||||
__ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct rep_fast_stosb(rcx_RegL cnt, rdi_RegP base, rax_RegI zero, Universe dummy,
|
||||
rFlagsReg cr)
|
||||
%{
|
||||
predicate(UseFastStosb);
|
||||
match(Set dummy (ClearArray cnt base));
|
||||
effect(USE_KILL cnt, USE_KILL base, KILL zero, KILL cr);
|
||||
format %{ "xorq rax, rax\t# ClearArray:\n\t"
|
||||
"shlq rcx,3\t# Convert doublewords to bytes\n\t"
|
||||
"rep stosb\t# Store rax to *rdi++ while rcx--" %}
|
||||
ins_encode %{
|
||||
__ clear_mem($base$$Register, $cnt$$Register, $zero$$Register);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct string_compare(rdi_RegP str1, rcx_RegI cnt1, rsi_RegP str2, rdx_RegI cnt2,
|
||||
rax_RegI result, regD tmp1, rFlagsReg cr)
|
||||
%{
|
||||
@ -10478,6 +10495,23 @@ instruct array_equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI result,
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
// encode char[] to byte[] in ISO_8859_1
|
||||
instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len,
|
||||
regD tmp1, regD tmp2, regD tmp3, regD tmp4,
|
||||
rcx_RegI tmp5, rax_RegI result, rFlagsReg cr) %{
|
||||
match(Set result (EncodeISOArray src (Binary dst len)));
|
||||
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL tmp5, KILL cr);
|
||||
|
||||
format %{ "Encode array $src,$dst,$len -> $result // KILL RCX, RDX, $tmp1, $tmp2, $tmp3, $tmp4, RSI, RDI " %}
|
||||
ins_encode %{
|
||||
__ encode_iso_array($src$$Register, $dst$$Register, $len$$Register,
|
||||
$tmp1$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister,
|
||||
$tmp4$$XMMRegister, $tmp5$$Register, $result$$Register);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
|
||||
//----------Control Flow Instructions------------------------------------------
|
||||
// Signed compare Instructions
|
||||
|
||||
|
||||
@ -98,10 +98,20 @@ BasicObjectLock* frame::interpreter_frame_monitor_end() const {
|
||||
#endif // CC_INTERP
|
||||
|
||||
void frame::patch_pc(Thread* thread, address pc) {
|
||||
// We borrow this call to set the thread pointer in the interpreter
|
||||
// state; the hook to set up deoptimized frames isn't supplied it.
|
||||
assert(pc == NULL, "should be");
|
||||
get_interpreterState()->set_thread((JavaThread *) thread);
|
||||
|
||||
if (pc != NULL) {
|
||||
_cb = CodeCache::find_blob(pc);
|
||||
SharkFrame* sharkframe = zeroframe()->as_shark_frame();
|
||||
sharkframe->set_pc(pc);
|
||||
_pc = pc;
|
||||
_deopt_state = is_deoptimized;
|
||||
|
||||
} else {
|
||||
// We borrow this call to set the thread pointer in the interpreter
|
||||
// state; the hook to set up deoptimized frames isn't supplied it.
|
||||
assert(pc == NULL, "should be");
|
||||
get_interpreterState()->set_thread((JavaThread *) thread);
|
||||
}
|
||||
}
|
||||
|
||||
bool frame::safe_for_sender(JavaThread *thread) {
|
||||
|
||||
@ -45,27 +45,36 @@ inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
|
||||
case ZeroFrame::ENTRY_FRAME:
|
||||
_pc = StubRoutines::call_stub_return_pc();
|
||||
_cb = NULL;
|
||||
_deopt_state = not_deoptimized;
|
||||
break;
|
||||
|
||||
case ZeroFrame::INTERPRETER_FRAME:
|
||||
_pc = NULL;
|
||||
_cb = NULL;
|
||||
_deopt_state = not_deoptimized;
|
||||
break;
|
||||
|
||||
case ZeroFrame::SHARK_FRAME:
|
||||
case ZeroFrame::SHARK_FRAME: {
|
||||
_pc = zero_sharkframe()->pc();
|
||||
_cb = CodeCache::find_blob_unsafe(pc());
|
||||
address original_pc = nmethod::get_deopt_original_pc(this);
|
||||
if (original_pc != NULL) {
|
||||
_pc = original_pc;
|
||||
_deopt_state = is_deoptimized;
|
||||
} else {
|
||||
_deopt_state = not_deoptimized;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case ZeroFrame::FAKE_STUB_FRAME:
|
||||
_pc = NULL;
|
||||
_cb = NULL;
|
||||
_deopt_state = not_deoptimized;
|
||||
break;
|
||||
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
_deopt_state = not_deoptimized;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
|
||||
@ -68,6 +68,10 @@ class SharkFrame : public ZeroFrame {
|
||||
return (address) value_of_word(pc_off);
|
||||
}
|
||||
|
||||
void set_pc(address pc) const {
|
||||
*((address*) addr_of_word(pc_off)) = pc;
|
||||
}
|
||||
|
||||
intptr_t* unextended_sp() const {
|
||||
return (intptr_t *) value_of_word(unextended_sp_off);
|
||||
}
|
||||
|
||||
@ -30,28 +30,12 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field)
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type)
|
||||
|
||||
#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
|
||||
#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
|
||||
/* NOTE that we do not use the last_entry() macro here; it is used */
|
||||
/* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
|
||||
/* be present there) */
|
||||
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -243,29 +243,32 @@ void os::Bsd::initialize_system_info() {
|
||||
int mib[2];
|
||||
size_t len;
|
||||
int cpu_val;
|
||||
u_long mem_val;
|
||||
julong mem_val;
|
||||
|
||||
/* get processors count via hw.ncpus sysctl */
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_NCPU;
|
||||
len = sizeof(cpu_val);
|
||||
if (sysctl(mib, 2, &cpu_val, &len, NULL, 0) != -1 && cpu_val >= 1) {
|
||||
assert(len == sizeof(cpu_val), "unexpected data size");
|
||||
set_processor_count(cpu_val);
|
||||
}
|
||||
else {
|
||||
set_processor_count(1); // fallback
|
||||
}
|
||||
|
||||
/* get physical memory via hw.usermem sysctl (hw.usermem is used
|
||||
* instead of hw.physmem because we need size of allocatable memory
|
||||
/* get physical memory via hw.memsize sysctl (hw.memsize is used
|
||||
* since it returns a 64 bit value)
|
||||
*/
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_USERMEM;
|
||||
mib[1] = HW_MEMSIZE;
|
||||
len = sizeof(mem_val);
|
||||
if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1)
|
||||
if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) {
|
||||
assert(len == sizeof(mem_val), "unexpected data size");
|
||||
_physical_memory = mem_val;
|
||||
else
|
||||
} else {
|
||||
_physical_memory = 256*1024*1024; // fallback (XXXBSD?)
|
||||
}
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
{
|
||||
@ -298,12 +301,12 @@ void os::init_system_properties_values() {
|
||||
|
||||
// The next steps are taken in the product version:
|
||||
//
|
||||
// Obtain the JAVA_HOME value from the location of libjvm[_g].so.
|
||||
// Obtain the JAVA_HOME value from the location of libjvm.so.
|
||||
// This library should be located at:
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm[_g].so.
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm.so.
|
||||
//
|
||||
// If "/jre/lib/" appears at the right place in the path, then we
|
||||
// assume libjvm[_g].so is installed in a JDK and we use this path.
|
||||
// assume libjvm.so is installed in a JDK and we use this path.
|
||||
//
|
||||
// Otherwise exit with message: "Could not create the Java virtual machine."
|
||||
//
|
||||
@ -313,9 +316,9 @@ void os::init_system_properties_values() {
|
||||
// instead of exit check for $JAVA_HOME environment variable.
|
||||
//
|
||||
// If it is defined and we are able to locate $JAVA_HOME/jre/lib/<arch>,
|
||||
// then we append a fake suffix "hotspot/libjvm[_g].so" to this path so
|
||||
// it looks like libjvm[_g].so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm[_g].so.
|
||||
// then we append a fake suffix "hotspot/libjvm.so" to this path so
|
||||
// it looks like libjvm.so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm.so.
|
||||
//
|
||||
// Otherwise exit.
|
||||
//
|
||||
@ -1228,7 +1231,7 @@ const char* os::get_current_directory(char *buf, int buflen) {
|
||||
return getcwd(buf, buflen);
|
||||
}
|
||||
|
||||
// check if addr is inside libjvm[_g].so
|
||||
// check if addr is inside libjvm.so
|
||||
bool os::address_is_in_vm(address addr) {
|
||||
static address libjvm_base_addr;
|
||||
Dl_info dlinfo;
|
||||
@ -1689,7 +1692,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
|
||||
|
||||
static char saved_jvm_path[MAXPATHLEN] = {0};
|
||||
|
||||
// Find the full path to the current module, libjvm or libjvm_g
|
||||
// Find the full path to the current module, libjvm
|
||||
void os::jvm_path(char *buf, jint buflen) {
|
||||
// Error checking.
|
||||
if (buflen < MAXPATHLEN) {
|
||||
@ -1732,10 +1735,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
char* jrelib_p;
|
||||
int len;
|
||||
|
||||
// Check the current module name "libjvm" or "libjvm_g".
|
||||
// Check the current module name "libjvm"
|
||||
p = strrchr(buf, '/');
|
||||
assert(strstr(p, "/libjvm") == p, "invalid library name");
|
||||
p = strstr(p, "_g") ? "_g" : "";
|
||||
|
||||
rp = realpath(java_home_var, buf);
|
||||
if (rp == NULL)
|
||||
@ -1764,11 +1766,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
// to complete the path to JVM being overridden. Otherwise fallback
|
||||
// to the path to the current library.
|
||||
if (0 == access(buf, F_OK)) {
|
||||
// Use current module name "libjvm[_g]" instead of
|
||||
// "libjvm"debug_only("_g")"" since for fastdebug version
|
||||
// we should have "libjvm" but debug_only("_g") adds "_g"!
|
||||
// Use current module name "libjvm"
|
||||
len = strlen(buf);
|
||||
snprintf(buf + len, buflen-len, "/libjvm%s%s", p, JNI_LIB_SUFFIX);
|
||||
snprintf(buf + len, buflen-len, "/libjvm%s", JNI_LIB_SUFFIX);
|
||||
} else {
|
||||
// Fall back to path of current library
|
||||
rp = realpath(dli_fname, buf);
|
||||
@ -4094,11 +4094,12 @@ void os::PlatformEvent::park() { // AKA "down()"
|
||||
}
|
||||
-- _nParked ;
|
||||
|
||||
// In theory we could move the ST of 0 into _Event past the unlock(),
|
||||
// but then we'd need a MEMBAR after the ST.
|
||||
_Event = 0 ;
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
}
|
||||
guarantee (_Event >= 0, "invariant") ;
|
||||
}
|
||||
@ -4161,40 +4162,44 @@ int os::PlatformEvent::park(jlong millis) {
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
assert (_nParked == 0, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void os::PlatformEvent::unpark() {
|
||||
int v, AnyWaiters ;
|
||||
for (;;) {
|
||||
v = _Event ;
|
||||
if (v > 0) {
|
||||
// The LD of _Event could have reordered or be satisfied
|
||||
// by a read-aside from this processor's write buffer.
|
||||
// To avoid problems execute a barrier and then
|
||||
// ratify the value.
|
||||
OrderAccess::fence() ;
|
||||
if (_Event == v) return ;
|
||||
continue ;
|
||||
}
|
||||
if (Atomic::cmpxchg (v+1, &_Event, v) == v) break ;
|
||||
// Transitions for _Event:
|
||||
// 0 :=> 1
|
||||
// 1 :=> 1
|
||||
// -1 :=> either 0 or 1; must signal target thread
|
||||
// That is, we can safely transition _Event from -1 to either
|
||||
// 0 or 1. Forcing 1 is slightly more efficient for back-to-back
|
||||
// unpark() calls.
|
||||
// See also: "Semaphores in Plan 9" by Mullender & Cox
|
||||
//
|
||||
// Note: Forcing a transition from "-1" to "1" on an unpark() means
|
||||
// that it will take two back-to-back park() calls for the owning
|
||||
// thread to block. This has the benefit of forcing a spurious return
|
||||
// from the first park() call after an unpark() call which will help
|
||||
// shake out uses of park() and unpark() without condition variables.
|
||||
|
||||
if (Atomic::xchg(1, &_Event) >= 0) return;
|
||||
|
||||
// Wait for the thread associated with the event to vacate
|
||||
int status = pthread_mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
int AnyWaiters = _nParked;
|
||||
assert(AnyWaiters == 0 || AnyWaiters == 1, "invariant");
|
||||
if (AnyWaiters != 0 && WorkAroundNPTLTimedWaitHang) {
|
||||
AnyWaiters = 0;
|
||||
pthread_cond_signal(_cond);
|
||||
}
|
||||
if (v < 0) {
|
||||
// Wait for the thread associated with the event to vacate
|
||||
int status = pthread_mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
AnyWaiters = _nParked ;
|
||||
assert (AnyWaiters == 0 || AnyWaiters == 1, "invariant") ;
|
||||
if (AnyWaiters != 0 && WorkAroundNPTLTimedWaitHang) {
|
||||
AnyWaiters = 0 ;
|
||||
pthread_cond_signal (_cond);
|
||||
}
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
if (AnyWaiters != 0) {
|
||||
status = pthread_cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
if (AnyWaiters != 0) {
|
||||
status = pthread_cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
|
||||
// Note that we signal() _after dropping the lock for "immortal" Events.
|
||||
@ -4280,13 +4285,14 @@ static void unpackTime(struct timespec* absTime, bool isAbsolute, jlong time) {
|
||||
}
|
||||
|
||||
void Parker::park(bool isAbsolute, jlong time) {
|
||||
// Ideally we'd do something useful while spinning, such
|
||||
// as calling unpackTime().
|
||||
|
||||
// Optional fast-path check:
|
||||
// Return immediately if a permit is available.
|
||||
if (_counter > 0) {
|
||||
_counter = 0 ;
|
||||
OrderAccess::fence();
|
||||
return ;
|
||||
}
|
||||
// We depend on Atomic::xchg() having full barrier semantics
|
||||
// since we are doing a lock-free update to _counter.
|
||||
if (Atomic::xchg(0, &_counter) > 0) return;
|
||||
|
||||
Thread* thread = Thread::current();
|
||||
assert(thread->is_Java_thread(), "Must be JavaThread");
|
||||
@ -4327,6 +4333,8 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0;
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert (status == 0, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
return;
|
||||
}
|
||||
@ -4363,12 +4371,14 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0 ;
|
||||
status = pthread_mutex_unlock(_mutex) ;
|
||||
assert_status(status == 0, status, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
|
||||
// If externally suspended while waiting, re-suspend
|
||||
if (jt->handle_special_suspend_equivalent_condition()) {
|
||||
jt->java_suspend_self();
|
||||
}
|
||||
|
||||
OrderAccess::fence();
|
||||
}
|
||||
|
||||
void Parker::unpark() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -59,14 +59,6 @@ inline const char* os::path_separator() {
|
||||
return ":";
|
||||
}
|
||||
|
||||
inline const char* os::jlong_format_specifier() {
|
||||
return "%lld";
|
||||
}
|
||||
|
||||
inline const char* os::julong_format_specifier() {
|
||||
return "%llu";
|
||||
}
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -321,12 +321,12 @@ void os::init_system_properties_values() {
|
||||
|
||||
// The next steps are taken in the product version:
|
||||
//
|
||||
// Obtain the JAVA_HOME value from the location of libjvm[_g].so.
|
||||
// Obtain the JAVA_HOME value from the location of libjvm.so.
|
||||
// This library should be located at:
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm[_g].so.
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm.so.
|
||||
//
|
||||
// If "/jre/lib/" appears at the right place in the path, then we
|
||||
// assume libjvm[_g].so is installed in a JDK and we use this path.
|
||||
// assume libjvm.so is installed in a JDK and we use this path.
|
||||
//
|
||||
// Otherwise exit with message: "Could not create the Java virtual machine."
|
||||
//
|
||||
@ -336,9 +336,9 @@ void os::init_system_properties_values() {
|
||||
// instead of exit check for $JAVA_HOME environment variable.
|
||||
//
|
||||
// If it is defined and we are able to locate $JAVA_HOME/jre/lib/<arch>,
|
||||
// then we append a fake suffix "hotspot/libjvm[_g].so" to this path so
|
||||
// it looks like libjvm[_g].so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm[_g].so.
|
||||
// then we append a fake suffix "hotspot/libjvm.so" to this path so
|
||||
// it looks like libjvm.so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm.so.
|
||||
//
|
||||
// Otherwise exit.
|
||||
//
|
||||
@ -1679,7 +1679,7 @@ const char* os::get_current_directory(char *buf, int buflen) {
|
||||
return getcwd(buf, buflen);
|
||||
}
|
||||
|
||||
// check if addr is inside libjvm[_g].so
|
||||
// check if addr is inside libjvm.so
|
||||
bool os::address_is_in_vm(address addr) {
|
||||
static address libjvm_base_addr;
|
||||
Dl_info dlinfo;
|
||||
@ -2180,7 +2180,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
|
||||
|
||||
static char saved_jvm_path[MAXPATHLEN] = {0};
|
||||
|
||||
// Find the full path to the current module, libjvm.so or libjvm_g.so
|
||||
// Find the full path to the current module, libjvm.so
|
||||
void os::jvm_path(char *buf, jint buflen) {
|
||||
// Error checking.
|
||||
if (buflen < MAXPATHLEN) {
|
||||
@ -2223,10 +2223,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
char* jrelib_p;
|
||||
int len;
|
||||
|
||||
// Check the current module name "libjvm.so" or "libjvm_g.so".
|
||||
// Check the current module name "libjvm.so".
|
||||
p = strrchr(buf, '/');
|
||||
assert(strstr(p, "/libjvm") == p, "invalid library name");
|
||||
p = strstr(p, "_g") ? "_g" : "";
|
||||
|
||||
rp = realpath(java_home_var, buf);
|
||||
if (rp == NULL)
|
||||
@ -2242,11 +2241,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
}
|
||||
|
||||
if (0 == access(buf, F_OK)) {
|
||||
// Use current module name "libjvm[_g].so" instead of
|
||||
// "libjvm"debug_only("_g")".so" since for fastdebug version
|
||||
// we should have "libjvm.so" but debug_only("_g") adds "_g"!
|
||||
// Use current module name "libjvm.so"
|
||||
len = strlen(buf);
|
||||
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
|
||||
snprintf(buf + len, buflen-len, "/hotspot/libjvm.so");
|
||||
} else {
|
||||
// Go back to path of .so
|
||||
rp = realpath(dli_fname, buf);
|
||||
@ -5004,11 +5001,12 @@ void os::PlatformEvent::park() { // AKA "down()"
|
||||
}
|
||||
-- _nParked ;
|
||||
|
||||
// In theory we could move the ST of 0 into _Event past the unlock(),
|
||||
// but then we'd need a MEMBAR after the ST.
|
||||
_Event = 0 ;
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
}
|
||||
guarantee (_Event >= 0, "invariant") ;
|
||||
}
|
||||
@ -5071,40 +5069,44 @@ int os::PlatformEvent::park(jlong millis) {
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
assert (_nParked == 0, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void os::PlatformEvent::unpark() {
|
||||
int v, AnyWaiters ;
|
||||
for (;;) {
|
||||
v = _Event ;
|
||||
if (v > 0) {
|
||||
// The LD of _Event could have reordered or be satisfied
|
||||
// by a read-aside from this processor's write buffer.
|
||||
// To avoid problems execute a barrier and then
|
||||
// ratify the value.
|
||||
OrderAccess::fence() ;
|
||||
if (_Event == v) return ;
|
||||
continue ;
|
||||
}
|
||||
if (Atomic::cmpxchg (v+1, &_Event, v) == v) break ;
|
||||
// Transitions for _Event:
|
||||
// 0 :=> 1
|
||||
// 1 :=> 1
|
||||
// -1 :=> either 0 or 1; must signal target thread
|
||||
// That is, we can safely transition _Event from -1 to either
|
||||
// 0 or 1. Forcing 1 is slightly more efficient for back-to-back
|
||||
// unpark() calls.
|
||||
// See also: "Semaphores in Plan 9" by Mullender & Cox
|
||||
//
|
||||
// Note: Forcing a transition from "-1" to "1" on an unpark() means
|
||||
// that it will take two back-to-back park() calls for the owning
|
||||
// thread to block. This has the benefit of forcing a spurious return
|
||||
// from the first park() call after an unpark() call which will help
|
||||
// shake out uses of park() and unpark() without condition variables.
|
||||
|
||||
if (Atomic::xchg(1, &_Event) >= 0) return;
|
||||
|
||||
// Wait for the thread associated with the event to vacate
|
||||
int status = pthread_mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
int AnyWaiters = _nParked;
|
||||
assert(AnyWaiters == 0 || AnyWaiters == 1, "invariant");
|
||||
if (AnyWaiters != 0 && WorkAroundNPTLTimedWaitHang) {
|
||||
AnyWaiters = 0;
|
||||
pthread_cond_signal(_cond);
|
||||
}
|
||||
if (v < 0) {
|
||||
// Wait for the thread associated with the event to vacate
|
||||
int status = pthread_mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
AnyWaiters = _nParked ;
|
||||
assert (AnyWaiters == 0 || AnyWaiters == 1, "invariant") ;
|
||||
if (AnyWaiters != 0 && WorkAroundNPTLTimedWaitHang) {
|
||||
AnyWaiters = 0 ;
|
||||
pthread_cond_signal (_cond);
|
||||
}
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
if (AnyWaiters != 0) {
|
||||
status = pthread_cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
if (AnyWaiters != 0) {
|
||||
status = pthread_cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
|
||||
// Note that we signal() _after dropping the lock for "immortal" Events.
|
||||
@ -5190,13 +5192,14 @@ static void unpackTime(timespec* absTime, bool isAbsolute, jlong time) {
|
||||
}
|
||||
|
||||
void Parker::park(bool isAbsolute, jlong time) {
|
||||
// Ideally we'd do something useful while spinning, such
|
||||
// as calling unpackTime().
|
||||
|
||||
// Optional fast-path check:
|
||||
// Return immediately if a permit is available.
|
||||
if (_counter > 0) {
|
||||
_counter = 0 ;
|
||||
OrderAccess::fence();
|
||||
return ;
|
||||
}
|
||||
// We depend on Atomic::xchg() having full barrier semantics
|
||||
// since we are doing a lock-free update to _counter.
|
||||
if (Atomic::xchg(0, &_counter) > 0) return;
|
||||
|
||||
Thread* thread = Thread::current();
|
||||
assert(thread->is_Java_thread(), "Must be JavaThread");
|
||||
@ -5237,6 +5240,8 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0;
|
||||
status = pthread_mutex_unlock(_mutex);
|
||||
assert (status == 0, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
return;
|
||||
}
|
||||
@ -5273,12 +5278,14 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0 ;
|
||||
status = pthread_mutex_unlock(_mutex) ;
|
||||
assert_status(status == 0, status, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
|
||||
// If externally suspended while waiting, re-suspend
|
||||
if (jt->handle_special_suspend_equivalent_condition()) {
|
||||
jt->java_suspend_self();
|
||||
}
|
||||
|
||||
OrderAccess::fence();
|
||||
}
|
||||
|
||||
void Parker::unpark() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -68,14 +68,6 @@ inline const char* os::path_separator() {
|
||||
return ":";
|
||||
}
|
||||
|
||||
inline const char* os::jlong_format_specifier() {
|
||||
return "%lld";
|
||||
}
|
||||
|
||||
inline const char* os::julong_format_specifier() {
|
||||
return "%llu";
|
||||
}
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -1876,11 +1876,6 @@ void SplashFreeLibrary() {
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
jlong_format_specifier() {
|
||||
return "%lld";
|
||||
}
|
||||
|
||||
/*
|
||||
* Block current thread and continue execution in a new thread
|
||||
*/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -64,6 +64,12 @@
|
||||
#define Counter2Micros(counts) (1)
|
||||
#endif /* HAVE_GETHRTIME */
|
||||
|
||||
#ifdef _LP64
|
||||
#define JLONG_FORMAT "%ld"
|
||||
#else
|
||||
#define JLONG_FORMAT "%lld"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes.
|
||||
*/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -734,12 +734,12 @@ void os::init_system_properties_values() {
|
||||
|
||||
// The next steps are taken in the product version:
|
||||
//
|
||||
// Obtain the JAVA_HOME value from the location of libjvm[_g].so.
|
||||
// Obtain the JAVA_HOME value from the location of libjvm.so.
|
||||
// This library should be located at:
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm[_g].so.
|
||||
// <JAVA_HOME>/jre/lib/<arch>/{client|server}/libjvm.so.
|
||||
//
|
||||
// If "/jre/lib/" appears at the right place in the path, then we
|
||||
// assume libjvm[_g].so is installed in a JDK and we use this path.
|
||||
// assume libjvm.so is installed in a JDK and we use this path.
|
||||
//
|
||||
// Otherwise exit with message: "Could not create the Java virtual machine."
|
||||
//
|
||||
@ -749,9 +749,9 @@ void os::init_system_properties_values() {
|
||||
// instead of exit check for $JAVA_HOME environment variable.
|
||||
//
|
||||
// If it is defined and we are able to locate $JAVA_HOME/jre/lib/<arch>,
|
||||
// then we append a fake suffix "hotspot/libjvm[_g].so" to this path so
|
||||
// it looks like libjvm[_g].so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm[_g].so.
|
||||
// then we append a fake suffix "hotspot/libjvm.so" to this path so
|
||||
// it looks like libjvm.so is installed there
|
||||
// <JAVA_HOME>/jre/lib/<arch>/hotspot/libjvm.so.
|
||||
//
|
||||
// Otherwise exit.
|
||||
//
|
||||
@ -1934,7 +1934,7 @@ const char* os::get_current_directory(char *buf, int buflen) {
|
||||
return getcwd(buf, buflen);
|
||||
}
|
||||
|
||||
// check if addr is inside libjvm[_g].so
|
||||
// check if addr is inside libjvm.so
|
||||
bool os::address_is_in_vm(address addr) {
|
||||
static address libjvm_base_addr;
|
||||
Dl_info dlinfo;
|
||||
@ -2474,7 +2474,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
|
||||
|
||||
static char saved_jvm_path[MAXPATHLEN] = { 0 };
|
||||
|
||||
// Find the full path to the current module, libjvm.so or libjvm_g.so
|
||||
// Find the full path to the current module, libjvm.so
|
||||
void os::jvm_path(char *buf, jint buflen) {
|
||||
// Error checking.
|
||||
if (buflen < MAXPATHLEN) {
|
||||
@ -2522,10 +2522,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
strcpy(cpu_arch, "amd64");
|
||||
}
|
||||
#endif
|
||||
// Check the current module name "libjvm.so" or "libjvm_g.so".
|
||||
// Check the current module name "libjvm.so".
|
||||
p = strrchr(buf, '/');
|
||||
assert(strstr(p, "/libjvm") == p, "invalid library name");
|
||||
p = strstr(p, "_g") ? "_g" : "";
|
||||
|
||||
realpath(java_home_var, buf);
|
||||
// determine if this is a legacy image or modules image
|
||||
@ -2538,11 +2537,9 @@ void os::jvm_path(char *buf, jint buflen) {
|
||||
}
|
||||
|
||||
if (0 == access(buf, F_OK)) {
|
||||
// Use current module name "libjvm[_g].so" instead of
|
||||
// "libjvm"debug_only("_g")".so" since for fastdebug version
|
||||
// we should have "libjvm.so" but debug_only("_g") adds "_g"!
|
||||
// Use current module name "libjvm.so"
|
||||
len = strlen(buf);
|
||||
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
|
||||
snprintf(buf + len, buflen-len, "/hotspot/libjvm.so");
|
||||
} else {
|
||||
// Go back to path of .so
|
||||
realpath((char *)dlinfo.dli_fname, buf);
|
||||
@ -6017,6 +6014,9 @@ void os::PlatformEvent::park() { // AKA: down()
|
||||
_Event = 0 ;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6058,51 +6058,43 @@ int os::PlatformEvent::park(jlong millis) {
|
||||
_Event = 0 ;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other.
|
||||
OrderAccess::fence();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void os::PlatformEvent::unpark() {
|
||||
int v, AnyWaiters;
|
||||
// Transitions for _Event:
|
||||
// 0 :=> 1
|
||||
// 1 :=> 1
|
||||
// -1 :=> either 0 or 1; must signal target thread
|
||||
// That is, we can safely transition _Event from -1 to either
|
||||
// 0 or 1. Forcing 1 is slightly more efficient for back-to-back
|
||||
// unpark() calls.
|
||||
// See also: "Semaphores in Plan 9" by Mullender & Cox
|
||||
//
|
||||
// Note: Forcing a transition from "-1" to "1" on an unpark() means
|
||||
// that it will take two back-to-back park() calls for the owning
|
||||
// thread to block. This has the benefit of forcing a spurious return
|
||||
// from the first park() call after an unpark() call which will help
|
||||
// shake out uses of park() and unpark() without condition variables.
|
||||
|
||||
// Increment _Event.
|
||||
// Another acceptable implementation would be to simply swap 1
|
||||
// into _Event:
|
||||
// if (Swap (&_Event, 1) < 0) {
|
||||
// mutex_lock (_mutex) ; AnyWaiters = nParked; mutex_unlock (_mutex) ;
|
||||
// if (AnyWaiters) cond_signal (_cond) ;
|
||||
// }
|
||||
|
||||
for (;;) {
|
||||
v = _Event ;
|
||||
if (v > 0) {
|
||||
// The LD of _Event could have reordered or be satisfied
|
||||
// by a read-aside from this processor's write buffer.
|
||||
// To avoid problems execute a barrier and then
|
||||
// ratify the value. A degenerate CAS() would also work.
|
||||
// Viz., CAS (v+0, &_Event, v) == v).
|
||||
OrderAccess::fence() ;
|
||||
if (_Event == v) return ;
|
||||
continue ;
|
||||
}
|
||||
if (Atomic::cmpxchg (v+1, &_Event, v) == v) break ;
|
||||
}
|
||||
if (Atomic::xchg(1, &_Event) >= 0) return;
|
||||
|
||||
// If the thread associated with the event was parked, wake it.
|
||||
if (v < 0) {
|
||||
int status ;
|
||||
// Wait for the thread assoc with the PlatformEvent to vacate.
|
||||
status = os::Solaris::mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
AnyWaiters = _nParked ;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
guarantee (AnyWaiters == 0 || AnyWaiters == 1, "invariant") ;
|
||||
if (AnyWaiters != 0) {
|
||||
// We intentional signal *after* dropping the lock
|
||||
// to avoid a common class of futile wakeups.
|
||||
status = os::Solaris::cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
// Wait for the thread assoc with the PlatformEvent to vacate.
|
||||
int status = os::Solaris::mutex_lock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_lock");
|
||||
int AnyWaiters = _nParked;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock");
|
||||
guarantee(AnyWaiters == 0 || AnyWaiters == 1, "invariant");
|
||||
if (AnyWaiters != 0) {
|
||||
// We intentional signal *after* dropping the lock
|
||||
// to avoid a common class of futile wakeups.
|
||||
status = os::Solaris::cond_signal(_cond);
|
||||
assert_status(status == 0, status, "cond_signal");
|
||||
}
|
||||
}
|
||||
|
||||
@ -6180,14 +6172,14 @@ static void unpackTime(timespec* absTime, bool isAbsolute, jlong time) {
|
||||
}
|
||||
|
||||
void Parker::park(bool isAbsolute, jlong time) {
|
||||
// Ideally we'd do something useful while spinning, such
|
||||
// as calling unpackTime().
|
||||
|
||||
// Optional fast-path check:
|
||||
// Return immediately if a permit is available.
|
||||
if (_counter > 0) {
|
||||
_counter = 0 ;
|
||||
OrderAccess::fence();
|
||||
return ;
|
||||
}
|
||||
// We depend on Atomic::xchg() having full barrier semantics
|
||||
// since we are doing a lock-free update to _counter.
|
||||
if (Atomic::xchg(0, &_counter) > 0) return;
|
||||
|
||||
// Optional fast-exit: Check interrupt before trying to wait
|
||||
Thread* thread = Thread::current();
|
||||
@ -6229,6 +6221,8 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert (status == 0, "invariant") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
return;
|
||||
}
|
||||
@ -6270,12 +6264,14 @@ void Parker::park(bool isAbsolute, jlong time) {
|
||||
_counter = 0 ;
|
||||
status = os::Solaris::mutex_unlock(_mutex);
|
||||
assert_status(status == 0, status, "mutex_unlock") ;
|
||||
// Paranoia to ensure our locked and lock-free paths interact
|
||||
// correctly with each other and Java-level accesses.
|
||||
OrderAccess::fence();
|
||||
|
||||
// If externally suspended while waiting, re-suspend
|
||||
if (jt->handle_special_suspend_equivalent_condition()) {
|
||||
jt->java_suspend_self();
|
||||
}
|
||||
OrderAccess::fence();
|
||||
}
|
||||
|
||||
void Parker::unpark() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -50,9 +50,6 @@ inline const char* os::file_separator() { return "/"; }
|
||||
inline const char* os::line_separator() { return "\n"; }
|
||||
inline const char* os::path_separator() { return ":"; }
|
||||
|
||||
inline const char* os::jlong_format_specifier() { return "%lld"; }
|
||||
inline const char* os::julong_format_specifier() { return "%llu"; }
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -1323,11 +1323,6 @@ void SplashFreeLibrary() {
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
jlong_format_specifier() {
|
||||
return "%I64d";
|
||||
}
|
||||
|
||||
/*
|
||||
* Block current thread and continue execution in a new thread
|
||||
*/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -69,6 +69,8 @@ extern jlong Counter2Micros(jlong counts);
|
||||
extern int _main(int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#define JLONG_FORMAT "%I64d"
|
||||
|
||||
/*
|
||||
* Function prototypes.
|
||||
*/
|
||||
|
||||
@ -49,7 +49,7 @@ void WindowsDecoder::initialize() {
|
||||
pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions");
|
||||
pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize");
|
||||
_pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64");
|
||||
_pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName");
|
||||
_pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)::GetProcAddress(handle, "UnDecorateSymbolName");
|
||||
|
||||
if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) {
|
||||
_pfnSymGetSymFromAddr64 = NULL;
|
||||
@ -60,8 +60,9 @@ void WindowsDecoder::initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
_pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS);
|
||||
if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) {
|
||||
HANDLE hProcess = ::GetCurrentProcess();
|
||||
_pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_EXACT_SYMBOLS);
|
||||
if (!_pfnSymInitialize(hProcess, NULL, TRUE)) {
|
||||
_pfnSymGetSymFromAddr64 = NULL;
|
||||
_pfnUndecorateSymbolName = NULL;
|
||||
::FreeLibrary(handle);
|
||||
@ -70,6 +71,77 @@ void WindowsDecoder::initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
// set pdb search paths
|
||||
pfn_SymSetSearchPath _pfn_SymSetSearchPath =
|
||||
(pfn_SymSetSearchPath)::GetProcAddress(handle, "SymSetSearchPath");
|
||||
pfn_SymGetSearchPath _pfn_SymGetSearchPath =
|
||||
(pfn_SymGetSearchPath)::GetProcAddress(handle, "SymGetSearchPath");
|
||||
if (_pfn_SymSetSearchPath != NULL && _pfn_SymGetSearchPath != NULL) {
|
||||
char paths[MAX_PATH];
|
||||
int len = sizeof(paths);
|
||||
if (!_pfn_SymGetSearchPath(hProcess, paths, len)) {
|
||||
paths[0] = '\0';
|
||||
} else {
|
||||
// available spaces in path buffer
|
||||
len -= (int)strlen(paths);
|
||||
}
|
||||
|
||||
char tmp_path[MAX_PATH];
|
||||
DWORD dwSize;
|
||||
HMODULE hJVM = ::GetModuleHandle("jvm.dll");
|
||||
tmp_path[0] = '\0';
|
||||
// append the path where jvm.dll is located
|
||||
if (hJVM != NULL && (dwSize = ::GetModuleFileName(hJVM, tmp_path, sizeof(tmp_path))) > 0) {
|
||||
while (dwSize > 0 && tmp_path[dwSize] != '\\') {
|
||||
dwSize --;
|
||||
}
|
||||
|
||||
tmp_path[dwSize] = '\0';
|
||||
|
||||
if (dwSize > 0 && len > (int)dwSize + 1) {
|
||||
strncat(paths, os::path_separator(), 1);
|
||||
strncat(paths, tmp_path, dwSize);
|
||||
len -= dwSize + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// append $JRE/bin. Arguments::get_java_home actually returns $JRE
|
||||
// path
|
||||
char *p = Arguments::get_java_home();
|
||||
assert(p != NULL, "empty java home");
|
||||
size_t java_home_len = strlen(p);
|
||||
if (len > (int)java_home_len + 5) {
|
||||
strncat(paths, os::path_separator(), 1);
|
||||
strncat(paths, p, java_home_len);
|
||||
strncat(paths, "\\bin", 4);
|
||||
len -= (int)(java_home_len + 5);
|
||||
}
|
||||
|
||||
// append $JDK/bin path if it exists
|
||||
assert(java_home_len < MAX_PATH, "Invalid path length");
|
||||
// assume $JRE is under $JDK, construct $JDK/bin path and
|
||||
// see if it exists or not
|
||||
if (strncmp(&p[java_home_len - 3], "jre", 3) == 0) {
|
||||
strncpy(tmp_path, p, java_home_len - 3);
|
||||
tmp_path[java_home_len - 3] = '\0';
|
||||
strncat(tmp_path, "bin", 3);
|
||||
|
||||
// if the directory exists
|
||||
DWORD dwAttrib = GetFileAttributes(tmp_path);
|
||||
if (dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
||||
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
// tmp_path should have the same length as java_home_len, since we only
|
||||
// replaced 'jre' with 'bin'
|
||||
if (len > (int)java_home_len + 1) {
|
||||
strncat(paths, os::path_separator(), 1);
|
||||
strncat(paths, tmp_path, java_home_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_pfn_SymSetSearchPath(hProcess, paths);
|
||||
}
|
||||
|
||||
// find out if jvm.dll contains private symbols, by decoding
|
||||
// current function and comparing the result
|
||||
address addr = (address)Decoder::demangle;
|
||||
|
||||
@ -35,6 +35,8 @@ typedef DWORD (WINAPI *pfn_SymSetOptions)(DWORD);
|
||||
typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL);
|
||||
typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
|
||||
typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD);
|
||||
typedef BOOL (WINAPI *pfn_SymSetSearchPath)(HANDLE, PCTSTR);
|
||||
typedef BOOL (WINAPI *pfn_SymGetSearchPath)(HANDLE, PTSTR, int);
|
||||
|
||||
class WindowsDecoder : public AbstractDecoder {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -182,7 +182,7 @@ void os::init_system_properties_values() {
|
||||
|
||||
if (!getenv("_ALT_JAVA_HOME_DIR", home_dir, MAX_PATH)) {
|
||||
os::jvm_path(home_dir, sizeof(home_dir));
|
||||
// Found the full path to jvm[_g].dll.
|
||||
// Found the full path to jvm.dll.
|
||||
// Now cut the path to <java_home>/jre if we can.
|
||||
*(strrchr(home_dir, '\\')) = '\0'; /* get rid of \jvm.dll */
|
||||
pslash = strrchr(home_dir, '\\');
|
||||
@ -1715,7 +1715,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
|
||||
|
||||
static char saved_jvm_path[MAX_PATH] = {0};
|
||||
|
||||
// Find the full path to the current module, jvm.dll or jvm_g.dll
|
||||
// Find the full path to the current module, jvm.dll
|
||||
void os::jvm_path(char *buf, jint buflen) {
|
||||
// Error checking.
|
||||
if (buflen < MAX_PATH) {
|
||||
@ -1874,8 +1874,22 @@ static BOOL WINAPI consoleHandler(DWORD event) {
|
||||
}
|
||||
return TRUE;
|
||||
break;
|
||||
case CTRL_LOGOFF_EVENT: {
|
||||
// Don't terminate JVM if it is running in a non-interactive session,
|
||||
// such as a service process.
|
||||
USEROBJECTFLAGS flags;
|
||||
HANDLE handle = GetProcessWindowStation();
|
||||
if (handle != NULL &&
|
||||
GetUserObjectInformation(handle, UOI_FLAGS, &flags,
|
||||
sizeof( USEROBJECTFLAGS), NULL)) {
|
||||
// If it is a non-interactive session, let next handler to deal
|
||||
// with it.
|
||||
if ((flags.dwFlags & WSF_VISIBLE) == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
case CTRL_CLOSE_EVENT:
|
||||
case CTRL_LOGOFF_EVENT:
|
||||
case CTRL_SHUTDOWN_EVENT:
|
||||
os::signal_raise(SIGTERM);
|
||||
return TRUE;
|
||||
@ -2946,7 +2960,7 @@ char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
|
||||
}
|
||||
if( Verbose && PrintMiscellaneous ) {
|
||||
reserveTimer.stop();
|
||||
tty->print_cr("reserve_memory of %Ix bytes took %ld ms (%ld ticks)", bytes,
|
||||
tty->print_cr("reserve_memory of %Ix bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes,
|
||||
reserveTimer.milliseconds(), reserveTimer.ticks());
|
||||
}
|
||||
}
|
||||
@ -4305,7 +4319,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||
if (hFile == NULL) {
|
||||
if (PrintMiscellaneous && Verbose) {
|
||||
DWORD err = GetLastError();
|
||||
tty->print_cr("CreateFile() failed: GetLastError->%ld.");
|
||||
tty->print_cr("CreateFile() failed: GetLastError->%ld.", err);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -4355,7 +4369,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||
if (hMap == NULL) {
|
||||
if (PrintMiscellaneous && Verbose) {
|
||||
DWORD err = GetLastError();
|
||||
tty->print_cr("CreateFileMapping() failed: GetLastError->%ld.");
|
||||
tty->print_cr("CreateFileMapping() failed: GetLastError->%ld.", err);
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
return NULL;
|
||||
@ -4565,6 +4579,7 @@ int os::PlatformEvent::park (jlong Millis) {
|
||||
}
|
||||
v = _Event ;
|
||||
_Event = 0 ;
|
||||
// see comment at end of os::PlatformEvent::park() below:
|
||||
OrderAccess::fence() ;
|
||||
// If we encounter a nearly simultanous timeout expiry and unpark()
|
||||
// we return OS_OK indicating we awoke via unpark().
|
||||
@ -4602,25 +4617,25 @@ void os::PlatformEvent::park () {
|
||||
|
||||
void os::PlatformEvent::unpark() {
|
||||
guarantee (_ParkHandle != NULL, "Invariant") ;
|
||||
int v ;
|
||||
for (;;) {
|
||||
v = _Event ; // Increment _Event if it's < 1.
|
||||
if (v > 0) {
|
||||
// If it's already signaled just return.
|
||||
// The LD of _Event could have reordered or be satisfied
|
||||
// by a read-aside from this processor's write buffer.
|
||||
// To avoid problems execute a barrier and then
|
||||
// ratify the value. A degenerate CAS() would also work.
|
||||
// Viz., CAS (v+0, &_Event, v) == v).
|
||||
OrderAccess::fence() ;
|
||||
if (_Event == v) return ;
|
||||
continue ;
|
||||
}
|
||||
if (Atomic::cmpxchg (v+1, &_Event, v) == v) break ;
|
||||
}
|
||||
if (v < 0) {
|
||||
::SetEvent (_ParkHandle) ;
|
||||
}
|
||||
|
||||
// Transitions for _Event:
|
||||
// 0 :=> 1
|
||||
// 1 :=> 1
|
||||
// -1 :=> either 0 or 1; must signal target thread
|
||||
// That is, we can safely transition _Event from -1 to either
|
||||
// 0 or 1. Forcing 1 is slightly more efficient for back-to-back
|
||||
// unpark() calls.
|
||||
// See also: "Semaphores in Plan 9" by Mullender & Cox
|
||||
//
|
||||
// Note: Forcing a transition from "-1" to "1" on an unpark() means
|
||||
// that it will take two back-to-back park() calls for the owning
|
||||
// thread to block. This has the benefit of forcing a spurious return
|
||||
// from the first park() call after an unpark() call which will help
|
||||
// shake out uses of park() and unpark() without condition variables.
|
||||
|
||||
if (Atomic::xchg(1, &_Event) >= 0) return;
|
||||
|
||||
::SetEvent(_ParkHandle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -38,9 +38,6 @@ inline const char* os::line_separator() { return "\r\n"; }
|
||||
inline const char* os::path_separator() { return ";"; }
|
||||
inline const char* os::dll_file_extension() { return ".dll"; }
|
||||
|
||||
inline const char* os::jlong_format_specifier() { return "%I64d"; }
|
||||
inline const char* os::julong_format_specifier() { return "%I64u"; }
|
||||
|
||||
inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
|
||||
|
||||
// File names are case-insensitive on windows only
|
||||
|
||||
@ -29,37 +29,26 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
/******************************/ \
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t)
|
||||
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
/**********************/ \
|
||||
/* Posix Thread IDs */ \
|
||||
/**********************/ \
|
||||
\
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t) \
|
||||
declare_unsigned_integer_type(pthread_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(pthread_t)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_BSD_X86_VM_VMSTRUCTS_BSD_X86_HPP
|
||||
|
||||
@ -30,21 +30,13 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field)
|
||||
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_BSD_ZERO_VM_VMSTRUCTS_BSD_ZERO_HPP
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
@ -37,38 +37,27 @@
|
||||
\
|
||||
nonstatic_field(JavaThread, _base_of_stack_pointer, intptr_t*) \
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t)
|
||||
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
/**********************/ \
|
||||
/* POSIX Thread IDs */ \
|
||||
/**********************/ \
|
||||
\
|
||||
declare_integer_type(OSThread::thread_id_t) \
|
||||
declare_unsigned_integer_type(pthread_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(pthread_t)
|
||||
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \
|
||||
\
|
||||
/************************/ \
|
||||
/* JavaThread constants */ \
|
||||
/************************/ \
|
||||
\
|
||||
declare_constant(JavaFrameAnchor::flushed) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_constant(JavaFrameAnchor::flushed)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
|
||||
|
||||
@ -29,37 +29,26 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
/******************************/ \
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
nonstatic_field(OSThread, _pthread_id, pthread_t)
|
||||
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
/**********************/ \
|
||||
/* Posix Thread IDs */ \
|
||||
/**********************/ \
|
||||
\
|
||||
declare_integer_type(OSThread::thread_id_t) \
|
||||
declare_unsigned_integer_type(pthread_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(pthread_t)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
|
||||
|
||||
@ -30,21 +30,12 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field)
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type)
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
|
||||
|
||||
@ -29,44 +29,32 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
/******************************/ \
|
||||
\
|
||||
nonstatic_field(JavaThread, _base_of_stack_pointer, intptr_t*) \
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t)
|
||||
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
/**********************/ \
|
||||
/* Solaris Thread IDs */ \
|
||||
/**********************/ \
|
||||
\
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t)
|
||||
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \
|
||||
\
|
||||
/************************/ \
|
||||
/* JavaThread constants */ \
|
||||
/************************/ \
|
||||
\
|
||||
declare_constant(JavaFrameAnchor::flushed) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_constant(JavaFrameAnchor::flushed)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
|
||||
|
||||
@ -29,36 +29,24 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
/******************************/ \
|
||||
\
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t)
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
/**********************/ \
|
||||
/* Solaris Thread IDs */ \
|
||||
/**********************/ \
|
||||
\
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
|
||||
|
||||
@ -29,32 +29,21 @@
|
||||
// constants required by the Serviceability Agent. This file is
|
||||
// referenced by vmStructs.cpp.
|
||||
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
|
||||
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \
|
||||
\
|
||||
/******************************/ \
|
||||
/* Threads (NOTE: incomplete) */ \
|
||||
/******************************/ \
|
||||
\
|
||||
nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \
|
||||
unchecked_nonstatic_field(OSThread, _thread_handle, sizeof(HANDLE)) /* NOTE: no type */ \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
unchecked_nonstatic_field(OSThread, _thread_handle, sizeof(HANDLE)) /* NOTE: no type */
|
||||
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \
|
||||
#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \
|
||||
\
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t) \
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
declare_unsigned_integer_type(OSThread::thread_id_t)
|
||||
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
|
||||
\
|
||||
/* This must be the last entry, and must be present */ \
|
||||
last_entry()
|
||||
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant)
|
||||
|
||||
#endif // OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
|
||||
|
||||
@ -36,7 +36,7 @@ public class ProjectCreator {
|
||||
+ "into .dsp file, substituting for path given in "
|
||||
+ "-sourceBase. Example: HotSpotWorkSpace>");
|
||||
System.err.println(" -dllLoc <path to directory in which to put "
|
||||
+ "jvm.dll and jvm_g.dll; no trailing slash>");
|
||||
+ "jvm.dll; no trailing slash>");
|
||||
System.err.println(" If any of the above are specified, "
|
||||
+ "they must all be.");
|
||||
System.err.println(" Additional, optional arguments, which can be "
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -808,7 +808,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
|
||||
static int
|
||||
parse_stack_size(const char *s, jlong *result) {
|
||||
jlong n = 0;
|
||||
int args_read = sscanf(s, jlong_format_specifier(), &n);
|
||||
int args_read = sscanf(s, JLONG_FORMAT, &n);
|
||||
if (args_read != 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -86,7 +86,6 @@ void ReportExceptionDescription(JNIEnv * env);
|
||||
jboolean RemovableMachineDependentOption(char * option);
|
||||
void PrintMachineDependentOptions();
|
||||
|
||||
const char *jlong_format_specifier();
|
||||
/*
|
||||
* Block current thread and continue execution in new thread
|
||||
*/
|
||||
|
||||
@ -862,8 +862,10 @@ uint InstructForm::oper_input_base(FormDict &globals) {
|
||||
( strcmp(_matrule->_rChild->_opType,"AryEq" )==0 ||
|
||||
strcmp(_matrule->_rChild->_opType,"StrComp" )==0 ||
|
||||
strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
|
||||
strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 )) {
|
||||
strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
|
||||
strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
|
||||
// String.(compareTo/equals/indexOf) and Arrays.equals
|
||||
// and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
|
||||
// take 1 control and 1 memory edges.
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -216,8 +216,6 @@ class AbstractAssembler : public ResourceObj {
|
||||
bool isByte(int x) const { return 0 <= x && x < 0x100; }
|
||||
bool isShiftCount(int x) const { return 0 <= x && x < 32; }
|
||||
|
||||
void emit_long(jint x) { emit_int32(x); } // deprecated
|
||||
|
||||
// Instruction boundaries (required when emitting relocatable values).
|
||||
class InstructionMark: public StackObj {
|
||||
private:
|
||||
|
||||
@ -3223,7 +3223,12 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co
|
||||
}
|
||||
if (try_inline_full(callee, holder_known, bc, receiver))
|
||||
return true;
|
||||
print_inlining(callee, _inline_bailout_msg, /*success*/ false);
|
||||
|
||||
// Entire compilation could fail during try_inline_full call.
|
||||
// In that case printing inlining decision info is useless.
|
||||
if (!bailed_out())
|
||||
print_inlining(callee, _inline_bailout_msg, /*success*/ false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3753,7 +3758,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
|
||||
push_scope(callee, cont);
|
||||
|
||||
// the BlockListBuilder for the callee could have bailed out
|
||||
CHECK_BAILOUT_(false);
|
||||
if (bailed_out())
|
||||
return false;
|
||||
|
||||
// Temporarily set up bytecode stream so we can append instructions
|
||||
// (only using the bci of this stream)
|
||||
@ -3819,7 +3825,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
|
||||
iterate_all_blocks(callee_start_block == NULL);
|
||||
|
||||
// If we bailed out during parsing, return immediately (this is bad news)
|
||||
if (bailed_out()) return false;
|
||||
if (bailed_out())
|
||||
return false;
|
||||
|
||||
// iterate_all_blocks theoretically traverses in random order; in
|
||||
// practice, we have only traversed the continuation if we are
|
||||
@ -3828,9 +3835,6 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
|
||||
!continuation()->is_set(BlockBegin::was_visited_flag),
|
||||
"continuation should not have been parsed yet if we created it");
|
||||
|
||||
// If we bailed out during parsing, return immediately (this is bad news)
|
||||
CHECK_BAILOUT_(false);
|
||||
|
||||
// At this point we are almost ready to return and resume parsing of
|
||||
// the caller back in the GraphBuilder. The only thing we want to do
|
||||
// first is an optimization: during parsing of the callee we
|
||||
@ -4171,7 +4175,10 @@ void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool succes
|
||||
else
|
||||
log->inline_success("receiver is statically known");
|
||||
} else {
|
||||
log->inline_fail(msg);
|
||||
if (msg != NULL)
|
||||
log->inline_fail(msg);
|
||||
else
|
||||
log->inline_fail("reason unknown");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
@ -360,7 +360,7 @@ void InstructionPrinter::do_Constant(Constant* x) {
|
||||
ValueType* t = x->type();
|
||||
switch (t->tag()) {
|
||||
case intTag : output()->print("%d" , t->as_IntConstant ()->value()); break;
|
||||
case longTag : output()->print(os::jlong_format_specifier(), t->as_LongConstant()->value()); output()->print("L"); break;
|
||||
case longTag : output()->print(JLONG_FORMAT, t->as_LongConstant()->value()); output()->print("L"); break;
|
||||
case floatTag : output()->print("%g" , t->as_FloatConstant ()->value()); break;
|
||||
case doubleTag : output()->print("%gD" , t->as_DoubleConstant()->value()); break;
|
||||
case objectTag : print_object(x); break;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, 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
|
||||
@ -1563,7 +1563,7 @@ void LIR_Const::print_value_on(outputStream* out) const {
|
||||
switch (type()) {
|
||||
case T_ADDRESS:out->print("address:%d",as_jint()); break;
|
||||
case T_INT: out->print("int:%d", as_jint()); break;
|
||||
case T_LONG: out->print("lng:%lld", as_jlong()); break;
|
||||
case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break;
|
||||
case T_FLOAT: out->print("flt:%f", as_jfloat()); break;
|
||||
case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break;
|
||||
case T_OBJECT: out->print("obj:0x%x", as_jobject()); break;
|
||||
|
||||
@ -2259,7 +2259,7 @@ class LIR_OpVisitState: public StackObj {
|
||||
typedef enum { inputMode, firstMode = inputMode, tempMode, outputMode, numModes, invalidMode = -1 } OprMode;
|
||||
|
||||
enum {
|
||||
maxNumberOfOperands = 16,
|
||||
maxNumberOfOperands = 20,
|
||||
maxNumberOfInfos = 4
|
||||
};
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@
|
||||
"Inline methods containing exception handlers " \
|
||||
"(NOTE: does not work with current backend)") \
|
||||
\
|
||||
develop(bool, InlineSynchronizedMethods, true, \
|
||||
product(bool, InlineSynchronizedMethods, true, \
|
||||
"Inline synchronized methods") \
|
||||
\
|
||||
develop(bool, InlineNIOCheckIndex, true, \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2013, 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
|
||||
@ -645,7 +645,7 @@ class CompileReplay : public StackObj {
|
||||
java_mirror->bool_field_put(fd.offset(), value);
|
||||
} else if (strcmp(field_signature, "J") == 0) {
|
||||
jlong value;
|
||||
if (sscanf(string_value, INT64_FORMAT, &value) != 1) {
|
||||
if (sscanf(string_value, JLONG_FORMAT, &value) != 1) {
|
||||
fprintf(stderr, "Error parsing long: %s\n", string_value);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -59,6 +59,19 @@ bool ciType::is_subtype_of(ciType* type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciType::name
|
||||
//
|
||||
// Return the name of this type
|
||||
const char* ciType::name() {
|
||||
if (is_primitive_type()) {
|
||||
return type2name(basic_type());
|
||||
} else {
|
||||
assert(is_klass(), "must be");
|
||||
return as_klass()->name()->as_utf8();
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciType::print_impl
|
||||
//
|
||||
@ -73,7 +86,8 @@ void ciType::print_impl(outputStream* st) {
|
||||
//
|
||||
// Print the name of this type
|
||||
void ciType::print_name_on(outputStream* st) {
|
||||
st->print(type2name(basic_type()));
|
||||
ResourceMark rm;
|
||||
st->print(name());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -77,6 +77,7 @@ public:
|
||||
bool is_type() const { return true; }
|
||||
bool is_classless() const { return is_primitive_type(); }
|
||||
|
||||
const char* name();
|
||||
virtual void print_name_on(outputStream* st);
|
||||
void print_name() {
|
||||
print_name_on(tty);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -64,6 +64,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
int _sde_length;
|
||||
Array<u2>* _inner_classes;
|
||||
AnnotationArray* _annotations;
|
||||
AnnotationArray* _type_annotations;
|
||||
|
||||
void set_class_synthetic_flag(bool x) { _synthetic_flag = x; }
|
||||
void set_class_sourcefile(Symbol* x) { _sourcefile = x; }
|
||||
@ -71,12 +72,14 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
void set_class_sde_buffer(char* x, int len) { _sde_buffer = x; _sde_length = len; }
|
||||
void set_class_inner_classes(Array<u2>* x) { _inner_classes = x; }
|
||||
void set_class_annotations(AnnotationArray* x) { _annotations = x; }
|
||||
void set_class_type_annotations(AnnotationArray* x) { _type_annotations = x; }
|
||||
void init_parsed_class_attributes() {
|
||||
_synthetic_flag = false;
|
||||
_sourcefile = NULL;
|
||||
_generic_signature = NULL;
|
||||
_sde_buffer = NULL;
|
||||
_sde_length = 0;
|
||||
_annotations = _type_annotations = NULL;
|
||||
// initialize the other flags too:
|
||||
_has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
|
||||
_max_bootstrap_specifier_index = -1;
|
||||
@ -92,17 +95,20 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
_method_DontInline,
|
||||
_method_LambdaForm_Compiled,
|
||||
_method_LambdaForm_Hidden,
|
||||
_sun_misc_Contended,
|
||||
_annotation_LIMIT
|
||||
};
|
||||
const Location _location;
|
||||
int _annotations_present;
|
||||
u2 _contended_group;
|
||||
|
||||
AnnotationCollector(Location location)
|
||||
: _location(location), _annotations_present(0)
|
||||
{
|
||||
assert((int)_annotation_LIMIT <= (int)sizeof(_annotations_present) * BitsPerByte, "");
|
||||
}
|
||||
// If this annotation name has an ID, report it (or _none).
|
||||
ID annotation_index(Symbol* name);
|
||||
ID annotation_index(ClassLoaderData* loader_data, Symbol* name);
|
||||
// Set the annotation name:
|
||||
void set_annotation(ID id) {
|
||||
assert((int)id >= 0 && (int)id < (int)_annotation_LIMIT, "oob");
|
||||
@ -111,6 +117,12 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
// Report if the annotation is present.
|
||||
bool has_any_annotations() { return _annotations_present != 0; }
|
||||
bool has_annotation(ID id) { return (nth_bit((int)id) & _annotations_present) != 0; }
|
||||
|
||||
void set_contended_group(u2 group) { _contended_group = group; }
|
||||
u2 contended_group() { return _contended_group; }
|
||||
|
||||
void set_contended(bool contended) { set_annotation(_sun_misc_Contended); }
|
||||
bool is_contended() { return has_annotation(_sun_misc_Contended); }
|
||||
};
|
||||
class FieldAnnotationCollector: public AnnotationCollector {
|
||||
public:
|
||||
@ -163,6 +175,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
bool* is_synthetic_addr,
|
||||
u2* generic_signature_index_addr,
|
||||
AnnotationArray** field_annotations,
|
||||
AnnotationArray** field_type_annotations,
|
||||
FieldAnnotationCollector* parsed_annotations,
|
||||
TRAPS);
|
||||
Array<u2>* parse_fields(ClassLoaderData* loader_data,
|
||||
@ -170,8 +183,17 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
constantPoolHandle cp, bool is_interface,
|
||||
FieldAllocationCount *fac,
|
||||
Array<AnnotationArray*>** fields_annotations,
|
||||
Array<AnnotationArray*>** fields_type_annotations,
|
||||
u2* java_fields_count_ptr, TRAPS);
|
||||
|
||||
void print_field_layout(Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
int static_fields_end);
|
||||
|
||||
// Method parsing
|
||||
methodHandle parse_method(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp,
|
||||
@ -180,6 +202,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
AnnotationArray** method_annotations,
|
||||
AnnotationArray** method_parameter_annotations,
|
||||
AnnotationArray** method_default_annotations,
|
||||
AnnotationArray** method_type_annotations,
|
||||
TRAPS);
|
||||
Array<Method*>* parse_methods(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp,
|
||||
@ -189,6 +212,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
Array<AnnotationArray*>** methods_annotations,
|
||||
Array<AnnotationArray*>** methods_parameter_annotations,
|
||||
Array<AnnotationArray*>** methods_default_annotations,
|
||||
Array<AnnotationArray*>** methods_type_annotations,
|
||||
bool* has_default_method,
|
||||
TRAPS);
|
||||
Array<int>* sort_methods(ClassLoaderData* loader_data,
|
||||
@ -196,6 +220,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
Array<AnnotationArray*>* methods_annotations,
|
||||
Array<AnnotationArray*>* methods_parameter_annotations,
|
||||
Array<AnnotationArray*>* methods_default_annotations,
|
||||
Array<AnnotationArray*>* methods_type_annotations,
|
||||
TRAPS);
|
||||
u2* parse_exception_table(ClassLoaderData* loader_data,
|
||||
u4 code_length, u4 exception_table_length,
|
||||
@ -239,7 +264,8 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
int runtime_invisible_annotations_length, TRAPS);
|
||||
int skip_annotation(u1* buffer, int limit, int index);
|
||||
int skip_annotation_value(u1* buffer, int limit, int index);
|
||||
void parse_annotations(u1* buffer, int limit, constantPoolHandle cp,
|
||||
void parse_annotations(ClassLoaderData* loader_data,
|
||||
u1* buffer, int limit, constantPoolHandle cp,
|
||||
/* Results (currently, only one result is supported): */
|
||||
AnnotationCollector* result,
|
||||
TRAPS);
|
||||
|
||||
@ -93,3 +93,10 @@ void ClassFileStream::skip_u2(int length, TRAPS) {
|
||||
}
|
||||
_current += length * 2;
|
||||
}
|
||||
|
||||
void ClassFileStream::skip_u4(int length, TRAPS) {
|
||||
if (_need_verify) {
|
||||
guarantee_more(length * 4, CHECK);
|
||||
}
|
||||
_current += length * 4;
|
||||
}
|
||||
|
||||
@ -133,6 +133,11 @@ class ClassFileStream: public ResourceObj {
|
||||
_current += 2 * length;
|
||||
}
|
||||
|
||||
void skip_u4(int length, TRAPS);
|
||||
void skip_u4_fast(int length) {
|
||||
_current += 4 * length;
|
||||
}
|
||||
|
||||
// Tells whether eos is reached
|
||||
bool at_eos() const { return _current == _buffer_end; }
|
||||
};
|
||||
|
||||
@ -318,6 +318,7 @@ ClassLoaderData::~ClassLoaderData() {
|
||||
}
|
||||
|
||||
Metaspace* ClassLoaderData::metaspace_non_null() {
|
||||
assert(!DumpSharedSpaces, "wrong metaspace!");
|
||||
// If the metaspace has not been allocated, create a new one. Might want
|
||||
// to create smaller arena for Reflection class loaders also.
|
||||
// The reason for the delayed allocation is because some class loaders are
|
||||
@ -330,10 +331,19 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
|
||||
}
|
||||
if (this == the_null_class_loader_data()) {
|
||||
assert (class_loader() == NULL, "Must be");
|
||||
size_t word_size = Metaspace::first_chunk_word_size();
|
||||
set_metaspace(new Metaspace(_metaspace_lock, word_size));
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType));
|
||||
} else if (is_anonymous()) {
|
||||
if (TraceClassLoaderData && Verbose && class_loader() != NULL) {
|
||||
tty->print_cr("is_anonymous: %s", class_loader()->klass()->internal_name());
|
||||
}
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType));
|
||||
} else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
|
||||
if (TraceClassLoaderData && Verbose && class_loader() != NULL) {
|
||||
tty->print_cr("is_reflection: %s", class_loader()->klass()->internal_name());
|
||||
}
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType));
|
||||
} else {
|
||||
set_metaspace(new Metaspace(_metaspace_lock)); // default size for now.
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::StandardMetaspaceType));
|
||||
}
|
||||
}
|
||||
return _metaspace;
|
||||
@ -672,8 +682,8 @@ void ClassLoaderData::initialize_shared_metaspaces() {
|
||||
"only supported for null loader data for now");
|
||||
assert (!_shared_metaspaces_initialized, "only initialize once");
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
_ro_metaspace = new Metaspace(_metaspace_lock, SharedReadOnlySize/wordSize);
|
||||
_rw_metaspace = new Metaspace(_metaspace_lock, SharedReadWriteSize/wordSize);
|
||||
_ro_metaspace = new Metaspace(_metaspace_lock, Metaspace::ROMetaspaceType);
|
||||
_rw_metaspace = new Metaspace(_metaspace_lock, Metaspace::ReadWriteMetaspaceType);
|
||||
_shared_metaspaces_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
@ -1148,7 +1148,8 @@ static Method* new_method(
|
||||
int code_length = bytecodes->length();
|
||||
|
||||
Method* m = Method::allocate(cp->pool_holder()->class_loader_data(),
|
||||
code_length, flags, 0, 0, 0, 0, 0, mt, CHECK_NULL);
|
||||
code_length, flags, 0, 0, 0, 0, 0, 0,
|
||||
mt, CHECK_NULL);
|
||||
|
||||
m->set_constants(NULL); // This will get filled in later
|
||||
m->set_name_index(cp->utf8(name));
|
||||
@ -1284,13 +1285,15 @@ static void merge_in_new_methods(InstanceKlass* klass,
|
||||
|
||||
enum { ANNOTATIONS, PARAMETERS, DEFAULTS, NUM_ARRAYS };
|
||||
|
||||
Array<AnnotationArray*>* original_annots[NUM_ARRAYS];
|
||||
Array<AnnotationArray*>* original_annots[NUM_ARRAYS] = { NULL };
|
||||
|
||||
Array<Method*>* original_methods = klass->methods();
|
||||
Annotations* annots = klass->annotations();
|
||||
original_annots[ANNOTATIONS] = annots->methods_annotations();
|
||||
original_annots[PARAMETERS] = annots->methods_parameter_annotations();
|
||||
original_annots[DEFAULTS] = annots->methods_default_annotations();
|
||||
if (annots != NULL) {
|
||||
original_annots[ANNOTATIONS] = annots->methods_annotations();
|
||||
original_annots[PARAMETERS] = annots->methods_parameter_annotations();
|
||||
original_annots[DEFAULTS] = annots->methods_default_annotations();
|
||||
}
|
||||
|
||||
Array<int>* original_ordering = klass->method_ordering();
|
||||
Array<int>* merged_ordering = Universe::the_empty_int_array();
|
||||
@ -1369,9 +1372,15 @@ static void merge_in_new_methods(InstanceKlass* klass,
|
||||
|
||||
// Replace klass methods with new merged lists
|
||||
klass->set_methods(merged_methods);
|
||||
annots->set_methods_annotations(merged_annots[ANNOTATIONS]);
|
||||
annots->set_methods_parameter_annotations(merged_annots[PARAMETERS]);
|
||||
annots->set_methods_default_annotations(merged_annots[DEFAULTS]);
|
||||
if (annots != NULL) {
|
||||
annots->set_methods_annotations(merged_annots[ANNOTATIONS]);
|
||||
annots->set_methods_parameter_annotations(merged_annots[PARAMETERS]);
|
||||
annots->set_methods_default_annotations(merged_annots[DEFAULTS]);
|
||||
} else {
|
||||
assert(merged_annots[ANNOTATIONS] == NULL, "Must be");
|
||||
assert(merged_annots[PARAMETERS] == NULL, "Must be");
|
||||
assert(merged_annots[DEFAULTS] == NULL, "Must be");
|
||||
}
|
||||
|
||||
ClassLoaderData* cld = klass->class_loader_data();
|
||||
MetadataFactory::free_array(cld, original_methods);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -687,19 +687,6 @@ void java_lang_Class::set_array_klass(oop java_class, Klass* klass) {
|
||||
}
|
||||
|
||||
|
||||
Method* java_lang_Class::resolved_constructor(oop java_class) {
|
||||
Metadata* constructor = java_class->metadata_field(_resolved_constructor_offset);
|
||||
assert(constructor == NULL || constructor->is_method(), "should be method");
|
||||
return ((Method*)constructor);
|
||||
}
|
||||
|
||||
|
||||
void java_lang_Class::set_resolved_constructor(oop java_class, Method* constructor) {
|
||||
assert(constructor->is_method(), "should be method");
|
||||
java_class->metadata_field_put(_resolved_constructor_offset, constructor);
|
||||
}
|
||||
|
||||
|
||||
bool java_lang_Class::is_primitive(oop java_class) {
|
||||
// should assert:
|
||||
//assert(java_lang_Class::is_instance(java_class), "must be a Class object");
|
||||
@ -924,7 +911,6 @@ jlong java_lang_Thread::stackSize(oop java_thread) {
|
||||
// Write the thread status value to threadStatus field in java.lang.Thread java class.
|
||||
void java_lang_Thread::set_thread_status(oop java_thread,
|
||||
java_lang_Thread::ThreadStatus status) {
|
||||
assert(JavaThread::current()->thread_state() == _thread_in_vm, "Java Thread is not running in vm");
|
||||
// The threadStatus is only present starting in 1.5
|
||||
if (_thread_status_offset > 0) {
|
||||
java_thread->int_field_put(_thread_status_offset, status);
|
||||
@ -1158,179 +1144,43 @@ void java_lang_Throwable::print(Handle throwable, outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
// Print stack trace element to resource allocated buffer
|
||||
char* java_lang_Throwable::print_stack_element_to_buffer(Method* method, int bci) {
|
||||
// Get strings and string lengths
|
||||
InstanceKlass* klass = method->method_holder();
|
||||
const char* klass_name = klass->external_name();
|
||||
int buf_len = (int)strlen(klass_name);
|
||||
char* source_file_name;
|
||||
if (klass->source_file_name() == NULL) {
|
||||
source_file_name = NULL;
|
||||
} else {
|
||||
source_file_name = klass->source_file_name()->as_C_string();
|
||||
buf_len += (int)strlen(source_file_name);
|
||||
}
|
||||
char* method_name = method->name()->as_C_string();
|
||||
buf_len += (int)strlen(method_name);
|
||||
// After this many redefines, the stack trace is unreliable.
|
||||
const int MAX_VERSION = USHRT_MAX;
|
||||
|
||||
// Allocate temporary buffer with extra space for formatting and line number
|
||||
char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64);
|
||||
// Helper backtrace functions to store bci|version together.
|
||||
static inline int merge_bci_and_version(int bci, int version) {
|
||||
// only store u2 for version, checking for overflow.
|
||||
if (version > USHRT_MAX || version < 0) version = MAX_VERSION;
|
||||
assert((jushort)bci == bci, "bci should be short");
|
||||
return build_int_from_shorts(version, bci);
|
||||
}
|
||||
|
||||
// Print stack trace line in buffer
|
||||
sprintf(buf, "\tat %s.%s", klass_name, method_name);
|
||||
static inline int bci_at(unsigned int merged) {
|
||||
return extract_high_short_from_int(merged);
|
||||
}
|
||||
static inline int version_at(unsigned int merged) {
|
||||
return extract_low_short_from_int(merged);
|
||||
}
|
||||
|
||||
static inline bool version_matches(Method* method, int version) {
|
||||
return (method->constants()->version() == version && version < MAX_VERSION);
|
||||
}
|
||||
|
||||
static inline int get_line_number(Method* method, int bci) {
|
||||
int line_number = 0;
|
||||
if (method->is_native()) {
|
||||
strcat(buf, "(Native Method)");
|
||||
// Negative value different from -1 below, enabling Java code in
|
||||
// class java.lang.StackTraceElement to distinguish "native" from
|
||||
// "no LineNumberTable". JDK tests for -2.
|
||||
line_number = -2;
|
||||
} else {
|
||||
int line_number = method->line_number_from_bci(bci);
|
||||
if (source_file_name != NULL && (line_number != -1)) {
|
||||
// Sourcename and linenumber
|
||||
sprintf(buf + (int)strlen(buf), "(%s:%d)", source_file_name, line_number);
|
||||
} else if (source_file_name != NULL) {
|
||||
// Just sourcename
|
||||
sprintf(buf + (int)strlen(buf), "(%s)", source_file_name);
|
||||
} else {
|
||||
// Neither soucename and linenumber
|
||||
sprintf(buf + (int)strlen(buf), "(Unknown Source)");
|
||||
}
|
||||
nmethod* nm = method->code();
|
||||
if (WizardMode && nm != NULL) {
|
||||
sprintf(buf + (int)strlen(buf), "(nmethod " INTPTR_FORMAT ")", (intptr_t)nm);
|
||||
// Returns -1 if no LineNumberTable, and otherwise actual line number
|
||||
line_number = method->line_number_from_bci(bci);
|
||||
if (line_number == -1 && ShowHiddenFrames) {
|
||||
line_number = bci + 1000000;
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
void java_lang_Throwable::print_stack_element(Handle stream, Method* method, int bci) {
|
||||
ResourceMark rm;
|
||||
char* buf = print_stack_element_to_buffer(method, bci);
|
||||
print_to_stream(stream, buf);
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, Method* method, int bci) {
|
||||
ResourceMark rm;
|
||||
char* buf = print_stack_element_to_buffer(method, bci);
|
||||
st->print_cr("%s", buf);
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_to_stream(Handle stream, const char* str) {
|
||||
if (stream.is_null()) {
|
||||
tty->print_cr("%s", str);
|
||||
} else {
|
||||
EXCEPTION_MARK;
|
||||
JavaValue result(T_VOID);
|
||||
Handle arg (THREAD, oopFactory::new_charArray(str, THREAD));
|
||||
if (!HAS_PENDING_EXCEPTION) {
|
||||
JavaCalls::call_virtual(&result,
|
||||
stream,
|
||||
KlassHandle(THREAD, stream->klass()),
|
||||
vmSymbols::println_name(),
|
||||
vmSymbols::char_array_void_signature(),
|
||||
arg,
|
||||
THREAD);
|
||||
}
|
||||
// Ignore any exceptions. we are in the middle of exception handling. Same as classic VM.
|
||||
if (HAS_PENDING_EXCEPTION) CLEAR_PENDING_EXCEPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const char* java_lang_Throwable::no_stack_trace_message() {
|
||||
return "\t<<no stack trace available>>";
|
||||
}
|
||||
|
||||
|
||||
// Currently used only for exceptions occurring during startup
|
||||
void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
|
||||
Thread *THREAD = Thread::current();
|
||||
Handle h_throwable(THREAD, throwable);
|
||||
while (h_throwable.not_null()) {
|
||||
objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
|
||||
if (result.is_null()) {
|
||||
st->print_cr(no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
while (result.not_null()) {
|
||||
typeArrayHandle methods (THREAD,
|
||||
typeArrayOop(result->obj_at(trace_methods_offset)));
|
||||
typeArrayHandle bcis (THREAD,
|
||||
typeArrayOop(result->obj_at(trace_bcis_offset)));
|
||||
|
||||
if (methods.is_null() || bcis.is_null()) {
|
||||
st->print_cr(no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
int length = methods()->length();
|
||||
for (int index = 0; index < length; index++) {
|
||||
Method* method = ((Method*)methods()->metadata_at(index));
|
||||
if (method == NULL) goto handle_cause;
|
||||
int bci = bcis->ushort_at(index);
|
||||
print_stack_element(st, method, bci);
|
||||
}
|
||||
result = objArrayHandle(THREAD, objArrayOop(result->obj_at(trace_next_offset)));
|
||||
}
|
||||
handle_cause:
|
||||
{
|
||||
EXCEPTION_MARK;
|
||||
JavaValue result(T_OBJECT);
|
||||
JavaCalls::call_virtual(&result,
|
||||
h_throwable,
|
||||
KlassHandle(THREAD, h_throwable->klass()),
|
||||
vmSymbols::getCause_name(),
|
||||
vmSymbols::void_throwable_signature(),
|
||||
THREAD);
|
||||
// Ignore any exceptions. we are in the middle of exception handling. Same as classic VM.
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
h_throwable = Handle();
|
||||
} else {
|
||||
h_throwable = Handle(THREAD, (oop) result.get_jobject());
|
||||
if (h_throwable.not_null()) {
|
||||
st->print("Caused by: ");
|
||||
print(h_throwable, st);
|
||||
st->cr();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void java_lang_Throwable::print_stack_trace(oop throwable, oop print_stream) {
|
||||
// Note: this is no longer used in Merlin, but we support it for compatibility.
|
||||
Thread *thread = Thread::current();
|
||||
Handle stream(thread, print_stream);
|
||||
objArrayHandle result (thread, objArrayOop(backtrace(throwable)));
|
||||
if (result.is_null()) {
|
||||
print_to_stream(stream, no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
while (result.not_null()) {
|
||||
typeArrayHandle methods(thread,
|
||||
typeArrayOop(result->obj_at(trace_methods_offset)));
|
||||
typeArrayHandle bcis (thread,
|
||||
typeArrayOop(result->obj_at(trace_bcis_offset)));
|
||||
|
||||
if (methods.is_null() || bcis.is_null()) {
|
||||
print_to_stream(stream, no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
int length = methods()->length();
|
||||
for (int index = 0; index < length; index++) {
|
||||
Method* method = ((Method*)methods()->metadata_at(index));
|
||||
if (method == NULL) return;
|
||||
int bci = bcis->ushort_at(index);
|
||||
print_stack_element(stream, method, bci);
|
||||
}
|
||||
result = objArrayHandle(thread, objArrayOop(result->obj_at(trace_next_offset)));
|
||||
}
|
||||
return line_number;
|
||||
}
|
||||
|
||||
// This class provides a simple wrapper over the internal structure of
|
||||
@ -1350,13 +1200,30 @@ class BacktraceBuilder: public StackObj {
|
||||
|
||||
enum {
|
||||
trace_methods_offset = java_lang_Throwable::trace_methods_offset,
|
||||
trace_bcis_offset = java_lang_Throwable::trace_bcis_offset,
|
||||
trace_bcis_offset = java_lang_Throwable::trace_bcis_offset,
|
||||
trace_mirrors_offset = java_lang_Throwable::trace_mirrors_offset,
|
||||
trace_next_offset = java_lang_Throwable::trace_next_offset,
|
||||
trace_size = java_lang_Throwable::trace_size,
|
||||
trace_chunk_size = java_lang_Throwable::trace_chunk_size
|
||||
};
|
||||
|
||||
// get info out of chunks
|
||||
static typeArrayOop get_methods(objArrayHandle chunk) {
|
||||
typeArrayOop methods = typeArrayOop(chunk->obj_at(trace_methods_offset));
|
||||
assert(methods != NULL, "method array should be initialized in backtrace");
|
||||
return methods;
|
||||
}
|
||||
static typeArrayOop get_bcis(objArrayHandle chunk) {
|
||||
typeArrayOop bcis = typeArrayOop(chunk->obj_at(trace_bcis_offset));
|
||||
assert(bcis != NULL, "bci array should be initialized in backtrace");
|
||||
return bcis;
|
||||
}
|
||||
static objArrayOop get_mirrors(objArrayHandle chunk) {
|
||||
objArrayOop mirrors = objArrayOop(chunk->obj_at(trace_mirrors_offset));
|
||||
assert(mirrors != NULL, "mirror array should be initialized in backtrace");
|
||||
return mirrors;
|
||||
}
|
||||
|
||||
// constructor for new backtrace
|
||||
BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL) {
|
||||
expand(CHECK);
|
||||
@ -1364,6 +1231,19 @@ class BacktraceBuilder: public StackObj {
|
||||
_index = 0;
|
||||
}
|
||||
|
||||
BacktraceBuilder(objArrayHandle backtrace) {
|
||||
_methods = get_methods(backtrace);
|
||||
_bcis = get_bcis(backtrace);
|
||||
_mirrors = get_mirrors(backtrace);
|
||||
assert(_methods->length() == _bcis->length() &&
|
||||
_methods->length() == _mirrors->length(),
|
||||
"method and source information arrays should match");
|
||||
|
||||
// head is the preallocated backtrace
|
||||
_backtrace = _head = backtrace();
|
||||
_index = 0;
|
||||
}
|
||||
|
||||
void expand(TRAPS) {
|
||||
objArrayHandle old_head(THREAD, _head);
|
||||
Pause_No_Safepoint_Verifier pnsv(&_nsv);
|
||||
@ -1371,10 +1251,10 @@ class BacktraceBuilder: public StackObj {
|
||||
objArrayOop head = oopFactory::new_objectArray(trace_size, CHECK);
|
||||
objArrayHandle new_head(THREAD, head);
|
||||
|
||||
typeArrayOop methods = oopFactory::new_metaDataArray(trace_chunk_size, CHECK);
|
||||
typeArrayOop methods = oopFactory::new_shortArray(trace_chunk_size, CHECK);
|
||||
typeArrayHandle new_methods(THREAD, methods);
|
||||
|
||||
typeArrayOop bcis = oopFactory::new_shortArray(trace_chunk_size, CHECK);
|
||||
typeArrayOop bcis = oopFactory::new_intArray(trace_chunk_size, CHECK);
|
||||
typeArrayHandle new_bcis(THREAD, bcis);
|
||||
|
||||
objArrayOop mirrors = oopFactory::new_objectArray(trace_chunk_size, CHECK);
|
||||
@ -1389,7 +1269,7 @@ class BacktraceBuilder: public StackObj {
|
||||
|
||||
_head = new_head();
|
||||
_methods = new_methods();
|
||||
_bcis = new_bcis();
|
||||
_bcis = new_bcis();
|
||||
_mirrors = new_mirrors();
|
||||
_index = 0;
|
||||
}
|
||||
@ -1403,7 +1283,6 @@ class BacktraceBuilder: public StackObj {
|
||||
// shorts. The later line number lookup would just smear the -1
|
||||
// to a 0 even if it could be recorded.
|
||||
if (bci == SynchronizationEntryBCI) bci = 0;
|
||||
assert(bci == (jushort)bci, "doesn't fit");
|
||||
|
||||
if (_index >= trace_chunk_size) {
|
||||
methodHandle mhandle(THREAD, method);
|
||||
@ -1411,26 +1290,148 @@ class BacktraceBuilder: public StackObj {
|
||||
method = mhandle();
|
||||
}
|
||||
|
||||
_methods->metadata_at_put(_index, method);
|
||||
_bcis->ushort_at_put(_index, bci);
|
||||
// we need to save the mirrors in the backtrace to keep the methods from
|
||||
// being unloaded if their class loader is unloaded while we still have
|
||||
// this stack trace.
|
||||
_methods->short_at_put(_index, method->method_idnum());
|
||||
_bcis->int_at_put(_index, merge_bci_and_version(bci, method->constants()->version()));
|
||||
|
||||
// We need to save the mirrors in the backtrace to keep the class
|
||||
// from being unloaded while we still have this stack trace.
|
||||
assert(method->method_holder()->java_mirror() != NULL, "never push null for mirror");
|
||||
_mirrors->obj_at_put(_index, method->method_holder()->java_mirror());
|
||||
_index++;
|
||||
}
|
||||
|
||||
Method* current_method() {
|
||||
assert(_index >= 0 && _index < trace_chunk_size, "out of range");
|
||||
return ((Method*)_methods->metadata_at(_index));
|
||||
}
|
||||
|
||||
jushort current_bci() {
|
||||
assert(_index >= 0 && _index < trace_chunk_size, "out of range");
|
||||
return _bcis->ushort_at(_index);
|
||||
}
|
||||
};
|
||||
|
||||
// Print stack trace element to resource allocated buffer
|
||||
char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
|
||||
int method_id, int version, int bci) {
|
||||
|
||||
// Get strings and string lengths
|
||||
InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(mirror()));
|
||||
const char* klass_name = holder->external_name();
|
||||
int buf_len = (int)strlen(klass_name);
|
||||
|
||||
// pushing to the stack trace added one.
|
||||
Method* method = holder->method_with_idnum(method_id);
|
||||
char* method_name = method->name()->as_C_string();
|
||||
buf_len += (int)strlen(method_name);
|
||||
|
||||
char* source_file_name = NULL;
|
||||
if (version_matches(method, version)) {
|
||||
Symbol* source = holder->source_file_name();
|
||||
if (source != NULL) {
|
||||
source_file_name = source->as_C_string();
|
||||
buf_len += (int)strlen(source_file_name);
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate temporary buffer with extra space for formatting and line number
|
||||
char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64);
|
||||
|
||||
// Print stack trace line in buffer
|
||||
sprintf(buf, "\tat %s.%s", klass_name, method_name);
|
||||
|
||||
if (!version_matches(method, version)) {
|
||||
strcat(buf, "(Redefined)");
|
||||
} else {
|
||||
int line_number = get_line_number(method, bci);
|
||||
if (line_number == -2) {
|
||||
strcat(buf, "(Native Method)");
|
||||
} else {
|
||||
if (source_file_name != NULL && (line_number != -1)) {
|
||||
// Sourcename and linenumber
|
||||
sprintf(buf + (int)strlen(buf), "(%s:%d)", source_file_name, line_number);
|
||||
} else if (source_file_name != NULL) {
|
||||
// Just sourcename
|
||||
sprintf(buf + (int)strlen(buf), "(%s)", source_file_name);
|
||||
} else {
|
||||
// Neither sourcename nor linenumber
|
||||
sprintf(buf + (int)strlen(buf), "(Unknown Source)");
|
||||
}
|
||||
nmethod* nm = method->code();
|
||||
if (WizardMode && nm != NULL) {
|
||||
sprintf(buf + (int)strlen(buf), "(nmethod " INTPTR_FORMAT ")", (intptr_t)nm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, Handle mirror,
|
||||
int method_id, int version, int bci) {
|
||||
ResourceMark rm;
|
||||
char* buf = print_stack_element_to_buffer(mirror, method_id, version, bci);
|
||||
st->print_cr("%s", buf);
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, methodHandle method, int bci) {
|
||||
Handle mirror = method->method_holder()->java_mirror();
|
||||
int method_id = method->method_idnum();
|
||||
int version = method->constants()->version();
|
||||
print_stack_element(st, mirror, method_id, version, bci);
|
||||
}
|
||||
|
||||
const char* java_lang_Throwable::no_stack_trace_message() {
|
||||
return "\t<<no stack trace available>>";
|
||||
}
|
||||
|
||||
|
||||
// Currently used only for exceptions occurring during startup
|
||||
void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
|
||||
Thread *THREAD = Thread::current();
|
||||
Handle h_throwable(THREAD, throwable);
|
||||
while (h_throwable.not_null()) {
|
||||
objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
|
||||
if (result.is_null()) {
|
||||
st->print_cr(no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
while (result.not_null()) {
|
||||
|
||||
// Get method id, bci, version and mirror from chunk
|
||||
typeArrayHandle methods (THREAD, BacktraceBuilder::get_methods(result));
|
||||
typeArrayHandle bcis (THREAD, BacktraceBuilder::get_bcis(result));
|
||||
objArrayHandle mirrors (THREAD, BacktraceBuilder::get_mirrors(result));
|
||||
|
||||
int length = methods()->length();
|
||||
for (int index = 0; index < length; index++) {
|
||||
Handle mirror(THREAD, mirrors->obj_at(index));
|
||||
// NULL mirror means end of stack trace
|
||||
if (mirror.is_null()) goto handle_cause;
|
||||
int method = methods->short_at(index);
|
||||
int version = version_at(bcis->int_at(index));
|
||||
int bci = bci_at(bcis->int_at(index));
|
||||
print_stack_element(st, mirror, method, version, bci);
|
||||
}
|
||||
result = objArrayHandle(THREAD, objArrayOop(result->obj_at(trace_next_offset)));
|
||||
}
|
||||
handle_cause:
|
||||
{
|
||||
EXCEPTION_MARK;
|
||||
JavaValue cause(T_OBJECT);
|
||||
JavaCalls::call_virtual(&cause,
|
||||
h_throwable,
|
||||
KlassHandle(THREAD, h_throwable->klass()),
|
||||
vmSymbols::getCause_name(),
|
||||
vmSymbols::void_throwable_signature(),
|
||||
THREAD);
|
||||
// Ignore any exceptions. we are in the middle of exception handling. Same as classic VM.
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
h_throwable = Handle();
|
||||
} else {
|
||||
h_throwable = Handle(THREAD, (oop) cause.get_jobject());
|
||||
if (h_throwable.not_null()) {
|
||||
st->print("Caused by: ");
|
||||
print(h_throwable, st);
|
||||
st->cr();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS) {
|
||||
if (!StackTraceInThrowable) return;
|
||||
@ -1591,21 +1592,8 @@ void java_lang_Throwable::allocate_backtrace(Handle throwable, TRAPS) {
|
||||
|
||||
// No-op if stack trace is disabled
|
||||
if (!StackTraceInThrowable) return;
|
||||
|
||||
objArrayOop h_oop = oopFactory::new_objectArray(trace_size, CHECK);
|
||||
objArrayHandle backtrace (THREAD, h_oop);
|
||||
typeArrayOop m_oop = oopFactory::new_metaDataArray(trace_chunk_size, CHECK);
|
||||
typeArrayHandle methods (THREAD, m_oop);
|
||||
typeArrayOop b = oopFactory::new_shortArray(trace_chunk_size, CHECK);
|
||||
typeArrayHandle bcis(THREAD, b);
|
||||
objArrayOop mirror_oop = oopFactory::new_objectArray(trace_chunk_size, CHECK);
|
||||
objArrayHandle mirrors (THREAD, mirror_oop);
|
||||
|
||||
// backtrace has space for one chunk (next is NULL)
|
||||
backtrace->obj_at_put(trace_methods_offset, methods());
|
||||
backtrace->obj_at_put(trace_bcis_offset, bcis());
|
||||
backtrace->obj_at_put(trace_mirrors_offset, mirrors());
|
||||
set_backtrace(throwable(), backtrace());
|
||||
BacktraceBuilder bt(CHECK); // creates a backtrace
|
||||
set_backtrace(throwable(), bt.backtrace());
|
||||
}
|
||||
|
||||
|
||||
@ -1617,48 +1605,26 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t
|
||||
|
||||
assert(throwable->is_a(SystemDictionary::Throwable_klass()), "sanity check");
|
||||
|
||||
objArrayOop backtrace = (objArrayOop)java_lang_Throwable::backtrace(throwable());
|
||||
assert(backtrace != NULL, "backtrace not preallocated");
|
||||
JavaThread* THREAD = JavaThread::current();
|
||||
|
||||
oop m = backtrace->obj_at(trace_methods_offset);
|
||||
typeArrayOop methods = typeArrayOop(m);
|
||||
assert(methods != NULL && methods->length() > 0, "method array not preallocated");
|
||||
objArrayHandle backtrace (THREAD, (objArrayOop)java_lang_Throwable::backtrace(throwable()));
|
||||
assert(backtrace.not_null(), "backtrace should have been preallocated");
|
||||
|
||||
oop b = backtrace->obj_at(trace_bcis_offset);
|
||||
typeArrayOop bcis = typeArrayOop(b);
|
||||
assert(bcis != NULL, "bci array not preallocated");
|
||||
ResourceMark rm(THREAD);
|
||||
vframeStream st(THREAD);
|
||||
|
||||
oop mr = backtrace->obj_at(trace_mirrors_offset);
|
||||
objArrayOop mirrors = objArrayOop(mr);
|
||||
assert(mirrors != NULL, "bci array not preallocated");
|
||||
|
||||
assert(methods->length() == bcis->length() &&
|
||||
methods->length() == mirrors->length(),
|
||||
"method and bci arrays should match");
|
||||
|
||||
JavaThread* thread = JavaThread::current();
|
||||
ResourceMark rm(thread);
|
||||
vframeStream st(thread);
|
||||
BacktraceBuilder bt(backtrace);
|
||||
|
||||
// Unlike fill_in_stack_trace we do not skip fillInStackTrace or throwable init
|
||||
// methods as preallocated errors aren't created by "java" code.
|
||||
|
||||
// fill in as much stack trace as possible
|
||||
typeArrayOop methods = BacktraceBuilder::get_methods(backtrace);
|
||||
int max_chunks = MIN2(methods->length(), (int)MaxJavaStackTraceDepth);
|
||||
int chunk_count = 0;
|
||||
|
||||
for (;!st.at_end(); st.next()) {
|
||||
// Add entry and smear the -1 bci to 0 since the array only holds
|
||||
// unsigned shorts. The later line number lookup would just smear
|
||||
// the -1 to a 0 even if it could be recorded.
|
||||
int bci = st.bci();
|
||||
if (bci == SynchronizationEntryBCI) bci = 0;
|
||||
assert(bci == (jushort)bci, "doesn't fit");
|
||||
bcis->ushort_at_put(chunk_count, bci);
|
||||
methods->metadata_at_put(chunk_count, st.method());
|
||||
mirrors->obj_at_put(chunk_count,
|
||||
st.method()->method_holder()->java_mirror());
|
||||
|
||||
bt.push(st.method(), st.bci(), CHECK);
|
||||
chunk_count++;
|
||||
|
||||
// Bail-out for deep stacks
|
||||
@ -1672,7 +1638,6 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t
|
||||
java_lang_Throwable::set_stacktrace(throwable(), java_lang_Throwable::unassigned_stacktrace());
|
||||
assert(java_lang_Throwable::unassigned_stacktrace() != NULL, "not initialized");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1691,12 +1656,12 @@ int java_lang_Throwable::get_stack_trace_depth(oop throwable, TRAPS) {
|
||||
chunk = next;
|
||||
}
|
||||
assert(chunk != NULL && chunk->obj_at(trace_next_offset) == NULL, "sanity check");
|
||||
// Count element in remaining partial chunk
|
||||
typeArrayOop methods = typeArrayOop(chunk->obj_at(trace_methods_offset));
|
||||
typeArrayOop bcis = typeArrayOop(chunk->obj_at(trace_bcis_offset));
|
||||
assert(methods != NULL && bcis != NULL, "sanity check");
|
||||
for (int i = 0; i < methods->length(); i++) {
|
||||
if (methods->metadata_at(i) == NULL) break;
|
||||
// Count element in remaining partial chunk. NULL value for mirror
|
||||
// marks the end of the stack trace elements that are saved.
|
||||
objArrayOop mirrors = BacktraceBuilder::get_mirrors(chunk);
|
||||
assert(mirrors != NULL, "sanity check");
|
||||
for (int i = 0; i < mirrors->length(); i++) {
|
||||
if (mirrors->obj_at(i) == NULL) break;
|
||||
depth++;
|
||||
}
|
||||
}
|
||||
@ -1722,25 +1687,28 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS
|
||||
if (chunk == NULL) {
|
||||
THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL);
|
||||
}
|
||||
// Get method,bci from chunk
|
||||
typeArrayOop methods = typeArrayOop(chunk->obj_at(trace_methods_offset));
|
||||
typeArrayOop bcis = typeArrayOop(chunk->obj_at(trace_bcis_offset));
|
||||
assert(methods != NULL && bcis != NULL, "sanity check");
|
||||
methodHandle method(THREAD, ((Method*)methods->metadata_at(chunk_index)));
|
||||
int bci = bcis->ushort_at(chunk_index);
|
||||
// Get method id, bci, version and mirror from chunk
|
||||
typeArrayOop methods = BacktraceBuilder::get_methods(chunk);
|
||||
typeArrayOop bcis = BacktraceBuilder::get_bcis(chunk);
|
||||
objArrayOop mirrors = BacktraceBuilder::get_mirrors(chunk);
|
||||
|
||||
assert(methods != NULL && bcis != NULL && mirrors != NULL, "sanity check");
|
||||
|
||||
int method = methods->short_at(chunk_index);
|
||||
int version = version_at(bcis->int_at(chunk_index));
|
||||
int bci = bci_at(bcis->int_at(chunk_index));
|
||||
Handle mirror(THREAD, mirrors->obj_at(chunk_index));
|
||||
|
||||
// Chunk can be partial full
|
||||
if (method.is_null()) {
|
||||
if (mirror.is_null()) {
|
||||
THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL);
|
||||
}
|
||||
|
||||
oop element = java_lang_StackTraceElement::create(method, bci, CHECK_0);
|
||||
oop element = java_lang_StackTraceElement::create(mirror, method, version, bci, CHECK_0);
|
||||
return element;
|
||||
}
|
||||
|
||||
oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
|
||||
// SystemDictionary::stackTraceElement_klass() will be null for pre-1.4 JDKs
|
||||
assert(JDK_Version::is_gte_jdk14x_version(), "should only be called in >= 1.4");
|
||||
|
||||
oop java_lang_StackTraceElement::create(Handle mirror, int method_id, int version, int bci, TRAPS) {
|
||||
// Allocate java.lang.StackTraceElement instance
|
||||
Klass* k = SystemDictionary::StackTraceElement_klass();
|
||||
assert(k != NULL, "must be loaded in 1.4+");
|
||||
@ -1752,37 +1720,39 @@ oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
|
||||
Handle element = ik->allocate_instance_handle(CHECK_0);
|
||||
// Fill in class name
|
||||
ResourceMark rm(THREAD);
|
||||
const char* str = method->method_holder()->external_name();
|
||||
InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(mirror()));
|
||||
const char* str = holder->external_name();
|
||||
oop classname = StringTable::intern((char*) str, CHECK_0);
|
||||
java_lang_StackTraceElement::set_declaringClass(element(), classname);
|
||||
|
||||
// Fill in method name
|
||||
Method* method = holder->method_with_idnum(method_id);
|
||||
oop methodname = StringTable::intern(method->name(), CHECK_0);
|
||||
java_lang_StackTraceElement::set_methodName(element(), methodname);
|
||||
// Fill in source file name
|
||||
Symbol* source = method->method_holder()->source_file_name();
|
||||
if (ShowHiddenFrames && source == NULL)
|
||||
source = vmSymbols::unknown_class_name();
|
||||
oop filename = StringTable::intern(source, CHECK_0);
|
||||
java_lang_StackTraceElement::set_fileName(element(), filename);
|
||||
// File in source line number
|
||||
int line_number;
|
||||
if (method->is_native()) {
|
||||
// Negative value different from -1 below, enabling Java code in
|
||||
// class java.lang.StackTraceElement to distinguish "native" from
|
||||
// "no LineNumberTable".
|
||||
line_number = -2;
|
||||
} else {
|
||||
// Returns -1 if no LineNumberTable, and otherwise actual line number
|
||||
line_number = method->line_number_from_bci(bci);
|
||||
if (line_number == -1 && ShowHiddenFrames) {
|
||||
line_number = bci + 1000000;
|
||||
}
|
||||
}
|
||||
java_lang_StackTraceElement::set_lineNumber(element(), line_number);
|
||||
|
||||
if (!version_matches(method, version)) {
|
||||
// The method was redefined, accurate line number information isn't available
|
||||
java_lang_StackTraceElement::set_fileName(element(), NULL);
|
||||
java_lang_StackTraceElement::set_lineNumber(element(), -1);
|
||||
} else {
|
||||
// Fill in source file name and line number.
|
||||
Symbol* source = holder->source_file_name();
|
||||
if (ShowHiddenFrames && source == NULL)
|
||||
source = vmSymbols::unknown_class_name();
|
||||
oop filename = StringTable::intern(source, CHECK_0);
|
||||
java_lang_StackTraceElement::set_fileName(element(), filename);
|
||||
|
||||
int line_number = get_line_number(method, bci);
|
||||
java_lang_StackTraceElement::set_lineNumber(element(), line_number);
|
||||
}
|
||||
return element();
|
||||
}
|
||||
|
||||
oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
|
||||
Handle mirror (THREAD, method->method_holder()->java_mirror());
|
||||
int method_id = method->method_idnum();
|
||||
return create(mirror, method_id, method->constants()->version(), bci, THREAD);
|
||||
}
|
||||
|
||||
void java_lang_reflect_AccessibleObject::compute_offsets() {
|
||||
Klass* k = SystemDictionary::reflect_AccessibleObject_klass();
|
||||
@ -1813,10 +1783,12 @@ void java_lang_reflect_Method::compute_offsets() {
|
||||
annotations_offset = -1;
|
||||
parameter_annotations_offset = -1;
|
||||
annotation_default_offset = -1;
|
||||
type_annotations_offset = -1;
|
||||
compute_optional_offset(signature_offset, k, vmSymbols::signature_name(), vmSymbols::string_signature());
|
||||
compute_optional_offset(annotations_offset, k, vmSymbols::annotations_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(parameter_annotations_offset, k, vmSymbols::parameter_annotations_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(annotation_default_offset, k, vmSymbols::annotation_default_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(type_annotations_offset, k, vmSymbols::type_annotations_name(), vmSymbols::byte_array_signature());
|
||||
}
|
||||
|
||||
Handle java_lang_reflect_Method::create(TRAPS) {
|
||||
@ -1962,6 +1934,22 @@ void java_lang_reflect_Method::set_annotation_default(oop method, oop value) {
|
||||
method->obj_field_put(annotation_default_offset, value);
|
||||
}
|
||||
|
||||
bool java_lang_reflect_Method::has_type_annotations_field() {
|
||||
return (type_annotations_offset >= 0);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Method::type_annotations(oop method) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
return method->obj_field(type_annotations_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Method::set_type_annotations(oop method, oop value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
method->obj_field_put(type_annotations_offset, value);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Constructor::compute_offsets() {
|
||||
Klass* k = SystemDictionary::reflect_Constructor_klass();
|
||||
compute_offset(clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature());
|
||||
@ -1973,9 +1961,11 @@ void java_lang_reflect_Constructor::compute_offsets() {
|
||||
signature_offset = -1;
|
||||
annotations_offset = -1;
|
||||
parameter_annotations_offset = -1;
|
||||
type_annotations_offset = -1;
|
||||
compute_optional_offset(signature_offset, k, vmSymbols::signature_name(), vmSymbols::string_signature());
|
||||
compute_optional_offset(annotations_offset, k, vmSymbols::annotations_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(parameter_annotations_offset, k, vmSymbols::parameter_annotations_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(type_annotations_offset, k, vmSymbols::type_annotations_name(), vmSymbols::byte_array_signature());
|
||||
}
|
||||
|
||||
Handle java_lang_reflect_Constructor::create(TRAPS) {
|
||||
@ -2086,6 +2076,22 @@ void java_lang_reflect_Constructor::set_parameter_annotations(oop method, oop va
|
||||
method->obj_field_put(parameter_annotations_offset, value);
|
||||
}
|
||||
|
||||
bool java_lang_reflect_Constructor::has_type_annotations_field() {
|
||||
return (type_annotations_offset >= 0);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Constructor::type_annotations(oop constructor) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
return constructor->obj_field(type_annotations_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Constructor::set_type_annotations(oop constructor, oop value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
constructor->obj_field_put(type_annotations_offset, value);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Field::compute_offsets() {
|
||||
Klass* k = SystemDictionary::reflect_Field_klass();
|
||||
compute_offset(clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature());
|
||||
@ -2096,8 +2102,10 @@ void java_lang_reflect_Field::compute_offsets() {
|
||||
// The generic signature and annotations fields are only present in 1.5
|
||||
signature_offset = -1;
|
||||
annotations_offset = -1;
|
||||
type_annotations_offset = -1;
|
||||
compute_optional_offset(signature_offset, k, vmSymbols::signature_name(), vmSymbols::string_signature());
|
||||
compute_optional_offset(annotations_offset, k, vmSymbols::annotations_name(), vmSymbols::byte_array_signature());
|
||||
compute_optional_offset(type_annotations_offset, k, vmSymbols::type_annotations_name(), vmSymbols::byte_array_signature());
|
||||
}
|
||||
|
||||
Handle java_lang_reflect_Field::create(TRAPS) {
|
||||
@ -2192,6 +2200,21 @@ void java_lang_reflect_Field::set_annotations(oop field, oop value) {
|
||||
field->obj_field_put(annotations_offset, value);
|
||||
}
|
||||
|
||||
bool java_lang_reflect_Field::has_type_annotations_field() {
|
||||
return (type_annotations_offset >= 0);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Field::type_annotations(oop field) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
return field->obj_field(type_annotations_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Field::set_type_annotations(oop field, oop value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
assert(has_type_annotations_field(), "type_annotations field must be present");
|
||||
field->obj_field_put(type_annotations_offset, value);
|
||||
}
|
||||
|
||||
void sun_reflect_ConstantPool::compute_offsets() {
|
||||
Klass* k = SystemDictionary::reflect_ConstantPool_klass();
|
||||
@ -2202,6 +2225,66 @@ void sun_reflect_ConstantPool::compute_offsets() {
|
||||
}
|
||||
}
|
||||
|
||||
void java_lang_reflect_Parameter::compute_offsets() {
|
||||
Klass* k = SystemDictionary::reflect_Parameter_klass();
|
||||
if(NULL != k) {
|
||||
compute_offset(name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature());
|
||||
compute_offset(modifiers_offset, k, vmSymbols::modifiers_name(), vmSymbols::int_signature());
|
||||
compute_offset(index_offset, k, vmSymbols::index_name(), vmSymbols::int_signature());
|
||||
compute_offset(executable_offset, k, vmSymbols::executable_name(), vmSymbols::executable_signature());
|
||||
}
|
||||
}
|
||||
|
||||
Handle java_lang_reflect_Parameter::create(TRAPS) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
Symbol* name = vmSymbols::java_lang_reflect_Parameter();
|
||||
Klass* k = SystemDictionary::resolve_or_fail(name, true, CHECK_NH);
|
||||
instanceKlassHandle klass (THREAD, k);
|
||||
// Ensure it is initialized
|
||||
klass->initialize(CHECK_NH);
|
||||
return klass->allocate_instance_handle(CHECK_NH);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Parameter::name(oop param) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
return param->obj_field(name_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Parameter::set_name(oop param, oop value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
param->obj_field_put(name_offset, value);
|
||||
}
|
||||
|
||||
int java_lang_reflect_Parameter::modifiers(oop param) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
return param->int_field(modifiers_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Parameter::set_modifiers(oop param, int value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
param->int_field_put(modifiers_offset, value);
|
||||
}
|
||||
|
||||
int java_lang_reflect_Parameter::index(oop param) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
return param->int_field(index_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Parameter::set_index(oop param, int value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
param->int_field_put(index_offset, value);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Parameter::executable(oop param) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
return param->obj_field(executable_offset);
|
||||
}
|
||||
|
||||
void java_lang_reflect_Parameter::set_executable(oop param, oop value) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
param->obj_field_put(executable_offset, value);
|
||||
}
|
||||
|
||||
|
||||
Handle sun_reflect_ConstantPool::create(TRAPS) {
|
||||
assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
|
||||
@ -2836,7 +2919,6 @@ int java_lang_System::err_offset_in_bytes() {
|
||||
|
||||
int java_lang_Class::_klass_offset;
|
||||
int java_lang_Class::_array_klass_offset;
|
||||
int java_lang_Class::_resolved_constructor_offset;
|
||||
int java_lang_Class::_oop_size_offset;
|
||||
int java_lang_Class::_static_oop_field_count_offset;
|
||||
GrowableArray<Klass*>* java_lang_Class::_fixup_mirror_list = NULL;
|
||||
@ -2857,6 +2939,7 @@ int java_lang_reflect_Method::signature_offset;
|
||||
int java_lang_reflect_Method::annotations_offset;
|
||||
int java_lang_reflect_Method::parameter_annotations_offset;
|
||||
int java_lang_reflect_Method::annotation_default_offset;
|
||||
int java_lang_reflect_Method::type_annotations_offset;
|
||||
int java_lang_reflect_Constructor::clazz_offset;
|
||||
int java_lang_reflect_Constructor::parameterTypes_offset;
|
||||
int java_lang_reflect_Constructor::exceptionTypes_offset;
|
||||
@ -2865,6 +2948,7 @@ int java_lang_reflect_Constructor::modifiers_offset;
|
||||
int java_lang_reflect_Constructor::signature_offset;
|
||||
int java_lang_reflect_Constructor::annotations_offset;
|
||||
int java_lang_reflect_Constructor::parameter_annotations_offset;
|
||||
int java_lang_reflect_Constructor::type_annotations_offset;
|
||||
int java_lang_reflect_Field::clazz_offset;
|
||||
int java_lang_reflect_Field::name_offset;
|
||||
int java_lang_reflect_Field::type_offset;
|
||||
@ -2872,6 +2956,11 @@ int java_lang_reflect_Field::slot_offset;
|
||||
int java_lang_reflect_Field::modifiers_offset;
|
||||
int java_lang_reflect_Field::signature_offset;
|
||||
int java_lang_reflect_Field::annotations_offset;
|
||||
int java_lang_reflect_Field::type_annotations_offset;
|
||||
int java_lang_reflect_Parameter::name_offset;
|
||||
int java_lang_reflect_Parameter::modifiers_offset;
|
||||
int java_lang_reflect_Parameter::index_offset;
|
||||
int java_lang_reflect_Parameter::executable_offset;
|
||||
int java_lang_boxing_object::value_offset;
|
||||
int java_lang_boxing_object::long_value_offset;
|
||||
int java_lang_ref_Reference::referent_offset;
|
||||
@ -3056,6 +3145,8 @@ void JavaClasses::compute_offsets() {
|
||||
sun_reflect_ConstantPool::compute_offsets();
|
||||
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
|
||||
}
|
||||
if (JDK_Version::is_jdk18x_version())
|
||||
java_lang_reflect_Parameter::compute_offsets();
|
||||
|
||||
// generated interpreter code wants to know about the offsets we just computed:
|
||||
AbstractAssembler::update_delayed_values();
|
||||
@ -3181,7 +3272,6 @@ void JavaClasses::check_offsets() {
|
||||
// Fake fields
|
||||
// CHECK_OFFSET("java/lang/Class", java_lang_Class, klass); // %%% this needs to be checked
|
||||
// CHECK_OFFSET("java/lang/Class", java_lang_Class, array_klass); // %%% this needs to be checked
|
||||
// CHECK_OFFSET("java/lang/Class", java_lang_Class, resolved_constructor); // %%% this needs to be checked
|
||||
|
||||
// java.lang.Throwable
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -206,7 +206,6 @@ class java_lang_String : AllStatic {
|
||||
|
||||
#define CLASS_INJECTED_FIELDS(macro) \
|
||||
macro(java_lang_Class, klass, intptr_signature, false) \
|
||||
macro(java_lang_Class, resolved_constructor, intptr_signature, false) \
|
||||
macro(java_lang_Class, array_klass, intptr_signature, false) \
|
||||
macro(java_lang_Class, oop_size, int_signature, false) \
|
||||
macro(java_lang_Class, static_oop_field_count, int_signature, false)
|
||||
@ -218,7 +217,6 @@ class java_lang_Class : AllStatic {
|
||||
// The fake offsets are added by the class loader when java.lang.Class is loaded
|
||||
|
||||
static int _klass_offset;
|
||||
static int _resolved_constructor_offset;
|
||||
static int _array_klass_offset;
|
||||
|
||||
static int _oop_size_offset;
|
||||
@ -254,15 +252,11 @@ class java_lang_Class : AllStatic {
|
||||
static bool is_primitive(oop java_class);
|
||||
static BasicType primitive_type(oop java_class);
|
||||
static oop primitive_mirror(BasicType t);
|
||||
// JVM_NewInstance support
|
||||
static Method* resolved_constructor(oop java_class);
|
||||
static void set_resolved_constructor(oop java_class, Method* constructor);
|
||||
// JVM_NewArray support
|
||||
static Klass* array_klass(oop java_class);
|
||||
static void set_array_klass(oop java_class, Klass* klass);
|
||||
// compiler support for class operations
|
||||
static int klass_offset_in_bytes() { return _klass_offset; }
|
||||
static int resolved_constructor_offset_in_bytes() { return _resolved_constructor_offset; }
|
||||
static int array_klass_offset_in_bytes() { return _array_klass_offset; }
|
||||
// Support for classRedefinedCount field
|
||||
static int classRedefinedCount(oop the_class_mirror);
|
||||
@ -469,8 +463,7 @@ class java_lang_Throwable: AllStatic {
|
||||
static int static_unassigned_stacktrace_offset;
|
||||
|
||||
// Printing
|
||||
static char* print_stack_element_to_buffer(Method* method, int bci);
|
||||
static void print_to_stream(Handle stream, const char* str);
|
||||
static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci);
|
||||
// StackTrace (programmatic access, new since 1.4)
|
||||
static void clear_stacktrace(oop throwable);
|
||||
// No stack trace available
|
||||
@ -490,12 +483,9 @@ class java_lang_Throwable: AllStatic {
|
||||
static oop message(oop throwable);
|
||||
static oop message(Handle throwable);
|
||||
static void set_message(oop throwable, oop value);
|
||||
// Print stack trace stored in exception by call-back to Java
|
||||
// Note: this is no longer used in Merlin, but we still suppport
|
||||
// it for compatibility.
|
||||
static void print_stack_trace(oop throwable, oop print_stream);
|
||||
static void print_stack_element(Handle stream, Method* method, int bci);
|
||||
static void print_stack_element(outputStream *st, Method* method, int bci);
|
||||
static void print_stack_element(outputStream *st, Handle mirror, int method,
|
||||
int version, int bci);
|
||||
static void print_stack_element(outputStream *st, methodHandle method, int bci);
|
||||
static void print_stack_usage(Handle stream);
|
||||
|
||||
// Allocate space for backtrace (created but stack trace not filled in)
|
||||
@ -554,6 +544,7 @@ class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
|
||||
static int annotations_offset;
|
||||
static int parameter_annotations_offset;
|
||||
static int annotation_default_offset;
|
||||
static int type_annotations_offset;
|
||||
|
||||
static void compute_offsets();
|
||||
|
||||
@ -599,6 +590,10 @@ class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
|
||||
static oop annotation_default(oop method);
|
||||
static void set_annotation_default(oop method, oop value);
|
||||
|
||||
static bool has_type_annotations_field();
|
||||
static oop type_annotations(oop method);
|
||||
static void set_type_annotations(oop method, oop value);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
};
|
||||
@ -618,6 +613,7 @@ class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject
|
||||
static int signature_offset;
|
||||
static int annotations_offset;
|
||||
static int parameter_annotations_offset;
|
||||
static int type_annotations_offset;
|
||||
|
||||
static void compute_offsets();
|
||||
|
||||
@ -653,6 +649,10 @@ class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject
|
||||
static oop parameter_annotations(oop method);
|
||||
static void set_parameter_annotations(oop method, oop value);
|
||||
|
||||
static bool has_type_annotations_field();
|
||||
static oop type_annotations(oop constructor);
|
||||
static void set_type_annotations(oop constructor, oop value);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
};
|
||||
@ -671,6 +671,7 @@ class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
|
||||
static int modifiers_offset;
|
||||
static int signature_offset;
|
||||
static int annotations_offset;
|
||||
static int type_annotations_offset;
|
||||
|
||||
static void compute_offsets();
|
||||
|
||||
@ -710,10 +711,45 @@ class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
|
||||
static oop annotation_default(oop method);
|
||||
static void set_annotation_default(oop method, oop value);
|
||||
|
||||
static bool has_type_annotations_field();
|
||||
static oop type_annotations(oop field);
|
||||
static void set_type_annotations(oop field, oop value);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
};
|
||||
|
||||
class java_lang_reflect_Parameter {
|
||||
private:
|
||||
// Note that to reduce dependencies on the JDK we compute these
|
||||
// offsets at run-time.
|
||||
static int name_offset;
|
||||
static int modifiers_offset;
|
||||
static int index_offset;
|
||||
static int executable_offset;
|
||||
|
||||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
||||
// Accessors
|
||||
static oop name(oop field);
|
||||
static void set_name(oop field, oop value);
|
||||
|
||||
static int index(oop reflect);
|
||||
static void set_index(oop reflect, int value);
|
||||
|
||||
static int modifiers(oop reflect);
|
||||
static void set_modifiers(oop reflect, int value);
|
||||
|
||||
static oop executable(oop constructor);
|
||||
static void set_executable(oop constructor, oop value);
|
||||
|
||||
friend class JavaClasses;
|
||||
};
|
||||
|
||||
// Interface to sun.reflect.ConstantPool objects
|
||||
class sun_reflect_ConstantPool {
|
||||
private:
|
||||
@ -1217,7 +1253,8 @@ class java_lang_StackTraceElement: AllStatic {
|
||||
static void set_lineNumber(oop element, int value);
|
||||
|
||||
// Create an instance of StackTraceElement
|
||||
static oop create(methodHandle m, int bci, TRAPS);
|
||||
static oop create(Handle mirror, int method, int version, int bci, TRAPS);
|
||||
static oop create(methodHandle method, int bci, TRAPS);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
@ -142,7 +142,7 @@ PlaceholderEntry* PlaceholderTable::find_and_add(int index, unsigned int hash,
|
||||
}
|
||||
|
||||
|
||||
// placeholder used to track class loading internal states
|
||||
// placeholder is used to track class loading internal states
|
||||
// placeholder existence now for loading superclass/superinterface
|
||||
// superthreadQ tracks class circularity, while loading superclass/superinterface
|
||||
// loadInstanceThreadQ tracks load_instance_class calls
|
||||
@ -153,15 +153,17 @@ PlaceholderEntry* PlaceholderTable::find_and_add(int index, unsigned int hash,
|
||||
// All claimants remove SeenThread after completing action
|
||||
// On removal: if definer and all queues empty, remove entry
|
||||
// Note: you can be in both placeholders and systemDictionary
|
||||
// see parse_stream for redefine classes
|
||||
// Therefore - must always check SD first
|
||||
// Ignores the case where entry is not found
|
||||
void PlaceholderTable::find_and_remove(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data, Thread* thread) {
|
||||
Symbol* name, ClassLoaderData* loader_data,
|
||||
classloadAction action,
|
||||
Thread* thread) {
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
PlaceholderEntry *probe = get_entry(index, hash, name, loader_data);
|
||||
if (probe != NULL) {
|
||||
// No other threads using this entry
|
||||
probe->remove_seen_thread(thread, action);
|
||||
// If no other threads using this entry, and this thread is not using this entry for other states
|
||||
if ((probe->superThreadQ() == NULL) && (probe->loadInstanceThreadQ() == NULL)
|
||||
&& (probe->defineThreadQ() == NULL) && (probe->definer() == NULL)) {
|
||||
remove_entry(index, hash, name, loader_data);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
@ -82,7 +82,7 @@ public:
|
||||
};
|
||||
|
||||
// find_and_add returns probe pointer - old or new
|
||||
// If no entry exists, add a placeholder entry and push SeenThread
|
||||
// If no entry exists, add a placeholder entry and push SeenThread for classloadAction
|
||||
// If entry exists, reuse entry and push SeenThread for classloadAction
|
||||
PlaceholderEntry* find_and_add(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data,
|
||||
@ -92,9 +92,11 @@ public:
|
||||
void remove_entry(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data);
|
||||
|
||||
// Remove placeholder information
|
||||
// find_and_remove first removes SeenThread for classloadAction
|
||||
// If all queues are empty and definer is null, remove the PlacheholderEntry completely
|
||||
void find_and_remove(int index, unsigned int hash,
|
||||
Symbol* name, ClassLoaderData* loader_data, Thread* thread);
|
||||
Symbol* name, ClassLoaderData* loader_data,
|
||||
classloadAction action, Thread* thread);
|
||||
|
||||
// GC support.
|
||||
void classes_do(KlassClosure* f);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
@ -172,7 +172,7 @@ Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name, Handle
|
||||
assert(klass_h() == NULL, "Should not have result with exception pending");
|
||||
Handle e(THREAD, PENDING_EXCEPTION);
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
THROW_MSG_CAUSE_0(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string(), e);
|
||||
THROW_MSG_CAUSE_NULL(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string(), e);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
@ -181,9 +181,9 @@ Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name, Handle
|
||||
if (klass_h() == NULL) {
|
||||
ResourceMark rm(THREAD);
|
||||
if (throw_error) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string());
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string());
|
||||
} else {
|
||||
THROW_MSG_0(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string());
|
||||
}
|
||||
}
|
||||
return (Klass*)klass_h();
|
||||
@ -343,29 +343,29 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
|
||||
}
|
||||
if (throw_circularity_error) {
|
||||
ResourceMark rm(THREAD);
|
||||
THROW_MSG_0(vmSymbols::java_lang_ClassCircularityError(), child_name->as_C_string());
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), child_name->as_C_string());
|
||||
}
|
||||
|
||||
// java.lang.Object should have been found above
|
||||
assert(class_name != NULL, "null super class for resolving");
|
||||
// Resolve the super class or interface, check results on return
|
||||
Klass* superk = NULL;
|
||||
superk = SystemDictionary::resolve_or_null(class_name,
|
||||
Klass* superk = SystemDictionary::resolve_or_null(class_name,
|
||||
class_loader,
|
||||
protection_domain,
|
||||
THREAD);
|
||||
|
||||
KlassHandle superk_h(THREAD, superk);
|
||||
|
||||
// Note: clean up of placeholders currently in callers of
|
||||
// resolve_super_or_fail - either at update_dictionary time
|
||||
// or on error
|
||||
// Clean up of placeholders moved so that each classloadAction registrar self-cleans up
|
||||
// It is no longer necessary to keep the placeholder table alive until update_dictionary
|
||||
// or error. GC used to walk the placeholder table as strong roots.
|
||||
// The instanceKlass is kept alive because the class loader is on the stack,
|
||||
// which keeps the loader_data alive, as well as all instanceKlasses in
|
||||
// the loader_data. parseClassFile adds the instanceKlass to loader_data.
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
|
||||
if (probe != NULL) {
|
||||
probe->remove_seen_thread(THREAD, PlaceholderTable::LOAD_SUPER);
|
||||
}
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPER, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
if (HAS_PENDING_EXCEPTION || superk_h() == NULL) {
|
||||
// can null superk
|
||||
@ -430,8 +430,8 @@ void SystemDictionary::validate_protection_domain(instanceKlassHandle klass,
|
||||
|
||||
// We're using a No_Safepoint_Verifier to catch any place where we
|
||||
// might potentially do a GC at all.
|
||||
// SystemDictionary::do_unloading() asserts that classes are only
|
||||
// unloaded at a safepoint.
|
||||
// Dictionary::do_unloading() asserts that classes in SD are only
|
||||
// unloaded at a safepoint. Anonymous classes are not in SD.
|
||||
No_Safepoint_Verifier nosafepoint;
|
||||
dictionary()->add_protection_domain(d_index, d_hash, klass, loader_data,
|
||||
protection_domain, THREAD);
|
||||
@ -486,7 +486,6 @@ void SystemDictionary::double_lock_wait(Handle lockObject, TRAPS) {
|
||||
// super class loading here.
|
||||
// This also is critical in cases where the original thread gets stalled
|
||||
// even in non-circularity situations.
|
||||
// Note: only one thread can define the class, but multiple can resolve
|
||||
// Note: must call resolve_super_or_fail even if null super -
|
||||
// to force placeholder entry creation for this class for circularity detection
|
||||
// Caller must check for pending exception
|
||||
@ -518,14 +517,6 @@ instanceKlassHandle SystemDictionary::handle_parallel_super_load(
|
||||
protection_domain,
|
||||
true,
|
||||
CHECK_(nh));
|
||||
// We don't redefine the class, so we just need to clean up if there
|
||||
// was not an error (don't want to modify any system dictionary
|
||||
// data structures).
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
|
||||
// parallelCapable class loaders do NOT wait for parallel superclass loads to complete
|
||||
// Serial class loaders and bootstrap classloader do wait for superclass loads
|
||||
@ -595,6 +586,10 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
|
||||
// Do lookup to see if class already exist and the protection domain
|
||||
// has the right access
|
||||
// This call uses find which checks protection domain already matches
|
||||
// All subsequent calls use find_class, and set has_loaded_class so that
|
||||
// before we return a result we call out to java to check for valid protection domain
|
||||
// to allow returning the Klass* and add it to the pd_set if it is valid
|
||||
unsigned int d_hash = dictionary()->compute_hash(name, loader_data);
|
||||
int d_index = dictionary()->hash_to_index(d_hash);
|
||||
Klass* probe = dictionary()->find(d_index, d_hash, name, loader_data,
|
||||
@ -652,7 +647,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
}
|
||||
|
||||
// If the class in is in the placeholder table, class loading is in progress
|
||||
// If the class is in the placeholder table, class loading is in progress
|
||||
if (super_load_in_progress && havesupername==true) {
|
||||
k = SystemDictionary::handle_parallel_super_load(name, superclassname,
|
||||
class_loader, protection_domain, lockObject, THREAD);
|
||||
@ -664,7 +659,9 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
}
|
||||
|
||||
bool throw_circularity_error = false;
|
||||
if (!class_has_been_loaded) {
|
||||
bool load_instance_added = false;
|
||||
|
||||
// add placeholder entry to record loading instance class
|
||||
// Five cases:
|
||||
@ -690,7 +687,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
// No performance benefit and no deadlock issues.
|
||||
// case 5. parallelCapable user level classloaders - without objectLocker
|
||||
// Allow parallel classloading of a class/classloader pair
|
||||
bool throw_circularity_error = false;
|
||||
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
if (class_loader.is_null() || !is_parallelCapable(class_loader)) {
|
||||
@ -726,12 +723,13 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
}
|
||||
}
|
||||
// All cases: add LOAD_INSTANCE
|
||||
// All cases: add LOAD_INSTANCE holding SystemDictionary_lock
|
||||
// case 3: UnsyncloadClass || case 5: parallelCapable: allow competing threads to try
|
||||
// LOAD_INSTANCE in parallel
|
||||
// add placeholder entry even if error - callers will remove on error
|
||||
|
||||
if (!throw_circularity_error && !class_has_been_loaded) {
|
||||
PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, name, loader_data, PlaceholderTable::LOAD_INSTANCE, NULL, THREAD);
|
||||
load_instance_added = true;
|
||||
// For class loaders that do not acquire the classloader object lock,
|
||||
// if they did not catch another thread holding LOAD_INSTANCE,
|
||||
// need a check analogous to the acquire ObjectLocker/find_class
|
||||
@ -740,19 +738,18 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
// class loaders holding the ObjectLock shouldn't find the class here
|
||||
Klass* check = find_class(d_index, d_hash, name, loader_data);
|
||||
if (check != NULL) {
|
||||
// Klass is already loaded, so just return it
|
||||
// Klass is already loaded, so return it after checking/adding protection domain
|
||||
k = instanceKlassHandle(THREAD, check);
|
||||
class_has_been_loaded = true;
|
||||
newprobe->remove_seen_thread(THREAD, PlaceholderTable::LOAD_INSTANCE);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must throw error outside of owning lock
|
||||
if (throw_circularity_error) {
|
||||
assert(!HAS_PENDING_EXCEPTION && load_instance_added == false,"circularity error cleanup");
|
||||
ResourceMark rm(THREAD);
|
||||
THROW_MSG_0(vmSymbols::java_lang_ClassCircularityError(), name->as_C_string());
|
||||
THROW_MSG_NULL(vmSymbols::java_lang_ClassCircularityError(), name->as_C_string());
|
||||
}
|
||||
|
||||
if (!class_has_been_loaded) {
|
||||
@ -782,20 +779,6 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
}
|
||||
|
||||
// clean up placeholder entries for success or error
|
||||
// This cleans up LOAD_INSTANCE entries
|
||||
// It also cleans up LOAD_SUPER entries on errors from
|
||||
// calling load_instance_class
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, name, loader_data);
|
||||
if (probe != NULL) {
|
||||
probe->remove_seen_thread(THREAD, PlaceholderTable::LOAD_INSTANCE);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
// If everything was OK (no exceptions, no null return value), and
|
||||
// class_loader is NOT the defining loader, do a little more bookkeeping.
|
||||
if (!HAS_PENDING_EXCEPTION && !k.is_null() &&
|
||||
@ -819,18 +802,22 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
}
|
||||
}
|
||||
}
|
||||
if (HAS_PENDING_EXCEPTION || k.is_null()) {
|
||||
// On error, clean up placeholders
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
} // load_instance_class loop
|
||||
|
||||
if (load_instance_added == true) {
|
||||
// clean up placeholder entries for LOAD_INSTANCE success or error
|
||||
// This brackets the SystemDictionary updates for both defining
|
||||
// and initiating loaders
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, PlaceholderTable::LOAD_INSTANCE, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
if (HAS_PENDING_EXCEPTION || k.is_null()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
{
|
||||
ClassLoaderData* loader_data = k->class_loader_data();
|
||||
@ -850,8 +837,8 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
|
||||
// so we cannot allow GC to occur while we're holding this entry.
|
||||
// We're using a No_Safepoint_Verifier to catch any place where we
|
||||
// might potentially do a GC at all.
|
||||
// SystemDictionary::do_unloading() asserts that classes are only
|
||||
// unloaded at a safepoint.
|
||||
// Dictionary::do_unloading() asserts that classes in SD are only
|
||||
// unloaded at a safepoint. Anonymous classes are not in SD.
|
||||
No_Safepoint_Verifier nosafepoint;
|
||||
if (dictionary()->is_valid_protection_domain(d_index, d_hash, name,
|
||||
loader_data,
|
||||
@ -898,8 +885,8 @@ Klass* SystemDictionary::find(Symbol* class_name,
|
||||
// so we cannot allow GC to occur while we're holding this entry.
|
||||
// We're using a No_Safepoint_Verifier to catch any place where we
|
||||
// might potentially do a GC at all.
|
||||
// SystemDictionary::do_unloading() asserts that classes are only
|
||||
// unloaded at a safepoint.
|
||||
// Dictionary::do_unloading() asserts that classes in SD are only
|
||||
// unloaded at a safepoint. Anonymous classes are not in SD.
|
||||
No_Safepoint_Verifier nosafepoint;
|
||||
return dictionary()->find(d_index, d_hash, class_name, loader_data,
|
||||
protection_domain, THREAD);
|
||||
@ -965,10 +952,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
// throw potential ClassFormatErrors.
|
||||
//
|
||||
// Note: "name" is updated.
|
||||
// Further note: a placeholder will be added for this class when
|
||||
// super classes are loaded (resolve_super_or_fail). We expect this
|
||||
// to be called for all classes but java.lang.Object; and we preload
|
||||
// java.lang.Object through resolve_or_fail, not this path.
|
||||
|
||||
instanceKlassHandle k = ClassFileParser(st).parseClassFile(class_name,
|
||||
loader_data,
|
||||
@ -979,21 +962,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
|
||||
true,
|
||||
THREAD);
|
||||
|
||||
// We don't redefine the class, so we just need to clean up whether there
|
||||
// was an error or not (don't want to modify any system dictionary
|
||||
// data structures).
|
||||
// Parsed name could be null if we threw an error before we got far
|
||||
// enough along to parse it -- in that case, there is nothing to clean up.
|
||||
if (parsed_name != NULL) {
|
||||
unsigned int p_hash = placeholders()->compute_hash(parsed_name,
|
||||
loader_data);
|
||||
int p_index = placeholders()->hash_to_index(p_hash);
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, parsed_name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
if (host_klass.not_null() && k.not_null()) {
|
||||
assert(EnableInvokeDynamic, "");
|
||||
@ -1062,10 +1030,6 @@ Klass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
// throw potential ClassFormatErrors.
|
||||
//
|
||||
// Note: "name" is updated.
|
||||
// Further note: a placeholder will be added for this class when
|
||||
// super classes are loaded (resolve_super_or_fail). We expect this
|
||||
// to be called for all classes but java.lang.Object; and we preload
|
||||
// java.lang.Object through resolve_or_fail, not this path.
|
||||
|
||||
instanceKlassHandle k = ClassFileParser(st).parseClassFile(class_name,
|
||||
loader_data,
|
||||
@ -1114,25 +1078,7 @@ Klass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
}
|
||||
}
|
||||
|
||||
// If parsing the class file or define_instance_class failed, we
|
||||
// need to remove the placeholder added on our behalf. But we
|
||||
// must make sure parsed_name is valid first (it won't be if we had
|
||||
// a format error before the class was parsed far enough to
|
||||
// find the name).
|
||||
if (HAS_PENDING_EXCEPTION && parsed_name != NULL) {
|
||||
unsigned int p_hash = placeholders()->compute_hash(parsed_name,
|
||||
loader_data);
|
||||
int p_index = placeholders()->hash_to_index(p_hash);
|
||||
{
|
||||
MutexLocker mu(SystemDictionary_lock, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, parsed_name, loader_data, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Make sure that we didn't leave a place holder in the
|
||||
// SystemDictionary; this is only done on success
|
||||
// Make sure we have an entry in the SystemDictionary on success
|
||||
debug_only( {
|
||||
if (!HAS_PENDING_EXCEPTION) {
|
||||
assert(parsed_name != NULL, "parsed_name is still null?");
|
||||
@ -1547,8 +1493,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* clas
|
||||
// Other cases fall through, and may run into duplicate defines
|
||||
// caught by finding an entry in the SystemDictionary
|
||||
if ((UnsyncloadClass || is_parallelDefine(class_loader)) && (probe->instance_klass() != NULL)) {
|
||||
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
#ifdef ASSERT
|
||||
Klass* check = find_class(d_index, d_hash, name_h, loader_data);
|
||||
@ -1578,8 +1523,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(Symbol* clas
|
||||
probe->set_instance_klass(k());
|
||||
}
|
||||
probe->set_definer(NULL);
|
||||
probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, THREAD);
|
||||
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
}
|
||||
@ -1736,6 +1680,8 @@ int SystemDictionary::calculate_systemdictionary_size(int classcount) {
|
||||
}
|
||||
return newsize;
|
||||
}
|
||||
// Assumes classes in the SystemDictionary are only unloaded at a safepoint
|
||||
// Note: anonymous classes are not in the SD.
|
||||
bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) {
|
||||
// First, mark for unload all ClassLoaderData referencing a dead class loader.
|
||||
bool has_dead_loaders = ClassLoaderDataGraph::do_unloading(is_alive);
|
||||
@ -2105,9 +2051,7 @@ void SystemDictionary::update_dictionary(int d_index, unsigned int d_hash,
|
||||
// All loaded classes get a unique ID.
|
||||
TRACE_INIT_ID(k);
|
||||
|
||||
// Check for a placeholder. If there, remove it and make a
|
||||
// new system dictionary entry.
|
||||
placeholders()->find_and_remove(p_index, p_hash, name, loader_data, THREAD);
|
||||
// Make a new system dictionary entry.
|
||||
Klass* sd_check = find_class(d_index, d_hash, name, loader_data);
|
||||
if (sd_check == NULL) {
|
||||
dictionary()->add_klass(name, loader_data, k);
|
||||
@ -2116,12 +2060,8 @@ void SystemDictionary::update_dictionary(int d_index, unsigned int d_hash,
|
||||
#ifdef ASSERT
|
||||
sd_check = find_class(d_index, d_hash, name, loader_data);
|
||||
assert (sd_check != NULL, "should have entry in system dictionary");
|
||||
// Changed to allow PH to remain to complete class circularity checking
|
||||
// while only one thread can define a class at one time, multiple
|
||||
// classes can resolve the superclass for a class at one time,
|
||||
// and the placeholder is used to track that
|
||||
// Symbol* ph_check = find_placeholder(name, class_loader);
|
||||
// assert (ph_check == NULL, "should not have a placeholder entry");
|
||||
// Note: there may be a placeholder entry: for circularity testing
|
||||
// or for parallel defines
|
||||
#endif
|
||||
SystemDictionary_lock->notify_all();
|
||||
}
|
||||
|
||||
@ -131,6 +131,7 @@ class SymbolPropertyTable;
|
||||
do_klass(Properties_klass, java_util_Properties, Pre ) \
|
||||
do_klass(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre ) \
|
||||
do_klass(reflect_Field_klass, java_lang_reflect_Field, Pre ) \
|
||||
do_klass(reflect_Parameter_klass, java_lang_reflect_Parameter, Opt ) \
|
||||
do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre ) \
|
||||
do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \
|
||||
\
|
||||
@ -459,6 +460,7 @@ public:
|
||||
// Tells whether ClassLoader.checkPackageAccess is present
|
||||
static bool has_checkPackageAccess() { return _has_checkPackageAccess; }
|
||||
|
||||
static bool Parameter_klass_loaded() { return WK_KLASS(reflect_Parameter_klass) != NULL; }
|
||||
static bool Class_klass_loaded() { return WK_KLASS(Class_klass) != NULL; }
|
||||
static bool Cloneable_klass_loaded() { return WK_KLASS(Cloneable_klass) != NULL; }
|
||||
static bool Object_klass_loaded() { return WK_KLASS(Object_klass) != NULL; }
|
||||
|
||||
@ -86,6 +86,7 @@
|
||||
template(java_lang_reflect_Method, "java/lang/reflect/Method") \
|
||||
template(java_lang_reflect_Constructor, "java/lang/reflect/Constructor") \
|
||||
template(java_lang_reflect_Field, "java/lang/reflect/Field") \
|
||||
template(java_lang_reflect_Parameter, "java/lang/reflect/Parameter") \
|
||||
template(java_lang_reflect_Array, "java/lang/reflect/Array") \
|
||||
template(java_lang_StringBuffer, "java/lang/StringBuffer") \
|
||||
template(java_lang_StringBuilder, "java/lang/StringBuilder") \
|
||||
@ -126,6 +127,7 @@
|
||||
template(tag_line_number_table, "LineNumberTable") \
|
||||
template(tag_local_variable_table, "LocalVariableTable") \
|
||||
template(tag_local_variable_type_table, "LocalVariableTypeTable") \
|
||||
template(tag_method_parameters, "MethodParameters") \
|
||||
template(tag_stack_map_table, "StackMapTable") \
|
||||
template(tag_synthetic, "Synthetic") \
|
||||
template(tag_deprecated, "Deprecated") \
|
||||
@ -136,6 +138,8 @@
|
||||
template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations") \
|
||||
template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations") \
|
||||
template(tag_annotation_default, "AnnotationDefault") \
|
||||
template(tag_runtime_visible_type_annotations, "RuntimeVisibleTypeAnnotations") \
|
||||
template(tag_runtime_invisible_type_annotations, "RuntimeInvisibleTypeAnnotations") \
|
||||
template(tag_enclosing_method, "EnclosingMethod") \
|
||||
template(tag_bootstrap_methods, "BootstrapMethods") \
|
||||
\
|
||||
@ -190,7 +194,10 @@
|
||||
template(java_lang_VirtualMachineError, "java/lang/VirtualMachineError") \
|
||||
template(java_lang_StackOverflowError, "java/lang/StackOverflowError") \
|
||||
template(java_lang_StackTraceElement, "java/lang/StackTraceElement") \
|
||||
\
|
||||
/* Concurrency support */ \
|
||||
template(java_util_concurrent_locks_AbstractOwnableSynchronizer, "java/util/concurrent/locks/AbstractOwnableSynchronizer") \
|
||||
template(sun_misc_Contended_signature, "Lsun/misc/Contended;") \
|
||||
\
|
||||
/* class symbols needed by intrinsics */ \
|
||||
VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
|
||||
@ -233,12 +240,17 @@
|
||||
/* Support for annotations (JDK 1.5 and above) */ \
|
||||
\
|
||||
template(annotations_name, "annotations") \
|
||||
template(index_name, "index") \
|
||||
template(executable_name, "executable") \
|
||||
template(parameter_annotations_name, "parameterAnnotations") \
|
||||
template(annotation_default_name, "annotationDefault") \
|
||||
template(sun_reflect_ConstantPool, "sun/reflect/ConstantPool") \
|
||||
template(ConstantPool_name, "constantPoolOop") \
|
||||
template(sun_reflect_UnsafeStaticFieldAccessorImpl, "sun/reflect/UnsafeStaticFieldAccessorImpl")\
|
||||
template(base_name, "base") \
|
||||
/* Type Annotations (JDK 8 and above) */ \
|
||||
template(type_annotations_name, "typeAnnotations") \
|
||||
\
|
||||
\
|
||||
/* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \
|
||||
template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \
|
||||
@ -275,7 +287,7 @@
|
||||
NOT_LP64( do_alias(intptr_signature, int_signature) ) \
|
||||
LP64_ONLY( do_alias(intptr_signature, long_signature) ) \
|
||||
template(selectAlternative_signature, "(ZLjava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;") \
|
||||
\
|
||||
\
|
||||
/* common method and field names */ \
|
||||
template(object_initializer_name, "<init>") \
|
||||
template(class_initializer_name, "<clinit>") \
|
||||
@ -374,7 +386,6 @@
|
||||
template(basicType_name, "basicType") \
|
||||
template(append_name, "append") \
|
||||
template(klass_name, "klass") \
|
||||
template(resolved_constructor_name, "resolved_constructor") \
|
||||
template(array_klass_name, "array_klass") \
|
||||
template(oop_size_name, "oop_size") \
|
||||
template(static_oop_field_count_name, "static_oop_field_count") \
|
||||
@ -470,6 +481,7 @@
|
||||
template(class_signature, "Ljava/lang/Class;") \
|
||||
template(string_signature, "Ljava/lang/String;") \
|
||||
template(reference_signature, "Ljava/lang/ref/Reference;") \
|
||||
template(executable_signature, "Ljava/lang/reflect/Executable;") \
|
||||
template(concurrenthashmap_signature, "Ljava/util/concurrent/ConcurrentHashMap;") \
|
||||
template(String_StringBuilder_signature, "(Ljava/lang/String;)Ljava/lang/StringBuilder;") \
|
||||
template(int_StringBuilder_signature, "(I)Ljava/lang/StringBuilder;") \
|
||||
@ -723,6 +735,11 @@
|
||||
do_intrinsic(_checkIndex, java_nio_Buffer, checkIndex_name, int_int_signature, F_R) \
|
||||
do_name( checkIndex_name, "checkIndex") \
|
||||
\
|
||||
do_class(sun_nio_cs_iso8859_1_Encoder, "sun/nio/cs/ISO_8859_1$Encoder") \
|
||||
do_intrinsic(_encodeISOArray, sun_nio_cs_iso8859_1_Encoder, encodeISOArray_name, encodeISOArray_signature, F_S) \
|
||||
do_name( encodeISOArray_name, "encodeISOArray") \
|
||||
do_signature(encodeISOArray_signature, "([CI[BII)I") \
|
||||
\
|
||||
/* java/lang/ref/Reference */ \
|
||||
do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \
|
||||
\
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "code/nmethod.hpp"
|
||||
#include "code/pcDesc.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "gc_implementation/shared/markSweep.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/gcLocker.hpp"
|
||||
@ -39,6 +40,7 @@
|
||||
#include "oops/objArrayOop.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/icache.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
@ -168,6 +170,8 @@ nmethod* CodeCache::next_nmethod (CodeBlob* cb) {
|
||||
return (nmethod*)cb;
|
||||
}
|
||||
|
||||
static size_t maxCodeCacheUsed = 0;
|
||||
|
||||
CodeBlob* CodeCache::allocate(int size) {
|
||||
// Do not seize the CodeCache lock here--if the caller has not
|
||||
// already done so, we are going to lose bigtime, since the code
|
||||
@ -192,6 +196,8 @@ CodeBlob* CodeCache::allocate(int size) {
|
||||
(address)_heap->end() - (address)_heap->begin());
|
||||
}
|
||||
}
|
||||
maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() -
|
||||
(address)_heap->low_boundary()) - unallocated_capacity());
|
||||
verify_if_often();
|
||||
print_trace("allocation", cb, size);
|
||||
return cb;
|
||||
@ -928,7 +934,14 @@ void CodeCache::print_internals() {
|
||||
FREE_C_HEAP_ARRAY(int, buckets, mtCode);
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
void CodeCache::print() {
|
||||
print_summary(tty);
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (!Verbose) return;
|
||||
|
||||
CodeBlob_sizes live;
|
||||
CodeBlob_sizes dead;
|
||||
|
||||
@ -953,7 +966,7 @@ void CodeCache::print() {
|
||||
}
|
||||
|
||||
|
||||
if (Verbose) {
|
||||
if (WizardMode) {
|
||||
// print the oop_map usage
|
||||
int code_size = 0;
|
||||
int number_of_blobs = 0;
|
||||
@ -977,20 +990,30 @@ void CodeCache::print() {
|
||||
tty->print_cr(" map size = %d", map_size);
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
}
|
||||
|
||||
#endif // PRODUCT
|
||||
void CodeCache::print_summary(outputStream* st, bool detailed) {
|
||||
size_t total = (_heap->high_boundary() - _heap->low_boundary());
|
||||
st->print_cr("CodeCache: size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
|
||||
"Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT
|
||||
"Kb max_free_chunk=" SIZE_FORMAT "Kb",
|
||||
total/K, (total - unallocated_capacity())/K,
|
||||
maxCodeCacheUsed/K, unallocated_capacity()/K, largest_free_block()/K);
|
||||
|
||||
void CodeCache::print_bounds(outputStream* st) {
|
||||
st->print_cr("Code Cache [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
|
||||
_heap->low_boundary(),
|
||||
_heap->high(),
|
||||
_heap->high_boundary());
|
||||
st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
|
||||
" adapters=" UINT32_FORMAT " free_code_cache=" SIZE_FORMAT "Kb"
|
||||
" largest_free_block=" SIZE_FORMAT,
|
||||
nof_blobs(), nof_nmethods(), nof_adapters(),
|
||||
unallocated_capacity()/K, largest_free_block());
|
||||
if (detailed) {
|
||||
st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
|
||||
_heap->low_boundary(),
|
||||
_heap->high(),
|
||||
_heap->high_boundary());
|
||||
st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
|
||||
" adapters=" UINT32_FORMAT,
|
||||
nof_blobs(), nof_nmethods(), nof_adapters());
|
||||
st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ?
|
||||
"enabled" : Arguments::mode() == Arguments::_int ?
|
||||
"disabled (interpreter mode)" :
|
||||
"disabled (not enough contiguous free space left)");
|
||||
}
|
||||
}
|
||||
|
||||
void CodeCache::log_state(outputStream* st) {
|
||||
|
||||
@ -145,11 +145,11 @@ class CodeCache : AllStatic {
|
||||
static void prune_scavenge_root_nmethods();
|
||||
|
||||
// Printing/debugging
|
||||
static void print() PRODUCT_RETURN; // prints summary
|
||||
static void print(); // prints summary
|
||||
static void print_internals();
|
||||
static void verify(); // verifies the code cache
|
||||
static void print_trace(const char* event, CodeBlob* cb, int size = 0) PRODUCT_RETURN;
|
||||
static void print_bounds(outputStream* st); // Prints a summary of the bounds of the code cache
|
||||
static void print_summary(outputStream* st, bool detailed = true); // Prints a summary of the code cache usage
|
||||
static void log_state(outputStream* st);
|
||||
|
||||
// The full limits of the codeCache
|
||||
|
||||
@ -50,6 +50,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// Missing feature tests
|
||||
virtual bool supports_native() { return true; }
|
||||
virtual bool supports_osr () { return true; }
|
||||
virtual bool can_compile_method(methodHandle method) { return true; }
|
||||
#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK))
|
||||
virtual bool is_c1 () { return false; }
|
||||
virtual bool is_c2 () { return false; }
|
||||
|
||||
@ -1218,7 +1218,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
||||
// lock, make sure that the compilation
|
||||
// isn't prohibited in a straightforward way.
|
||||
|
||||
if (compiler(comp_level) == NULL || compilation_is_prohibited(method, osr_bci, comp_level)) {
|
||||
if (compiler(comp_level) == NULL || !compiler(comp_level)->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1714,6 +1714,20 @@ void CompileBroker::maybe_block() {
|
||||
}
|
||||
}
|
||||
|
||||
// wrapper for CodeCache::print_summary()
|
||||
static void codecache_print(bool detailed)
|
||||
{
|
||||
ResourceMark rm;
|
||||
stringStream s;
|
||||
// Dump code cache into a buffer before locking the tty,
|
||||
{
|
||||
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
CodeCache::print_summary(&s, detailed);
|
||||
}
|
||||
ttyLocker ttyl;
|
||||
tty->print_cr(s.as_string());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// CompileBroker::invoke_compiler_on_method
|
||||
//
|
||||
@ -1841,6 +1855,9 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
tty->print_cr("size: %d time: %d inlined: %d bytes", code_size, (int)time.milliseconds(), task->num_inlined_bytecodes());
|
||||
}
|
||||
|
||||
if (PrintCodeCacheOnCompilation)
|
||||
codecache_print(/* detailed= */ false);
|
||||
|
||||
// Disable compilation, if required.
|
||||
switch (compilable) {
|
||||
case ciEnv::MethodCompilable_never:
|
||||
@ -1885,6 +1902,7 @@ void CompileBroker::handle_full_code_cache() {
|
||||
UseInterpreter = true;
|
||||
if (UseCompiler || AlwaysCompileLoopMethods ) {
|
||||
if (xtty != NULL) {
|
||||
ResourceMark rm;
|
||||
stringStream s;
|
||||
// Dump code cache state into a buffer before locking the tty,
|
||||
// because log_state() will use locks causing lock conflicts.
|
||||
@ -1898,9 +1916,9 @@ void CompileBroker::handle_full_code_cache() {
|
||||
}
|
||||
warning("CodeCache is full. Compiler has been disabled.");
|
||||
warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
|
||||
CodeCache::print_bounds(tty);
|
||||
#ifndef PRODUCT
|
||||
if (CompileTheWorld || ExitOnFullCodeCache) {
|
||||
codecache_print(/* detailed= */ true);
|
||||
before_exit(JavaThread::current());
|
||||
exit_globals(); // will delete tty
|
||||
vm_direct_exit(CompileTheWorld ? 0 : 1);
|
||||
@ -1913,6 +1931,7 @@ void CompileBroker::handle_full_code_cache() {
|
||||
AlwaysCompileLoopMethods = false;
|
||||
}
|
||||
}
|
||||
codecache_print(/* detailed= */ true);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@ -542,17 +542,17 @@ void print_register_type(OopMapValue::oop_types x, VMReg optional,
|
||||
st->print("Oop");
|
||||
break;
|
||||
case OopMapValue::value_value:
|
||||
st->print("Value" );
|
||||
st->print("Value");
|
||||
break;
|
||||
case OopMapValue::narrowoop_value:
|
||||
tty->print("NarrowOop" );
|
||||
st->print("NarrowOop");
|
||||
break;
|
||||
case OopMapValue::callee_saved_value:
|
||||
st->print("Callers_" );
|
||||
st->print("Callers_");
|
||||
optional->print_on(st);
|
||||
break;
|
||||
case OopMapValue::derived_oop_value:
|
||||
st->print("Derived_oop_" );
|
||||
st->print("Derived_oop_");
|
||||
optional->print_on(st);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -56,7 +56,7 @@ void ConcurrentMarkSweepPolicy::initialize_generations() {
|
||||
if (_generations == NULL)
|
||||
vm_exit_during_initialization("Unable to allocate gen spec");
|
||||
|
||||
if (ParNewGeneration::in_use()) {
|
||||
if (UseParNewGC) {
|
||||
if (UseAdaptiveSizePolicy) {
|
||||
_generations[0] = new GenerationSpec(Generation::ASParNew,
|
||||
_initial_gen0_size, _max_gen0_size);
|
||||
@ -96,7 +96,7 @@ void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size,
|
||||
|
||||
void ConcurrentMarkSweepPolicy::initialize_gc_policy_counters() {
|
||||
// initialize the policy counters - 2 collectors, 3 generations
|
||||
if (ParNewGeneration::in_use()) {
|
||||
if (UseParNewGC) {
|
||||
_gc_policy_counters = new GCPolicyCounters("ParNew:CMS", 2, 3);
|
||||
}
|
||||
else {
|
||||
@ -119,7 +119,7 @@ void ASConcurrentMarkSweepPolicy::initialize_gc_policy_counters() {
|
||||
|
||||
assert(size_policy() != NULL, "A size policy is required");
|
||||
// initialize the policy counters - 2 collectors, 3 generations
|
||||
if (ParNewGeneration::in_use()) {
|
||||
if (UseParNewGC) {
|
||||
_gc_policy_counters = new CMSGCAdaptivePolicyCounters("ParNew:CMS", 2, 3,
|
||||
size_policy());
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -214,7 +214,6 @@ HeapWord* CompactibleFreeListSpace::forward(oop q, size_t size,
|
||||
assert(q->forwardee() == NULL, "should be forwarded to NULL");
|
||||
}
|
||||
|
||||
VALIDATE_MARK_SWEEP_ONLY(MarkSweep::register_live_oop(q, adjusted_size));
|
||||
compact_top += adjusted_size;
|
||||
|
||||
// we need to update the offset table so that the beginnings of objects can be
|
||||
@ -555,7 +554,7 @@ void CompactibleFreeListSpace::reportFreeListStatistics() const {
|
||||
reportIndexedFreeListStatistics();
|
||||
size_t total_size = totalSizeInIndexedFreeLists() +
|
||||
_dictionary->total_chunk_size(DEBUG_ONLY(freelistLock()));
|
||||
gclog_or_tty->print(" free=%ld frag=%1.4f\n", total_size, flsFrag());
|
||||
gclog_or_tty->print(" free=" SIZE_FORMAT " frag=%1.4f\n", total_size, flsFrag());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, 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
|
||||
@ -827,10 +827,10 @@ void ConcurrentMarkSweepGeneration::printOccupancy(const char *s) {
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
if (PrintGCDetails) {
|
||||
if (Verbose) {
|
||||
gclog_or_tty->print(" [%d %s-%s: "SIZE_FORMAT"("SIZE_FORMAT")]",
|
||||
gclog_or_tty->print("[%d %s-%s: "SIZE_FORMAT"("SIZE_FORMAT")]",
|
||||
level(), short_name(), s, used(), capacity());
|
||||
} else {
|
||||
gclog_or_tty->print(" [%d %s-%s: "SIZE_FORMAT"K("SIZE_FORMAT"K)]",
|
||||
gclog_or_tty->print("[%d %s-%s: "SIZE_FORMAT"K("SIZE_FORMAT"K)]",
|
||||
level(), short_name(), s, used() / K, capacity() / K);
|
||||
}
|
||||
}
|
||||
@ -3338,7 +3338,7 @@ bool ConcurrentMarkSweepGeneration::grow_by(size_t bytes) {
|
||||
if (Verbose && PrintGC) {
|
||||
size_t new_mem_size = _virtual_space.committed_size();
|
||||
size_t old_mem_size = new_mem_size - bytes;
|
||||
gclog_or_tty->print_cr("Expanding %s from %ldK by %ldK to %ldK",
|
||||
gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
|
||||
name(), old_mem_size/K, bytes/K, new_mem_size/K);
|
||||
}
|
||||
}
|
||||
@ -9203,7 +9203,7 @@ void ASConcurrentMarkSweepGeneration::shrink_by(size_t desired_bytes) {
|
||||
if (Verbose && PrintGCDetails) {
|
||||
size_t new_mem_size = _virtual_space.committed_size();
|
||||
size_t old_mem_size = new_mem_size + bytes;
|
||||
gclog_or_tty->print_cr("Shrinking %s from %ldK by %ldK to %ldK",
|
||||
gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
|
||||
name(), old_mem_size/K, bytes/K, new_mem_size/K);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ CollectionSetChooser::CollectionSetChooser() :
|
||||
_curr_index(0), _length(0), _first_par_unreserved_idx(0),
|
||||
_region_live_threshold_bytes(0), _remaining_reclaimable_bytes(0) {
|
||||
_region_live_threshold_bytes =
|
||||
HeapRegion::GrainBytes * (size_t) G1OldCSetRegionLiveThresholdPercent / 100;
|
||||
HeapRegion::GrainBytes * (size_t) G1MixedGCLiveThresholdPercent / 100;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, 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
|
||||
@ -192,6 +192,7 @@ bool CMMarkStack::allocate(size_t capacity) {
|
||||
setEmpty();
|
||||
_capacity = (jint) capacity;
|
||||
_saved_index = -1;
|
||||
_should_expand = false;
|
||||
NOT_PRODUCT(_max_depth = 0);
|
||||
return true;
|
||||
}
|
||||
@ -747,8 +748,8 @@ void ConcurrentMark::reset() {
|
||||
assert(_heap_end != NULL, "heap bounds should look ok");
|
||||
assert(_heap_start < _heap_end, "heap bounds should look ok");
|
||||
|
||||
// reset all the marking data structures and any necessary flags
|
||||
clear_marking_state();
|
||||
// Reset all the marking data structures and any necessary flags
|
||||
reset_marking_state();
|
||||
|
||||
if (verbose_low()) {
|
||||
gclog_or_tty->print_cr("[global] resetting");
|
||||
@ -766,6 +767,23 @@ void ConcurrentMark::reset() {
|
||||
set_concurrent_marking_in_progress();
|
||||
}
|
||||
|
||||
|
||||
void ConcurrentMark::reset_marking_state(bool clear_overflow) {
|
||||
_markStack.set_should_expand();
|
||||
_markStack.setEmpty(); // Also clears the _markStack overflow flag
|
||||
if (clear_overflow) {
|
||||
clear_has_overflown();
|
||||
} else {
|
||||
assert(has_overflown(), "pre-condition");
|
||||
}
|
||||
_finger = _heap_start;
|
||||
|
||||
for (uint i = 0; i < _max_worker_id; ++i) {
|
||||
CMTaskQueue* queue = _task_queues->queue(i);
|
||||
queue->set_empty();
|
||||
}
|
||||
}
|
||||
|
||||
void ConcurrentMark::set_phase(uint active_tasks, bool concurrent) {
|
||||
assert(active_tasks <= _max_worker_id, "we should not have more");
|
||||
|
||||
@ -796,7 +814,7 @@ void ConcurrentMark::set_phase(uint active_tasks, bool concurrent) {
|
||||
void ConcurrentMark::set_non_marking_state() {
|
||||
// We set the global marking state to some default values when we're
|
||||
// not doing marking.
|
||||
clear_marking_state();
|
||||
reset_marking_state();
|
||||
_active_tasks = 0;
|
||||
clear_concurrent_marking_in_progress();
|
||||
}
|
||||
@ -963,7 +981,7 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
|
||||
// not clear the overflow flag since we rely on it being true when
|
||||
// we exit this method to abort the pause and restart concurent
|
||||
// marking.
|
||||
clear_marking_state(concurrent() /* clear_overflow */);
|
||||
reset_marking_state(concurrent() /* clear_overflow */);
|
||||
force_overflow()->update();
|
||||
|
||||
if (G1Log::fine()) {
|
||||
@ -1257,8 +1275,9 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
||||
if (has_overflown()) {
|
||||
// Oops. We overflowed. Restart concurrent marking.
|
||||
_restart_for_overflow = true;
|
||||
// Clear the flag. We do not need it any more.
|
||||
clear_has_overflown();
|
||||
// Clear the marking state because we will be restarting
|
||||
// marking due to overflowing the global mark stack.
|
||||
reset_marking_state();
|
||||
if (G1TraceMarkStackOverflow) {
|
||||
gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
|
||||
}
|
||||
@ -1282,6 +1301,8 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
||||
/* option */ VerifyOption_G1UseNextMarking);
|
||||
}
|
||||
assert(!restart_for_overflow(), "sanity");
|
||||
// Completely reset the marking state since marking completed
|
||||
set_non_marking_state();
|
||||
}
|
||||
|
||||
// Expand the marking stack, if we have to and if we can.
|
||||
@ -1289,11 +1310,6 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
||||
_markStack.expand();
|
||||
}
|
||||
|
||||
// Reset the marking state if marking completed
|
||||
if (!restart_for_overflow()) {
|
||||
set_non_marking_state();
|
||||
}
|
||||
|
||||
#if VERIFY_OBJS_PROCESSED
|
||||
_scan_obj_cl.objs_processed = 0;
|
||||
ThreadLocalObjQueue::objs_enqueued = 0;
|
||||
@ -2963,22 +2979,6 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
void ConcurrentMark::clear_marking_state(bool clear_overflow) {
|
||||
_markStack.set_should_expand();
|
||||
_markStack.setEmpty(); // Also clears the _markStack overflow flag
|
||||
if (clear_overflow) {
|
||||
clear_has_overflown();
|
||||
} else {
|
||||
assert(has_overflown(), "pre-condition");
|
||||
}
|
||||
_finger = _heap_start;
|
||||
|
||||
for (uint i = 0; i < _max_worker_id; ++i) {
|
||||
CMTaskQueue* queue = _task_queues->queue(i);
|
||||
queue->set_empty();
|
||||
}
|
||||
}
|
||||
|
||||
// Aggregate the counting data that was constructed concurrently
|
||||
// with marking.
|
||||
class AggregateCountDataHRClosure: public HeapRegionClosure {
|
||||
@ -3185,7 +3185,7 @@ void ConcurrentMark::abort() {
|
||||
// Clear the liveness counting data
|
||||
clear_all_count_data();
|
||||
// Empty mark stack
|
||||
clear_marking_state();
|
||||
reset_marking_state();
|
||||
for (uint i = 0; i < _max_worker_id; ++i) {
|
||||
_tasks[i]->clear_region_fields();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, 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
|
||||
@ -478,15 +478,18 @@ protected:
|
||||
// It resets the global marking data structures, as well as the
|
||||
// task local ones; should be called during initial mark.
|
||||
void reset();
|
||||
// It resets all the marking data structures.
|
||||
void clear_marking_state(bool clear_overflow = true);
|
||||
|
||||
// Resets all the marking data structures. Called when we have to restart
|
||||
// marking or when marking completes (via set_non_marking_state below).
|
||||
void reset_marking_state(bool clear_overflow = true);
|
||||
|
||||
// We do this after we're done with marking so that the marking data
|
||||
// structures are initialised to a sensible and predictable state.
|
||||
void set_non_marking_state();
|
||||
|
||||
// It should be called to indicate which phase we're in (concurrent
|
||||
// mark or remark) and how many threads are currently active.
|
||||
void set_phase(uint active_tasks, bool concurrent);
|
||||
// We do this after we're done with marking so that the marking data
|
||||
// structures are initialised to a sensible and predictable state.
|
||||
void set_non_marking_state();
|
||||
|
||||
// prints all gathered CM-related statistics
|
||||
void print_stats();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, 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
|
||||
@ -159,13 +159,11 @@ void ConcurrentMarkThread::run() {
|
||||
VM_CGC_Operation op(&final_cl, verbose_str, true /* needs_pll */);
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
if (cm()->restart_for_overflow() &&
|
||||
G1TraceMarkStackOverflow) {
|
||||
gclog_or_tty->print_cr("Restarting conc marking because of MS overflow "
|
||||
"in remark (restart #%d).", iter);
|
||||
}
|
||||
|
||||
if (cm()->restart_for_overflow()) {
|
||||
if (G1TraceMarkStackOverflow) {
|
||||
gclog_or_tty->print_cr("Restarting conc marking because of MS overflow "
|
||||
"in remark (restart #%d).", iter);
|
||||
}
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user