This commit is contained in:
Jesper Wilhelmsson 2015-06-10 05:59:44 +02:00
commit 5a01287618
1072 changed files with 9105 additions and 4590 deletions

View File

@ -308,3 +308,4 @@ e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62
989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63
8ffdeabc7c2b9a8280bf46cae026ac46b4d31c26 jdk9-b64
4915246064b2f89d5f00c96e758686b7fdad36a6 jdk9-b65
ff3fc75f3214ad7e03595be1b0d0f38d887b6f0e jdk9-b66

View File

@ -308,3 +308,4 @@ ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
82cf9aab9a83e41c8194ba01af9666afdb856cbe jdk9-b64
7c31f9d7b932f7924f1258d52885b1c7c3e078c2 jdk9-b65
dc6e8336f51bb6b67b7245766179eab5ca7720b4 jdk9-b66

View File

@ -559,6 +559,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
-Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-D_WINSOCK_DEPRECATED_NO_WARNINGS \
-DWIN32 -DIAL"
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"

View File

@ -4366,7 +4366,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1431429776
DATE_WHEN_GENERATED=1432629750
###############################################################################
#
@ -42071,6 +42071,7 @@ fi
-Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-D_WINSOCK_DEPRECATED_NO_WARNINGS \
-DWIN32 -DIAL"
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"

View File

@ -94,7 +94,6 @@ ACCEPTED_BIN_DIFF="
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
@ -173,7 +172,6 @@ ACCEPTED_BIN_DIFF="
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
@ -293,7 +291,6 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
@ -428,7 +425,6 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
@ -509,7 +505,6 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/kinit.exe
./bin/klist.exe
./bin/ktab.exe
./bin/native2ascii.exe
./bin/orbd.exe
./bin/pack200.exe
./bin/policytool.exe
@ -585,7 +580,6 @@ ACCEPTED_BIN_DIFF="
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool

View File

@ -1301,8 +1301,6 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/nati
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof
jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver : jdk/src/share/classes/com/sun/net/httpserver
jdk/src/jdk.httpserver/share/classes/sun/net/httpserver : jdk/src/share/classes/sun/net/httpserver
@ -1487,16 +1485,16 @@ langtools/src/java.compiler/share/classes/javax/annotation/processing : langtool
langtools/src/java.compiler/share/classes/javax/lang/model : langtools/src/share/classes/javax/lang/model
langtools/src/java.compiler/share/classes/javax/tools : langtools/src/share/classes/javax/tools
langtools/src/jdk.compiler/share/classes/com/sun/source : langtools/src/share/classes/com/sun/source
langtools/src/jdk.compiler/share/classes/com/sun/tools/classfile : langtools/src/share/classes/com/sun/tools/classfile
langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint : langtools/src/share/classes/com/sun/tools/doclint
langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources : langtools/src/share/classes/com/sun/tools/doclint/resources
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac : langtools/src/share/classes/com/sun/tools/javac
langtools/src/jdk.compiler/share/classes/com/sun/tools/javah : langtools/src/share/classes/com/sun/tools/javah
langtools/src/jdk.compiler/share/classes/com/sun/tools/javap : langtools/src/share/classes/com/sun/tools/javap
langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac : langtools/src/share/classes/com/sun/tools/sjavac
langtools/src/jdk.dev/share/classes/com/sun/tools/jdeps : langtools/src/share/classes/com/sun/tools/jdeps
langtools/src/jdk.dev/share/classes/com/sun/tools/jdeps/resources : langtools/src/share/classes/com/sun/tools/jdeps/resources
langtools/src/jdk.javadoc/share/classes/com/sun/javadoc : langtools/src/share/classes/com/sun/javadoc
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets : langtools/src/share/classes/com/sun/tools/doclets
langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc : langtools/src/share/classes/com/sun/tools/javadoc
langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile : langtools/src/share/classes/com/sun/tools/classfile
langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap : langtools/src/share/classes/com/sun/tools/javap
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps : langtools/src/share/classes/com/sun/tools/jdeps
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources : langtools/src/share/classes/com/sun/tools/jdeps/resources
nashorn/src/jdk.scripting.nashorn/share/classes : nashorn/src

View File

@ -308,3 +308,4 @@ d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62
0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63
0a5e5a7c3539e8bde73d9fe55750e49a49cb8dac jdk9-b64
afc1e295c4bf83f9a5dd539c29914edd4a754a3f jdk9-b65
44ee68f7dbacab24a45115fd6a8ccdc7eb6e8f0b jdk9-b66

View File

@ -25,7 +25,7 @@
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.
-->
</head>
@ -40,97 +40,97 @@ for the type of the <code>any</code> (code generated for the type by an IDL comp
been compiled with the object implementation). As a result, the object receiving the
<code>any</code> does not have a portable method of using it.
<P><code>DynAny</code>s enable traversal of the data value associated with an
<code>any</code> at runtime, and extraction of the primitive constituents of the data value.
This is especially helpful for writing powerful generic servers (bridges, event channels
supporting filtering). Similarly, this facility enables the construction of an
<code>any</code> at runtime, without having static knowledge of its type. This is especially
<P><code>DynAny</code>s enable traversal of the data value associated with an
<code>any</code> at runtime, and extraction of the primitive constituents of the data value.
This is especially helpful for writing powerful generic servers (bridges, event channels
supporting filtering). Similarly, this facility enables the construction of an
<code>any</code> at runtime, without having static knowledge of its type. This is especially
helpful for writing generic clients (bridges, browsers, debuggers, user interface tools).
<P><code>Any</code> values can be dynamically interpreted (traversed) and constructed through
<tt>DynAny</tt> objects. A <tt>DynAny</tt> object is associated with a data
value which corresponds to a copy of the value inserted into an <tt>Any</tt>. A
<P><code>Any</code> values can be dynamically interpreted (traversed) and constructed through
<tt>DynAny</tt> objects. A <tt>DynAny</tt> object is associated with a data
value which corresponds to a copy of the value inserted into an <tt>Any</tt>. A
<tt>DynAny</tt> object may be viewed as an ordered collection of component
<tt>DynAny</tt>s. For <tt>DynAny</tt>s representing a basic type, such as <code>long</code>,
or a type without components, such as an empty exception, the ordered collection of
components is empty.
<tt>DynAny</tt>s. For <tt>DynAny</tt>s representing a basic type, such as <code>long</code>,
or a type without components, such as an empty exception, the ordered collection of
components is empty.
<P>Each <tt>DynAny</tt> object maintains the notion of a current position into its collection
of component <tt>DynAny</tt>s. The current position is identified by an index value that runs
from 0 to n-1, where <em>n</em> is the number of components. The special index value -1
<P>Each <tt>DynAny</tt> object maintains the notion of a current position into its collection
of component <tt>DynAny</tt>s. The current position is identified by an index value that runs
from 0 to n-1, where <em>n</em> is the number of components. The special index value -1
indicates a current position that points nowhere.
For values that cannot have a current position (such as an empty exception),
the index value is fixed at -1.
If a <code>DynAny</code> is initialized with a value that has components, the index is
If a <code>DynAny</code> is initialized with a value that has components, the index is
initialized to 0.
After creation of an uninitialized <code>DynAny</code> (that is, a <code>DynAny</code> that
After creation of an uninitialized <code>DynAny</code> (that is, a <code>DynAny</code> that
has no value but a <code>TypeCode</code>
that permits components), the current position depends on the type of value represented by
the <code>DynAny</code>. (The current position is set to 0 or -1, depending on whether the
the <code>DynAny</code>. (The current position is set to 0 or -1, depending on whether the
new <code>DynAny</code>
gets default values for its components.)
<P>The iteration operations <code>rewind</code>, <code>seek</code>, and <code>next</code>
<P>The iteration operations <code>rewind</code>, <code>seek</code>, and <code>next</code>
can be used to change the current position
and the <code>current_component</code> operation returns the component at the current
and the <code>current_component</code> operation returns the component at the current
position.
The <code>component_count</code> operation returns the number of components of a
The <code>component_count</code> operation returns the number of components of a
<code>DynAny</code>.
Collectively, these operations enable iteration over the components of a
Collectively, these operations enable iteration over the components of a
<code>DynAny</code>, for example,
to (recursively) examine its contents.
<P>A constructed <code>DynAny</code> object is a <code>DynAny</code> object associated with
<P>A constructed <code>DynAny</code> object is a <code>DynAny</code> object associated with
a constructed type.
There is a different interface, inheriting from the <code>DynAny</code> interface,
There is a different interface, inheriting from the <code>DynAny</code> interface,
associated with
each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array,
exception, and value type). A constructed <code>DynAny</code> object exports operations
exception, and value type). A constructed <code>DynAny</code> object exports operations
that enable the creation of new <code>DynAny</code> objects,
each of them associated with a component of the constructed data value.
As an example, a <code>DynStruct</code> is associated with a <code>struct</code> value. This
As an example, a <code>DynStruct</code> is associated with a <code>struct</code> value. This
means that the <code>DynStruct</code>
may be seen as owning an ordered collection of components, one for each structure member.
The <code>DynStruct</code> object exports operations that enable the creation of new
The <code>DynStruct</code> object exports operations that enable the creation of new
<code>DynAny</code> objects,
each of them associated with a member of the <code>struct</code>.
<P>If a <code>DynAny</code> object has been obtained from another (constructed)
<P>If a <code>DynAny</code> object has been obtained from another (constructed)
<code>DynAny</code> object,
such as a <code>DynAny</code> representing a structure member that was created from a
such as a <code>DynAny</code> representing a structure member that was created from a
<code>DynStruct</code>,
the member <code>DynAny</code> is logically contained in the <code>DynStruct</code>.
Calling an <code>insert</code> or <code>get</code> operation leaves the current position
Calling an <code>insert</code> or <code>get</code> operation leaves the current position
unchanged.
Destroying a top-level <code>DynAny</code> object (one that was not obtained as a component
Destroying a top-level <code>DynAny</code> object (one that was not obtained as a component
of another <code>DynAny</code>)
also destroys any component <code>DynAny</code> objects obtained from it.
Destroying a non-top level <code>DynAny</code> object does nothing.
Invoking operations on a destroyed top-level <code>DynAny</code> or any of its descendants
Invoking operations on a destroyed top-level <code>DynAny</code> or any of its descendants
raises OBJECT_NOT_EXIST.
If the programmer wants to destroy a <code>DynAny</code> object but still wants to
If the programmer wants to destroy a <code>DynAny</code> object but still wants to
manipulate some component
of the data value associated with it, then he or she should first create a
of the data value associated with it, then he or she should first create a
<code>DynAny</code> for the component
and, after that, make a copy of the created <code>DynAny</code> object.
<P>The behavior of <code>DynAny</code> objects has been defined in order to enable efficient
<P>The behavior of <code>DynAny</code> objects has been defined in order to enable efficient
implementations
in terms of allocated memory space and speed of access. <code>DynAny</code> objects are
in terms of allocated memory space and speed of access. <code>DynAny</code> objects are
intended to be used
for traversing values extracted from <code>any</code>s or constructing values of
for traversing values extracted from <code>any</code>s or constructing values of
<code>any</code>s at runtime.
Their use for other purposes is not recommended.
Their use for other purposes is not recommended.
<H2>Handling DynAny objects</H2>
<P><code>Insert</code> and <code>get</code> operations are necessary to handle basic
<P><code>Insert</code> and <code>get</code> operations are necessary to handle basic
<code>DynAny</code> objects
but are also helpful to handle constructed <code>DynAny</code> objects.
Inserting a basic data type value into a constructed <code>DynAny</code> object
@ -145,9 +145,8 @@ equivalent to
the <code>TypeCode</code> contained in the <code>DynAny</code> or, if the
<code>DynAny</code> has components, is equivalent to the <code>TypeCode</code>
of the <code>DynAny</code> at the current position.
<P>Basic operations include:
<P>
<UL>
<LI>insert_boolean, get_boolean
<LI>insert_char, get_char
@ -181,28 +180,28 @@ equivalent to
<LI>get_boxed_value
<LI>get_boxed_value_as_dyn_any
</UL>
<P><code>DynAny</code> and <code>DynAnyFactory</code> objects are intended to be local to
<P><code>DynAny</code> and <code>DynAnyFactory</code> objects are intended to be local to
the process in which they are
created and used. This means that references to <code>DynAny</code> and
created and used. This means that references to <code>DynAny</code> and
<code>DynAnyFactory</code> objects cannot be exported
to other processes, or externalized with <code>ORB.object_to_string()</code>.
If any attempt is made to do so, the offending operation will raise a MARSHAL system
If any attempt is made to do so, the offending operation will raise a MARSHAL system
exception.
Since their interfaces are specified in IDL, <code>DynAny</code> objects export operations
Since their interfaces are specified in IDL, <code>DynAny</code> objects export operations
defined in the standard
<code>org.omg.CORBA.Object</code> interface. However, any attempt to invoke operations
<code>org.omg.CORBA.Object</code> interface. However, any attempt to invoke operations
exported through the <code>Object</code>
interface may raise the standard NO_IMPLEMENT exception.
An attempt to use a <code>DynAny</code> object with the DII may raise the NO_IMPLEMENT
An attempt to use a <code>DynAny</code> object with the DII may raise the NO_IMPLEMENT
exception.
<H3>Package Specification</H3>
<P>For a precise list of supported sections of official specifications with which
the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
<P>For a precise list of supported sections of official specifications with which
the Java[tm] Platform, Standard Edition 6 ORB complies, see <A
HREF="../CORBA/doc-files/compliance.html">Official Specifications for CORBA
support in Java[tm] SE 6</A>.
@since 1.4

View File

@ -468,3 +468,4 @@ ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58
2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63
bf92b8db249cdfa5651ef954b6c0743a7e0ea4cd jdk9-b64
e7ae94c4f35e940ea423fc1dd260435df34a77c0 jdk9-b65
197e94e0dacddd16816f101d24fc0442ab518326 jdk9-b66

File diff suppressed because it is too large Load Diff

View File

@ -466,6 +466,11 @@ class Address VALUE_OBJ_CLASS_SPEC {
case base_plus_offset:
{
unsigned size = i->get(31, 30);
if (i->get(26, 26) && i->get(23, 23)) {
// SIMD Q Type - Size = 128 bits
assert(size == 0, "bad size");
size = 0b100;
}
unsigned mask = (1 << size) - 1;
if (_offset < 0 || _offset & mask)
{
@ -1888,9 +1893,18 @@ public:
};
enum SIMD_RegVariant {
S32, D64, Q128
B, H, S, D, Q
};
#define INSN(NAME, op) \
void NAME(FloatRegister Rt, SIMD_RegVariant T, const Address &adr) { \
ld_st2((Register)Rt, adr, (int)T & 3, op + ((T==Q) ? 0b10:0b00), 1); \
} \
INSN(ldr, 1);
INSN(str, 0);
#undef INSN
private:
@ -1997,27 +2011,87 @@ public:
rf(Vm, 16), f(0b000111, 15, 10), rf(Vn, 5), rf(Vd, 0); \
}
INSN(eor, 0b101110001);
INSN(orr, 0b001110101);
INSN(eor, 0b101110001);
INSN(orr, 0b001110101);
INSN(andr, 0b001110001);
INSN(bic, 0b001110011);
INSN(bif, 0b101110111);
INSN(bit, 0b101110101);
INSN(bsl, 0b101110011);
INSN(orn, 0b001110111);
INSN(bic, 0b001110011);
INSN(bif, 0b101110111);
INSN(bit, 0b101110101);
INSN(bsl, 0b101110011);
INSN(orn, 0b001110111);
#undef INSN
#define INSN(NAME, opc) \
#define INSN(NAME, opc, opc2) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \
starti; \
f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \
f((int)T >> 1, 23, 22), f(1, 21), rf(Vm, 16), f(0b100001, 15, 10); \
f((int)T >> 1, 23, 22), f(1, 21), rf(Vm, 16), f(opc2, 15, 10); \
rf(Vn, 5), rf(Vd, 0); \
}
INSN(addv, 0);
INSN(subv, 1);
INSN(addv, 0, 0b100001);
INSN(subv, 1, 0b100001);
INSN(mulv, 0, 0b100111);
INSN(sshl, 0, 0b010001);
INSN(ushl, 1, 0b010001);
#undef INSN
#define INSN(NAME, opc, opc2) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { \
starti; \
f(0, 31), f((int)T & 1, 30), f(opc, 29), f(0b01110, 28, 24); \
f((int)T >> 1, 23, 22), f(opc2, 21, 10); \
rf(Vn, 5), rf(Vd, 0); \
}
INSN(absr, 0, 0b100000101110);
INSN(negr, 1, 0b100000101110);
INSN(notr, 1, 0b100000010110);
INSN(addv, 0, 0b110001101110);
#undef INSN
#define INSN(NAME, op0, cmode0) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, unsigned imm8, unsigned lsl = 0) { \
unsigned cmode = cmode0; \
unsigned op = op0; \
starti; \
assert(lsl == 0 || \
((T == T4H || T == T8H) && lsl == 8) || \
((T == T2S || T == T4S) && ((lsl >> 3) < 4)), "invalid shift"); \
cmode |= lsl >> 2; \
if (T == T4H || T == T8H) cmode |= 0b1000; \
if (!(T == T4H || T == T8H || T == T2S || T == T4S)) { \
assert(op == 0 && cmode0 == 0, "must be MOVI"); \
cmode = 0b1110; \
if (T == T1D || T == T2D) op = 1; \
} \
f(0, 31), f((int)T & 1, 30), f(op, 29), f(0b0111100000, 28, 19); \
f(imm8 >> 5, 18, 16), f(cmode, 15, 12), f(0x01, 11, 10), f(imm8 & 0b11111, 9, 5); \
rf(Vd, 0); \
}
INSN(movi, 0, 0);
INSN(orri, 0, 1);
INSN(mvni, 1, 0);
INSN(bici, 1, 1);
#undef INSN
#define INSN(NAME, op1, op2, op3) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \
starti; \
assert(T == T2S || T == T4S || T == T2D, "invalid arrangement"); \
f(0, 31), f((int)T & 1, 30), f(op1, 29), f(0b01110, 28, 24), f(op2, 23); \
f(T==T2D ? 1:0, 22); f(1, 21), rf(Vm, 16), f(op3, 15, 10), rf(Vn, 5), rf(Vd, 0); \
}
INSN(fadd, 0, 0, 0b110101);
INSN(fdiv, 1, 0, 0b111111);
INSN(fmul, 1, 0, 0b110111);
INSN(fsub, 0, 1, 0b110101);
#undef INSN
@ -2064,19 +2138,40 @@ public:
#undef INSN
void shl(FloatRegister Vd, FloatRegister Vn, SIMD_Arrangement T, int shift){
void ins(FloatRegister Vd, SIMD_RegVariant T, FloatRegister Vn, int didx, int sidx) {
starti;
/* The encodings for the immh:immb fields (bits 22:16) are
* 0001 xxx 8B/16B, shift = xxx
* 001x xxx 4H/8H, shift = xxxx
* 01xx xxx 2S/4S, shift = xxxxx
* 1xxx xxx 1D/2D, shift = xxxxxx (1D is RESERVED)
*/
assert((1 << ((T>>1)+3)) > shift, "Invalid Shift value");
f(0, 31), f(T & 1, 30), f(0b0011110, 29, 23), f((1 << ((T>>1)+3))|shift, 22, 16);
f(0b010101, 15, 10), rf(Vn, 5), rf(Vd, 0);
assert(T != Q, "invalid register variant");
f(0b01101110000, 31, 21), f(((didx<<1)|1)<<(int)T, 20, 16), f(0, 15);
f(sidx<<(int)T, 14, 11), f(1, 10), rf(Vn, 5), rf(Vd, 0);
}
void umov(Register Rd, FloatRegister Vn, SIMD_RegVariant T, int idx) {
starti;
f(0, 31), f(T==D ? 1:0, 30), f(0b001110000, 29, 21);
f(((idx<<1)|1)<<(int)T, 20, 16), f(0b001111, 15, 10);
rf(Vn, 5), rf(Rd, 0);
}
#define INSN(NAME, opc, opc2) \
void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, int shift){ \
starti; \
/* The encodings for the immh:immb fields (bits 22:16) are \
* 0001 xxx 8B/16B, shift = xxx \
* 001x xxx 4H/8H, shift = xxxx \
* 01xx xxx 2S/4S, shift = xxxxx \
* 1xxx xxx 1D/2D, shift = xxxxxx (1D is RESERVED) \
*/ \
assert((1 << ((T>>1)+3)) > shift, "Invalid Shift value"); \
f(0, 31), f(T & 1, 30), f(opc, 29), f(0b011110, 28, 23), \
f((1 << ((T>>1)+3))|shift, 22, 16); f(opc2, 15, 10), rf(Vn, 5), rf(Vd, 0); \
}
INSN(shl, 0, 0b010101);
INSN(sshr, 0, 0b000001);
INSN(ushr, 1, 0b000001);
#undef INSN
void ushll(FloatRegister Vd, SIMD_Arrangement Ta, FloatRegister Vn, SIMD_Arrangement Tb, int shift) {
starti;
/* The encodings for the immh:immb fields (bits 22:16) are
@ -2149,6 +2244,23 @@ public:
rf(Vn, 5), rf(Vd, 0);
}
void dup(FloatRegister Vd, SIMD_Arrangement T, Register Xs)
{
starti;
assert(T != T1D, "reserved encoding");
f(0,31), f((int)T & 1, 30), f(0b001110000, 29, 21);
f((1 << (T >> 1)), 20, 16), f(0b000011, 15, 10), rf(Xs, 5), rf(Vd, 0);
}
void dup(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, int index = 0)
{
starti;
assert(T != T1D, "reserved encoding");
f(0, 31), f((int)T & 1, 30), f(0b001110000, 29, 21);
f(((1 << (T >> 1)) | (index << ((T >> 1) + 1))), 20, 16);
f(0b000001, 15, 10), rf(Vn, 5), rf(Vd, 0);
}
// CRC32 instructions
#define INSN(NAME, sf, sz) \
void NAME(Register Rd, Register Rn, Register Rm) { \

View File

@ -64,7 +64,7 @@ define_pd_global(intx, StackShadowPages, 4 DEBUG_ONLY(+5));
define_pd_global(intx, PreInflateSpin, 10);
define_pd_global(bool, RewriteBytecodes, true);
define_pd_global(bool, RewriteFrequentPairs, false);
define_pd_global(bool, RewriteFrequentPairs, true);
define_pd_global(bool, UseMembar, true);

View File

@ -2802,8 +2802,8 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len,
uzp2(v21, v20, v16, T2D);
eor(v20, T16B, v17, v21);
shl(v16, v28, T2D, 1);
shl(v17, v20, T2D, 1);
shl(v16, T2D, v28, 1);
shl(v17, T2D, v20, 1);
eor(v0, T16B, v0, v16);
eor(v1, T16B, v1, v17);

View File

@ -37,6 +37,7 @@ class MacroAssembler: public Assembler {
friend class LIR_Assembler;
using Assembler::mov;
using Assembler::movi;
protected:
@ -464,6 +465,45 @@ public:
void movptr(Register r, uintptr_t imm64);
// Macro to mov replicated immediate to vector register.
// Where imm32 == hex abcdefgh, Vd will get the following values
// for different arrangements in T
// T8B: Vd = ghghghghghghghgh
// T16B: Vd = ghghghghghghghghghghghghghghghgh
// T4H: Vd = efghefghefghefgh
// T8H: Vd = efghefghefghefghefghefghefghefgh
// T2S: Vd = abcdefghabcdefgh
// T4S: Vd = abcdefghabcdefghabcdefghabcdefgh
// T1D/T2D: invalid
void mov(FloatRegister Vd, SIMD_Arrangement T, u_int32_t imm32) {
assert(T != T1D && T != T2D, "invalid arrangement");
u_int32_t nimm32 = ~imm32;
if (T == T8B || T == T16B) { imm32 &= 0xff; nimm32 &= 0xff; }
if (T == T4H || T == T8H) { imm32 &= 0xffff; nimm32 &= 0xffff; }
u_int32_t x = imm32;
int movi_cnt = 0;
int movn_cnt = 0;
while (x) { if (x & 0xff) movi_cnt++; x >>= 8; }
x = nimm32;
while (x) { if (x & 0xff) movn_cnt++; x >>= 8; }
if (movn_cnt < movi_cnt) imm32 = nimm32;
unsigned lsl = 0;
while (imm32 && (imm32 & 0xff) == 0) { lsl += 8; imm32 >>= 8; }
if (movn_cnt < movi_cnt)
mvni(Vd, T, imm32 & 0xff, lsl);
else
movi(Vd, T, imm32 & 0xff, lsl);
imm32 >>= 8; lsl += 8;
while (imm32) {
while ((imm32 & 0xff) == 0) { lsl += 8; imm32 >>= 8; }
if (movn_cnt < movi_cnt)
bici(Vd, T, imm32 & 0xff, lsl);
else
orri(Vd, T, imm32 & 0xff, lsl);
lsl += 8; imm32 >>= 8;
}
}
// macro instructions for accessing and updating floating point
// status register
//

View File

@ -186,7 +186,7 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl {
// it's optoregs.
number_of_registers = (2 * RegisterImpl::number_of_registers +
2 * FloatRegisterImpl::number_of_registers +
4 * FloatRegisterImpl::number_of_registers +
1) // flags
};

View File

@ -513,23 +513,61 @@ void TemplateTable::nofast_iload() {
void TemplateTable::iload_internal(RewriteControl rc) {
transition(vtos, itos);
if (RewriteFrequentPairs && rc == may_rewrite) {
// TODO : check x86 code for what to do here
__ call_Unimplemented();
} else {
locals_index(r1);
__ ldr(r0, iaddress(r1));
Label rewrite, done;
Register bc = r4;
// get next bytecode
__ load_unsigned_byte(r1, at_bcp(Bytecodes::length_for(Bytecodes::_iload)));
// if _iload, wait to rewrite to iload2. We only want to rewrite the
// last two iloads in a pair. Comparing against fast_iload means that
// the next bytecode is neither an iload or a caload, and therefore
// an iload pair.
__ cmpw(r1, Bytecodes::_iload);
__ br(Assembler::EQ, done);
// if _fast_iload rewrite to _fast_iload2
__ cmpw(r1, Bytecodes::_fast_iload);
__ movw(bc, Bytecodes::_fast_iload2);
__ br(Assembler::EQ, rewrite);
// if _caload rewrite to _fast_icaload
__ cmpw(r1, Bytecodes::_caload);
__ movw(bc, Bytecodes::_fast_icaload);
__ br(Assembler::EQ, rewrite);
// else rewrite to _fast_iload
__ movw(bc, Bytecodes::_fast_iload);
// rewrite
// bc: new bytecode
__ bind(rewrite);
patch_bytecode(Bytecodes::_iload, bc, r1, false);
__ bind(done);
}
// do iload, get the local value into tos
locals_index(r1);
__ ldr(r0, iaddress(r1));
}
void TemplateTable::fast_iload2()
{
__ call_Unimplemented();
transition(vtos, itos);
locals_index(r1);
__ ldr(r0, iaddress(r1));
__ push(itos);
locals_index(r1, 3);
__ ldr(r0, iaddress(r1));
}
void TemplateTable::fast_iload()
{
__ call_Unimplemented();
transition(vtos, itos);
locals_index(r1);
__ ldr(r0, iaddress(r1));
}
void TemplateTable::lload()
@ -721,7 +759,18 @@ void TemplateTable::caload()
// iload followed by caload frequent pair
void TemplateTable::fast_icaload()
{
__ call_Unimplemented();
transition(vtos, itos);
// load index out of locals
locals_index(r2);
__ ldr(r1, iaddress(r2));
__ pop_ptr(r0);
// r0: array
// r1: index
index_check(r0, r1); // leaves index in r1, kills rscratch1
__ lea(r1, Address(r0, r1, Address::uxtw(1)));
__ load_unsigned_short(r0, Address(r1, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
}
void TemplateTable::saload()
@ -797,7 +846,47 @@ void TemplateTable::aload_0_internal(RewriteControl rc) {
// These bytecodes with a small amount of code are most profitable
// to rewrite
if (RewriteFrequentPairs && rc == may_rewrite) {
__ call_Unimplemented();
Label rewrite, done;
const Register bc = r4;
// get next bytecode
__ load_unsigned_byte(r1, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0)));
// do actual aload_0
aload(0);
// if _getfield then wait with rewrite
__ cmpw(r1, Bytecodes::Bytecodes::_getfield);
__ br(Assembler::EQ, done);
// if _igetfield then reqrite to _fast_iaccess_0
assert(Bytecodes::java_code(Bytecodes::_fast_iaccess_0) == Bytecodes::_aload_0, "fix bytecode definition");
__ cmpw(r1, Bytecodes::_fast_igetfield);
__ movw(bc, Bytecodes::_fast_iaccess_0);
__ br(Assembler::EQ, rewrite);
// if _agetfield then reqrite to _fast_aaccess_0
assert(Bytecodes::java_code(Bytecodes::_fast_aaccess_0) == Bytecodes::_aload_0, "fix bytecode definition");
__ cmpw(r1, Bytecodes::_fast_agetfield);
__ movw(bc, Bytecodes::_fast_aaccess_0);
__ br(Assembler::EQ, rewrite);
// if _fgetfield then reqrite to _fast_faccess_0
assert(Bytecodes::java_code(Bytecodes::_fast_faccess_0) == Bytecodes::_aload_0, "fix bytecode definition");
__ cmpw(r1, Bytecodes::_fast_fgetfield);
__ movw(bc, Bytecodes::_fast_faccess_0);
__ br(Assembler::EQ, rewrite);
// else rewrite to _fast_aload0
assert(Bytecodes::java_code(Bytecodes::_fast_aload_0) == Bytecodes::_aload_0, "fix bytecode definition");
__ movw(bc, Bytecodes::Bytecodes::_fast_aload_0);
// rewrite
// bc: new bytecode
__ bind(rewrite);
patch_bytecode(Bytecodes::_aload_0, bc, r1, false);
__ bind(done);
} else {
aload(0);
}

View File

@ -3372,6 +3372,25 @@ operand immI() %{
interface(CONST_INTER);
%}
// Integer Immediate: 0-bit
operand immI0() %{
predicate(n->get_int() == 0);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 5-bit
operand immI5() %{
predicate(Assembler::is_simm5(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 8-bit
operand immI8() %{
predicate(Assembler::is_simm8(n->get_int()));
@ -3381,6 +3400,25 @@ operand immI8() %{
interface(CONST_INTER);
%}
// Integer Immediate: the value 10
operand immI10() %{
predicate(n->get_int() == 10);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 11-bit
operand immI11() %{
predicate(Assembler::is_simm11(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 13-bit
operand immI13() %{
predicate(Assembler::is_simm13(n->get_int()));
@ -3410,84 +3448,6 @@ operand immI16() %{
interface(CONST_INTER);
%}
// Unsigned Integer Immediate: 12-bit (non-negative that fits in simm13)
operand immU12() %{
predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 6-bit
operand immU6() %{
predicate(n->get_int() >= 0 && n->get_int() <= 63);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 11-bit
operand immI11() %{
predicate(Assembler::is_simm11(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 5-bit
operand immI5() %{
predicate(Assembler::is_simm5(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Int Immediate non-negative
operand immU31()
%{
predicate(n->get_int() >= 0);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 0-bit
operand immI0() %{
predicate(n->get_int() == 0);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: the value 10
operand immI10() %{
predicate(n->get_int() == 10);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: the values 0-31
operand immU5() %{
predicate(n->get_int() >= 0 && n->get_int() <= 31);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: the values 1-31
operand immI_1_31() %{
predicate(n->get_int() >= 1 && n->get_int() <= 31);
@ -3529,7 +3489,6 @@ operand immI_24() %{
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: the value 255
operand immI_255() %{
predicate( n->get_int() == 255 );
@ -3550,6 +3509,46 @@ operand immI_65535() %{
interface(CONST_INTER);
%}
// Integer Immediate: the values 0-31
operand immU5() %{
predicate(n->get_int() >= 0 && n->get_int() <= 31);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate: 6-bit
operand immU6() %{
predicate(n->get_int() >= 0 && n->get_int() <= 63);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Unsigned Integer Immediate: 12-bit (non-negative that fits in simm13)
operand immU12() %{
predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int()));
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Integer Immediate non-negative
operand immU31()
%{
predicate(n->get_int() >= 0);
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
// Long Immediate: the value FF
operand immL_FF() %{
predicate( n->get_long() == 0xFFL );
@ -5653,17 +5652,17 @@ instruct loadUB2L(iRegL dst, memory mem) %{
ins_pipe(iload_mem);
%}
// Load Unsigned Byte (8 bit UNsigned) with 8-bit mask into Long Register
instruct loadUB2L_immI8(iRegL dst, memory mem, immI8 mask) %{
// Load Unsigned Byte (8 bit UNsigned) with 32-bit mask into Long Register
instruct loadUB2L_immI(iRegL dst, memory mem, immI mask) %{
match(Set dst (ConvI2L (AndI (LoadUB mem) mask)));
ins_cost(MEMORY_REF_COST + DEFAULT_COST);
size(2*4);
format %{ "LDUB $mem,$dst\t# ubyte & 8-bit mask -> long\n\t"
"AND $dst,$mask,$dst" %}
format %{ "LDUB $mem,$dst\t# ubyte & 32-bit mask -> long\n\t"
"AND $dst,right_n_bits($mask, 8),$dst" %}
ins_encode %{
__ ldub($mem$$Address, $dst$$Register);
__ and3($dst$$Register, $mask$$constant, $dst$$Register);
__ and3($dst$$Register, $mask$$constant & right_n_bits(8), $dst$$Register);
%}
ins_pipe(iload_mem);
%}
@ -5776,20 +5775,20 @@ instruct loadUS2L_immI13(iRegL dst, memory mem, immI13 mask) %{
ins_pipe(iload_mem);
%}
// Load Unsigned Short/Char (16bit UNsigned) with a 16-bit mask into a Long Register
instruct loadUS2L_immI16(iRegL dst, memory mem, immI16 mask, iRegL tmp) %{
// Load Unsigned Short/Char (16bit UNsigned) with a 32-bit mask into a Long Register
instruct loadUS2L_immI(iRegL dst, memory mem, immI mask, iRegL tmp) %{
match(Set dst (ConvI2L (AndI (LoadUS mem) mask)));
effect(TEMP dst, TEMP tmp);
ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
format %{ "LDUH $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t"
"SET $mask,$tmp\n\t"
format %{ "LDUH $mem,$dst\t! ushort/char & 32-bit mask -> long\n\t"
"SET right_n_bits($mask, 16),$tmp\n\t"
"AND $dst,$tmp,$dst" %}
ins_encode %{
Register Rdst = $dst$$Register;
Register Rtmp = $tmp$$Register;
__ lduh($mem$$Address, Rdst);
__ set($mask$$constant, Rtmp);
__ set($mask$$constant & right_n_bits(16), Rtmp);
__ and3(Rdst, Rtmp, Rdst);
%}
ins_pipe(iload_mem);

View File

@ -5431,18 +5431,18 @@ instruct loadUB2L(eRegL dst, memory mem, eFlagsReg cr) %{
%}
// Load Unsigned Byte (8 bit UNsigned) with mask into Long Register
instruct loadUB2L_immI8(eRegL dst, memory mem, immI8 mask, eFlagsReg cr) %{
instruct loadUB2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadUB mem) mask)));
effect(KILL cr);
format %{ "MOVZX8 $dst.lo,$mem\t# ubyte & 8-bit mask -> long\n\t"
format %{ "MOVZX8 $dst.lo,$mem\t# ubyte & 32-bit mask -> long\n\t"
"XOR $dst.hi,$dst.hi\n\t"
"AND $dst.lo,$mask" %}
"AND $dst.lo,right_n_bits($mask, 8)" %}
ins_encode %{
Register Rdst = $dst$$Register;
__ movzbl(Rdst, $mem$$Address);
__ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst));
__ andl(Rdst, $mask$$constant);
__ andl(Rdst, $mask$$constant & right_n_bits(8));
%}
ins_pipe(ialu_reg_mem);
%}
@ -5550,19 +5550,19 @@ instruct loadUS2L_immI_255(eRegL dst, memory mem, immI_255 mask, eFlagsReg cr) %
ins_pipe(ialu_reg_mem);
%}
// Load Unsigned Short/Char (16 bit UNsigned) with a 16-bit mask into Long Register
instruct loadUS2L_immI16(eRegL dst, memory mem, immI16 mask, eFlagsReg cr) %{
// Load Unsigned Short/Char (16 bit UNsigned) with a 32-bit mask into Long Register
instruct loadUS2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadUS mem) mask)));
effect(KILL cr);
format %{ "MOVZX $dst.lo, $mem\t# ushort/char & 16-bit mask -> long\n\t"
format %{ "MOVZX $dst.lo, $mem\t# ushort/char & 32-bit mask -> long\n\t"
"XOR $dst.hi,$dst.hi\n\t"
"AND $dst.lo,$mask" %}
"AND $dst.lo,right_n_bits($mask, 16)" %}
ins_encode %{
Register Rdst = $dst$$Register;
__ movzwl(Rdst, $mem$$Address);
__ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst));
__ andl(Rdst, $mask$$constant);
__ andl(Rdst, $mask$$constant & right_n_bits(16));
%}
ins_pipe(ialu_reg_mem);
%}

View File

@ -4753,17 +4753,17 @@ instruct loadUB2L(rRegL dst, memory mem)
ins_pipe(ialu_reg_mem);
%}
// Load Unsigned Byte (8 bit UNsigned) with a 8-bit mask into Long Register
instruct loadUB2L_immI8(rRegL dst, memory mem, immI8 mask, rFlagsReg cr) %{
// Load Unsigned Byte (8 bit UNsigned) with 32-bit mask into Long Register
instruct loadUB2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadUB mem) mask)));
effect(KILL cr);
format %{ "movzbq $dst, $mem\t# ubyte & 8-bit mask -> long\n\t"
"andl $dst, $mask" %}
format %{ "movzbq $dst, $mem\t# ubyte & 32-bit mask -> long\n\t"
"andl $dst, right_n_bits($mask, 8)" %}
ins_encode %{
Register Rdst = $dst$$Register;
__ movzbq(Rdst, $mem$$Address);
__ andl(Rdst, $mask$$constant);
__ andl(Rdst, $mask$$constant & right_n_bits(8));
%}
ins_pipe(ialu_reg_mem);
%}
@ -4863,17 +4863,17 @@ instruct loadUS2L_immI_255(rRegL dst, memory mem, immI_255 mask) %{
ins_pipe(ialu_reg_mem);
%}
// Load Unsigned Short/Char (16 bit UNsigned) with mask into Long Register
instruct loadUS2L_immI16(rRegL dst, memory mem, immI16 mask, rFlagsReg cr) %{
// Load Unsigned Short/Char (16 bit UNsigned) with 32-bit mask into Long Register
instruct loadUS2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{
match(Set dst (ConvI2L (AndI (LoadUS mem) mask)));
effect(KILL cr);
format %{ "movzwq $dst, $mem\t# ushort/char & 16-bit mask -> long\n\t"
"andl $dst, $mask" %}
format %{ "movzwq $dst, $mem\t# ushort/char & 32-bit mask -> long\n\t"
"andl $dst, right_n_bits($mask, 16)" %}
ins_encode %{
Register Rdst = $dst$$Register;
__ movzwq(Rdst, $mem$$Address);
__ andl(Rdst, $mask$$constant);
__ andl(Rdst, $mask$$constant & right_n_bits(16));
%}
ins_pipe(ialu_reg_mem);
%}

View File

@ -49,25 +49,6 @@ ciMethodHandle* ciCallSite::get_target() const {
return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
}
// ------------------------------------------------------------------
// ciCallSite::get_context
//
// Return the target MethodHandle of this CallSite.
ciKlass* ciCallSite::get_context() {
assert(!is_constant_call_site(), "");
VM_ENTRY_MARK;
oop call_site_oop = get_oop();
InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site_oop);
if (ctxk == NULL) {
// The call site doesn't have a context associated. Set it to the default context.
oop def_context_oop = java_lang_invoke_CallSite::default_context();
java_lang_invoke_CallSite::set_context_cas(call_site_oop, def_context_oop, /*expected=*/NULL);
ctxk = MethodHandles::get_call_site_context(call_site_oop);
}
return (CURRENT_ENV->get_metadata(ctxk))->as_klass();
}
// ------------------------------------------------------------------
// ciCallSite::print
//

View File

@ -43,7 +43,6 @@ public:
// Return the target MethodHandle of this CallSite.
ciMethodHandle* get_target() const;
ciKlass* get_context();
void print();
};

View File

@ -453,8 +453,12 @@ int ciInstanceKlass::compute_nonstatic_fields() {
if (fields == NULL) {
// This can happen if this class (java.lang.Class) has invisible fields.
_nonstatic_fields = super_fields;
return super_fields->length();
if (super_fields != NULL) {
_nonstatic_fields = super_fields;
return super_fields->length();
} else {
return 0;
}
}
int flen = fields->length();

View File

@ -2967,47 +2967,42 @@ int java_lang_invoke_MethodType::rtype_slot_count(oop mt) {
int java_lang_invoke_CallSite::_target_offset;
int java_lang_invoke_CallSite::_context_offset;
int java_lang_invoke_CallSite::_default_context_offset;
void java_lang_invoke_CallSite::compute_offsets() {
Klass* k = SystemDictionary::CallSite_klass();
if (k != NULL) {
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
compute_offset(_context_offset, k, vmSymbols::context_name(), vmSymbols::sun_misc_Cleaner_signature());
compute_offset(_default_context_offset, k,
vmSymbols::DEFAULT_CONTEXT_name(), vmSymbols::sun_misc_Cleaner_signature(),
/*is_static=*/true, /*allow_super=*/false);
compute_offset(_context_offset, k, vmSymbols::context_name(),
vmSymbols::java_lang_invoke_MethodHandleNatives_CallSiteContext_signature());
}
}
oop java_lang_invoke_CallSite::context_volatile(oop call_site) {
oop java_lang_invoke_CallSite::context(oop call_site) {
assert(java_lang_invoke_CallSite::is_instance(call_site), "");
oop dep_oop = call_site->obj_field_volatile(_context_offset);
oop dep_oop = call_site->obj_field(_context_offset);
return dep_oop;
}
void java_lang_invoke_CallSite::set_context_volatile(oop call_site, oop context) {
assert(java_lang_invoke_CallSite::is_instance(call_site), "");
call_site->obj_field_put_volatile(_context_offset, context);
}
// Support for java_lang_invoke_MethodHandleNatives_CallSiteContext
bool java_lang_invoke_CallSite::set_context_cas(oop call_site, oop context, oop expected) {
assert(java_lang_invoke_CallSite::is_instance(call_site), "");
HeapWord* context_addr = call_site->obj_field_addr<HeapWord>(_context_offset);
oop res = oopDesc::atomic_compare_exchange_oop(context, context_addr, expected, true);
bool success = (res == expected);
if (success) {
update_barrier_set((void*)context_addr, context);
int java_lang_invoke_MethodHandleNatives_CallSiteContext::_vmdependencies_offset;
void java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets() {
Klass* k = SystemDictionary::Context_klass();
if (k != NULL) {
CALLSITECONTEXT_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
}
return success;
}
oop java_lang_invoke_CallSite::default_context() {
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::CallSite_klass());
oop def_context_oop = ik->java_mirror()->obj_field(_default_context_offset);
assert(!oopDesc::is_null(def_context_oop), "");
return def_context_oop;
nmethodBucket* java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) {
assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
return (nmethodBucket*) (address) call_site->long_field(_vmdependencies_offset);
}
void java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(oop call_site, nmethodBucket* context) {
assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
call_site->long_field_put(_vmdependencies_offset, (jlong) (address) context);
}
// Support for java_security_AccessControlContext
@ -3403,6 +3398,7 @@ void JavaClasses::compute_offsets() {
java_lang_invoke_LambdaForm::compute_offsets();
java_lang_invoke_MethodType::compute_offsets();
java_lang_invoke_CallSite::compute_offsets();
java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets();
java_security_AccessControlContext::compute_offsets();
// Initialize reflection classes. The layouts of these classes
// changed with the new reflection implementation in JDK 1.4, and

View File

@ -1170,8 +1170,6 @@ class java_lang_invoke_CallSite: AllStatic {
private:
static int _target_offset;
static int _context_offset;
static int _default_context_offset;
static void compute_offsets();
@ -1181,11 +1179,7 @@ public:
static void set_target( oop site, oop target);
static void set_target_volatile( oop site, oop target);
static oop context_volatile(oop site);
static void set_context_volatile(oop site, oop context);
static bool set_context_cas (oop site, oop context, oop expected);
static oop default_context();
static oop context(oop site);
// Testers
static bool is_subclass(Klass* klass) {
@ -1197,6 +1191,31 @@ public:
static int target_offset_in_bytes() { return _target_offset; }
};
// Interface to java.lang.invoke.MethodHandleNatives$CallSiteContext objects
#define CALLSITECONTEXT_INJECTED_FIELDS(macro) \
macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false)
class java_lang_invoke_MethodHandleNatives_CallSiteContext : AllStatic {
friend class JavaClasses;
private:
static int _vmdependencies_offset;
static void compute_offsets();
public:
// Accessors
static nmethodBucket* vmdependencies(oop context);
static void set_vmdependencies(oop context, nmethodBucket* bucket);
// Testers
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::Context_klass());
}
static bool is_instance(oop obj);
};
// Interface to java.security.AccessControlContext objects
class java_security_AccessControlContext: AllStatic {
@ -1406,7 +1425,8 @@ class InjectedField {
#define ALL_INJECTED_FIELDS(macro) \
CLASS_INJECTED_FIELDS(macro) \
CLASSLOADER_INJECTED_FIELDS(macro) \
MEMBERNAME_INJECTED_FIELDS(macro)
MEMBERNAME_INJECTED_FIELDS(macro) \
CALLSITECONTEXT_INJECTED_FIELDS(macro)
// Interface to hard-coded offset checking

View File

@ -49,6 +49,10 @@ inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}

View File

@ -159,6 +159,7 @@ class Ticks;
do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre ) \
do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre ) \
do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre ) \
do_klass(Context_klass, java_lang_invoke_MethodHandleNatives_CallSiteContext, Pre ) \
do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre ) \
do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre ) \
do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre ) \

View File

@ -274,12 +274,14 @@
/* internal classes known only to the JVM: */ \
template(java_lang_invoke_MemberName, "java/lang/invoke/MemberName") \
template(java_lang_invoke_MethodHandleNatives, "java/lang/invoke/MethodHandleNatives") \
template(java_lang_invoke_MethodHandleNatives_CallSiteContext, "java/lang/invoke/MethodHandleNatives$CallSiteContext") \
template(java_lang_invoke_LambdaForm, "java/lang/invoke/LambdaForm") \
template(java_lang_invoke_ForceInline_signature, "Ljava/lang/invoke/ForceInline;") \
template(java_lang_invoke_DontInline_signature, "Ljava/lang/invoke/DontInline;") \
template(java_lang_invoke_Stable_signature, "Ljava/lang/invoke/Stable;") \
template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;") \
template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \
/* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */ \
template(findMethodHandleType_name, "findMethodHandleType") \
template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
@ -401,7 +403,7 @@
template(protection_domain_name, "protection_domain") \
template(signers_name, "signers_name") \
template(loader_data_name, "loader_data") \
template(dependencies_name, "dependencies") \
template(vmdependencies_name, "vmdependencies") \
template(input_stream_void_signature, "(Ljava/io/InputStream;)V") \
template(getFileURL_name, "getFileURL") \
template(getFileURL_signature, "(Ljava/io/File;)Ljava/net/URL;") \

View File

@ -1047,40 +1047,6 @@ void CodeCache::flush_dependents_on(instanceKlassHandle dependee) {
}
}
// Flushes compiled methods dependent on a particular CallSite
// instance when its target is different than the given MethodHandle.
void CodeCache::flush_dependents_on(Handle call_site, Handle method_handle) {
assert_lock_strong(Compile_lock);
if (number_of_nmethods_with_dependencies() == 0) return;
// CodeCache can only be updated by a thread_in_VM and they will all be
// stopped during the safepoint so CodeCache will be safe to update without
// holding the CodeCache_lock.
CallSiteDepChange changes(call_site(), method_handle());
// Compute the dependent nmethods that have a reference to a
// CallSite object. We use InstanceKlass::mark_dependent_nmethod
// directly instead of CodeCache::mark_for_deoptimization because we
// want dependents on the call site class only not all classes in
// the ContextStream.
int marked = 0;
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site());
if (ctxk == NULL) {
return; // No dependencies to invalidate yet.
}
marked = ctxk->mark_dependent_nmethods(changes);
}
if (marked > 0) {
// At least one nmethod has been marked for deoptimization
VM_Deoptimize op;
VMThread::execute(&op);
}
}
#ifdef HOTSWAP
// Flushes compiled methods dependent on dependee in the evolutionary sense
void CodeCache::flush_evol_dependents_on(instanceKlassHandle ev_k_h) {

View File

@ -224,7 +224,6 @@ class CodeCache : AllStatic {
// Flushing and deoptimization
static void flush_dependents_on(instanceKlassHandle dependee);
static void flush_dependents_on(Handle call_site, Handle method_handle);
#ifdef HOTSWAP
// Flushing and deoptimization in case of evolution
static void flush_evol_dependents_on(instanceKlassHandle dependee);

View File

@ -117,9 +117,7 @@ void Dependencies::assert_has_no_finalizable_subclasses(ciKlass* ctxk) {
}
void Dependencies::assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle) {
ciKlass* ctxk = call_site->get_context();
check_ctxk(ctxk);
assert_common_3(call_site_target_value, ctxk, call_site, method_handle);
assert_common_2(call_site_target_value, call_site, method_handle);
}
// Helper function. If we are adding a new dep. under ctxk2,
@ -175,7 +173,6 @@ void Dependencies::assert_common_2(DepType dept,
}
}
} else {
assert(dep_implicit_context_arg(dept) == 0, "sanity");
if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) {
// look in this bucket for redundant assertions
const int stride = 2;
@ -389,7 +386,7 @@ int Dependencies::_dep_args[TYPE_LIMIT] = {
3, // unique_concrete_subtypes_2 ctxk, k1, k2
3, // unique_concrete_methods_2 ctxk, m1, m2
1, // no_finalizable_subclasses ctxk
3 // call_site_target_value ctxk, call_site, method_handle
2 // call_site_target_value call_site, method_handle
};
const char* Dependencies::dep_name(Dependencies::DepType dept) {
@ -1515,16 +1512,11 @@ Klass* Dependencies::check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepCh
return find_finalizable_subclass(search_at);
}
Klass* Dependencies::check_call_site_target_value(Klass* recorded_ctxk, oop call_site, oop method_handle, CallSiteDepChange* changes) {
assert(call_site->is_a(SystemDictionary::CallSite_klass()), "sanity");
Klass* Dependencies::check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes) {
assert(!oopDesc::is_null(call_site), "sanity");
assert(!oopDesc::is_null(method_handle), "sanity");
assert(call_site->is_a(SystemDictionary::CallSite_klass()), "sanity");
Klass* call_site_ctxk = MethodHandles::get_call_site_context(call_site);
assert(!Klass::is_null(call_site_ctxk), "call site context should be initialized already");
if (recorded_ctxk != call_site_ctxk) {
// Stale context
return recorded_ctxk;
}
if (changes == NULL) {
// Validate all CallSites
if (java_lang_invoke_CallSite::target(call_site) != method_handle)
@ -1599,7 +1591,7 @@ Klass* Dependencies::DepStream::check_call_site_dependency(CallSiteDepChange* ch
Klass* witness = NULL;
switch (type()) {
case call_site_target_value:
witness = check_call_site_target_value(context_type(), argument_oop(1), argument_oop(2), changes);
witness = check_call_site_target_value(argument_oop(0), argument_oop(1), changes);
break;
default:
witness = NULL;

View File

@ -173,7 +173,7 @@ class Dependencies: public ResourceObj {
non_klass_types = (1 << call_site_target_value),
klass_types = all_types & ~non_klass_types,
non_ctxk_types = (1 << evol_method),
non_ctxk_types = (1 << evol_method) | (1 << call_site_target_value),
implicit_ctxk_types = 0,
explicit_ctxk_types = all_types & ~(non_ctxk_types | implicit_ctxk_types),
@ -330,7 +330,7 @@ class Dependencies: public ResourceObj {
static Klass* check_exclusive_concrete_methods(Klass* ctxk, Method* m1, Method* m2,
KlassDepChange* changes = NULL);
static Klass* check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepChange* changes = NULL);
static Klass* check_call_site_target_value(Klass* recorded_ctxk, oop call_site, oop method_handle, CallSiteDepChange* changes = NULL);
static Klass* check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes = NULL);
// A returned Klass* is NULL if the dependency assertion is still
// valid. A non-NULL Klass* is a 'witness' to the assertion
// failure, a point in the class hierarchy where the assertion has
@ -496,7 +496,7 @@ class Dependencies: public ResourceObj {
bool next();
DepType type() { return _type; }
bool is_oop_argument(int i) { return type() == call_site_target_value && i > 0; }
bool is_oop_argument(int i) { return type() == call_site_target_value; }
uintptr_t get_identifier(int i);
int argument_count() { return dep_args(type()); }

View File

@ -565,13 +565,18 @@ nmethod* nmethod::new_nmethod(methodHandle method,
// the number of methods compiled. For applications with a lot
// classes the slow way is too slow.
for (Dependencies::DepStream deps(nm); deps.next(); ) {
Klass* klass = deps.context_type();
if (klass == NULL) {
continue; // ignore things like evol_method
if (deps.type() == Dependencies::call_site_target_value) {
// CallSite dependencies are managed on per-CallSite instance basis.
oop call_site = deps.argument_oop(0);
MethodHandles::add_dependent_nmethod(call_site, nm);
} else {
Klass* klass = deps.context_type();
if (klass == NULL) {
continue; // ignore things like evol_method
}
// record this nmethod as dependent on this klass
InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
}
// record this nmethod as dependent on this klass
InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
}
NOT_PRODUCT(nmethod_stats.note_nmethod(nm));
if (PrintAssembly || CompilerOracle::has_option_string(method, "PrintAssembly")) {
@ -1464,13 +1469,20 @@ void nmethod::flush_dependencies(BoolObjectClosure* is_alive) {
if (!has_flushed_dependencies()) {
set_has_flushed_dependencies();
for (Dependencies::DepStream deps(this); deps.next(); ) {
Klass* klass = deps.context_type();
if (klass == NULL) continue; // ignore things like evol_method
// During GC the is_alive closure is non-NULL, and is used to
// determine liveness of dependees that need to be updated.
if (is_alive == NULL || klass->is_loader_alive(is_alive)) {
InstanceKlass::cast(klass)->remove_dependent_nmethod(this);
if (deps.type() == Dependencies::call_site_target_value) {
// CallSite dependencies are managed on per-CallSite instance basis.
oop call_site = deps.argument_oop(0);
MethodHandles::remove_dependent_nmethod(call_site, this);
} else {
Klass* klass = deps.context_type();
if (klass == NULL) {
continue; // ignore things like evol_method
}
// During GC the is_alive closure is non-NULL, and is used to
// determine liveness of dependees that need to be updated.
if (is_alive == NULL || klass->is_loader_alive(is_alive)) {
InstanceKlass::cast(klass)->remove_dependent_nmethod(this);
}
}
}
}

View File

@ -1822,11 +1822,10 @@ int nmethodBucket::decrement() {
// are dependent on the changes that were passed in and mark them for
// deoptimization. Returns the number of nmethods found.
//
int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
int nmethodBucket::mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes) {
assert_locked_or_safepoint(CodeCache_lock);
int found = 0;
nmethodBucket* b = _dependencies;
while (b != NULL) {
for (nmethodBucket* b = deps; b != NULL; b = b->next()) {
nmethod* nm = b->get_nmethod();
// since dependencies aren't removed until an nmethod becomes a zombie,
// the dependency list may contain nmethods which aren't alive.
@ -1834,7 +1833,6 @@ int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
if (TraceDependencies) {
ResourceMark rm;
tty->print_cr("Marked for deoptimization");
tty->print_cr(" context = %s", this->external_name());
changes.print();
nm->print();
nm->print_dependencies();
@ -1842,36 +1840,119 @@ int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
nm->mark_for_deoptimization();
found++;
}
b = b->next();
}
return found;
}
//
// Add an nmethodBucket to the list of dependencies for this nmethod.
// It's possible that an nmethod has multiple dependencies on this klass
// so a count is kept for each bucket to guarantee that creation and
// deletion of dependencies is consistent. Returns new head of the list.
//
nmethodBucket* nmethodBucket::add_dependent_nmethod(nmethodBucket* deps, nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
for (nmethodBucket* b = deps; b != NULL; b = b->next()) {
if (nm == b->get_nmethod()) {
b->increment();
return deps;
}
}
return new nmethodBucket(nm, deps);
}
//
// Decrement count of the nmethod in the dependency list and remove
// the bucket completely when the count goes to 0. This method must
// find a corresponding bucket otherwise there's a bug in the
// recording of dependencies. Returns true if the bucket is ready for reclamation.
//
bool nmethodBucket::remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
for (nmethodBucket* b = deps; b != NULL; b = b->next()) {
if (nm == b->get_nmethod()) {
int val = b->decrement();
guarantee(val >= 0, err_msg("Underflow: %d", val));
return (val == 0);
}
}
#ifdef ASSERT
tty->print_raw_cr("### can't find dependent nmethod");
nm->print();
#endif // ASSERT
ShouldNotReachHere();
return false;
}
//
// Reclaim all unused buckets. Returns new head of the list.
//
nmethodBucket* nmethodBucket::clean_dependent_nmethods(nmethodBucket* deps) {
nmethodBucket* first = deps;
nmethodBucket* last = NULL;
nmethodBucket* b = first;
while (b != NULL) {
assert(b->count() >= 0, err_msg("bucket count: %d", b->count()));
nmethodBucket* next = b->next();
if (b->count() == 0) {
if (last == NULL) {
first = next;
} else {
last->set_next(next);
}
delete b;
// last stays the same.
} else {
last = b;
}
b = next;
}
return first;
}
#ifndef PRODUCT
void nmethodBucket::print_dependent_nmethods(nmethodBucket* deps, bool verbose) {
int idx = 0;
for (nmethodBucket* b = deps; b != NULL; b = b->next()) {
nmethod* nm = b->get_nmethod();
tty->print("[%d] count=%d { ", idx++, b->count());
if (!verbose) {
nm->print_on(tty, "nmethod");
tty->print_cr(" } ");
} else {
nm->print();
nm->print_dependencies();
tty->print_cr("--- } ");
}
}
}
bool nmethodBucket::is_dependent_nmethod(nmethodBucket* deps, nmethod* nm) {
for (nmethodBucket* b = deps; b != NULL; b = b->next()) {
if (nm == b->get_nmethod()) {
#ifdef ASSERT
int count = b->count();
assert(count >= 0, err_msg("count shouldn't be negative: %d", count));
#endif
return true;
}
}
return false;
}
#endif //PRODUCT
int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
assert_locked_or_safepoint(CodeCache_lock);
return nmethodBucket::mark_dependent_nmethods(_dependencies, changes);
}
void InstanceKlass::clean_dependent_nmethods() {
assert_locked_or_safepoint(CodeCache_lock);
if (has_unloaded_dependent()) {
nmethodBucket* b = _dependencies;
nmethodBucket* last = NULL;
while (b != NULL) {
assert(b->count() >= 0, err_msg("bucket count: %d", b->count()));
nmethodBucket* next = b->next();
if (b->count() == 0) {
if (last == NULL) {
_dependencies = next;
} else {
last->set_next(next);
}
delete b;
// last stays the same.
} else {
last = b;
}
b = next;
}
_dependencies = nmethodBucket::clean_dependent_nmethods(_dependencies);
set_has_unloaded_dependent(false);
}
#ifdef ASSERT
@ -1885,90 +1966,26 @@ void InstanceKlass::clean_dependent_nmethods() {
#endif
}
//
// Add an nmethodBucket to the list of dependencies for this nmethod.
// It's possible that an nmethod has multiple dependencies on this klass
// so a count is kept for each bucket to guarantee that creation and
// deletion of dependencies is consistent.
//
void InstanceKlass::add_dependent_nmethod(nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
nmethodBucket* b = _dependencies;
nmethodBucket* last = NULL;
while (b != NULL) {
if (nm == b->get_nmethod()) {
b->increment();
return;
}
b = b->next();
}
_dependencies = new nmethodBucket(nm, _dependencies);
_dependencies = nmethodBucket::add_dependent_nmethod(_dependencies, nm);
}
//
// Decrement count of the nmethod in the dependency list and remove
// the bucket competely when the count goes to 0. This method must
// find a corresponding bucket otherwise there's a bug in the
// recording of dependecies.
//
void InstanceKlass::remove_dependent_nmethod(nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
nmethodBucket* b = _dependencies;
nmethodBucket* last = NULL;
while (b != NULL) {
if (nm == b->get_nmethod()) {
int val = b->decrement();
guarantee(val >= 0, err_msg("Underflow: %d", val));
if (val == 0) {
set_has_unloaded_dependent(true);
}
return;
}
last = b;
b = b->next();
}
#ifdef ASSERT
tty->print_cr("### %s can't find dependent nmethod:", this->external_name());
nm->print();
#endif // ASSERT
ShouldNotReachHere();
}
if (nmethodBucket::remove_dependent_nmethod(_dependencies, nm)) {
set_has_unloaded_dependent(true);
}
}
#ifndef PRODUCT
void InstanceKlass::print_dependent_nmethods(bool verbose) {
nmethodBucket* b = _dependencies;
int idx = 0;
while (b != NULL) {
nmethod* nm = b->get_nmethod();
tty->print("[%d] count=%d { ", idx++, b->count());
if (!verbose) {
nm->print_on(tty, "nmethod");
tty->print_cr(" } ");
} else {
nm->print();
nm->print_dependencies();
tty->print_cr("--- } ");
}
b = b->next();
}
nmethodBucket::print_dependent_nmethods(_dependencies, verbose);
}
bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
nmethodBucket* b = _dependencies;
while (b != NULL) {
if (nm == b->get_nmethod()) {
#ifdef ASSERT
int count = b->count();
assert(count >= 0, err_msg("count shouldn't be negative: %d", count));
#endif
return true;
}
b = b->next();
}
return false;
return nmethodBucket::is_dependent_nmethod(_dependencies, nm);
}
#endif //PRODUCT

View File

@ -1290,6 +1290,15 @@ class nmethodBucket: public CHeapObj<mtClass> {
nmethodBucket* next() { return _next; }
void set_next(nmethodBucket* b) { _next = b; }
nmethod* get_nmethod() { return _nmethod; }
static int mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes);
static nmethodBucket* add_dependent_nmethod(nmethodBucket* deps, nmethod* nm);
static bool remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm);
static nmethodBucket* clean_dependent_nmethods(nmethodBucket* deps);
#ifndef PRODUCT
static void print_dependent_nmethods(nmethodBucket* deps, bool verbose);
static bool is_dependent_nmethod(nmethodBucket* deps, nmethod* nm);
#endif //PRODUCT
};
// An iterator that's used to access the inner classes indices in the

View File

@ -599,10 +599,14 @@ Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
}
bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
const TypeOopPtr* dest_t = phase->type(in(ArrayCopyNode::Dest))->is_oopptr();
Node* dest = in(ArrayCopyNode::Dest);
if (dest->is_top()) {
return false;
}
const TypeOopPtr* dest_t = phase->type(dest)->is_oopptr();
assert(!dest_t->is_known_instance() || _dest_type->is_known_instance(), "result of EA not recorded");
const TypeOopPtr* src_t = phase->type(in(ArrayCopyNode::Src))->is_oopptr();
assert(!src_t->is_known_instance() || _src_type->is_known_instance(), "result of EA not recorded");
assert(in(ArrayCopyNode::Src)->is_top() || !phase->type(in(ArrayCopyNode::Src))->is_oopptr()->is_known_instance() ||
_src_type->is_known_instance(), "result of EA not recorded");
if (_dest_type != TypeOopPtr::BOTTOM || t_oop->is_known_instance()) {
assert(_dest_type == TypeOopPtr::BOTTOM || _dest_type->is_known_instance(), "result of EA is known instance");

View File

@ -1946,7 +1946,7 @@ bool CallLeafNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
}
}
}
if (may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
return true;
}
return false;

View File

@ -1457,18 +1457,18 @@ void GraphKit::set_all_memory_call(Node* call, bool separate_io_proj) {
// factory methods in "int adr_idx"
Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
int adr_idx,
MemNode::MemOrd mo, bool require_atomic_access) {
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency, bool require_atomic_access) {
assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
const TypePtr* adr_type = NULL; // debug-mode-only argument
debug_only(adr_type = C->get_adr_type(adr_idx));
Node* mem = memory(adr_idx);
Node* ld;
if (require_atomic_access && bt == T_LONG) {
ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo);
ld = LoadLNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
} else if (require_atomic_access && bt == T_DOUBLE) {
ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo);
ld = LoadDNode::make_atomic(ctl, mem, adr, adr_type, t, mo, control_dependency);
} else {
ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo);
ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
}
ld = _gvn.transform(ld);
if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {

View File

@ -512,21 +512,24 @@ class GraphKit : public Phase {
// adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
// of volatile fields.
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
MemNode::MemOrd mo, bool require_atomic_access = false) {
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false) {
// This version computes alias_index from bottom_type
return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
mo, require_atomic_access);
mo, control_dependency, require_atomic_access);
}
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
MemNode::MemOrd mo, bool require_atomic_access = false) {
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false) {
// This version computes alias_index from an address type
assert(adr_type != NULL, "use other make_load factory");
return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
mo, require_atomic_access);
mo, control_dependency, require_atomic_access);
}
// This is the base version which is given an alias index.
Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
MemNode::MemOrd mo, bool require_atomic_access = false);
MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest,
bool require_atomic_access = false);
// Create & transform a StoreNode and store the effect into the
// parser's memory state.

View File

@ -2631,7 +2631,9 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas
if (!is_store) {
MemNode::MemOrd mo = is_volatile ? MemNode::acquire : MemNode::unordered;
Node* p = make_load(control(), adr, value_type, type, adr_type, mo, is_volatile);
// To be valid, unsafe loads may depend on other conditions than
// the one that guards them: pin the Load node
Node* p = make_load(control(), adr, value_type, type, adr_type, mo, LoadNode::Pinned, is_volatile);
// load value
switch (type) {
case T_BOOLEAN:
@ -5488,7 +5490,7 @@ Node * LibraryCallKit::load_field_from_object(Node * fromObj, const char * field
}
// Build the load.
MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, is_vol);
Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);
// If reference is volatile, prevent following memory ops from
// floating up past the volatile read. Also prevents commoning
// another volatile read.

View File

@ -437,7 +437,13 @@ class Invariance : public StackObj {
}
}
if (all_inputs_invariant) {
_invariant.set(n->_idx); // I am a invariant too
// If n's control is a predicate that was moved out of the
// loop, it was marked invariant but n is only invariant if
// it depends only on that test. Otherwise, unless that test
// is out of the loop, it's not invariant.
if (n->is_CFG() || n->depends_only_on_test() || n->in(0) == NULL || !_phase->is_member(_lpt, n->in(0))) {
_invariant.set(n->_idx); // I am a invariant too
}
}
} else { // process next input
_stack.set_index(idx + 1);

View File

@ -1582,13 +1582,36 @@ void PhaseIdealLoop::mark_reductions(IdealLoopTree *loop) {
if (opc != ReductionNode::opcode(opc, def_node->bottom_type()->basic_type())) {
if (!def_node->is_reduction()) { // Not marked yet
// To be a reduction, the arithmetic node must have the phi as input and provide a def to it
bool ok = false;
for (unsigned j = 1; j < def_node->req(); j++) {
Node* in = def_node->in(j);
if (in == phi) {
def_node->add_flag(Node::Flag_is_reduction);
ok = true;
break;
}
}
// do nothing if we did not match the initial criteria
if (ok == false) {
continue;
}
// The result of the reduction must not be used in the loop
for (DUIterator_Fast imax, i = def_node->fast_outs(imax); i < imax && ok; i++) {
Node* u = def_node->fast_out(i);
if (has_ctrl(u) && !loop->is_member(get_loop(get_ctrl(u)))) {
continue;
}
if (u == phi) {
continue;
}
ok = false;
}
// iff the uses conform
if (ok) {
def_node->add_flag(Node::Flag_is_reduction);
}
}
}
}

View File

@ -718,7 +718,7 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) {
}
// Use same limit as split_if_with_blocks_post
if( C->unique() > 35000 ) return n; // Method too big
if( C->live_nodes() > 35000 ) return n; // Method too big
// Split 'n' through the merge point if it is profitable
Node *phi = split_thru_phi( n, n_blk, policy );
@ -802,7 +802,7 @@ void PhaseIdealLoop::split_if_with_blocks_post( Node *n ) {
// Cloning Cmp through Phi's involves the split-if transform.
// FastLock is not used by an If
if( n->is_Cmp() && !n->is_FastLock() ) {
if( C->unique() > 35000 ) return; // Method too big
if( C->live_nodes() > 35000 ) return; // Method too big
// Do not do 'split-if' if irreducible loops are present.
if( _has_irreducible_loops )

View File

@ -844,7 +844,7 @@ void Matcher::init_spill_mask( Node *ret ) {
MachNode *spillCP = match_tree(new LoadNNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM,MemNode::unordered));
#endif
MachNode *spillI = match_tree(new LoadINode(NULL,mem,fp,atp,TypeInt::INT,MemNode::unordered));
MachNode *spillL = match_tree(new LoadLNode(NULL,mem,fp,atp,TypeLong::LONG,MemNode::unordered,false));
MachNode *spillL = match_tree(new LoadLNode(NULL,mem,fp,atp,TypeLong::LONG,MemNode::unordered, LoadNode::DependsOnlyOnTest, false));
MachNode *spillF = match_tree(new LoadFNode(NULL,mem,fp,atp,Type::FLOAT,MemNode::unordered));
MachNode *spillD = match_tree(new LoadDNode(NULL,mem,fp,atp,Type::DOUBLE,MemNode::unordered));
MachNode *spillP = match_tree(new LoadPNode(NULL,mem,fp,atp,TypeInstPtr::BOTTOM,MemNode::unordered));

View File

@ -784,6 +784,9 @@ void LoadNode::dump_spec(outputStream *st) const {
// standard dump does this in Verbose and WizardMode
st->print(" #"); _type->dump_on(st);
}
if (!_depends_only_on_test) {
st->print(" (does not depend only on test)");
}
}
#endif
@ -800,7 +803,7 @@ bool LoadNode::is_immutable_value(Node* adr) {
//----------------------------LoadNode::make-----------------------------------
// Polymorphic factory method:
Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo) {
Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypePtr* adr_type, const Type *rt, BasicType bt, MemOrd mo, ControlDependency control_dependency) {
Compile* C = gvn.C;
// sanity check the alias category against the created node type
@ -816,39 +819,39 @@ Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypeP
rt->isa_oopptr() || is_immutable_value(adr),
"raw memory operations should have control edge");
switch (bt) {
case T_BOOLEAN: return new LoadUBNode(ctl, mem, adr, adr_type, rt->is_int(), mo);
case T_BYTE: return new LoadBNode (ctl, mem, adr, adr_type, rt->is_int(), mo);
case T_INT: return new LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo);
case T_CHAR: return new LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo);
case T_SHORT: return new LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo);
case T_LONG: return new LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo);
case T_FLOAT: return new LoadFNode (ctl, mem, adr, adr_type, rt, mo);
case T_DOUBLE: return new LoadDNode (ctl, mem, adr, adr_type, rt, mo);
case T_ADDRESS: return new LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo);
case T_BOOLEAN: return new LoadUBNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
case T_BYTE: return new LoadBNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
case T_INT: return new LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
case T_CHAR: return new LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
case T_SHORT: return new LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency);
case T_LONG: return new LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency);
case T_FLOAT: return new LoadFNode (ctl, mem, adr, adr_type, rt, mo, control_dependency);
case T_DOUBLE: return new LoadDNode (ctl, mem, adr, adr_type, rt, mo, control_dependency);
case T_ADDRESS: return new LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency);
case T_OBJECT:
#ifdef _LP64
if (adr->bottom_type()->is_ptr_to_narrowoop()) {
Node* load = gvn.transform(new LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop(), mo));
Node* load = gvn.transform(new LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop(), mo, control_dependency));
return new DecodeNNode(load, load->bottom_type()->make_ptr());
} else
#endif
{
assert(!adr->bottom_type()->is_ptr_to_narrowoop() && !adr->bottom_type()->is_ptr_to_narrowklass(), "should have got back a narrow oop");
return new LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr(), mo);
return new LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr(), mo, control_dependency);
}
}
ShouldNotReachHere();
return (LoadNode*)NULL;
}
LoadLNode* LoadLNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo) {
LoadLNode* LoadLNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo, ControlDependency control_dependency) {
bool require_atomic = true;
return new LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), mo, require_atomic);
return new LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency, require_atomic);
}
LoadDNode* LoadDNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo) {
LoadDNode* LoadDNode::make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, MemOrd mo, ControlDependency control_dependency) {
bool require_atomic = true;
return new LoadDNode(ctl, mem, adr, adr_type, rt, mo, require_atomic);
return new LoadDNode(ctl, mem, adr, adr_type, rt, mo, control_dependency, require_atomic);
}

View File

@ -137,7 +137,33 @@ public:
//------------------------------LoadNode---------------------------------------
// Load value; requires Memory and Address
class LoadNode : public MemNode {
public:
// Some loads (from unsafe) should be pinned: they don't depend only
// on the dominating test. The boolean field _depends_only_on_test
// below records whether that node depends only on the dominating
// test.
// Methods used to build LoadNodes pass an argument of type enum
// ControlDependency instead of a boolean because those methods
// typically have multiple boolean parameters with default values:
// passing the wrong boolean to one of these parameters by mistake
// goes easily unnoticed. Using an enum, the compiler can check that
// the type of a value and the type of the parameter match.
enum ControlDependency {
Pinned,
DependsOnlyOnTest
};
private:
// LoadNode::hash() doesn't take the _depends_only_on_test field
// into account: If the graph already has a non-pinned LoadNode and
// we add a pinned LoadNode with the same inputs, it's safe for GVN
// to replace the pinned LoadNode with the non-pinned LoadNode,
// otherwise it wouldn't be safe to have a non pinned LoadNode with
// those inputs in the first place. If the graph already has a
// pinned LoadNode and we add a non pinned LoadNode with the same
// inputs, it's safe (but suboptimal) for GVN to replace the
// non-pinned LoadNode by the pinned LoadNode.
bool _depends_only_on_test;
// On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish
// loads that can be reordered, and such requiring acquire semantics to
// adhere to the Java specification. The required behaviour is stored in
@ -154,8 +180,8 @@ protected:
virtual Node* find_previous_arraycopy(PhaseTransform* phase, Node* ld_alloc, Node*& mem, bool can_see_stored_value) const;
public:
LoadNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, MemOrd mo)
: MemNode(c,mem,adr,at), _type(rt), _mo(mo) {
LoadNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, MemOrd mo, ControlDependency control_dependency)
: MemNode(c,mem,adr,at), _type(rt), _mo(mo), _depends_only_on_test(control_dependency == DependsOnlyOnTest) {
init_class_id(Class_Load);
}
inline bool is_unordered() const { return !is_acquire(); }
@ -166,7 +192,8 @@ public:
// Polymorphic factory method:
static Node* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
const TypePtr* at, const Type *rt, BasicType bt, MemOrd mo);
const TypePtr* at, const Type *rt, BasicType bt,
MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
virtual uint hash() const; // Check the type
@ -234,16 +261,15 @@ protected:
// which produce results (new raw memory state) inside of loops preventing all
// manner of other optimizations). Basically, it's ugly but so is the alternative.
// See comment in macro.cpp, around line 125 expand_allocate_common().
virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM && _depends_only_on_test; }
};
//------------------------------LoadBNode--------------------------------------
// Load a byte (8bits signed) from memory
class LoadBNode : public LoadNode {
public:
LoadBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
: LoadNode(c, mem, adr, at, ti, mo) {}
LoadBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
@ -256,8 +282,8 @@ public:
// Load a unsigned byte (8bits unsigned) from memory
class LoadUBNode : public LoadNode {
public:
LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti, MemOrd mo)
: LoadNode(c, mem, adr, at, ti, mo) {}
LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
@ -270,8 +296,8 @@ public:
// Load an unsigned short/char (16bits unsigned) from memory
class LoadUSNode : public LoadNode {
public:
LoadUSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
: LoadNode(c, mem, adr, at, ti, mo) {}
LoadUSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
@ -284,8 +310,8 @@ public:
// Load a short (16bits signed) from memory
class LoadSNode : public LoadNode {
public:
LoadSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
: LoadNode(c, mem, adr, at, ti, mo) {}
LoadSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
@ -298,8 +324,8 @@ public:
// Load an integer from memory
class LoadINode : public LoadNode {
public:
LoadINode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo)
: LoadNode(c, mem, adr, at, ti, mo) {}
LoadINode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, ti, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
virtual int store_Opcode() const { return Op_StoreI; }
@ -331,15 +357,15 @@ class LoadLNode : public LoadNode {
public:
LoadLNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeLong *tl,
MemOrd mo, bool require_atomic_access = false)
: LoadNode(c, mem, adr, at, tl, mo), _require_atomic_access(require_atomic_access) {}
MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest, bool require_atomic_access = false)
: LoadNode(c, mem, adr, at, tl, mo, control_dependency), _require_atomic_access(require_atomic_access) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegL; }
virtual int store_Opcode() const { return Op_StoreL; }
virtual BasicType memory_type() const { return T_LONG; }
bool require_atomic_access() const { return _require_atomic_access; }
static LoadLNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
const Type* rt, MemOrd mo);
const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
LoadNode::dump_spec(st);
@ -352,8 +378,8 @@ public:
// Load a long from unaligned memory
class LoadL_unalignedNode : public LoadLNode {
public:
LoadL_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo)
: LoadLNode(c, mem, adr, at, TypeLong::LONG, mo) {}
LoadL_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadLNode(c, mem, adr, at, TypeLong::LONG, mo, control_dependency) {}
virtual int Opcode() const;
};
@ -361,8 +387,8 @@ public:
// Load a float (64 bits) from memory
class LoadFNode : public LoadNode {
public:
LoadFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, MemOrd mo)
: LoadNode(c, mem, adr, at, t, mo) {}
LoadFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegF; }
virtual int store_Opcode() const { return Op_StoreF; }
@ -382,15 +408,15 @@ class LoadDNode : public LoadNode {
public:
LoadDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t,
MemOrd mo, bool require_atomic_access = false)
: LoadNode(c, mem, adr, at, t, mo), _require_atomic_access(require_atomic_access) {}
MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest, bool require_atomic_access = false)
: LoadNode(c, mem, adr, at, t, mo, control_dependency), _require_atomic_access(require_atomic_access) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegD; }
virtual int store_Opcode() const { return Op_StoreD; }
virtual BasicType memory_type() const { return T_DOUBLE; }
bool require_atomic_access() const { return _require_atomic_access; }
static LoadDNode* make_atomic(Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type,
const Type* rt, MemOrd mo);
const Type* rt, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest);
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const {
LoadNode::dump_spec(st);
@ -403,8 +429,8 @@ public:
// Load a double from unaligned memory
class LoadD_unalignedNode : public LoadDNode {
public:
LoadD_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo)
: LoadDNode(c, mem, adr, at, Type::DOUBLE, mo) {}
LoadD_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadDNode(c, mem, adr, at, Type::DOUBLE, mo, control_dependency) {}
virtual int Opcode() const;
};
@ -412,8 +438,8 @@ public:
// Load a pointer from memory (either object or array)
class LoadPNode : public LoadNode {
public:
LoadPNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t, MemOrd mo)
: LoadNode(c, mem, adr, at, t, mo) {}
LoadPNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegP; }
virtual int store_Opcode() const { return Op_StoreP; }
@ -425,8 +451,8 @@ public:
// Load a narrow oop from memory (either object or array)
class LoadNNode : public LoadNode {
public:
LoadNNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t, MemOrd mo)
: LoadNode(c, mem, adr, at, t, mo) {}
LoadNNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t, MemOrd mo, ControlDependency control_dependency = DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, t, mo, control_dependency) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegN; }
virtual int store_Opcode() const { return Op_StoreN; }

View File

@ -235,7 +235,7 @@ void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
//
MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
bool needs_atomic_access = is_vol || AlwaysAtomicAccesses;
Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, needs_atomic_access);
Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, needs_atomic_access);
// Adjust Java stack
if (type2size[bt] == 1)

View File

@ -1573,11 +1573,12 @@ void PhaseCCP::analyze() {
set_type(n, t);
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Node* m = n->fast_out(i); // Get user
if( m->is_Region() ) { // New path to Region? Must recheck Phis too
if (m->is_Region()) { // New path to Region? Must recheck Phis too
for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
Node* p = m->fast_out(i2); // Propagate changes to uses
if( p->bottom_type() != type(p) ) // If not already bottomed out
if (p->bottom_type() != type(p)) { // If not already bottomed out
worklist.push(p); // Propagate change to user
}
}
}
// If we changed the receiver type to a call, we need to revisit
@ -1587,12 +1588,31 @@ void PhaseCCP::analyze() {
if (m->is_Call()) {
for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
Node* p = m->fast_out(i2); // Propagate changes to uses
if (p->is_Proj() && p->as_Proj()->_con == TypeFunc::Control && p->outcnt() == 1)
if (p->is_Proj() && p->as_Proj()->_con == TypeFunc::Control && p->outcnt() == 1) {
worklist.push(p->unique_out());
}
}
}
if( m->bottom_type() != type(m) ) // If not already bottomed out
if (m->bottom_type() != type(m)) { // If not already bottomed out
worklist.push(m); // Propagate change to user
}
// CmpU nodes can get their type information from two nodes up in the
// graph (instead of from the nodes immediately above). Make sure they
// are added to the worklist if nodes they depend on are updated, since
// they could be missed and get wrong types otherwise.
uint m_op = m->Opcode();
if (m_op == Op_AddI || m_op == Op_SubI) {
for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) {
Node* p = m->fast_out(i2); // Propagate changes to uses
if (p->Opcode() == Op_CmpU) {
// Got a CmpU which might need the new type information from node n.
if(p->bottom_type() != type(p)) { // If not already bottomed out
worklist.push(p); // Propagate change to user
}
}
}
}
}
}
}

View File

@ -1631,7 +1631,7 @@ void SuperWord::output() {
}
Node* adr = low_adr->in(MemNode::Address);
const TypePtr* atyp = n->adr_type();
vn = LoadVectorNode::make(opc, ctl, mem, adr, atyp, vlen, velt_basic_type(n));
vn = LoadVectorNode::make(opc, ctl, mem, adr, atyp, vlen, velt_basic_type(n), control_dependency(p));
vlen_in_bytes = vn->as_LoadVector()->memory_size();
} else if (n->is_Store()) {
// Promote value to be stored to vector
@ -2280,6 +2280,19 @@ Node* SuperWord::executed_last(Node_List* p) {
return n;
}
LoadNode::ControlDependency SuperWord::control_dependency(Node_List* p) {
LoadNode::ControlDependency dep = LoadNode::DependsOnlyOnTest;
for (uint i = 0; i < p->size(); i++) {
Node* n = p->at(i);
assert(n->is_Load(), "only meaningful for loads");
if (!n->depends_only_on_test()) {
dep = LoadNode::Pinned;
}
}
return dep;
}
//----------------------------align_initial_loop_index---------------------------
// Adjust pre-loop limit so that in main loop, a load/store reference
// to align_to_ref will be a position zero in the vector.

View File

@ -428,6 +428,7 @@ class SuperWord : public ResourceObj {
Node* executed_first(Node_List* p);
// Return the node executed last in pack p.
Node* executed_last(Node_List* p);
static LoadNode::ControlDependency control_dependency(Node_List* p);
// Alignment within a vector memory reference
int memory_alignment(MemNode* s, int iv_adjust);
// (Start, end] half-open range defining which operands are vector

View File

@ -406,9 +406,11 @@ PackNode* PackNode::binary_tree_pack(int lo, int hi) {
// Return the vector version of a scalar load node.
LoadVectorNode* LoadVectorNode::make(int opc, Node* ctl, Node* mem,
Node* adr, const TypePtr* atyp, uint vlen, BasicType bt) {
Node* adr, const TypePtr* atyp,
uint vlen, BasicType bt,
ControlDependency control_dependency) {
const TypeVect* vt = TypeVect::make(bt, vlen);
return new LoadVectorNode(ctl, mem, adr, atyp, vt);
return new LoadVectorNode(ctl, mem, adr, atyp, vt, control_dependency);
}
// Return the vector version of a scalar store node.

View File

@ -454,8 +454,8 @@ class XorVNode : public VectorNode {
// Load Vector from memory
class LoadVectorNode : public LoadNode {
public:
LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt)
: LoadNode(c, mem, adr, at, vt, MemNode::unordered) {
LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt, ControlDependency control_dependency = LoadNode::DependsOnlyOnTest)
: LoadNode(c, mem, adr, at, vt, MemNode::unordered, control_dependency) {
init_class_id(Class_LoadVector);
}
@ -471,7 +471,9 @@ class LoadVectorNode : public LoadNode {
virtual int store_Opcode() const { return Op_StoreVector; }
static LoadVectorNode* make(int opc, Node* ctl, Node* mem,
Node* adr, const TypePtr* atyp, uint vlen, BasicType bt);
Node* adr, const TypePtr* atyp,
uint vlen, BasicType bt,
ControlDependency control_dependency = LoadNode::DependsOnlyOnTest);
};
//------------------------------StoreVectorNode--------------------------------

View File

@ -943,22 +943,56 @@ int MethodHandles::find_MemberNames(KlassHandle k,
return rfill + overflow;
}
// Get context class for a CallSite instance: either extract existing context or use default one.
InstanceKlass* MethodHandles::get_call_site_context(oop call_site) {
// In order to extract a context the following traversal is performed:
// CallSite.context => Cleaner.referent => Class._klass => Klass
assert(java_lang_invoke_CallSite::is_instance(call_site), "");
oop context_oop = java_lang_invoke_CallSite::context_volatile(call_site);
if (oopDesc::is_null(context_oop)) {
return NULL; // The context hasn't been initialized yet.
void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
oop context = java_lang_invoke_CallSite::context(call_site);
nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
nmethodBucket* new_deps = nmethodBucket::add_dependent_nmethod(deps, nm);
if (deps != new_deps) {
java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps);
}
oop context_class_oop = java_lang_ref_Reference::referent(context_oop);
if (oopDesc::is_null(context_class_oop)) {
// The context reference was cleared by GC, so current dependency context
// isn't usable anymore. Context should be fetched from CallSite again.
return NULL;
}
void MethodHandles::remove_dependent_nmethod(oop call_site, nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
oop context = java_lang_invoke_CallSite::context(call_site);
nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
if (nmethodBucket::remove_dependent_nmethod(deps, nm)) {
nmethodBucket* new_deps = nmethodBucket::clean_dependent_nmethods(deps);
if (deps != new_deps) {
java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps);
}
}
}
void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) {
assert_lock_strong(Compile_lock);
int marked = 0;
CallSiteDepChange changes(call_site(), target());
{
MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag);
oop context = java_lang_invoke_CallSite::context(call_site());
nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context);
marked = nmethodBucket::mark_dependent_nmethods(deps, changes);
if (marked > 0) {
nmethodBucket* new_deps = nmethodBucket::clean_dependent_nmethods(deps);
if (deps != new_deps) {
java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps);
}
}
}
if (marked > 0) {
// At least one nmethod has been marked for deoptimization
VM_Deoptimize op;
VMThread::execute(&op);
}
return InstanceKlass::cast(java_lang_Class::as_Klass(context_class_oop));
}
//------------------------------------------------------------------------------
@ -1277,7 +1311,7 @@ JVM_ENTRY(void, MHN_setCallSiteTargetNormal(JNIEnv* env, jobject igcls, jobject
{
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
CodeCache::flush_dependents_on(call_site, target);
MethodHandles::flush_dependent_nmethods(call_site, target);
java_lang_invoke_CallSite::set_target(call_site(), target());
}
}
@ -1289,30 +1323,34 @@ JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobjec
{
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
CodeCache::flush_dependents_on(call_site, target);
MethodHandles::flush_dependent_nmethods(call_site, target);
java_lang_invoke_CallSite::set_target_volatile(call_site(), target());
}
}
JVM_END
JVM_ENTRY(void, MHN_invalidateDependentNMethods(JNIEnv* env, jobject igcls, jobject call_site_jh)) {
Handle call_site(THREAD, JNIHandles::resolve_non_null(call_site_jh));
JVM_ENTRY(void, MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject context_jh)) {
Handle context(THREAD, JNIHandles::resolve_non_null(context_jh));
{
// Walk all nmethods depending on this call site.
MutexLocker mu1(Compile_lock, thread);
CallSiteDepChange changes(call_site(), Handle());
InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site());
if (ctxk == NULL) {
return; // No dependencies to invalidate yet.
}
int marked = 0;
{
MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag);
marked = ctxk->mark_dependent_nmethods(changes);
nmethodBucket* b = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context());
while(b != NULL) {
nmethod* nm = b->get_nmethod();
if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization()) {
nm->mark_for_deoptimization();
marked++;
}
nmethodBucket* next = b->next();
delete b;
b = next;
}
java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context(), NULL); // reset context
}
java_lang_invoke_CallSite::set_context_volatile(call_site(), NULL); // Reset call site to initial state
if (marked > 0) {
// At least one nmethod has been marked for deoptimization
VM_Deoptimize op;
@ -1358,6 +1396,7 @@ JVM_END
#define MT JLINV"MethodType;"
#define MH JLINV"MethodHandle;"
#define MEM JLINV"MemberName;"
#define CTX JLINV"MethodHandleNatives$CallSiteContext;"
#define CC (char*) /*cast a literal from (const char*)*/
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
@ -1375,7 +1414,7 @@ static JNINativeMethod MHN_methods[] = {
{CC"objectFieldOffset", CC"("MEM")J", FN_PTR(MHN_objectFieldOffset)},
{CC"setCallSiteTargetNormal", CC"("CS""MH")V", FN_PTR(MHN_setCallSiteTargetNormal)},
{CC"setCallSiteTargetVolatile", CC"("CS""MH")V", FN_PTR(MHN_setCallSiteTargetVolatile)},
{CC"invalidateDependentNMethods", CC"("CS")V", FN_PTR(MHN_invalidateDependentNMethods)},
{CC"clearCallSiteContext", CC"("CTX")V", FN_PTR(MHN_clearCallSiteContext)},
{CC"staticFieldOffset", CC"("MEM")J", FN_PTR(MHN_staticFieldOffset)},
{CC"staticFieldBase", CC"("MEM")"OBJ, FN_PTR(MHN_staticFieldBase)},
{CC"getMemberVMInfo", CC"("MEM")"OBJ, FN_PTR(MHN_getMemberVMInfo)}

View File

@ -69,7 +69,10 @@ class MethodHandles: AllStatic {
enum { _suppress_defc = 1, _suppress_name = 2, _suppress_type = 4 };
// CallSite support
static InstanceKlass* get_call_site_context(oop call_site);
static void add_dependent_nmethod(oop call_site, nmethod* nm);
static void remove_dependent_nmethod(oop call_site, nmethod* nm);
static void flush_dependent_nmethods(Handle call_site, Handle target);
// Generate MethodHandles adapters.
static bool generate_adapters();

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8080699
* @summary eliminated arraycopy node still reachable through exception edges
* @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestDeadArrayCopyOnMemChain
*
*/
public class TestDeadArrayCopyOnMemChain {
static class A {
int f;
}
static void test_helper(Object o) {
}
static void test(int src_off, boolean flag) {
// dst is eliminated first. Eliminating dst causes src to be
// eliminated. When working on the safepoint at the uncommon
// trap in the exception handler, the eliminated ArrayCopyNode
// is reached through the exception edges.
Object[] dst = new Object[10];
Object[] src = new Object[10];
// src_off causes the exception handler to be run sometimes
try {
System.arraycopy(src, src_off, dst, 0, 10);
} catch (IndexOutOfBoundsException ioobe) {
// flag always false so test becomes uncommon trap. Make
// sure src is live at the unc.
if (flag) {
test_helper(src);
}
}
}
static public void main(String[] args) {
for (int i = 0; i < 20000; i++) {
test((i%2) == 0 ? 0 : -1, false);
}
}
}

View File

@ -24,12 +24,15 @@
/**
* @test
* @bug 8057967
* @ignore 8079205
* @run main/bootclasspath -Xbatch java.lang.invoke.CallSiteDepContextTest
* @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceClassUnloading
* -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC
* -verbose:gc java.lang.invoke.CallSiteDepContextTest
*/
package java.lang.invoke;
import java.lang.ref.*;
import java.lang.reflect.Field;
import jdk.internal.org.objectweb.asm.*;
import sun.misc.Unsafe;
@ -96,6 +99,13 @@ public class CallSiteDepContextTest {
}
}
public static void testHiddenDepField() throws Exception {
try {
Field f = MethodHandleNatives.CallSiteContext.class.getDeclaredField("vmdependencies");
throw new AssertionError("Context.dependencies field should be hidden");
} catch(NoSuchFieldException e) { /* expected */ }
}
public static void testSharedCallSite() throws Throwable {
Class<?> cls1 = UNSAFE.defineAnonymousClass(Object.class, getClassFile("CS_1"), null);
Class<?> cls2 = UNSAFE.defineAnonymousClass(Object.class, getClassFile("CS_2"), null);
@ -132,12 +142,14 @@ public class CallSiteDepContextTest {
static ReferenceQueue rq = new ReferenceQueue();
static PhantomReference ref;
public static void testGC() throws Throwable {
public static void testGC(boolean clear, boolean precompile) throws Throwable {
String id = "_" + clear + "_" + precompile;
mcs = new MutableCallSite(LOOKUP.findStatic(T.class, "f1", TYPE));
Class<?>[] cls = new Class[] {
UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_1"), null),
UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_2"), null),
UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_1" + id), null),
UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_2" + id), null),
};
MethodHandle[] mhs = new MethodHandle[] {
@ -151,30 +163,38 @@ public class CallSiteDepContextTest {
execute(1, mhs);
ref = new PhantomReference<>(cls[0], rq);
cls[0] = UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_3"), null);
cls[0] = UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_3" + id), null);
mhs[0] = LOOKUP.findStatic(cls[0], METHOD_NAME, TYPE);
do {
System.gc();
try {
Reference ref1 = rq.remove(1000);
Reference ref1 = rq.remove(100);
if (ref1 == ref) {
ref1.clear();
System.gc(); // Ensure that the stale context is cleared
break;
}
} catch(InterruptedException e) { /* ignore */ }
} while (true);
execute(1, mhs);
if (clear) {
ref.clear();
System.gc(); // Ensure that the stale context is unloaded
}
if (precompile) {
execute(1, mhs);
}
mcs.setTarget(LOOKUP.findStatic(T.class, "f2", TYPE));
execute(2, mhs);
}
public static void main(String[] args) throws Throwable {
testHiddenDepField();
testSharedCallSite();
testNonBoundCallSite();
testGC();
testGC(false, false);
testGC(false, true);
testGC( true, false);
testGC( true, true);
System.out.println("TEST PASSED");
}
}

View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8080976
* @summary Loop variant use in reduction should prevent vectorization
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestReductionWithLoopVariantUse
*
*/
public class TestReductionWithLoopVariantUse {
static int m(int[] array) {
int c = 0;
for (int i = 0; i < 256; i++) {
c += array[i];
array[i] = c;
}
return c;
}
static public void main(String[] args) {
int[] array = new int[256];
int[] array2 = new int[256];
for (int j = 0; j < 256; j++) {
array2[j] = j;
}
for (int i = 0; i < 20000; i++) {
System.arraycopy(array2, 0, array, 0, 256);
int res = m(array);
boolean success = true;
int c = 0;
for (int j = 0; j < 256; j++) {
c += array2[j];
if (array[j] != c) {
System.out.println("Failed for " + j + " : " + array[j] + " != " + c);
success = false;
}
}
if (c != res) {
System.out.println("Failed for sum: " + c + " != " + res);
}
if (!success) {
throw new RuntimeException("Test failed");
}
}
}
}

View File

@ -41,10 +41,32 @@ public class StableConfiguration {
System.out.println("Server Compiler: " + get());
}
// The method 'get' below returns true if the method is server compiled
// and is used by the Stable tests to determine whether methods in
// general are being server compiled or not as the -XX:+FoldStableValues
// option is only applicable to -server.
//
// On aarch64 we DeOptimize when patching. This means that when the
// method is compiled as a result of -Xcomp it DeOptimizes immediately.
// The result is that getMethodCompilationLevel returns 0. This means
// the method returns true based on java.vm.name.
//
// However when the tests are run with -XX:+TieredCompilation and
// -XX:TieredStopAtLevel=1 this fails because methods will always
// be client compiled.
//
// Solution is to add a simple method 'get1' which should never be
// DeOpted and use that to determine the compilation level instead.
static void get1() {
}
// ::get() is among immediately compiled methods.
static boolean get() {
try {
Method m = StableConfiguration.class.getDeclaredMethod("get");
get1();
Method m = StableConfiguration.class.getDeclaredMethod("get1");
int level = WB.getMethodCompilationLevel(m);
if (level > 0) {
return (level == 4);

View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8080156 8060036
* @summary Test correctness of type propagation to CmpUNodes.
* @run main TestTypePropagationToCmpU
*/
public class TestTypePropagationToCmpU {
public static void main(String[] args) {
try {
// Trigger compilation
for (int i = 0; i < 100_000; ++i) {
test();
}
} catch (NullPointerException e) {
// Test should never throw a NullPointerException
throw new RuntimeException("Test failed");
}
}
static int global = 42;
public static void test() {
int a = Integer.MIN_VALUE;
int b = global;
char[] buf = { 0 };
for (int i = 0; i <= b; ++i) {
a = i - b;
}
// C2 adds a range check and an uncommon trap here to ensure that the array index
// is in bounds. If type information is not propagated correctly to the corresponding
// CmpUNode, this trap may be always taken. Because C2 also removes the unnecessary
// allocation of 'buf', a NullPointerException is thrown in this case.
char c = buf[(a * 11) / 2 - a]; // a is 0 here if global >= 0
buf[0] = 0;
}
}

View File

@ -0,0 +1,103 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8077504
* @summary Unsafe load can loose control dependency and cause crash
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestUnsafeLoadControl
*
*/
import java.lang.reflect.Field;
import sun.misc.Unsafe;
public class TestUnsafeLoadControl {
private static final Unsafe UNSAFE;
static {
try {
Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
UNSAFE = (Unsafe) unsafeField.get(null);
} catch(Exception e) {
throw new RuntimeException(e);
}
}
static int val;
static void test1(int[] a, boolean[] flags, boolean flag, long j) {
for (int i = 0; i < 10; i++) {
if (flags[i]) {
if (flag) {
long address = (j << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET;
int v = UNSAFE.getInt(a, address);
val = v;
}
}
}
}
static int test2(int[] a, boolean[] flags, boolean flag, long j) {
int sum = 0;
for (int i = 0; i < 10; i++) {
if (flags[i]) {
if (flag) {
long address = (j << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET;
int v = UNSAFE.getInt(a, address);
if (v == 0) {
sum++;
}
}
}
}
return sum;
}
static public void main(String[] args) {
boolean[] flags = new boolean[10];
for (int i = 0; i < flags.length; i++) {
flags[i] = true;
}
int[] array = new int[10];
for (int i = 0; i < 20000; i++) {
test1(array, flags, true, 0);
}
for (int i = 0; i < flags.length; i++) {
flags[i] = false;
}
test1(array, flags, true, Long.MAX_VALUE/4);
for (int i = 0; i < flags.length; i++) {
flags[i] = true;
}
for (int i = 0; i < 20000; i++) {
test2(array, flags, true, 0);
}
for (int i = 0; i < flags.length; i++) {
flags[i] = false;
}
test2(array, flags, true, Long.MAX_VALUE/4);
}
}

View File

@ -308,3 +308,4 @@ f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63
6f91749b5aaef1a171ec2254163233438d1071d1 jdk9-b64
ae7406e82828fe1c245ac7507a9da5fd5b1c9529 jdk9-b65
d5963ccce28d7a3e96ee3e2dc8a8676e61699b70 jdk9-b66

View File

@ -311,3 +311,4 @@ cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62
b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63
df100399ed27d0eaa57c137ca99819a0fee66178 jdk9-b64
45ef73bb85c12ec1b291835c1d40e342a454e3f0 jdk9-b65
1232f4013417e4a9cd291096798d10f2e601d69d jdk9-b66

View File

@ -308,3 +308,4 @@ da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63
7de8d036ad0980d988d1b9b4b4e6be555d9fbf98 jdk9-b64
ed94f3e7ba6bbfec0772de6d24e39543e13f6d88 jdk9-b65
4fbcca8ab812198c7fb747ea7b213b6e404f36e9 jdk9-b66

View File

@ -0,0 +1,7 @@
0x2124 0x00b8
0x2126 0x00b7
0x2131 0x00af
0x2263 0x00ab
0x2264 0x00bb
0x2574 0x3094
0x264c 0x00b5

View File

@ -1,7 +1,7 @@
#
# mapping is based on JIS_X_0208_MS932_De/Encoder
#
# moved following entries to .nr
# copied following entries to .nr
#
# 0x224c 0xffe2
# 0x225d 0x22a5
@ -14,7 +14,7 @@
# 0x2d7b 0x2229
# 0x2d7c 0x222a
#
# and following to c2b
# and moved following to c2b
#
# 0x2124 0x00b8
# 0x2126 0x00b7
@ -144,13 +144,13 @@
0x2241 0x2229
0x224a 0x2227
0x224b 0x2228
#0x224c 0xffe2
0x224c 0xffe2
0x224d 0x21d2
0x224e 0x21d4
0x224f 0x2200
0x2250 0x2203
0x225c 0x2220
#0x225d 0x22a5
0x225d 0x22a5
0x225e 0x2312
0x225f 0x2202
0x2260 0x2207
@ -158,11 +158,11 @@
0x2262 0x2252
0x2263 0x226a
0x2264 0x226b
#0x2265 0x221a
0x2265 0x221a
0x2266 0x223d
0x2267 0x221d
0x2268 0x2235
#0x2269 0x222b
0x2269 0x222b
0x226a 0x222c
0x2272 0x212b
0x2273 0x2030
@ -620,19 +620,19 @@
0x2d6d 0x337e
0x2d6e 0x337d
0x2d6f 0x337c
#0x2d70 0x2252
#0x2d71 0x2261
0x2d70 0x2252
0x2d71 0x2261
0x2d72 0x222b
0x2d73 0x222e
0x2d74 0x2211
0x2d75 0x221a
0x2d76 0x22a5
#0x2d77 0x2220
0x2d77 0x2220
0x2d78 0x221f
0x2d79 0x22bf
#0x2d7a 0x2235
#0x2d7b 0x2229
#0x2d7c 0x222a
0x2d7a 0x2235
0x2d7b 0x2229
0x2d7c 0x222a
0x3021 0x4e9c
0x3022 0x5516
0x3023 0x5a03

View File

@ -23,7 +23,7 @@
# as the round-trip entries.
#
# b2c and c2b all have entry "0x2271 <-> 0x2116", so the
# "0x742c -> 0x2116" entry is moved to the .nr table.
# "0x742c -> 0x2116" entry is copied to the .nr table.
#
# mapping (c2b) generated from JIS_X_0212_Solaris_Encoder has
# two "dup" entries
@ -6126,7 +6126,7 @@
0x7429 0xff07
0x742a 0xff02
0x742b 0x3231
#0x742c 0x2116
0x742c 0x2116
0x742d 0x2121
0x742e 0x70bb
0x742f 0x4efc

View File

@ -0,0 +1,6 @@
#
# generate these charsets into sun.nio.cs
#
EUC_CN
EUC_KR
GBK

View File

@ -25,9 +25,9 @@
include GendataCommon.gmk
$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))
$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.jdeps.gmk))
JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml
JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml
MODULES_XML += $(TOPDIR)/modules.xml
#

View File

@ -35,11 +35,6 @@ $(eval $(call SetupLauncher,javah, \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
$(eval $(call SetupLauncher,javap, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
$(eval $(call SetupLauncher,serialver, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))

View File

@ -25,14 +25,5 @@
include LauncherCommon.gmk
$(eval $(call SetupLauncher,jdeps, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
$(eval $(call SetupLauncher,jimage,\
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.tools.jimage.Main"$(COMMA) }'))
$(eval $(call SetupLauncher,native2ascii, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))

View File

@ -1,41 +1,36 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 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.
#
# 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.
#
# @test
# @bug 4200310
# @summary make sure class files are not duplicated between rt.jar,
# charsets.jar, and localedata.jar
# @author Norbert Lindenberg
# @run shell Test4200310.sh
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/rt.jar" > class-list
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/charsets.jar" >> class-list
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/ext/localedata.jar" >> class-list
duplicates=`grep '\.class$' class-list | sort | uniq -d`
include LauncherCommon.gmk
rm -f class-list
if [ "$duplicates" != "" ]; then
echo FAILED: $duplicates are duplicated between rt.jar, charsets.jar, and localedata.jar
exit 1
fi
$(eval $(call SetupLauncher,javap, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
exit 0
$(eval $(call SetupLauncher,jdeps, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))

View File

@ -146,11 +146,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBJAVA_CFLAGS), \
DISABLED_WARNINGS_gcc := type-limits format-nonliteral, \
DISABLED_WARNINGS_clang := int-conversion, \
DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
DISABLED_WARNINGS_microsoft := 4022 4267 4996, \
WARNINGS_AS_ERRORS_solstudio := false, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \

View File

@ -49,7 +49,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
$(BUILD_LIBHPROF_CFLAGS), \
CFLAGS_debug := -DHPROF_LOGGING, \
CFLAGS_windows := -D_WINSOCK_DEPRECATED_NO_WARNINGS, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \

View File

@ -1,24 +0,0 @@
." Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
."
." This code is free software; you can redistribute it and/or modify it
." under the terms of the GNU General Public License version 2 only, as
." published by the Free Software Foundation.
."
." This code is distributed in the hope that it will be useful, but WITHOUT
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
." version 2 for more details (a copy is included in the LICENSE file that
." accompanied this code).
."
." You should have received a copy of the GNU General Public License version
." 2 along with this work; if not, write to the Free Software Foundation,
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
."
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
." or visit www.oracle.com if you need additional information or have any
." questions.
."
.TH native2ascii 1 "07 May 2011"
.LP

View File

@ -1,87 +0,0 @@
'\" t
.\" 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
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This code is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" SectDesc: Internationalization Tools
.\" Title: native2ascii.1
.\"
.if n .pl 99999
.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
.SH SYNOPSIS
.sp
.nf
\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
.fi
.sp
.TP
\fIinputfile\fR
The encoded file to be converted to ASCII\&.
.TP
\fIoutputfile\fR
The converted ASCII file\&.
.SH DESCRIPTION
The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
.PP
If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
.SH OPTIONS
.TP
-reverse
.br
Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
.TP
-encoding \fIencoding_name\fR
.br
Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
.TP
-J\fIoption\fR
.br
Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
.RE
.br
'pl 8.5i
'bp

View File

@ -0,0 +1,101 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*/
/**
* This package provides methods to read files from a JAR file and to
* transform them to a more compact transfer format called Pack200.
* It also provides methods to receive the transmitted data and expand
* it into a JAR file equivalent to the original JAR file.
*
* <p>
* The {@code pack} methods may be used by application developers who
* wish to deploy large JARs on the web. The {@code unpack} methods
* may be used by deployment applications such as Java Web Start and
* Java Plugin.
*
* <p>
* In typical use, the packed output should be further compressed
* using a suitable tool such as gzip or
* {@code java.util.zip.GZIPOutputStream}. The resulting file (with
* a suffix ".pack.gz") should be hosted on a HTTP/1.1 compliant
* server, which will be capable of handling "Accept-Encoding", as
* specified by the HTTP 1.1 RFC2616 specification.
*
* <p>
* <b>NOTE:</b> It is recommended that the original ".jar" file be
* hosted in addition to the ".pack.gz" file, so that older client
* implementations will continue to work reliably. (On-demand
* compression by the server is not recommended.)
*
* <p>
* When a client application requests a ".jar" file (call it
* "Large.jar"), the client will transmit the headers
* "Content-Type=application/x-java-archive" as well as
* "Accept-Encoding=pack200-gzip". This indicates to the server that
* the client application desires an version of the file encoded with
* Pack200 and further compressed with gzip.
*
* <p>
* The server implementation will typically check for the existence of
* "Large.pack.gz". If that file is available, the server will
* transmit it with the headers "Content-Encoding=pack200-gzip" and
* "Content-Type=application/x-java-archive".
*
* <p>
* If the ".pack.gz" file, is not available, then the server will
* transmit the original ".jar" with "Content-Encoding=null" and
* "Content-Type=application/x-java-archive".
*
* <p>
* A MIME type of "application/x-java-pack200" may be specified by the
* client application to indicate a ".pack" file is required.
* However, this has limited capability, and is not recommended.
*
* <h2> Package Specification</h2>
* Network Transfer Format Specification :<a href="http://jcp.org/en/jsr/detail?id=200">
* http://jcp.org/en/jsr/detail?id=200</a>
*
* <h2> Related Documentation</h2>
* For overviews, tutorials, examples, guides, and tool documentation, please
* see:
* <ul>
*
* <li>
* Jar File Specification :<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">
* http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li>
*
* <li>
* Class File Specification: Chapter 4 of
* <em>The Java&trade; Virtual Machine Specification</em>
*
* <li>
* Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt">
* http://www.ietf.org/rfc/rfc2616.txt
* </ul>
*
* <li>
* @since 1.5</li>
*/
package com.sun.java.util.jar.pack;

View File

@ -1,104 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<!--
Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
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.
-->
</head>
<body bgcolor="white">
<p>
This package provides methods to read files from a JAR file and
to transform them to a more compact transfer format called Pack200.
It also provides methods to receive the transmitted data and expand
it into a JAR file equivalent to the original JAR file.
<p>
The <tt>pack</tt> methods may be used by application developers
who wish to deploy large JARs on the web. The <tt>unpack</tt> methods may be used
by deployment applications such as Java Web Start and Java Plugin.
<p>
In typical use, the packed output should be further compressed using
a suitable tool such as gzip or <tt>java.util.zip.GZIPOutputStream</tt>.
The resulting file (with a suffix ".pack.gz") should be hosted on a HTTP/1.1
compliant server, which will be capable of handling "Accept-Encoding",
as specified by the HTTP 1.1 RFC2616 specification.
<p>
<b>NOTE:</b> It is recommended that the original ".jar" file be hosted
in addition to the ".pack.gz" file, so that older client implementations
will continue to work reliably.
(On-demand compression by the server is not recommended.)
<p>
When a client application requests a ".jar" file (call it "Large.jar"),
the client will transmit the headers
"Content-Type=application/x-java-archive" as well as "Accept-Encoding=pack200-gzip".
This indicates to the server that the client application desires an version
of the file encoded with Pack200 and further compressed with gzip.
<p>
The server implementation will typically check for the existence of "Large.pack.gz".
If that file is available, the server will transmit it with the headers
"Content-Encoding=pack200-gzip" and "Content-Type=application/x-java-archive".
<p>
If the ".pack.gz" file, is not available, then the server will transmit
the original ".jar"
with "Content-Encoding=null" and "Content-Type=application/x-java-archive".
<p>
A MIME type of "application/x-java-pack200" may be specified by the
client application to indicate a ".pack" file is required.
However, this has limited capability, and is not recommended.
<h2> Package Specification</h2>
Network Transfer Format Specification :<a href="http://jcp.org/en/jsr/detail?id=200">
http://jcp.org/en/jsr/detail?id=200</a>
<h2> Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please
see:
<ul>
<li>
Jar File Specification :<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li>
<li>
Class File Specification: Chapter 4 of
<em>The Java&trade; Virtual Machine Specification</em>
<li>
Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt">
http://www.ietf.org/rfc/rfc2616.txt
</ul>
<li>
@since 1.5</li>
<br><!-- Put @see and @since tags down here. -->
</body>
</html>

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 1999, 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.
*/
/**
* Provides classes related to creating and configuring secure socket
* factories. These classes are used with the Sun reference
* implementation of the Java Secure Socket Extension (JSSE).
*/
package com.sun.net.ssl;

View File

@ -1,56 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
Copyright (c) 1999, 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.
-->
</head>
<body bgcolor="white">
Provides classes related to creating and configuring secure socket factories.
These classes are used with the Sun reference implementation of the Java
Secure Socket Extension (JSSE).
<!--
<h2>Package Specification</h2>
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
</ul>
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
</ul>
-->
</body>
</html>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,34 +23,27 @@
* questions.
*/
package jdk.nashorn.internal.runtime;
import jdk.nashorn.api.scripting.JSObject;
/**
* A ListAdapter that can wraps a JSObject.
* Provides for system input and output through data streams,
* serialization and the file system.
*
* Unless otherwise noted, passing a null argument to a constructor or
* method in any class or interface in this package will cause a
* {@code NullPointerException} to be thrown.
*
* <h2>Package Specification</h2>
* <ul>
* <li><a href="../../../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
* </ul>
*
* <h2>Related Documentation</h2>
*
* For overviews, tutorials, examples, guides, and tool documentation,
* please see:
* <ul>
* <li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
* </ul>
*
* @since 1.0
*/
public final class JSObjectListAdapter extends ListAdapter {
/**
* Creates a new list wrapper for the specified JSObject.
* @param obj JSOcript the object to wrap
*/
public JSObjectListAdapter(final JSObject obj) {
super(obj);
}
@Override
public int size() {
return JSType.toInt32(((JSObject)obj).getMember("length"));
}
@Override
protected Object getAt(final int index) {
return ((JSObject)obj).getSlot(index);
}
@Override
protected void setAt(final int index, final Object element) {
((JSObject)obj).setSlot(index, element);
}
}
package java.io;

View File

@ -1,52 +0,0 @@
<!--
Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation. 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.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<body bgcolor="white">
Provides for system input and output through data streams,
serialization and the file system.
Unless otherwise noted, passing a null argument to a constructor
or method in any class or interface in this package will cause a
<tt>NullPointerException</tt> to be thrown.
<h2>Package Specification</h2>
<ul>
<li><a href="../../../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
</ul>
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation,
please see:
<ul>
<li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
</ul>
@since 1.0
</body>
</html>

View File

@ -0,0 +1,140 @@
/*
* Copyright (c) 1998, 2003, 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.
*/
/**
* Provides reference-object classes, which support a limited degree
* of interaction with the garbage collector. A program may use a
* reference object to maintain a reference to some other object in
* such a way that the latter object may still be reclaimed by the
* collector. A program may also arrange to be notified some time
* after the collector has determined that the reachability of a given
* object has changed.
*
*<h2>Package Specification</h2>
*
* A <em>reference object</em> encapsulates a reference to some other
* object so that the reference itself may be examined and manipulated
* like any other object. Three types of reference objects are
* provided, each weaker than the last: <em>soft</em>, <em>weak</em>,
* and <em>phantom</em>. Each type corresponds to a different level
* of reachability, as defined below. Soft references are for
* implementing memory-sensitive caches, weak references are for
* implementing canonicalizing mappings that do not prevent their keys
* (or values) from being reclaimed, and phantom references are for
* scheduling pre-mortem cleanup actions in a more flexible way than
* is possible with the Java finalization mechanism.
*
* <p> Each reference-object type is implemented by a subclass of the
* abstract base {@link java.lang.ref.Reference} class.
* An instance of one of these subclasses encapsulates a single
* reference to a particular object, called the <em>referent</em>.
* Every reference object provides methods for getting and clearing
* the reference. Aside from the clearing operation reference objects
* are otherwise immutable, so no {@code set} operation is
* provided. A program may further subclass these subclasses, adding
* whatever fields and methods are required for its purposes, or it
* may use these subclasses without change.
*
* <h3>Notification</h3>
*
* A program may request to be notified of changes in an object's
* reachability by <em>registering</em> an appropriate reference
* object with a <em>reference queue</em> at the time the reference
* object is created. Some time after the garbage collector
* determines that the reachability of the referent has changed to the
* value corresponding to the type of the reference, it will add the
* reference to the associated queue. At this point, the reference is
* considered to be <em>enqueued</em>. The program may remove
* references from a queue either by polling or by blocking until a
* reference becomes available. Reference queues are implemented by
* the {@link java.lang.ref.ReferenceQueue} class.
*
* <p> The relationship between a registered reference object and its
* queue is one-sided. That is, a queue does not keep track of the
* references that are registered with it. If a registered reference
* becomes unreachable itself, then it will never be enqueued. It is
* the responsibility of the program using reference objects to ensure
* that the objects remain reachable for as long as the program is
* interested in their referents.
*
* <p> While some programs will choose to dedicate a thread to
* removing reference objects from one or more queues and processing
* them, this is by no means necessary. A tactic that often works
* well is to examine a reference queue in the course of performing
* some other fairly-frequent action. For example, a hashtable that
* uses weak references to implement weak keys could poll its
* reference queue each time the table is accessed. This is how the
* {@link java.util.WeakHashMap} class works. Because
* the {@link java.lang.ref.ReferenceQueue#poll
* ReferenceQueue.poll} method simply checks an internal data
* structure, this check will add little overhead to the hashtable
* access methods.
*
* <h3>Automatically-cleared references</h3>
*
* Soft and weak references are automatically cleared by the collector
* before being added to the queues with which they are registered, if
* any. Therefore soft and weak references need not be registered
* with a queue in order to be useful, while phantom references do.
* An object that is reachable via phantom references will remain so
* until all such references are cleared or themselves become
* unreachable.
*
* <a name="reachability"></a>
* <h3>Reachability</h3>
*
* Going from strongest to weakest, the different levels of
* reachability reflect the life cycle of an object. They are
* operationally defined as follows:
*
* <ul>
*
* <li> An object is <em>strongly reachable</em> if it can be reached
* by some thread without traversing any reference objects. A
* newly-created object is strongly reachable by the thread that
* created it.
*
* <li> An object is <em>softly reachable</em> if it is not strongly
* reachable but can be reached by traversing a soft reference.
*
* <li> An object is <em>weakly reachable</em> if it is neither
* strongly nor softly reachable but can be reached by traversing a
* weak reference. When the weak references to a weakly-reachable
* object are cleared, the object becomes eligible for finalization.
*
* <li> An object is <em>phantom reachable</em> if it is neither
* strongly, softly, nor weakly reachable, it has been finalized, and
* some phantom reference refers to it.
*
* <li> Finally, an object is <em>unreachable</em>, and therefore
* eligible for reclamation, when it is not reachable in any of the
* above ways.
*
* </ul>
*
* @author Mark Reinhold
* @since 1.2
*/
package java.lang.ref;

View File

@ -1,147 +0,0 @@
<!--
Copyright (c) 1998, 2003, 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.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<body bgcolor="white">
Provides reference-object classes, which support a limited degree of
interaction with the garbage collector. A program may use a reference object
to maintain a reference to some other object in such a way that the latter
object may still be reclaimed by the collector. A program may also arrange to
be notified some time after the collector has determined that the reachability
of a given object has changed.
<h2>Package Specification</h2>
A <em>reference object</em> encapsulates a reference to some other object so
that the reference itself may be examined and manipulated like any other
object. Three types of reference objects are provided, each weaker than the
last: <em>soft</em>, <em>weak</em>, and <em>phantom</em>. Each type
corresponds to a different level of reachability, as defined below. Soft
references are for implementing memory-sensitive caches, weak references are
for implementing canonicalizing mappings that do not prevent their keys (or
values) from being reclaimed, and phantom references are for scheduling
pre-mortem cleanup actions in a more flexible way than is possible with the
Java finalization mechanism.
<p> Each reference-object type is implemented by a subclass of the abstract
base <code>{@link java.lang.ref.Reference}</code> class. An instance of one of
these subclasses encapsulates a single reference to a particular object, called
the <em>referent</em>. Every reference object provides methods for getting and
clearing the reference. Aside from the clearing operation reference objects
are otherwise immutable, so no <code>set</code> operation is provided. A
program may further subclass these subclasses, adding whatever fields and
methods are required for its purposes, or it may use these subclasses without
change.
<h3>Notification</h3>
A program may request to be notified of changes in an object's reachability by
<em>registering</em> an appropriate reference object with a <em>reference
queue</em> at the time the reference object is created. Some time after the
garbage collector determines that the reachability of the referent has changed
to the value corresponding to the type of the reference, it will add the
reference to the associated queue. At this point, the reference is considered
to be <em>enqueued</em>. The program may remove references from a queue either
by polling or by blocking until a reference becomes available. Reference
queues are implemented by the <code>{@link java.lang.ref.ReferenceQueue}</code>
class.
<p> The relationship between a registered reference object and its queue is
one-sided. That is, a queue does not keep track of the references that are
registered with it. If a registered reference becomes unreachable itself, then
it will never be enqueued. It is the responsibility of the program using
reference objects to ensure that the objects remain reachable for as long as
the program is interested in their referents.
<p> While some programs will choose to dedicate a thread to removing reference
objects from one or more queues and processing them, this is by no means
necessary. A tactic that often works well is to examine a reference queue in
the course of performing some other fairly-frequent action. For example, a
hashtable that uses weak references to implement weak keys could poll its
reference queue each time the table is accessed. This is how the <code>{@link
java.util.WeakHashMap}</code> class works. Because the <code>{@link
java.lang.ref.ReferenceQueue#poll ReferenceQueue.poll}</code> method simply
checks an internal data structure, this check will add little overhead to the
hashtable access methods.
<h3>Automatically-cleared references</h3>
Soft and weak references are automatically cleared by the collector before
being added to the queues with which they are registered, if any. Therefore
soft and weak references need not be registered with a queue in order to be
useful, while phantom references do. An object that is reachable via phantom
references will remain so until all such references are cleared or themselves
become unreachable.
<a name="reachability"></a>
<h3>Reachability</h3>
Going from strongest to weakest, the different levels of reachability reflect
the life cycle of an object. They are operationally defined as follows:
<ul>
<li> An object is <em>strongly reachable</em> if it can be reached by some
thread without traversing any reference objects. A newly-created object is
strongly reachable by the thread that created it.
<li> An object is <em>softly reachable</em> if it is not strongly reachable but
can be reached by traversing a soft reference.
<li> An object is <em>weakly reachable</em> if it is neither strongly nor
softly reachable but can be reached by traversing a weak reference. When the
weak references to a weakly-reachable object are cleared, the object becomes
eligible for finalization.
<li> An object is <em>phantom reachable</em> if it is neither strongly, softly,
nor weakly reachable, it has been finalized, and some phantom reference refers
to it.
<li> Finally, an object is <em>unreachable</em>, and therefore eligible for
reclamation, when it is not reachable in any of the above ways.
</ul>
@author Mark Reinhold
@since 1.2
<!--
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
</ul>
-->
</body>
</html>

View File

@ -5176,7 +5176,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
}
/*
* returns true if 128 bit number <hi0,lo0> is less then <hi1,lo1>
* returns true if 128 bit number <hi0,lo0> is less than <hi1,lo1>
* hi0 & hi1 should be non-negative
*/
private static boolean longLongCompareMagnitude(long hi0, long lo0, long hi1, long lo1) {

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2000, 2009, 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.
*/
/**
* Service-provider classes for the {@link java.nio.channels}
* package.
*
* <p> Only developers who are defining new selector providers or
* asynchronous channel providers should need to make direct use of
* this package. </p>
*
* <p> Unless otherwise noted, passing a {@code null} argument to a
* constructor or method in any class or interface in this package
* will cause a {@link java.lang.NullPointerException
* NullPointerException} to be thrown.
*
*
* @since 1.4
* @author Mark Reinhold
* @author JSR-51 Expert Group
*/
package java.nio.channels.spi;

View File

@ -1,45 +0,0 @@
<!--
Copyright (c) 2000, 2009, 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.
-->
<!doctype html public "-//IETF//DTD HTML//EN">
<html>
<body bgcolor="white">
Service-provider classes for the <tt>{@link java.nio.channels}</tt> package.
<p> Only developers who are defining new selector providers or asynchronous
channel providers should need to make direct use of this package. </p>
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
or method in any class or interface in this package will cause a {@link
java.lang.NullPointerException NullPointerException} to be thrown.
@since 1.4
@author Mark Reinhold
@author JSR-51 Expert Group
</body>
</html>

View File

@ -30,6 +30,7 @@ import java.nio.CharBuffer;
import java.nio.charset.spi.CharsetProvider;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@ -336,12 +337,10 @@ public abstract class Charset
//
private static Iterator<CharsetProvider> providers() {
return new Iterator<>() {
ClassLoader cl = ClassLoader.getSystemClassLoader();
ServiceLoader<CharsetProvider> sl =
ServiceLoader.load(CharsetProvider.class, cl);
Iterator<CharsetProvider> i = sl.iterator();
CharsetProvider next = null;
private boolean getNext() {
@ -424,32 +423,36 @@ public abstract class Charset
/* The extended set of charsets */
private static class ExtendedProviderHolder {
static final CharsetProvider extendedProvider = extendedProvider();
static final CharsetProvider[] extendedProviders = extendedProviders();
// returns ExtendedProvider, if installed
private static CharsetProvider extendedProvider() {
return AccessController.doPrivileged(
new PrivilegedAction<>() {
public CharsetProvider run() {
try {
Class<?> epc
= Class.forName("sun.nio.cs.ext.ExtendedCharsets");
return (CharsetProvider)epc.newInstance();
} catch (ClassNotFoundException x) {
// Extended charsets not available
// (charsets.jar not present)
} catch (InstantiationException |
IllegalAccessException x) {
throw new Error(x);
}
return null;
private static CharsetProvider[] extendedProviders() {
return AccessController.doPrivileged(new PrivilegedAction<>() {
public CharsetProvider[] run() {
CharsetProvider[] cps = new CharsetProvider[1];
int n = 0;
ServiceLoader<CharsetProvider> sl =
ServiceLoader.loadInstalled(CharsetProvider.class);
for (CharsetProvider cp : sl) {
if (n + 1 > cps.length) {
cps = Arrays.copyOf(cps, cps.length << 1);
}
});
cps[n++] = cp;
}
return n == cps.length ? cps : Arrays.copyOf(cps, n);
}});
}
}
private static Charset lookupExtendedCharset(String charsetName) {
CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
return (ecp != null) ? ecp.charsetForName(charsetName) : null;
if (!sun.misc.VM.isBooted()) // see lookupViaProviders()
return null;
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
for (CharsetProvider cp : ecps) {
Charset cs = cp.charsetForName(charsetName);
if (cs != null)
return cs;
}
return null;
}
private static Charset lookup(String charsetName) {
@ -576,9 +579,10 @@ public abstract class Charset
new TreeMap<>(
ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER);
put(standardProvider.charsets(), m);
CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
if (ecp != null)
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
for (CharsetProvider ecp :ecps) {
put(ecp.charsets(), m);
}
for (Iterator<CharsetProvider> i = providers(); i.hasNext();) {
CharsetProvider cp = i.next();
put(cp.charsets(), m);

View File

@ -0,0 +1,90 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. 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.
*/
/**
* Defines charsets, decoders, and encoders, for translating between
* bytes and Unicode characters.
*
* <blockquote><table cellspacing=1 cellpadding=0 summary="Summary of charsets, decoders, and encoders in this package">
* <tr><th align="left">Class name</th><th align="left">Description</th></tr>
* <tr><td valign=top>{@link java.nio.charset.Charset}</td>
* <td>A named mapping between characters<br>and bytes</td></tr>
* <tr><td valign=top>{@link java.nio.charset.CharsetDecoder}</td>
* <td>Decodes bytes into characters</td></tr>
* <tr><td valign=top>{@link java.nio.charset.CharsetEncoder}&nbsp;&nbsp;</td>
* <td>Encodes characters into bytes</td></tr>
* <tr><td valign=top>{@link java.nio.charset.CoderResult}&nbsp;&nbsp;</td>
* <td>Describes coder results</td></tr>
* <tr><td valign=top>{@link java.nio.charset.CodingErrorAction}&nbsp;&nbsp;</td>
* <td>Describes actions to take when<br>coding errors are detected</td></tr>
*
* </table></blockquote>
*
* <p> A <i>charset</i> is named mapping between sequences of
* sixteen-bit Unicode characters and sequences of bytes, in the sense
* defined in <a
* href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC&nbsp;2278</i></a>.
* A <i>decoder</i> is an engine which transforms bytes in a specific
* charset into characters, and an <i>encoder</i> is an engine which
* transforms characters into bytes. Encoders and decoders operate on
* byte and character buffers. They are collectively referred to as
* <i>coders</i>.
*
* <p> The {@link java.nio.charset.Charset} class defines methods for
* creating coders for a given charset and for retrieving the various
* names associated with a charset. It also defines static methods
* for testing whether a particular charset is supported, for locating
* charset instances by name, and for constructing a map that contains
* every charset for which support is available in the current Java
* virtual machine.
*
* <p> Most users will not use these classes directly; instead they
* will use the existing charset-related constructors and methods in
* the {@link java.lang.String} class, together with the existing
* {@link java.io.InputStreamReader} and {@link
* java.io.OutputStreamWriter} classes, all of whose implementations
* have been reworked to make use of the charset facilities defined in
* this package. A small number of changes have been made to the
* {@link java.io.InputStreamReader} and {@link
* java.io.OutputStreamWriter} classes in order to allow explicit
* charset objects to be specified in the construction of instances of
* those classes.
*
* <p> Support for new charsets can be made available via the
* interface defined in the {@link
* java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
* java.nio.charset.spi}</tt> package.
*
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
* constructor or method in any class or interface in this package
* will cause a {@link java.lang.NullPointerException
* NullPointerException} to be thrown.
*
*
* @since 1.4
* @author Mark Reinhold
* @author JSR-51 Expert Group
*/
package java.nio.charset;

View File

@ -1,88 +0,0 @@
<!--
Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation. 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.
-->
<!doctype html public "-//IETF//DTD HTML//EN">
<html>
<body bgcolor="white">
Defines charsets, decoders, and encoders, for translating between bytes and
Unicode characters.
<blockquote><table cellspacing=1 cellpadding=0 summary="Summary of charsets, decoders, and encoders in this package">
<tr><th><p align="left">Class name</p></th><th><p align="left">Description</p></th></tr>
<tr><td valign=top><tt>{@link java.nio.charset.Charset}</tt></td>
<td>A named mapping between characters<br>and bytes</td></tr>
<tr><td valign=top><tt>{@link java.nio.charset.CharsetDecoder}</tt></td>
<td>Decodes bytes into characters</td></tr>
<tr><td valign=top><tt>{@link java.nio.charset.CharsetEncoder}&nbsp;&nbsp;</tt></td>
<td>Encodes characters into bytes</td></tr>
<tr><td valign=top><tt>{@link java.nio.charset.CoderResult}&nbsp;&nbsp;</tt></td>
<td>Describes coder results</td></tr>
<tr><td valign=top><tt>{@link java.nio.charset.CodingErrorAction}&nbsp;&nbsp;</tt></td>
<td>Describes actions to take when<br>coding errors are detected</td></tr>
</table></blockquote>
<p> A <i>charset</i> is named mapping between sequences of sixteen-bit Unicode
characters and sequences of bytes, in the sense defined in <a
href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC&nbsp;2278</i></a>. A
<i>decoder</i> is an engine which transforms bytes in a specific charset into
characters, and an <i>encoder</i> is an engine which transforms characters into
bytes. Encoders and decoders operate on byte and character buffers. They are
collectively referred to as <i>coders</i>.
<p> The {@link java.nio.charset.Charset} class defines methods for creating
coders for a given charset and for retrieving the various names associated with
a charset. It also defines static methods for testing whether a particular
charset is supported, for locating charset instances by name, and for
constructing a map that contains every charset for which support is available
in the current Java virtual machine.
<p> Most users will not use these classes directly; instead they will use the
existing charset-related constructors and methods in the {@link
java.lang.String} class, together with the existing {@link
java.io.InputStreamReader} and {@link java.io.OutputStreamWriter} classes, all
of whose implementations have been reworked to make use of the charset
facilities defined in this package. A small number of changes have been made
to the {@link java.io.InputStreamReader} and {@link java.io.OutputStreamWriter}
classes in order to allow explicit charset objects to be specified in the
construction of instances of those classes.
<p> Support for new charsets can be made available via the interface defined in
the {@link java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
java.nio.charset.spi}</tt> package.
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
or method in any class or interface in this package will cause a {@link
java.lang.NullPointerException NullPointerException} to be thrown.
@since 1.4
@author Mark Reinhold
@author JSR-51 Expert Group
</body>
</html>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2005, 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
@ -23,21 +23,19 @@
* questions.
*/
package sun.tools.native2ascii.resources;
import java.util.ListResourceBundle;
public class MsgNative2ascii extends ListResourceBundle {
public Object[][] getContents() {
Object[][] temp = new Object[][] {
{"err.bad.arg", "-encoding requires argument"},
{"err.cannot.read", "{0} could not be read."},
{"err.cannot.write", "{0} could not be written."},
{"usage", "Usage: native2ascii" +
" [-reverse] [-encoding encoding] [inputfile [outputfile]]"},
};
return temp;
}
}
/**
* Service-provider classes for the {@link java.nio.charset} package.
*
* <p> Only developers who are defining new charsets should need to
* make direct use of this package. </p>
*
* <p> Unless otherwise noted, passing a {@code null} argument to a
* constructor or method in any class or interface in this package
* will cause a {@link java.lang.NullPointerException
* NullPointerException} to be thrown.
*
* @since 1.4
* @author Mark Reinhold
* @author JSR-51 Expert Group
*/
package java.nio.charset.spi;

View File

@ -1,45 +0,0 @@
<!--
Copyright (c) 2001, 2005, 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.
-->
<!doctype html public "-//IETF//DTD HTML//EN">
<html>
<body bgcolor="white">
Service-provider classes for the <tt>{@link java.nio.charset}</tt> package.
<p> Only developers who are defining new charsets should need to make direct
use of this package. </p>
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
or method in any class or interface in this package will cause a {@link
java.lang.NullPointerException NullPointerException} to be thrown.
@since 1.4
@author Mark Reinhold
@author JSR-51 Expert Group
</body>
</html>

View File

@ -0,0 +1,141 @@
/*
* 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
* 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.
*/
/**
* Defines buffers, which are containers for data, and provides an
* overview of the other NIO packages.
*
*
* <p> The central abstractions of the NIO APIs are: </p>
*
* <ul>
*
* <li><p> <a href="#buffers"><i>Buffers</i></a>, which are containers for data;
* </p></li>
*
* <li><p> <a
* href="charset/package-summary.html"><i>Charsets</i></a> and their
* associated <i>decoders</i> and <i>encoders</i>, <br> which
* translate between bytes and Unicode characters; </p></li>
*
* <li><p> <a
* href="channels/package-summary.html"><i>Channels</i></a> of
* various types, which represent connections <br> to entities
* capable of performing I/O operations; and </p></li>
*
* <li><p> <i>Selectors</i> and <i>selection keys</i>, which
* together with <br> <i>selectable channels</i> define a <a
* href="channels/package-summary.html#multiplex">multiplexed,
* non-blocking <br> I/O</a>&nbsp;facility. </p></li>
*
* </ul>
*
* <p> The <tt>java.nio</tt> package defines the buffer classes, which
* are used throughout the NIO APIs. The charset API is defined in
* the {@link java.nio.charset} package, and the channel and selector
* APIs are defined in the {@link java.nio.channels} package. Each of
* these subpackages has its own service-provider (SPI) subpackage,
* the contents of which can be used to extend the platform's default
* implementations or to construct alternative implementations.
*
* <a name="buffers"> </a>
*
* <blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
* <tr><th align="left">Buffers</th><th align="left">Description</th></tr>
* <tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
* <td>Position, limit, and capacity;
* <br>clear, flip, rewind, and mark/reset</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ByteBuffer}</tt></td>
* <td>Get/put, compact, views; allocate,&nbsp;wrap</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</tt></td>
* <td>A byte buffer mapped to a file</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.CharBuffer}</tt></td>
* <td>Get/put, compact; allocate,&nbsp;wrap</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.DoubleBuffer}</tt></td>
* <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.FloatBuffer}</tt></td>
* <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.IntBuffer}</tt></td>
* <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.LongBuffer}</tt></td>
* <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
* <tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ShortBuffer}</tt></td>
* <td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
* <tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
* <td>Typesafe enumeration for&nbsp;byte&nbsp;orders</td></tr>
* </table></blockquote>
*
* <p> A <i>buffer</i> is a container for a fixed amount of data of a
* specific primitive type. In addition to its content a buffer has a
* <i>position</i>, which is the index of the next element to be read
* or written, and a <i>limit</i>, which is the index of the first
* element that should not be read or written. The base {@link
* java.nio.Buffer} class defines these properties as well as methods
* for <i>clearing</i>, <i>flipping</i>, and <i>rewinding</i>, for
* <i>marking</i> the current position, and for <i>resetting</i> the
* position to the previous mark.
*
* <p> There is a buffer class for each non-boolean primitive type.
* Each class defines a family of <i>get</i> and <i>put</i> methods
* for moving data out of and in to a buffer, methods for
* <i>compacting</i>, <i>duplicating</i>, and <i>slicing</i> a buffer,
* and static methods for <i>allocating</i> a new buffer as well as
* for <i>wrapping</i> an existing array into a buffer.
*
* <p> Byte buffers are distinguished in that they can be used as the
* sources and targets of I/O operations. They also support several
* features not found in the other buffer classes:
*
* <ul>
*
* <li><p> A byte buffer can be allocated as a <a
* href="ByteBuffer.html#direct"> <i>direct</i></a> buffer, in which
* case the Java virtual machine will make a best effort to perform
* native I/O operations directly upon it. </p></li>
*
* <li><p> A byte buffer can be created by {@link
* java.nio.channels.FileChannel#map <i>mapping</i>} a region of a
* file directly into memory, in which case a few additional
* file-related operations defined in the {@link
* java.nio.MappedByteBuffer} class are available. </p></li>
*
* <li><p> A byte buffer provides access to its content as either a
* heterogeneous or homogeneous sequence of <a
* href="ByteBuffer.html#bin"><i>binary data</i></a> of any
* non-boolean primitive type, in either big-endian or little-endian
* <a href="ByteOrder.html">byte order</a>. </p></li>
*
* </ul>
*
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
* constructor or method in any class or interface in this package
* will cause a {@link java.lang.NullPointerException
* NullPointerException} to be thrown.
*
* @since 1.4
* @author Mark Reinhold
* @author JSR-51 Expert Group
*/
package java.nio;

View File

@ -1,139 +0,0 @@
<!--
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
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.
-->
<!doctype html public "-//IETF//DTD HTML//EN">
<html>
<body bgcolor="white">
Defines buffers, which are containers for data, and provides an overview of the
other NIO packages.
<p> The central abstractions of the NIO APIs are: </p>
<ul>
<li><p> <a href="#buffers"><i>Buffers</i></a>, which are containers for data;
</p></li>
<li><p> <a href="charset/package-summary.html"><i>Charsets</i></a> and their
associated <i>decoders</i> and <i>encoders</i>, <br> which translate between
bytes and Unicode characters; </p></li>
<li><p> <a href="channels/package-summary.html"><i>Channels</i></a> of
various types, which represent connections <br> to entities capable of
performing I/O operations; and </p></li>
<li><p> <i>Selectors</i> and <i>selection keys</i>, which together with <br>
<i>selectable channels</i> define a <a
href="channels/package-summary.html#multiplex">multiplexed, non-blocking <br>
I/O</a>&nbsp;facility. </p></li>
</ul>
<p> The <tt>java.nio</tt> package defines the buffer classes, which are used
throughout the NIO APIs. The charset API is defined in the {@link
java.nio.charset} package, and the channel and selector APIs are defined in the
{@link java.nio.channels} package. Each of these subpackages has its own
service-provider (SPI) subpackage, the contents of which can be used to extend
the platform's default implementations or to construct alternative
implementations.
<a name="buffers"> </a>
<blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
<tr><th><p align="left">Buffers</p></th><th><p align="left">Description</p></th></tr>
<tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
<td>Position, limit, and capacity;
<br>clear, flip, rewind, and mark/reset</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ByteBuffer}</tt></td>
<td>Get/put, compact, views; allocate,&nbsp;wrap</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;&nbsp;&nbsp;{@link java.nio.MappedByteBuffer}&nbsp;&nbsp;</tt></td>
<td>A byte buffer mapped to a file</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.CharBuffer}</tt></td>
<td>Get/put, compact; allocate,&nbsp;wrap</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.DoubleBuffer}</tt></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.FloatBuffer}</tt></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.IntBuffer}</tt></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.LongBuffer}</tt></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
<tr><td valign=top><tt>&nbsp;&nbsp;{@link java.nio.ShortBuffer}</tt></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;'&nbsp;'</td></tr>
<tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
<td>Typesafe enumeration for&nbsp;byte&nbsp;orders</td></tr>
</table></blockquote>
<p> A <i>buffer</i> is a container for a fixed amount of data of a specific
primitive type. In addition to its content a buffer has a <i>position</i>,
which is the index of the next element to be read or written, and a
<i>limit</i>, which is the index of the first element that should not be read
or written. The base {@link java.nio.Buffer} class defines these properties as
well as methods for <i>clearing</i>, <i>flipping</i>, and <i>rewinding</i>, for
<i>marking</i> the current position, and for <i>resetting</i> the position to
the previous mark.
<p> There is a buffer class for each non-boolean primitive type. Each class
defines a family of <i>get</i> and <i>put</i> methods for moving data out of
and in to a buffer, methods for <i>compacting</i>, <i>duplicating</i>, and
<i>slicing</i> a buffer, and static methods for <i>allocating</i> a new buffer
as well as for <i>wrapping</i> an existing array into a buffer.
<p> Byte buffers are distinguished in that they can be used as the sources and
targets of I/O operations. They also support several features not found in the
other buffer classes:
<ul>
<li><p> A byte buffer can be allocated as a <a href="ByteBuffer.html#direct">
<i>direct</i></a> buffer, in which case the Java virtual machine will make a
best effort to perform native I/O operations directly upon it. </p></li>
<li><p> A byte buffer can be created by {@link
java.nio.channels.FileChannel#map <i>mapping</i>} a region of a
file directly into memory, in which case a few additional file-related
operations defined in the {@link java.nio.MappedByteBuffer} class are
available. </p></li>
<li><p> A byte buffer provides access to its content as either a heterogeneous
or homogeneous sequence of <a href="ByteBuffer.html#bin"><i>binary data</i></a>
of any non-boolean primitive type, in either big-endian or little-endian <a
href="ByteOrder.html">byte order</a>. </p></li>
</ul>
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
or method in any class or interface in this package will cause a {@link
java.lang.NullPointerException NullPointerException} to be thrown.
@since 1.4
@author Mark Reinhold
@author JSR-51 Expert Group
</body>
</html>

View File

@ -332,7 +332,7 @@ public class AttributedString {
* @param beginIndex Index of the first character of the range.
* @param endIndex Index of the character following the last character of the range.
* @exception NullPointerException if <code>attribute</code> is null.
* @exception IllegalArgumentException if beginIndex is less then 0, endIndex is
* @exception IllegalArgumentException if beginIndex is less than 0, endIndex is
* greater than the length of the string, or beginIndex and endIndex together don't
* define a non-empty subrange of the string.
*/
@ -357,7 +357,7 @@ public class AttributedString {
* @param endIndex Index of the character following the last
* character of the range.
* @exception NullPointerException if <code>attributes</code> is null.
* @exception IllegalArgumentException if beginIndex is less then
* @exception IllegalArgumentException if beginIndex is less than
* 0, endIndex is greater than the length of the string, or
* beginIndex and endIndex together don't define a non-empty
* subrange of the string and the attributes parameter is not an
@ -580,7 +580,7 @@ public class AttributedString {
* @param beginIndex the index of the first character
* @param endIndex the index of the character following the last character
* @return an iterator providing access to the text and its attributes
* @exception IllegalArgumentException if beginIndex is less then 0,
* @exception IllegalArgumentException if beginIndex is less than 0,
* endIndex is greater than the length of the string, or beginIndex is
* greater than endIndex.
*/

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 1998, 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.
*/
/**
* Provides classes and interfaces for handling text, dates, numbers,
* and messages in a manner independent of natural languages. This
* means your main application or applet can be written to be
* language-independent, and it can rely upon separate,
* dynamically-linked localized resources. This allows the flexibility
* of adding localizations for new localizations at any time.
*
* <p>These classes are capable of formatting dates, numbers, and
* messages, parsing; searching and sorting strings; and iterating
* over characters, words, sentences, and line breaks. This package
* contains three main groups of classes and interfaces:
*
* <ul>
* <li>Classes for iteration over text
* <li>Classes for formatting and parsing
* <li>Classes for string collation
* </ul>
*
* @since 1.1
*/
package java.text;

View File

@ -1,65 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
Copyright (c) 1998, 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.
-->
</head>
<body bgcolor="white">
Provides classes and interfaces for handling text, dates, numbers, and messages
in a manner independent of natural languages. This means your main application
or applet can be written to be language-independent, and it can rely upon
separate, dynamically-linked localized resources. This allows the flexibility
of adding localizations for new localizations at any time.
<p>
These classes are capable of formatting dates, numbers, and messages, parsing;
searching and sorting strings; and iterating over characters, words, sentences,
and line breaks. This package contains three main groups of classes and
interfaces:
<ul>
<li>Classes for iteration over text
<li>Classes for formatting and parsing
<li>Classes for string collation
</ul>
<!--
<h2>Package Specification</h2>
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
</ul>
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
</ul>
-->
@since 1.1
</body>
</html>

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2005, 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.
*/
/**
* Service provider classes for the classes in the java.text package.
*
* @since 1.6
*/
package java.text.spi;

View File

@ -1,50 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
Copyright (c) 2005, 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.
-->
</head>
<body bgcolor="white">
Service provider classes for the classes in the java.text package.
<!--
<h2>Package Specification</h2>
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
</ul>
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
</ul>
-->
@since 1.6
</body>
</html>

View File

@ -490,6 +490,16 @@ public final class HijrahChronology extends AbstractChronology implements Serial
return yearOfEra;
}
/**
* Creates the HijrahEra object from the numeric value.
* The Hijrah calendar system has only one era covering the
* proleptic years greater than zero.
* This method returns the singleton HijrahEra for the value 1.
*
* @param eraValue the era value
* @return the calendar system era, not null
* @throws DateTimeException if unable to create the era
*/
@Override
public HijrahEra eraOf(int eraValue) {
switch (eraValue) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015, 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
@ -1333,8 +1333,8 @@ public final class DateTimeFormatter {
* If the time '23:59:60' is received, then a simple conversion is applied,
* replacing the second-of-minute of 60 with 59. This query can be used
* on the parse result to determine if the leap-second adjustment was made.
* The query will return one second of excess if it did adjust to remove
* the leap-second, and zero if not. Note that applying a leap-second
* The query will return {@code true} if it did adjust to remove the
* leap-second, and {@code false} if not. Note that applying a leap-second
* smoothing mechanism, such as UTC-SLS, is the responsibility of the
* application, as follows:
* <pre>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015, 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
@ -120,9 +120,10 @@
*
* <h3>Duration and Period</h3>
* <p>
* Beyond dates and times, the API also allows the storage of period and durations of time.
* Beyond dates and times, the API also allows the storage of periods and durations of time.
* A {@link java.time.Duration} is a simple measure of time along the time-line in nanoseconds.
* A {@link java.time.Period} expresses an amount of time in units meaningful to humans, such as years or hours.
* A {@link java.time.Period} expresses an amount of time in units meaningful
* to humans, such as years or days.
* </p>
*
* <h3>Additional value types</h3>

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