diff --git a/make/scripts/pandoc-html-manpage-filter.js b/make/scripts/pandoc-html-manpage-filter.js index be63535d910..a7c671a078c 100644 --- a/make/scripts/pandoc-html-manpage-filter.js +++ b/make/scripts/pandoc-html-manpage-filter.js @@ -86,7 +86,7 @@ function MetaInlines(value) { function change_title(type, value) { if (type === 'MetaInlines') { if (value[0].t === 'Str') { - var match = value[0].c.match(/^([A-Z]+)\([0-9]+\)$/); + var match = value[0].c.match(/^([A-Z0-9]+)\([0-9]+\)$/); if (match) { return MetaInlines([ Str("The"), Space(), diff --git a/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp index bd0415e63eb..ea042837816 100644 --- a/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/gc/z/zArguments_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, 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 @@ -28,6 +28,7 @@ #include "utilities/debug.hpp" void ZArguments::initialize_platform() { +#ifdef COMPILER2 // The C2 barrier slow path expects vector registers to be least // 16 bytes wide, which is the minimum width available on all // x86-64 systems. However, the user could have speficied a lower @@ -37,4 +38,5 @@ void ZArguments::initialize_platform() { warning("ZGC requires MaxVectorSize to be at least 16"); FLAG_SET_DEFAULT(MaxVectorSize, 16); } +#endif } diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index 4d0310c83ff..174042a780c 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -1787,14 +1787,17 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) { assert(k != NULL, "just checking"); assert_locked_or_safepoint(Compile_lock); - // Link into hierachy. Make sure the vtables are initialized before linking into + k->set_init_state(InstanceKlass::loaded); + // make sure init_state store is already done. + // The compiler reads the hierarchy outside of the Compile_lock. + // Access ordering is used to add to hierarchy. + + // Link into hierachy. k->append_to_sibling_list(); // add to superklass/sibling list k->process_interfaces(THREAD); // handle all "implements" declarations - k->set_init_state(InstanceKlass::loaded); + // Now flush all code that depended on old class hierarchy. // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) - // Also, first reinitialize vtable because it may have gotten out of synch - // while the new class wasn't connected to the class hierarchy. CodeCache::flush_dependents_on(k); } diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp index f1d0d0e09f1..c621bc0d911 100644 --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -189,6 +189,15 @@ LoadBarrierNode::LoadBarrierNode(Compile* C, bs->register_potential_barrier_node(this); } +uint LoadBarrierNode::size_of() const { + return sizeof(*this); +} + +uint LoadBarrierNode::cmp(const Node& n) const { + ShouldNotReachHere(); + return 0; +} + const Type *LoadBarrierNode::bottom_type() const { const Type** floadbarrier = (const Type **)(Compile::current()->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*))); Node* in_oop = in(Oop); @@ -198,6 +207,11 @@ const Type *LoadBarrierNode::bottom_type() const { return TypeTuple::make(Number_of_Outputs, floadbarrier); } +const TypePtr* LoadBarrierNode::adr_type() const { + ShouldNotReachHere(); + return NULL; +} + const Type *LoadBarrierNode::Value(PhaseGVN *phase) const { const Type** floadbarrier = (const Type **)(phase->C->type_arena()->Amalloc_4((Number_of_Outputs)*sizeof(Type*))); const Type* val_t = phase->type(in(Oop)); @@ -441,6 +455,11 @@ Node *LoadBarrierNode::Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } +uint LoadBarrierNode::match_edge(uint idx) const { + ShouldNotReachHere(); + return 0; +} + void LoadBarrierNode::fix_similar_in_uses(PhaseIterGVN* igvn) { Node* out_res = proj_out_or_null(Oop); if (out_res == NULL) { @@ -1151,7 +1170,7 @@ static bool split_barrier_thru_phi(PhaseIdealLoop* phase, LoadBarrierNode* lb) { if (lb->in(LoadBarrierNode::Oop)->is_Phi()) { Node* oop_phi = lb->in(LoadBarrierNode::Oop); - if (oop_phi->in(2) == oop_phi) { + if ((oop_phi->req() != 3) || (oop_phi->in(2) == oop_phi)) { // Ignore phis with only one input return false; } diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp index 48ef8768e59..8c14c4d2b34 100644 --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -62,10 +62,14 @@ public: bool oop_reload_allowed); virtual int Opcode() const; + virtual uint size_of() const; + virtual uint cmp(const Node& n) const; virtual const Type *bottom_type() const; + virtual const TypePtr* adr_type() const; virtual const Type *Value(PhaseGVN *phase) const; virtual Node *Identity(PhaseGVN *phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual uint match_edge(uint idx) const; LoadBarrierNode* has_dominating_barrier(PhaseIdealLoop* phase, bool linear_only, diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index eb6e9d1e97e..832cddc4183 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -3654,14 +3654,14 @@ void JNIid::verify(Klass* holder) { } } -#ifdef ASSERT void InstanceKlass::set_init_state(ClassState state) { +#ifdef ASSERT bool good_state = is_shared() ? (_init_state <= state) : (_init_state < state); assert(good_state || state == allocated, "illegal state transition"); +#endif _init_state = (u1)state; } -#endif #if INCLUDE_JVMTI diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index 5b8ebd763e5..9b89d29e971 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1243,11 +1243,7 @@ public: private: // initialization state -#ifdef ASSERT void set_init_state(ClassState state); -#else - void set_init_state(ClassState state) { _init_state = (u1)state; } -#endif void set_rewritten() { _misc_flags |= _misc_rewritten; } void set_init_thread(Thread *thread) { _init_thread = thread; } diff --git a/src/hotspot/share/opto/callnode.cpp b/src/hotspot/share/opto/callnode.cpp index 2dc17afa06e..e2b0f5c8b20 100644 --- a/src/hotspot/share/opto/callnode.cpp +++ b/src/hotspot/share/opto/callnode.cpp @@ -1271,6 +1271,14 @@ uint SafePointNode::match_edge(uint idx) const { return (TypeFunc::Parms == idx); } +void SafePointNode::disconnect_from_root(PhaseIterGVN *igvn) { + assert(Opcode() == Op_SafePoint, "only value for safepoint in loops"); + int nb = igvn->C->root()->find_prec_edge(this); + if (nb != -1) { + igvn->C->root()->rm_prec(nb); + } +} + //============== SafePointScalarObjectNode ============== SafePointScalarObjectNode::SafePointScalarObjectNode(const TypeOopPtr* tp, diff --git a/src/hotspot/share/opto/callnode.hpp b/src/hotspot/share/opto/callnode.hpp index 3120a13059a..01a4025d4f3 100644 --- a/src/hotspot/share/opto/callnode.hpp +++ b/src/hotspot/share/opto/callnode.hpp @@ -462,6 +462,8 @@ public: return !_replaced_nodes.is_empty(); } + void disconnect_from_root(PhaseIterGVN *igvn); + // Standard Node stuff virtual int Opcode() const; virtual bool pinned() const { return true; } diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 42dc07b3b7c..30772fa350f 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -2184,6 +2184,23 @@ bool Compile::optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode) { return true; } +// Remove edges from "root" to each SafePoint at a backward branch. +// They were inserted during parsing (see add_safepoint()) to make +// infinite loops without calls or exceptions visible to root, i.e., +// useful. +void Compile::remove_root_to_sfpts_edges() { + Node *r = root(); + if (r != NULL) { + for (uint i = r->req(); i < r->len(); ++i) { + Node *n = r->in(i); + if (n != NULL && n->is_SafePoint()) { + r->rm_prec(i); + --i; + } + } + } +} + //------------------------------Optimize--------------------------------------- // Given a graph, optimize it. void Compile::Optimize() { @@ -2244,6 +2261,10 @@ void Compile::Optimize() { if (failing()) return; } + // Now that all inlining is over, cut edge from root to loop + // safepoints + remove_root_to_sfpts_edges(); + // Remove the speculative part of types and clean up the graph from // the extra CastPP nodes whose only purpose is to carry them. Do // that early so that optimizations are not disrupted by the extra @@ -3248,8 +3269,10 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f break; } } - assert(proj != NULL, "must be found"); - p->subsume_by(proj, this); + assert(proj != NULL || p->_con == TypeFunc::I_O, "io may be dropped at an infinite loop"); + if (proj != NULL) { + p->subsume_by(proj, this); + } } } break; diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index 23b49689aca..91c9ab6445a 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -1088,6 +1088,7 @@ class Compile : public Phase { void inline_string_calls(bool parse_time); void inline_boxing_calls(PhaseIterGVN& igvn); bool optimize_loops(PhaseIterGVN& igvn, LoopOptsMode mode); + void remove_root_to_sfpts_edges(); // Matching, CFG layout, allocation, code generation PhaseCFG* cfg() { return _cfg; } diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp index d68aa4c0dee..f0f5b953725 100644 --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -37,6 +37,7 @@ #include "opto/node.hpp" #include "opto/opcodes.hpp" #include "opto/regmask.hpp" +#include "opto/rootnode.hpp" #include "opto/type.hpp" #include "utilities/copy.hpp" #include "utilities/macros.hpp" @@ -1310,6 +1311,9 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { while (nstack.size() > 0) { dead = nstack.pop(); + if (dead->Opcode() == Op_SafePoint) { + dead->as_SafePoint()->disconnect_from_root(igvn); + } if (dead->outcnt() > 0) { // Keep dead node on stack until all uses are processed. nstack.push(dead); diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 5137344e36b..55da0c7e079 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -430,20 +430,6 @@ PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN *gvn, Unique_Node_List *worklist // Disconnect 'useless' nodes that are adjacent to useful nodes C->remove_useless_nodes(_useful); - - // Remove edges from "root" to each SafePoint at a backward branch. - // They were inserted during parsing (see add_safepoint()) to make infinite - // loops without calls or exceptions visible to root, i.e., useful. - Node *root = C->root(); - if( root != NULL ) { - for( uint i = root->req(); i < root->len(); ++i ) { - Node *n = root->in(i); - if( n != NULL && n->is_SafePoint() ) { - root->rm_prec(i); - --i; - } - } - } } //============================================================================= @@ -1354,6 +1340,9 @@ void PhaseIterGVN::remove_globally_dead_node( Node *dead ) { while (_stack.is_nonempty()) { dead = _stack.node(); + if (dead->Opcode() == Op_SafePoint) { + dead->as_SafePoint()->disconnect_from_root(this); + } uint progress_state = _stack.index(); assert(dead != C->root(), "killing root, eh?"); assert(!dead->is_top(), "add check for top when pushing"); @@ -1456,6 +1445,9 @@ void PhaseIterGVN::remove_globally_dead_node( Node *dead ) { //------------------------------subsume_node----------------------------------- // Remove users from node 'old' and add them to node 'nn'. void PhaseIterGVN::subsume_node( Node *old, Node *nn ) { + if (old->Opcode() == Op_SafePoint) { + old->as_SafePoint()->disconnect_from_root(this); + } assert( old != hash_find(old), "should already been removed" ); assert( old != C->top(), "cannot subsume top node"); // Copy debug or profile information to the new version: diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index dc38268aaac..c021fcf702c 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -3793,6 +3793,7 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { #if defined(AIX) UNSUPPORTED_OPTION(AllocateHeapAt); + UNSUPPORTED_OPTION(AllocateOldGenAt); #endif #ifndef PRODUCT diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index be9f846341b..34629e86ba3 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -2868,120 +2868,13 @@ public final class String : StringUTF16.lastIndexOfNonWhitespace(value); } - /** - * Removes vertical and horizontal white space margins from around the - * essential body of a multi-line string, while preserving relative - * indentation. - *
- * This string is first conceptually separated into lines as if by - * {@link String#lines()}. - *
- * Then, the minimum indentation (min) is determined as follows. For - * each non-blank line (as defined by {@link String#isBlank()}), the - * leading {@link Character#isWhitespace(int) white space} characters are - * counted. The min value is the smallest of these counts. - *
- * For each non-blank line, min leading white space characters are - * removed. Each white space character is treated as a single character. In - * particular, the tab character {@code "\t"} (U+0009) is considered a - * single character; it is not expanded. - *
- * Leading and trailing blank lines, if any, are removed. Trailing spaces are - * preserved. - *
- * Each line is suffixed with a line feed character {@code "\n"} (U+000A). - *
- * Finally, the lines are concatenated into a single string and returned. - * - * @apiNote - * This method's primary purpose is to shift a block of lines as far as - * possible to the left, while preserving relative indentation. Lines - * that were indented the least will thus have no leading white space. - * - * Example: - *
- * - * @return string with margins removed and line terminators normalized - * - * @see String#lines() - * @see String#isBlank() - * @see String#indent(int) - * @see Character#isWhitespace(int) - * - * @since 12 - */ - public String align() { - return align(0); - } - - /** - * Removes vertical and horizontal white space margins from around the - * essential body of a multi-line string, while preserving relative - * indentation and with optional indentation adjustment. - *- * ` - * This is the first line - * This is the second line - * `.align(); - * - * returns - * This is the first line - * This is the second line - *
- * Invoking this method is equivalent to: - *
- * {@code this.align().indent(n)} - *- * - * @apiNote - * Examples: - *
- * - * @param n number of leading white space characters - * to add or remove - * - * @return string with margins removed, indentation adjusted and - * line terminators normalized - * - * @see String#align() - * - * @since 12 - */ - public String align(int n) { - if (isEmpty()) { - return ""; - } - int outdent = lines().filter(not(String::isBlank)) - .mapToInt(String::indexOfNonWhitespace) - .min() - .orElse(0); - // overflow-conscious code - int indent = n - outdent; - return indent(indent > n ? Integer.MIN_VALUE : indent, true); - } - /** * This method allows the application of a function to {@code this} * string. The function should expect a single String argument * and produce an {@code R} result. + *- * ` - * This is the first line - * This is the second line - * `.align(0); - * - * returns - * This is the first line - * This is the second line - * - * - * ` - * This is the first line - * This is the second line - * `.align(4); - * returns - * This is the first line - * This is the second line - *
+ * Any exception thrown by {@code f()} will be propagated to the
+ * caller.
*
* @param f functional interface to a apply
*
diff --git a/src/java.base/share/classes/java/lang/constant/ClassDesc.java b/src/java.base/share/classes/java/lang/constant/ClassDesc.java
index 53dd1a451ca..796756a67e8 100644
--- a/src/java.base/share/classes/java/lang/constant/ClassDesc.java
+++ b/src/java.base/share/classes/java/lang/constant/ClassDesc.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -97,7 +97,10 @@ public interface ClassDesc
*/
static ClassDesc of(String packageName, String className) {
ConstantUtils.validateBinaryClassName(requireNonNull(packageName));
- validateMemberName(requireNonNull(className));
+ if (packageName.isEmpty()) {
+ return of(className);
+ }
+ validateMemberName(requireNonNull(className), false);
return ofDescriptor(String.format("L%s%s%s;",
binaryToInternal(packageName),
(packageName.length() > 0 ? "/" : ""),
@@ -130,6 +133,9 @@ public interface ClassDesc
*/
static ClassDesc ofDescriptor(String descriptor) {
requireNonNull(descriptor);
+ if (descriptor.isEmpty()) {
+ throw new IllegalArgumentException(String.format("not a valid reference type descriptor: %s", descriptor));
+ }
int depth = ConstantUtils.arrayDepth(descriptor);
if (depth > ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS) {
throw new IllegalArgumentException(String.format("Cannot create an array type descriptor with more than %d dimensions",
@@ -192,7 +198,7 @@ public interface ClassDesc
* @throws IllegalArgumentException if the nested class name is invalid
*/
default ClassDesc nested(String nestedName) {
- validateMemberName(nestedName);
+ validateMemberName(nestedName, false);
if (!isClassOrInterface())
throw new IllegalStateException("Outer class is not a class or interface type");
return ClassDesc.ofDescriptor(String.format("%s$%s;", dropLastChar(descriptorString()), nestedName));
diff --git a/src/java.base/share/classes/java/lang/constant/ConstantUtils.java b/src/java.base/share/classes/java/lang/constant/ConstantUtils.java
index 3000029a0c4..ab63166e606 100644
--- a/src/java.base/share/classes/java/lang/constant/ConstantUtils.java
+++ b/src/java.base/share/classes/java/lang/constant/ConstantUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -65,7 +65,7 @@ class ConstantUtils {
* @return the name passed if valid
* @throws IllegalArgumentException if the member name is invalid
*/
- public static String validateMemberName(String name) {
+ public static String validateMemberName(String name, boolean method) {
requireNonNull(name);
if (name.length() == 0)
throw new IllegalArgumentException("zero-length member name");
@@ -73,7 +73,7 @@ class ConstantUtils {
char ch = name.charAt(i);
if (ch == '.' || ch == ';' || ch == '[' || ch == '/')
throw new IllegalArgumentException("Invalid member name: " + name);
- if (ch == '<' || ch == '>') {
+ if (method && (ch == '<' || ch == '>')) {
if (!pointyNames.contains(name))
throw new IllegalArgumentException("Invalid member name: " + name);
}
@@ -126,8 +126,8 @@ class ConstantUtils {
++cur; // skip '('
while (cur < end && descriptor.charAt(cur) != ')') {
- int len = matchSig(descriptor, cur, end);
- if (len == 0 || descriptor.charAt(cur) == 'V')
+ int len = skipOverFieldSignature(descriptor, cur, end, false);
+ if (len == 0)
throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
ptypes.add(descriptor.substring(cur, cur + len));
cur += len;
@@ -136,41 +136,103 @@ class ConstantUtils {
throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
++cur; // skip ')'
- int rLen = matchSig(descriptor, cur, end);
+ int rLen = skipOverFieldSignature(descriptor, cur, end, true);
if (rLen == 0 || cur + rLen != end)
throw new IllegalArgumentException("Bad method descriptor: " + descriptor);
ptypes.add(0, descriptor.substring(cur, cur + rLen));
return ptypes;
}
+ private static final char JVM_SIGNATURE_ARRAY = '[';
+ private static final char JVM_SIGNATURE_BYTE = 'B';
+ private static final char JVM_SIGNATURE_CHAR = 'C';
+ private static final char JVM_SIGNATURE_CLASS = 'L';
+ private static final char JVM_SIGNATURE_ENDCLASS = ';';
+ private static final char JVM_SIGNATURE_ENUM = 'E';
+ private static final char JVM_SIGNATURE_FLOAT = 'F';
+ private static final char JVM_SIGNATURE_DOUBLE = 'D';
+ private static final char JVM_SIGNATURE_FUNC = '(';
+ private static final char JVM_SIGNATURE_ENDFUNC = ')';
+ private static final char JVM_SIGNATURE_INT = 'I';
+ private static final char JVM_SIGNATURE_LONG = 'J';
+ private static final char JVM_SIGNATURE_SHORT = 'S';
+ private static final char JVM_SIGNATURE_VOID = 'V';
+ private static final char JVM_SIGNATURE_BOOLEAN = 'Z';
+
/**
* Validates that the characters at [start, end) within the provided string
* describe a valid field type descriptor.
- *
- * @param str the descriptor string
+ * @param descriptor the descriptor string
* @param start the starting index into the string
* @param end the ending index within the string
+ * @param voidOK is void acceptable?
* @return the length of the descriptor, or 0 if it is not a descriptor
* @throws IllegalArgumentException if the descriptor string is not valid
*/
- static int matchSig(String str, int start, int end) {
- if (start >= end || start >= str.length() || end > str.length())
- return 0;
- char c = str.charAt(start);
- if (c == 'L') {
- int endc = str.indexOf(';', start);
- int badc = str.indexOf('.', start);
- if (badc >= 0 && badc < endc)
- return 0;
- badc = str.indexOf('[', start);
- if (badc >= 0 && badc < endc)
- return 0;
- return (endc < 0) ? 0 : endc - start + 1;
- } else if (c == '[') {
- int t = matchSig(str, start+1, end);
- return (t > 0) ? t + 1 : 0;
- } else {
- return ("IJCSBFDZV".indexOf(c) >= 0) ? 1 : 0;
+ @SuppressWarnings("fallthrough")
+ static int skipOverFieldSignature(String descriptor, int start, int end, boolean voidOK) {
+ int arrayDim = 0;
+ int index = start;
+ while (index < end) {
+ switch (descriptor.charAt(index)) {
+ case JVM_SIGNATURE_VOID: if (!voidOK) { return index; }
+ case JVM_SIGNATURE_BOOLEAN:
+ case JVM_SIGNATURE_BYTE:
+ case JVM_SIGNATURE_CHAR:
+ case JVM_SIGNATURE_SHORT:
+ case JVM_SIGNATURE_INT:
+ case JVM_SIGNATURE_FLOAT:
+ case JVM_SIGNATURE_LONG:
+ case JVM_SIGNATURE_DOUBLE:
+ return index - start + 1;
+ case JVM_SIGNATURE_CLASS:
+ // Skip leading 'L' and ignore first appearance of ';'
+ index++;
+ int indexOfSemi = descriptor.indexOf(';', index);
+ if (indexOfSemi != -1) {
+ String unqualifiedName = descriptor.substring(index, indexOfSemi);
+ boolean legal = verifyUnqualifiedClassName(unqualifiedName);
+ if (!legal) {
+ return 0;
+ }
+ return index - start + unqualifiedName.length() + 1;
+ }
+ return 0;
+ case JVM_SIGNATURE_ARRAY:
+ arrayDim++;
+ if (arrayDim > MAX_ARRAY_TYPE_DESC_DIMENSIONS) {
+ throw new IllegalArgumentException(String.format("Cannot create an array type descriptor with more than %d dimensions",
+ ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS));
+ }
+ // The rest of what's there better be a legal descriptor
+ index++;
+ voidOK = false;
+ break;
+ default:
+ return 0;
+ }
}
+ return 0;
+ }
+
+ static boolean verifyUnqualifiedClassName(String name) {
+ for (int index = 0; index < name.length(); index++) {
+ char ch = name.charAt(index);
+ if (ch < 128) {
+ if (ch == '.' || ch == ';' || ch == '[' ) {
+ return false; // do not permit '.', ';', or '['
+ }
+ if (ch == '/') {
+ // check for '//' or leading or trailing '/' which are not legal
+ // unqualified name must not be empty
+ if (index == 0 || index + 1 >= name.length() || name.charAt(index + 1) == '/') {
+ return false;
+ }
+ }
+ } else {
+ index ++;
+ }
+ }
+ return true;
}
}
diff --git a/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java b/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java
index 7a989a56a7e..5148e30ed0f 100644
--- a/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java
+++ b/src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@ final class DirectMethodHandleDescImpl implements DirectMethodHandleDesc {
requireNonNull(kind);
validateClassOrInterface(requireNonNull(owner));
- validateMemberName(requireNonNull(name));
+ validateMemberName(requireNonNull(name), true);
requireNonNull(type);
switch (kind) {
diff --git a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
index e8548dad60c..9d9ba3d4ce7 100644
--- a/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
+++ b/src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ public class DynamicCallSiteDesc {
String invocationName,
MethodTypeDesc invocationType,
ConstantDesc[] bootstrapArgs) {
- this.invocationName = validateMemberName(requireNonNull(invocationName));
+ this.invocationName = validateMemberName(requireNonNull(invocationName), true);
this.invocationType = requireNonNull(invocationType);
this.bootstrapMethod = requireNonNull(bootstrapMethod);
this.bootstrapArgs = requireNonNull(bootstrapArgs.clone());
diff --git a/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java b/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java
index d9ed29c0258..70c475125cb 100644
--- a/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java
+++ b/src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -96,7 +96,7 @@ public abstract class DynamicConstantDesc\u5185\u306E'{@code'}
dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0
+dc.tag.a.within.a = \u306B\u5C55\u958B\u3055\u308C\u308B\u5185\u306E{0}\u30BF\u30B0
dc.tag.end.not.permitted = \u7121\u52B9\u306A\u7D42\u4E86\u30BF\u30B0: {0}>
dc.tag.end.unexpected = \u4E88\u671F\u3057\u306A\u3044\u7D42\u4E86\u30BF\u30B0: {0}>
dc.tag.header.sequence.1 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}>
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
index 9421961eabd..d55a6561128 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
@@ -60,6 +60,7 @@ dc.ref.not.found = \u627E\u4E0D\u5230\u5F15\u7528
dc.service.not.found = \u627E\u4E0D\u5230\u670D\u52A1\u7C7B\u578B
dc.tag.code.within.code = '{@code'} \u5728
\u4E2D
dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A
+dc.tag.a.within.a = {0} \u6807\u8BB0\uFF0C\u5176\u6269\u5C55\u5230 \uFF0C\u4F4D\u4E8E \u5185
dc.tag.end.not.permitted = \u65E0\u6548\u7684\u7ED3\u675F\u6807\u8BB0: {0}>
dc.tag.end.unexpected = \u610F\u5916\u7684\u7ED3\u675F\u6807\u8BB0: {0}>
dc.tag.header.sequence.1 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}>
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java
index d2f66cdfa19..a8d0f2b6e48 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java
@@ -167,8 +167,7 @@ public class Preview {
public boolean isPreview(Feature feature) {
if (feature == Feature.SWITCH_EXPRESSION ||
feature == Feature.SWITCH_MULTIPLE_CASE_LABELS ||
- feature == Feature.SWITCH_RULE ||
- feature == Feature.RAW_STRING_LITERALS)
+ feature == Feature.SWITCH_RULE)
return true;
//Note: this is a backdoor which allows to optionally treat all features as 'preview' (for testing).
//When real preview features will be added, this method can be implemented to return 'true'
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
index 9832f731200..f20c03c3267 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
@@ -188,8 +188,7 @@ public enum Source {
IMPORT_ON_DEMAND_OBSERVABLE_PACKAGES(JDK1_2, JDK8),
SWITCH_MULTIPLE_CASE_LABELS(JDK13, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL),
SWITCH_RULE(JDK13, Fragments.FeatureSwitchRules, DiagKind.PLURAL),
- SWITCH_EXPRESSION(JDK13, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL),
- RAW_STRING_LITERALS(JDK13, Fragments.FeatureRawStringLiterals, DiagKind.PLURAL);
+ SWITCH_EXPRESSION(JDK13, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL);
enum DiagKind {
NORMAL,
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
index 32990f67d39..a33c0e5eb37 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
@@ -646,60 +646,7 @@ public class JavaTokenizer {
lexError(pos, Errors.UnclosedStrLit);
}
break loop;
- case '`':
- checkSourceLevel(pos, Feature.RAW_STRING_LITERALS);
- // Ensure that the backtick was not a Unicode escape sequence
- if (reader.peekBack() != '`') {
- reader.scanChar();
- lexError(pos, Errors.UnicodeBacktick);
- break loop;
- }
- // Turn off unicode processsing and save previous state
- boolean oldState = reader.setUnicodeConversion(false);
- // Count the number of backticks in the open quote sequence
- int openCount = reader.skipRepeats();
- // Skip last backtick
- reader.scanChar();
- while (reader.bp < reader.buflen) {
- // If potential close quote sequence
- if (reader.ch == '`') {
- // Count number of backticks in sequence
- int closeCount = reader.skipRepeats();
- // If the counts match we can exit the raw string literal
- if (openCount == closeCount) {
- break;
- }
- // Emit non-close backtick sequence
- for (int i = 0; i <= closeCount; i++) {
- reader.putChar('`', false);
- }
- // Skip last backtick
- reader.scanChar();
- } else if (reader.ch == LF) {
- reader.putChar(true);
- processLineTerminator(pos, reader.bp);
- } else if (reader.ch == CR) {
- if (reader.peekChar() == LF) {
- reader.scanChar();
- }
- // Translate CR and CRLF sequences to LF
- reader.putChar('\n', true);
- processLineTerminator(pos, reader.bp);
- } else {
- reader.putChar(true);
- }
- }
- // Restore unicode processsing
- reader.setUnicodeConversion(oldState);
- // Ensure the close quote was encountered
- if (reader.bp == reader.buflen) {
- lexError(pos, Errors.UnclosedStrLit);
- } else {
- tk = TokenKind.STRINGLITERAL;
- reader.scanChar();
- }
- break loop;
- default:
+ default:
if (isSpecial(reader.ch)) {
scanOperator();
} else {
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java
index 2fe3ef4b578..e9bfba88b15 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/UnicodeReader.java
@@ -64,10 +64,6 @@ public class UnicodeReader {
*/
protected int unicodeConversionBp = -1;
- /** Control conversion of unicode characters
- */
- protected boolean unicodeConversion = true;
-
protected Log log;
protected Names names;
@@ -158,17 +154,11 @@ public class UnicodeReader {
return new String(sbuf, 0, sp);
}
- protected boolean setUnicodeConversion(boolean newState) {
- boolean oldState = unicodeConversion;
- unicodeConversion = newState;
- return oldState;
- }
-
/** Convert unicode escape; bp points to initial '\' character
* (Spec 3.3).
*/
protected void convertUnicode() {
- if (ch == '\\' && unicodeConversion && unicodeConversionBp != bp ) {
+ if (ch == '\\' && unicodeConversionBp != bp ) {
bp++; ch = buf[bp];
if (ch == 'u') {
do {
@@ -264,24 +254,6 @@ public class UnicodeReader {
return buf[bp + 1];
}
- protected char peekBack() {
- return buf[bp];
- }
-
- /**
- * Skips consecutive occurrences of the current character, leaving bp positioned
- * at the last occurrence. Returns the occurrence count.
- */
- protected int skipRepeats() {
- int start = bp;
- while (bp < buflen) {
- if (buf[bp] != buf[bp + 1])
- break;
- bp++;
- }
- return bp - start;
- }
-
/**
* Returns a copy of the input buffer, up to its inputLength.
* Unicode escape sequences are not translated.
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index d8ea15ec10c..8089d81c864 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -1240,9 +1240,6 @@ compiler.err.unclosed.comment=\
compiler.err.unclosed.str.lit=\
unclosed string literal
-compiler.err.unicode.backtick=\
- attempt to use \\u0060 as a raw string literal delimiter
-
# 0: string
compiler.err.unsupported.encoding=\
unsupported encoding: {0}
@@ -2837,9 +2834,6 @@ compiler.misc.feature.switch.rules=\
compiler.misc.feature.switch.expressions=\
switch expressions
-compiler.misc.feature.raw.string.literals=\
- raw string literals
-
compiler.misc.feature.var.syntax.in.implicit.lambda=\
var syntax in implicit lambdas
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
index f847c9d1835..9e30d7a261e 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
@@ -49,6 +49,7 @@
# kind name an informative description of the kind of a declaration; see compiler.misc.kindname.*
# target a target version number, such as 1.5, 1.6, 1.7, taken from a com.sun.tools.javac.jvm.Target
# token the name of a non-terminal in source code; see compiler.misc.token.*
+# tree tag the name of a non-terminal in source code; see compiler.misc.token.*
# type a Java type; e.g. int, X, X
\nfor ({0} c : {0}.values())\n System.out.println(c);\n
+doclet.enum_values_doc.fullbody=\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\n\u8FD4\u3057\u307E\u3059\u3002
doclet.enum_values_doc.return=\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u306E\u914D\u5217
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
index 362e45ac8bb..b48ffd6dd01 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
@@ -211,13 +211,15 @@ doclet.Annotation_Type_Optional_Member=\u53EF\u9009\u5143\u7D20
doclet.Annotation_Type_Required_Member=\u5FC5\u9700\u7684\u5143\u7D20
doclet.Annotation_Type_Member=\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20
doclet.Enum_Constant=\u679A\u4E3E\u5E38\u91CF
-doclet.Class=\u7C7B
doclet.Description=\u8BF4\u660E
doclet.ConstantField=\u5E38\u91CF\u5B57\u6BB5
doclet.Value=\u503C
+doclet.linkMismatch_PackagedLinkedtoModule=\u8FDB\u884C\u6587\u6863\u5316\u7684\u4EE3\u7801\u4F7F\u7528\u4E86\u672A\u547D\u540D\u6A21\u5757\u4E2D\u7684\u7A0B\u5E8F\u5305\uFF0C\u4F46\u5728 {0} \u4E2D\u5B9A\u4E49\u7684\u7A0B\u5E8F\u5305\u5728\u547D\u540D\u6A21\u5757\u4E2D\u3002
+doclet.linkMismatch_ModuleLinkedtoPackage=\u8FDB\u884C\u6587\u6863\u5316\u7684\u4EE3\u7801\u4F7F\u7528\u4E86\u6A21\u5757\uFF0C\u4F46\u5728 {0} \u4E2D\u5B9A\u4E49\u7684\u7A0B\u5E8F\u5305\u5728\u672A\u547D\u540D\u6A21\u5757\u4E2D\u3002
+doclet.urlRedirected=URL {0} \u5DF2\u91CD\u5B9A\u5411\u5230 {1} \u2014 \u66F4\u65B0\u547D\u4EE4\u884C\u9009\u9879\u4EE5\u9690\u85CF\u6B64\u8B66\u544A\u3002
#Documentation for Enums
-doclet.enum_values_doc.fullbody=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n\nfor ({0} c : {0}.values())\n System.out.println(c);\n
+doclet.enum_values_doc.fullbody=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \n\u8FD4\u56DE\u4E00\u4E2A\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002
doclet.enum_values_doc.return=\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F\u8FD4\u56DE\u7684\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4
diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
index 3ac1c8922ba..57766c422df 100644
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
@@ -20,6 +20,10 @@ main.opt.e=\ -e