This commit is contained in:
Phil Race 2018-08-14 12:11:28 -07:00
commit 7000581e0b
916 changed files with 19307 additions and 3576 deletions

View File

@ -499,7 +499,9 @@ e1b3def126240d5433902f3cb0e91a4c27f6db50 jdk-11+18
1edcf36fe15f79d6228d1a63eb680878e2386480 jdk-11+23
ea900a7dc7d77dee30865c60eabd87fc24b1037c jdk-11+24
331888ea4a788df801b1edf8836646cd25fc758b jdk-11+25
945ba9278a272a5477ffb1b3ea1b04174fed8036 jdk-11+26
69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2
990db216e7199b2ba9989d8fa20b657e0ca7d969 jdk-12+3
499b873761d8e8a1cc4aa649daf04cbe98cbce77 jdk-12+4
f8696e0ab9b795030429fc3374ec03e378fd9ed7 jdk-12+5
7939b3c4e4088bf4f70ec5bbd8030393b653372f jdk-12+6

View File

@ -543,14 +543,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual"
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual -Wreorder"
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
# Non-zero builds have stricter warnings
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wreturn-type"
fi
elif test "x$TOOLCHAIN_TYPE" = xclang; then
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated"
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated -Wreorder"
if test "x$OPENJDK_TARGET_OS" = xlinux; then
WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-sometimes-uninitialized"
WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"

View File

@ -0,0 +1,94 @@
0x21 U+ff01
0x22 U+ff02
0x23 U+ff03
0x24 U+ff04
0x25 U+ff05
0x26 U+ff06
0x27 U+ff07
0x28 U+ff08
0x29 U+ff09
0x2a U+ff0a
0x2b U+ff0b
0x2c U+ff0c
0x2d U+ff0d
0x2e U+ff0e
0x2f U+ff0f
0x30 U+ff10
0x31 U+ff11
0x32 U+ff12
0x33 U+ff13
0x34 U+ff14
0x35 U+ff15
0x36 U+ff16
0x37 U+ff17
0x38 U+ff18
0x39 U+ff19
0x3a U+ff1a
0x3b U+ff1b
0x3c U+ff1c
0x3d U+ff1d
0x3e U+ff1e
0x3f U+ff1f
0x40 U+ff20
0x41 U+ff21
0x42 U+ff22
0x43 U+ff23
0x44 U+ff24
0x45 U+ff25
0x46 U+ff26
0x47 U+ff27
0x48 U+ff28
0x49 U+ff29
0x4a U+ff2a
0x4b U+ff2b
0x4c U+ff2c
0x4d U+ff2d
0x4e U+ff2e
0x4f U+ff2f
0x50 U+ff30
0x51 U+ff31
0x52 U+ff32
0x53 U+ff33
0x54 U+ff34
0x55 U+ff35
0x56 U+ff36
0x57 U+ff37
0x58 U+ff38
0x59 U+ff39
0x5a U+ff3a
0x5b U+ff3b
0x5c U+ff3c
0x5d U+ff3d
0x5e U+ff3e
0x5f U+ff3f
0x60 U+ff40
0x61 U+ff41
0x62 U+ff42
0x63 U+ff43
0x64 U+ff44
0x65 U+ff45
0x66 U+ff46
0x67 U+ff47
0x68 U+ff48
0x69 U+ff49
0x6a U+ff4a
0x6b U+ff4b
0x6c U+ff4c
0x6d U+ff4d
0x6e U+ff4e
0x6f U+ff4f
0x70 U+ff50
0x71 U+ff51
0x72 U+ff52
0x73 U+ff53
0x74 U+ff54
0x75 U+ff55
0x76 U+ff56
0x77 U+ff57
0x78 U+ff58
0x79 U+ff59
0x7a U+ff5a
0x7b U+ff5b
0x7c U+ff5c
0x7d U+ff5d
0x7e U+ff5e

View File

@ -0,0 +1,256 @@
0x00 U+0000
0x01 U+0001
0x02 U+0002
0x03 U+0003
0x04 U+0004
0x05 U+0005
0x06 U+0006
0x07 U+0007
0x08 U+0008
0x09 U+0009
0x0a U+000a
0x0b U+000b
0x0c U+000c
0x0d U+000d
0x0e U+000e
0x0f U+000f
0x10 U+0010
0x11 U+0011
0x12 U+0012
0x13 U+0013
0x14 U+0014
0x15 U+0015
0x16 U+0016
0x17 U+0017
0x18 U+0018
0x19 U+0019
0x1a U+001a
0x1b U+001b
0x1c U+001c
0x1d U+001d
0x1e U+001e
0x1f U+001f
0x20 U+0020
0x21 U+0021
0x22 U+0022
0x23 U+0023
0x24 U+0024
0x25 U+0025
0x26 U+0026
0x27 U+0027
0x28 U+0028
0x29 U+0029
0x2a U+002a
0x2b U+002b
0x2c U+002c
0x2d U+002d
0x2e U+002e
0x2f U+002f
0x30 U+0030
0x31 U+0031
0x32 U+0032
0x33 U+0033
0x34 U+0034
0x35 U+0035
0x36 U+0036
0x37 U+0037
0x38 U+0038
0x39 U+0039
0x3a U+003a
0x3b U+003b
0x3c U+003c
0x3d U+003d
0x3e U+003e
0x3f U+003f
0x40 U+0040
0x41 U+0041
0x42 U+0042
0x43 U+0043
0x44 U+0044
0x45 U+0045
0x46 U+0046
0x47 U+0047
0x48 U+0048
0x49 U+0049
0x4a U+004a
0x4b U+004b
0x4c U+004c
0x4d U+004d
0x4e U+004e
0x4f U+004f
0x50 U+0050
0x51 U+0051
0x52 U+0052
0x53 U+0053
0x54 U+0054
0x55 U+0055
0x56 U+0056
0x57 U+0057
0x58 U+0058
0x59 U+0059
0x5a U+005a
0x5b U+005b
0x5c U+005c
0x5d U+005d
0x5e U+005e
0x5f U+005f
0x60 U+0060
0x61 U+0061
0x62 U+0062
0x63 U+0063
0x64 U+0064
0x65 U+0065
0x66 U+0066
0x67 U+0067
0x68 U+0068
0x69 U+0069
0x6a U+006a
0x6b U+006b
0x6c U+006c
0x6d U+006d
0x6e U+006e
0x6f U+006f
0x70 U+0070
0x71 U+0071
0x72 U+0072
0x73 U+0073
0x74 U+0074
0x75 U+0075
0x76 U+0076
0x77 U+0077
0x78 U+0078
0x79 U+0079
0x7a U+007a
0x7b U+007b
0x7c U+007c
0x7d U+007d
0x7e U+007e
0x7f U+007f
0x80 U+0080
0x81 U+0081
0x82 U+0082
0x83 U+0083
0x84 U+0084
0x85 U+0085
0x86 U+0086
0x87 U+0087
0x88 U+0088
0x89 U+0089
0x8a U+008a
0x8b U+008b
0x8c U+008c
0x8d U+008d
0x8e U+008e
0x8f U+008f
0x90 U+0090
0x91 U+0091
0x92 U+0092
0x93 U+0093
0x94 U+0094
0x95 U+0095
0x96 U+0096
0x97 U+0097
0x98 U+0098
0x99 U+0099
0x9a U+009a
0x9b U+009b
0x9c U+009c
0x9d U+009d
0x9e U+009e
0x9f U+009f
0xa0 U+00a0
0xa1 U+00a1
0xa2 U+00a2
0xa3 U+00a3
0xa4 U+00a4
0xa5 U+00a5
0xa6 U+00a6
0xa7 U+00a7
0xa8 U+0153
0xa9 U+00a9
0xaa U+00aa
0xab U+00ab
0xac U+00ac
0xad U+00ad
0xae U+00ae
0xaf U+00af
0xb0 U+00b0
0xb1 U+00b1
0xb2 U+00b2
0xb3 U+00b3
0xb4 U+0178
0xb5 U+00b5
0xb6 U+00b6
0xb7 U+00b7
0xb8 U+0152
0xb9 U+00b9
0xba U+00ba
0xbb U+00bb
0xbc U+00bc
0xbd U+00bd
0xbe U+00be
0xbf U+00bf
0xc0 U+00c0
0xc1 U+00c1
0xc2 U+00c2
0xc3 U+0102
0xc4 U+00c4
0xc5 U+00c5
0xc6 U+00c6
0xc7 U+00c7
0xc8 U+00c8
0xc9 U+00c9
0xca U+00ca
0xcb U+00cb
0xcc U+0300
0xcd U+00cd
0xce U+00ce
0xcf U+00cf
0xd0 U+0110
0xd1 U+00d1
0xd2 U+0309
0xd3 U+00d3
0xd4 U+00d4
0xd5 U+01a0
0xd6 U+00d6
0xd7 U+00d7
0xd8 U+00d8
0xd9 U+00d9
0xda U+00da
0xdb U+00db
0xdc U+00dc
0xdd U+01af
0xde U+0303
0xdf U+00df
0xe0 U+00e0
0xe1 U+00e1
0xe2 U+00e2
0xe3 U+0103
0xe4 U+00e4
0xe5 U+00e5
0xe6 U+00e6
0xe7 U+00e7
0xe8 U+00e8
0xe9 U+00e9
0xea U+00ea
0xeb U+00eb
0xec U+0301
0xed U+00ed
0xee U+00ee
0xef U+00ef
0xf0 U+0111
0xf1 U+00f1
0xf2 U+0323
0xf3 U+00f3
0xf4 U+00f4
0xf5 U+01a1
0xf6 U+00f6
0xf7 U+00f7
0xf8 U+00f8
0xf9 U+00f9
0xfa U+00fa
0xfb U+00fb
0xfc U+00fc
0xfd U+01b0
0xfe U+20ab
0xff U+00ff

View File

@ -1241,6 +1241,16 @@ charset x-IBM1124 IBM1124
alias ibm-1124
alias 1124
charset x-IBM1129 IBM1129
package sun.nio.cs.ext
type sbcs
hisname Cp1129
ascii false
alias cp1129 # JDK historical
alias ibm1129
alias ibm-1129
alias 1129
charset x-IBM1364 IBM1364
package sun.nio.cs.ext
type ebcdic

View File

@ -19,6 +19,7 @@ IBM950
IBM970
IBM1046
IBM1124
IBM1129
IBM1383
ISO_8859_6
ISO_8859_8

View File

@ -123,6 +123,7 @@ TARGETS += $(GENSRC_DIR)/_gensrc_proc_done
$(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
($(CD) $(GENSRC_DIR)/META-INF/providers && \
p=""; \
impl=""; \
for i in $$($(LS) | $(SORT)); do \
c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
if test x$$p != x$$c; then \
@ -131,15 +132,27 @@ $(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
fi; \
$(ECHO) "provides $$c with" >> $@; \
p=$$c; \
impl=""; \
fi; \
$(ECHO) " $$i," >> $@; \
if test x$$impl != x; then \
$(ECHO) " , $$i" >> $@; \
else \
$(ECHO) " $$i" >> $@; \
fi; \
impl=$$i; \
done); \
$(ECHO) " ;" >> $@; \
$(ECHO) "uses org.graalvm.compiler.options.OptionDescriptors;" >> $@; \
$(ECHO) "provides org.graalvm.compiler.options.OptionDescriptors with" >> $@; \
impl=""; \
for i in $$($(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java' | $(SORT)); do \
c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.internal\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \
$(ECHO) " $$c," >> $@; \
if test x$$impl != x; then \
$(ECHO) " , $$c" >> $@; \
else \
$(ECHO) " $$c" >> $@; \
fi; \
impl=$$c; \
done; \
$(ECHO) " ;" >> $@;

View File

@ -40,6 +40,7 @@
#include <proc_service.h>
#include "gc/shared/collectedHeap.hpp"
#include "memory/heap.hpp"
#include "runtime/vmStructs.hpp"
typedef enum GEN_variant {

View File

@ -37,7 +37,9 @@ import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.stream.Collectors.*;
@ -131,7 +133,7 @@ public class GenModuleInfoSource {
// parse module-info.java.extra
this.extras = new ModuleInfo();
for (Path file : extraFiles) {
extras.parse(file);
extras.parseExtra(file);
}
// merge with module-info.java.extra
@ -177,6 +179,7 @@ public class GenModuleInfoSource {
final Map<String, Statement> provides = new HashMap<>();
Statement getStatement(String directive, String name) {
Objects.requireNonNull(name);
switch (directive) {
case "exports":
if (moduleInfo.exports.containsKey(name) &&
@ -223,49 +226,49 @@ public class GenModuleInfoSource {
extraFiles.exports.entrySet()
.stream()
.filter(e -> exports.containsKey(e.getKey()) &&
e.getValue().filter(modules))
e.getValue().filter(modules))
.forEach(e -> mergeExportsOrOpens(exports.get(e.getKey()),
e.getValue(),
modules));
e.getValue(),
modules));
// add exports that are not defined in the original module-info.java
extraFiles.exports.entrySet()
.stream()
.filter(e -> !exports.containsKey(e.getKey()) &&
e.getValue().filter(modules))
e.getValue().filter(modules))
.forEach(e -> addTargets(getStatement("exports", e.getKey()),
e.getValue(),
modules));
e.getValue(),
modules));
// API package opened in the original module-info.java
extraFiles.opens.entrySet()
.stream()
.filter(e -> opens.containsKey(e.getKey()) &&
e.getValue().filter(modules))
e.getValue().filter(modules))
.forEach(e -> mergeExportsOrOpens(opens.get(e.getKey()),
e.getValue(),
modules));
e.getValue(),
modules));
// add opens that are not defined in the original module-info.java
extraFiles.opens.entrySet()
.stream()
.filter(e -> !opens.containsKey(e.getKey()) &&
e.getValue().filter(modules))
e.getValue().filter(modules))
.forEach(e -> addTargets(getStatement("opens", e.getKey()),
e.getValue(),
modules));
e.getValue(),
modules));
// provides
extraFiles.provides.keySet()
.stream()
.filter(service -> provides.containsKey(service))
.forEach(service -> mergeProvides(service,
extraFiles.provides.get(service)));
extraFiles.provides.get(service)));
extraFiles.provides.keySet()
.stream()
.filter(service -> !provides.containsKey(service))
.forEach(service -> provides.put(service,
extraFiles.provides.get(service)));
extraFiles.provides.get(service)));
// uses
extraFiles.uses.keySet()
@ -280,8 +283,8 @@ public class GenModuleInfoSource {
Set<String> modules)
{
extra.targets.stream()
.filter(mn -> modules.contains(mn))
.forEach(mn -> statement.addTarget(mn));
.filter(mn -> modules.contains(mn))
.forEach(mn -> statement.addTarget(mn));
}
private void mergeExportsOrOpens(Statement statement,
@ -319,7 +322,7 @@ public class GenModuleInfoSource {
}
extra.targets.stream()
.forEach(mn -> statement.addTarget(mn));
.forEach(mn -> statement.addTarget(mn));
}
@ -358,189 +361,173 @@ public class GenModuleInfoSource {
.forEach(e -> writer.println(e.getValue()));
}
private void parse(Path sourcefile) throws IOException {
List<String> lines = Files.readAllLines(sourcefile);
Statement statement = null;
boolean hasTargets = false;
for (int lineNumber = 1; lineNumber <= lines.size(); ) {
String l = lines.get(lineNumber-1).trim();
int index = 0;
if (l.isEmpty()) {
lineNumber++;
continue;
}
// comment block starts
if (l.startsWith("/*")) {
while (l.indexOf("*/") == -1) { // end comment block
l = lines.get(lineNumber++).trim();
}
index = l.indexOf("*/") + 2;
if (index >= l.length()) {
lineNumber++;
continue;
} else {
// rest of the line
l = l.substring(index, l.length()).trim();
index = 0;
}
}
// skip comment and annotations
if (l.startsWith("//") || l.startsWith("@")) {
lineNumber++;
continue;
}
int current = lineNumber;
int count = 0;
while (index < l.length()) {
if (current == lineNumber && ++count > 20)
throw new Error("Fail to parse line " + lineNumber + " " + sourcefile);
int end = l.indexOf(';');
if (end == -1)
end = l.length();
String content = l.substring(0, end).trim();
if (content.isEmpty()) {
index = end+1;
if (index < l.length()) {
// rest of the line
l = l.substring(index, l.length()).trim();
index = 0;
}
continue;
}
String[] s = content.split("\\s+");
String keyword = s[0].trim();
String name = s.length > 1 ? s[1].trim() : null;
trace("%d: %s index=%d len=%d%n", lineNumber, l, index, l.length());
switch (keyword) {
case "module":
case "requires":
case "}":
index = l.length(); // skip to the end
continue;
case "exports":
case "opens":
case "provides":
case "uses":
// assume name immediately after exports, opens, provides, uses
statement = getStatement(keyword, name);
hasTargets = false;
int i = l.indexOf(name, keyword.length()+1) + name.length() + 1;
l = i < l.length() ? l.substring(i, l.length()).trim() : "";
index = 0;
if (s.length >= 3) {
if (!s[2].trim().equals(statement.qualifier)) {
throw new RuntimeException(sourcefile + ", line " +
lineNumber + ", is malformed: " + s[2]);
}
}
break;
case "to":
case "with":
if (statement == null) {
throw new RuntimeException(sourcefile + ", line " +
lineNumber + ", is malformed");
}
hasTargets = true;
String qualifier = statement.qualifier;
i = l.indexOf(qualifier, index) + qualifier.length() + 1;
l = i < l.length() ? l.substring(i, l.length()).trim() : "";
index = 0;
break;
}
if (index >= l.length()) {
// skip to next line
continue;
}
// comment block starts
if (l.startsWith("/*")) {
while (l.indexOf("*/") == -1) { // end comment block
l = lines.get(lineNumber++).trim();
}
index = l.indexOf("*/") + 2;
if (index >= l.length()) {
continue;
} else {
// rest of the line
l = l.substring(index, l.length()).trim();
index = 0;
}
}
if (l.startsWith("//")) {
index = l.length();
continue;
}
if (statement == null) {
throw new RuntimeException(sourcefile + ", line " +
lineNumber + ": missing keyword?");
}
if (!hasTargets) {
continue;
}
if (index >= l.length()) {
throw new RuntimeException(sourcefile + ", line " +
lineNumber + ": " + l);
}
// parse the target module of exports, opens, or provides
Statement stmt = statement;
int terminal = l.indexOf(';', index);
// determine up to which position to parse
int pos = terminal != -1 ? terminal : l.length();
// parse up to comments
int pos1 = l.indexOf("//", index);
if (pos1 != -1 && pos1 < pos) {
pos = pos1;
}
int pos2 = l.indexOf("/*", index);
if (pos2 != -1 && pos2 < pos) {
pos = pos2;
}
// target module(s) for qualitifed exports or opens
// or provider implementation class(es)
String rhs = l.substring(index, pos).trim();
index += rhs.length();
trace("rhs: index=%d [%s] [line: %s]%n", index, rhs, l);
String[] targets = rhs.split(",");
for (String t : targets) {
String n = t.trim();
if (n.length() > 0)
stmt.addTarget(n);
}
// start next statement
if (pos == terminal) {
statement = null;
hasTargets = false;
index = terminal + 1;
}
l = index < l.length() ? l.substring(index, l.length()).trim() : "";
index = 0;
}
lineNumber++;
private void parse(Path file) throws IOException {
Parser parser = new Parser(file);
parser.run();
if (verbose) {
parser.dump();
}
process(parser, false);
}
private void parseExtra(Path file) throws IOException {
Parser parser = new Parser(file);
parser.run();
if (verbose) {
parser.dump();
}
process(parser, true);
}
private void process(Parser parser, boolean extraFile) throws IOException {
// no duplicate statement local in each file
Map<String, Statement> exports = new HashMap<>();
Map<String, Statement> opens = new HashMap<>();
Map<String, Statement> uses = new HashMap<>();
Map<String, Statement> provides = new HashMap<>();
String token = null;
boolean hasCurlyBracket = false;
while ((token = parser.nextToken()) != null) {
if (token.equals("module")) {
String modulename = nextIdentifier(parser);
if (extraFile) {
throw parser.newError("cannot declare module in " + parser.sourceFile);
}
skipTokenOrThrow(parser, "{", "missing {");
hasCurlyBracket = true;
} else if (token.equals("requires")) {
token = nextIdentifier(parser);
if (token.equals("transitive")) {
token = nextIdentifier(parser);
}
if (extraFile) {
throw parser.newError("cannot declare requires in " + parser.sourceFile);
}
skipTokenOrThrow(parser, ";", "missing semicolon");
} else if (isExportsOpensProvidesUses(token)) {
// new statement
String keyword = token;
String name = nextIdentifier(parser);
Statement statement = getStatement(keyword, name);
switch (keyword) {
case "exports":
if (exports.containsKey(name)) {
throw parser.newError("multiple " + keyword + " " + name);
}
exports.put(name, statement);
break;
case "opens":
if (opens.containsKey(name)) {
throw parser.newError("multiple " + keyword + " " + name);
}
opens.put(name, statement);
break;
case "uses":
if (uses.containsKey(name)) {
throw parser.newError("multiple " + keyword + " " + name);
}
uses.put(name, statement);
break;
/* Disable this check until jdk.internal.vm.compiler generated file is fixed.
case "provides":
if (provides.containsKey(name)) {
throw parser.newError("multiple " + keyword + " " + name);
}
provides.put(name, statement);
break;
*/
}
String lookAhead = lookAhead(parser);
if (lookAhead.equals(statement.qualifier)) {
parser.nextToken(); // skip qualifier
while ((lookAhead = parser.peekToken()) != null) {
// add target name
name = nextIdentifier(parser);
statement.addTarget(name);
lookAhead = lookAhead(parser);
if (lookAhead.equals(",") || lookAhead.equals(";")) {
parser.nextToken();
} else {
throw parser.newError("missing semicolon");
}
if (lookAhead.equals(";")) {
break;
}
}
} else {
skipTokenOrThrow(parser, ";", "missing semicolon");
}
} else if (token.equals(";")) {
continue;
} else if (hasCurlyBracket && token.equals("}")) {
hasCurlyBracket = false;
if (parser.peekToken() != null) { // must be EOF
throw parser.newError("is malformed");
}
} else {
throw parser.newError("missing keyword");
}
}
if (hasCurlyBracket) {
parser.newError("missing }");
}
}
private boolean isExportsOpensProvidesUses(String word) {
switch (word) {
case "exports":
case "opens":
case "provides":
case "uses":
return true;
default:
return false;
}
}
private String lookAhead(Parser parser) {
String lookAhead = parser.peekToken();
if (lookAhead == null) { // EOF
throw parser.newError("reach end of file");
}
return lookAhead;
}
private String nextIdentifier(Parser parser) {
String lookAhead = parser.peekToken();
boolean maybeIdentifier = true;
switch (lookAhead) {
case "module":
case "requires":
case "exports":
case "opens":
case "provides":
case "uses":
case "to":
case "with":
case ",":
case ";":
case "{":
case "}":
maybeIdentifier = false;
}
if (lookAhead == null || !maybeIdentifier) {
throw parser.newError("<identifier> missing");
}
return parser.nextToken();
}
private String skipTokenOrThrow(Parser parser, String token, String msg) {
// look ahead to report the proper line number
String lookAhead = parser.peekToken();
if (!token.equals(lookAhead)) {
throw parser.newError(msg);
}
return parser.nextToken();
}
}
@ -620,4 +607,175 @@ public class GenModuleInfoSource {
System.out.format(fmt, params);
}
}
static class Parser {
private static final List<String> EMPTY = List.of();
private final Path sourceFile;
private boolean inCommentBlock = false;
private List<List<String>> tokens = new ArrayList<>();
private int lineNumber = 1;
private int index = 0;
Parser(Path file) {
this.sourceFile = file;
}
void run() throws IOException {
List<String> lines = Files.readAllLines(sourceFile);
for (int lineNumber = 1; lineNumber <= lines.size(); lineNumber++) {
String l = lines.get(lineNumber - 1).trim();
tokenize(l);
}
}
/*
* Tokenize the given string. Comments are skipped.
*/
List<String> tokenize(String l) {
while (!l.isEmpty()) {
if (inCommentBlock) {
int comment = l.indexOf("*/");
if (comment == -1)
return emptyTokens();
// end comment block
inCommentBlock = false;
if ((comment + 2) >= l.length()) {
return emptyTokens();
}
l = l.substring(comment + 2, l.length()).trim();
}
// skip comment
int comment = l.indexOf("//");
if (comment >= 0) {
l = l.substring(0, comment).trim();
if (l.isEmpty()) return emptyTokens();
}
if (l.isEmpty()) {
return emptyTokens();
}
int beginComment = l.indexOf("/*");
int endComment = l.indexOf("*/");
if (beginComment == -1)
return tokens(l);
String s1 = l.substring(0, beginComment).trim();
if (endComment > 0) {
String s2 = l.substring(endComment + 2, l.length()).trim();
if (s1.isEmpty()) {
l = s2;
} else if (s2.isEmpty()) {
l = s1;
} else {
l = s1 + " " + s2;
}
} else {
inCommentBlock = true;
return tokens(s1);
}
}
return tokens(l);
}
private List<String> emptyTokens() {
this.tokens.add(EMPTY);
return EMPTY;
}
private List<String> tokens(String l) {
List<String> tokens = new ArrayList<>();
for (String s : l.split("\\s+")) {
int pos=0;
s = s.trim();
if (s.isEmpty())
continue;
int i = s.indexOf(',', pos);
int j = s.indexOf(';', pos);
while ((i >= 0 && i < s.length()) || (j >= 0 && j < s.length())) {
if (j == -1 || (i >= 0 && i < j)) {
String n = s.substring(pos, i).trim();
if (!n.isEmpty()) {
tokens.add(n);
}
tokens.add(s.substring(i, i + 1));
pos = i + 1;
i = s.indexOf(',', pos);
} else {
String n = s.substring(pos, j).trim();
if (!n.isEmpty()) {
tokens.add(n);
}
tokens.add(s.substring(j, j + 1));
pos = j + 1;
j = s.indexOf(';', pos);
}
}
String n = s.substring(pos).trim();
if (!n.isEmpty()) {
tokens.add(n);
}
}
this.tokens.add(tokens);
return tokens;
}
/*
* Returns next token.
*/
String nextToken() {
while (lineNumber <= tokens.size()) {
List<String> l = tokens.get(lineNumber-1);
if (index < l.size()) {
return l.get(index++);
} else {
lineNumber++;
index = 0;
}
}
return null;
}
/*
* Peeks next token.
*/
String peekToken() {
int ln = lineNumber;
int i = index;
while (ln <= tokens.size()) {
List<String> l = tokens.get(ln-1);
if (i < l.size()) {
return l.get(i++);
} else {
ln++;
i = 0;
}
}
return null;
}
Error newError(String msg) {
if (lineNumber <= tokens.size()) {
throw new Error(sourceFile + ", line " +
lineNumber + ", " + msg + " \"" + lineAt(lineNumber) + "\"");
} else {
throw new Error(sourceFile + ", line " + lineNumber + ", " + msg);
}
}
void dump() {
for (int i = 1; i <= tokens.size(); i++) {
System.out.format("%d: %s%n", i, lineAt(i));
}
}
private String lineAt(int i) {
return tokens.get(i-1).stream().collect(Collectors.joining(" "));
}
}
}

View File

@ -28,6 +28,7 @@ package build.tools.module;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -35,6 +36,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import build.tools.module.GenModuleInfoSource.Statement;
@ -42,29 +44,36 @@ import build.tools.module.GenModuleInfoSource.Statement;
* Sanity test for GenModuleInfoSource tool
*/
public class ModuleInfoExtraTest {
private static final Path DIR = Paths.get("test");
private static final Path DIR = Paths.get("gen-module-info-test");
private static boolean verbose = false;
public static void main(String... args) throws Exception {
if (args.length != 0)
GenModuleInfoSource.verbose = true;
verbose = true;
GenModuleInfoSource.verbose = verbose;
ModuleInfoExtraTest test = new ModuleInfoExtraTest("m", "m1", "m2", "m3");
test.run();
test.testModuleInfo();
test.errorCases();
}
String[] moduleInfo = new String[] {
"exports p",
"to",
" // comment",
" /* comment */ m1",
"module m {",
" requires m1;",
" requires transitive m2;",
" exports p",
" to",
" // comment ... ",
" /* comment */ m1",
",",
"m2,m3",
" ;",
"exports q to m1;",
"provides s with /* ",
" comment */ impl ; // comment",
"provides s1",
" with ",
" impl1, impl2;"
" m2,m3",
" ;",
" exports q to m1;",
" provides s with /* ",
" comment */ impl ; // comment",
" provides s1",
" with ",
" impl1, impl2;",
"}"
};
String[] moduleInfoExtra = new String[] {
@ -76,33 +85,8 @@ public class ModuleInfoExtraTest {
"opens p.q ",
" to /* comment */ m3",
" , // m1",
" /* comment */, m4;",
"provides s1 with impl3;"
};
String[] test1 = new String[] {
"exports p1 to m1;",
"exports p2"
};
String[] test2 = new String[] {
"exports to m1;"
};
String[] test3 = new String[]{
"exports p3 to m1;",
" m2, m3;"
};
String[] test4 = new String[]{
"provides s with impl1;", // typo ; should be ,
" impl2, impl3;"
};
String[] test5 = new String[]{
"uses s3",
"provides s3 with impl1,",
" impl2, impl3;"
" /* comment */ m4; uses p.I",
"; provides s1 with impl3;"
};
final Builder builder;
@ -110,11 +94,6 @@ public class ModuleInfoExtraTest {
this.builder = new Builder(name).modules(modules);
}
void run() throws IOException {
testModuleInfo();
errorCases();
}
void testModuleInfo() throws IOException {
GenModuleInfoSource source = builder.sourceFile(moduleInfo).build();
@ -155,7 +134,9 @@ public class ModuleInfoExtraTest {
Set<String> opensPQ,
Set<String> providerS,
Set<String> providerS1) {
source.moduleInfo.print(new PrintWriter(System.out, true));
if (verbose)
source.moduleInfo.print(new PrintWriter(System.out, true));
Statement export = source.moduleInfo.exports.get("p");
if (!export.targets.equals(targetsP)) {
throw new Error("unexpected: " + export);
@ -177,24 +158,112 @@ public class ModuleInfoExtraTest {
}
}
final Map<String[], String> badModuleInfos = Map.of(
new String[] {
"module x {",
" exports p1 to ",
" m1",
"}"
}, ".*, line .*, missing semicolon.*",
new String[] {
"module x ",
" exports p1;"
}, ".*, line .*, missing \\{.*",
new String[] {
"module x {",
" requires m1;",
" requires",
"}"
}, ".*, line .*, <identifier> missing.*",
new String[] {
"module x {",
" requires transitive m1",
"}"
}, ".*, line .*, missing semicolon.*",
new String[] {
"module x {",
" exports p1 to m1;",
" exports p1 to m2;",
"}"
}, ".*, line .*, multiple exports p1.*"
);
final Map<String[], String> badExtraFiles = Map.of(
new String[] {
"requires m2;" // not allowed
}, ".*, line .*, cannot declare requires .*",
new String[] {
"exports p1 to m1;",
"exports p2" // missing semicolon
}, ".*, line .*, reach end of file.*",
new String[] {
"exports to m1;" // missing <identifier>
}, ".*, line .*, <identifier> missing.*",
new String[] {
"exports p3 to m1;",
" m2, m3;" // missing keyword
}, ".*, line .*, missing keyword.*",
new String[] {
"provides s with impl1;", // typo ; should be ,
" impl2, impl3;"
}, ".*, line .*, missing keyword.*",
new String[] {
"uses s3", // missing semicolon
"provides s3 with impl1,",
" impl2, impl3;"
}, ".*, line .*, missing semicolon.*",
new String[] {
"opens p1 to m1,, m2;" // missing identifier
}, ".*, line .*, <identifier> missing.*"
);
void errorCases() throws IOException {
fail(test1);
fail(test2);
fail(test3);
fail(test4);
fail(test5);
final Map<String[], String> duplicates = Map.of(
new String[] {
" exports p1 to m1, m2;",
" exports p1 to m3;",
}, ".*, line .*, multiple exports p1.*",
new String[] {
" opens p1 to m1, m2;",
" exports p1 to m3;",
" opens p1 to m3;"
}, ".*, line .*, multiple opens p1.*",
new String[] {
" uses s;",
" uses s;"
}, ".*, line .*, multiple uses s.*"
);
void errorCases() {
badModuleInfos.entrySet().stream().forEach(e -> badModuleInfoFile(e.getKey(), e.getValue()));
badExtraFiles.entrySet().stream().forEach(e -> badExtraFile(e.getKey(), e.getValue()));
duplicates.entrySet().stream().forEach(e -> badExtraFile(e.getKey(), e.getValue()));
}
void fail(String... extras) throws IOException {
Path file = DIR.resolve("test1");
Files.write(file, Arrays.asList(extras));
void badModuleInfoFile(String[] lines, String regex) {
Builder builder = new Builder("x").modules("m1", "m2", "m3");
try {
GenModuleInfoSource source = builder.sourceFile(lines).build();
throw new RuntimeException("Expected error: " + Arrays.toString(lines));
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (Error e) {
if (!e.getMessage().matches(regex)) {
throw e;
}
}
}
void badExtraFile(String[] extras, String regex) {
Path file = DIR.resolve("test1");
try {
Files.write(file, Arrays.asList(extras));
builder.build(file);
} catch (RuntimeException e) {
if (!e.getMessage().matches("test/test1, line .* is malformed.*") &&
!e.getMessage().matches("test/test1, line .* missing keyword.*")) {
Files.deleteIfExists(file);
throw new RuntimeException("Expected error: " + Arrays.toString(extras));
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (Error e) {
if (!e.getMessage().matches(regex)) {
throw e;
}
}
@ -218,11 +287,9 @@ public class ModuleInfoExtraTest {
Files.createDirectories(sourceFile.getParent());
try (BufferedWriter bw = Files.newBufferedWriter(sourceFile);
PrintWriter writer = new PrintWriter(bw)) {
writer.format("module %s {%n", moduleName);
for (String l : lines) {
writer.println(l);
}
writer.println("}");
}
return this;
}

View File

@ -796,6 +796,12 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
ifeq ($(OPENJDK_TARGET_OS), linux)
ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
endif
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX

View File

@ -32,7 +32,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
NAME := dt_shmem, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
CFLAGS := $(CFLAGS_JDKLIB), \
EXTRA_HEADER_DIRS := \
jdk.jdwp.agent:include \
jdk.jdwp.agent:libjdwp/export, \

View File

@ -30,8 +30,7 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
NAME := dt_socket, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
$(LIBDT_SOCKET_CPPFLAGS), \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBDT_SOCKET_CPPFLAGS), \
EXTRA_HEADER_DIRS := \
include \
libjdwp/export, \

View File

@ -116,6 +116,7 @@
<in>IBM1122.map</in>
<in>IBM1123.map</in>
<in>IBM1124.map</in>
<in>IBM1129.map</in>
<in>IBM1140.map</in>
<in>IBM1141.map</in>
<in>IBM1142.map</in>
@ -16285,6 +16286,11 @@
tool="3"
flavor2="0">
</item>
<item path="../../make/data/charsetmapping/IBM1129.map"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../make/data/charsetmapping/IBM1140.map"
ex="false"
tool="3"

View File

@ -46,6 +46,20 @@ ifeq ($(INCLUDE_GRAAL), true)
COMPILE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/test/graalunit
LIB_OUTPUTDIR := $(TEST_IMAGE_DIR)/hotspot/jtreg/graal
TEST_COMPILE_CP := \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.compiler \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.ci \
$(LIB_OUTPUTDIR)/junit-4.12.jar \
$(LIB_OUTPUTDIR)/asm-5.0.4.jar \
$(LIB_OUTPUTDIR)/asm-tree-5.0.4.jar \
$(LIB_OUTPUTDIR)/java-allocation-instrumenter.jar \
$(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar
TEST_JAVAC_FLAGS := \
-Xlint:none \
-processorpath $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
### Copy 3rd party libs
$(eval $(call SetupCopyFiles, COPY_GRAALUNIT_LIBS, \
FILES := $(wildcard $(GRAALUNIT_LIB)/*.jar), \
@ -54,7 +68,7 @@ ifeq ($(INCLUDE_GRAAL), true)
TARGETS_EXTRA_LIB += $(COPY_GRAALUNIT_LIBS)
### Compile and build graalunit tests
### Compile graalunit tests
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS, \
SETUP := GENERATE_USINGJDKBYTECODE, \
SRC := \
@ -84,26 +98,41 @@ ifeq ($(INCLUDE_GRAAL), true)
$(SRC_DIR)/org.graalvm.compiler.jtt/src \
$(SRC_DIR)/org.graalvm.compiler.lir.jtt/src \
, \
EXCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \
BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
JAR := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests.jar, \
CLASSPATH := \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.compiler \
$(JDK_OUTPUTDIR)/modules/jdk.internal.vm.ci \
$(LIB_OUTPUTDIR)/junit-4.12.jar \
$(LIB_OUTPUTDIR)/asm-5.0.4.jar \
$(LIB_OUTPUTDIR)/asm-tree-5.0.4.jar \
$(LIB_OUTPUTDIR)/java-allocation-instrumenter.jar \
$(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar \
, \
ADD_JAVAC_FLAGS := \
-Xlint:none -processorpath \
$(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
, \
CLASSPATH := $(TEST_COMPILE_CP), \
ADD_JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \
))
TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS)
### Compile graalunit tests which require -XDstringConcat=inline
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS_SET2, \
SETUP := GENERATE_USINGJDKBYTECODE, \
DEPENDS := $(BUILD_VM_COMPILER_TESTS), \
SRC := $(SRC_DIR)/org.graalvm.compiler.core.test/src, \
INCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \
BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
CLASSPATH := \
$(TEST_COMPILE_CP) \
$(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests \
, \
ADD_JAVAC_FLAGS := \
$(TEST_JAVAC_FLAGS) \
-XDstringConcat=inline \
, \
))
TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS_SET2)
### Generate jdk.vm.compiler.tests.jar
$(eval $(call SetupJarArchive, BUILD_VM_COMPILER_TESTS_JAR, \
DEPENDENCIES := $(BUILD_VM_COMPILER_TESTS) $(BUILD_VM_COMPILER_TESTS_SET2), \
SRCS := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
JAR := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests.jar, \
))
TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS_JAR)
### Compile and build mxtool
$(eval $(call SetupJavaCompilation, BUILD_MXTOOL, \

View File

@ -14471,7 +14471,7 @@ instruct overflowSubL_reg_imm(rFlagsReg cr, iRegL op1, immLAddSub op2)
format %{ "cmp $op1, $op2\t# overflow check long" %}
ins_cost(INSN_COST);
ins_encode %{
__ cmp($op1$$Register, $op2$$constant);
__ subs(zr, $op1$$Register, $op2$$constant);
%}
ins_pipe(icmp_reg_imm);

View File

@ -295,7 +295,7 @@ class PrePost {
int _offset;
Register _r;
public:
PrePost(Register reg, int o) : _r(reg), _offset(o) { }
PrePost(Register reg, int o) : _offset(o), _r(reg) { }
int offset() { return _offset; }
Register reg() { return _r; }
};
@ -353,7 +353,7 @@ class Address {
ext::operation _op;
public:
extend() { }
extend(int s, int o, ext::operation op) : _shift(s), _option(o), _op(op) { }
extend(int s, int o, ext::operation op) : _option(o), _shift(s), _op(op) { }
int option() const{ return _option; }
int shift() const { return _shift; }
ext::operation op() const { return _op; }
@ -398,26 +398,25 @@ class Address {
Address()
: _mode(no_mode) { }
Address(Register r)
: _mode(base_plus_offset), _base(r), _offset(0), _index(noreg), _target(0) { }
: _base(r), _index(noreg), _offset(0), _mode(base_plus_offset), _target(0) { }
Address(Register r, int o)
: _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
: _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
Address(Register r, long o)
: _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
: _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
Address(Register r, unsigned long o)
: _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
: _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
#ifdef ASSERT
Address(Register r, ByteSize disp)
: _mode(base_plus_offset), _base(r), _offset(in_bytes(disp)),
_index(noreg), _target(0) { }
: _base(r), _index(noreg), _offset(in_bytes(disp)), _mode(base_plus_offset), _target(0) { }
#endif
Address(Register r, Register r1, extend ext = lsl())
: _mode(base_plus_offset_reg), _base(r), _index(r1),
_ext(ext), _offset(0), _target(0) { }
: _base(r), _index(r1), _offset(0), _mode(base_plus_offset_reg),
_ext(ext), _target(0) { }
Address(Pre p)
: _mode(pre), _base(p.reg()), _offset(p.offset()) { }
: _base(p.reg()), _offset(p.offset()), _mode(pre) { }
Address(Post p)
: _mode(p.idx_reg() == NULL ? post : post_reg), _base(p.reg()),
_offset(p.offset()), _target(0), _index(p.idx_reg()) { }
: _base(p.reg()), _index(p.idx_reg()), _offset(p.offset()),
_mode(p.idx_reg() == NULL ? post : post_reg), _target(0) { }
Address(address target, RelocationHolder const& rspec)
: _mode(literal),
_rspec(rspec),
@ -426,7 +425,7 @@ class Address {
Address(address target, relocInfo::relocType rtype = relocInfo::external_word_type);
Address(Register base, RegisterOrConstant index, extend ext = lsl())
: _base (base),
_ext(ext), _offset(0), _target(0) {
_offset(0), _ext(ext), _target(0) {
if (index.is_register()) {
_mode = base_plus_offset_reg;
_index = index.as_register();

View File

@ -50,13 +50,13 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

View File

@ -1922,7 +1922,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
if (is_32bit)
__ cmpw(reg1, imm);
else
__ cmp(reg1, imm);
__ subs(zr, reg1, imm);
return;
} else {
__ mov(rscratch1, imm);
@ -2705,7 +2705,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
if (TypeEntries::is_type_none(current_klass)) {
__ cbz(rscratch2, none);
__ cmp(rscratch2, TypeEntries::null_seen);
__ cmp(rscratch2, (u1)TypeEntries::null_seen);
__ br(Assembler::EQ, none);
// There is a chance that the checks above (re-reading profiling
// data from memory) fail if another thread has just set the
@ -2750,7 +2750,7 @@ void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
Label ok;
__ ldr(rscratch1, mdo_addr);
__ cbz(rscratch1, ok);
__ cmp(rscratch1, TypeEntries::null_seen);
__ cmp(rscratch1, (u1)TypeEntries::null_seen);
__ br(Assembler::EQ, ok);
// may have been set by another thread
__ dmb(Assembler::ISHLD);

View File

@ -712,7 +712,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
{
Label ok, not_ok;
__ ldrw(obj_size, Address(klass, Klass::layout_helper_offset()));
__ cmp(obj_size, 0u);
__ cmp(obj_size, (u1)0);
__ br(Assembler::LE, not_ok); // make sure it's an instance (LH > 0)
__ tstw(obj_size, Klass::_lh_instance_slow_path_bit);
__ br(Assembler::EQ, ok);

View File

@ -48,6 +48,10 @@ public:
virtual void obj_equals(MacroAssembler* masm,
Register obj1, Register obj2);
virtual void resolve(MacroAssembler* masm, DecoratorSet decorators, Register obj) {
// Default implementation does not need to do anything.
}
virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
Register obj, Register tmp, Label& slowpath);

View File

@ -1636,7 +1636,7 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& md
ldr(rscratch1, mdo_addr);
cbz(rscratch1, none);
cmp(rscratch1, TypeEntries::null_seen);
cmp(rscratch1, (u1)TypeEntries::null_seen);
br(Assembler::EQ, none);
// There is a chance that the checks above (re-reading profiling
// data from memory) fail if another thread has just set the
@ -1670,7 +1670,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
ldrb(rscratch1, Address(mdp, in_bytes(DataLayout::tag_offset()) - off_to_start));
cmp(rscratch1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
cmp(rscratch1, u1(is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag));
br(Assembler::NE, profile_continue);
if (MethodData::profile_arguments()) {
@ -1682,7 +1682,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
// If return value type is profiled we may have no argument to profile
ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())));
sub(tmp, tmp, i*TypeStackSlotEntries::per_arg_count());
cmp(tmp, TypeStackSlotEntries::per_arg_count());
cmp(tmp, (u1)TypeStackSlotEntries::per_arg_count());
add(rscratch1, mdp, off_to_args);
br(Assembler::LT, done);
}
@ -1752,13 +1752,13 @@ void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret,
// length
Label do_profile;
ldrb(rscratch1, Address(rbcp, 0));
cmp(rscratch1, Bytecodes::_invokedynamic);
cmp(rscratch1, (u1)Bytecodes::_invokedynamic);
br(Assembler::EQ, do_profile);
cmp(rscratch1, Bytecodes::_invokehandle);
cmp(rscratch1, (u1)Bytecodes::_invokehandle);
br(Assembler::EQ, do_profile);
get_method(tmp);
ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
subs(zr, rscratch1, vmIntrinsics::_compiledLambdaForm);
br(Assembler::NE, profile_continue);
bind(do_profile);

View File

@ -494,7 +494,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg,
ldr(swap_reg, mark_addr);
}
andr(tmp_reg, swap_reg, markOopDesc::biased_lock_mask_in_place);
cmp(tmp_reg, markOopDesc::biased_lock_pattern);
cmp(tmp_reg, (u1)markOopDesc::biased_lock_pattern);
br(Assembler::NE, cas_label);
// The bias pattern is present in the object's header. Need to check
// whether the bias owner and the epoch are both still current.
@ -633,7 +633,7 @@ void MacroAssembler::biased_locking_exit(Register obj_reg, Register temp_reg, La
// the bias bit would be clear.
ldr(temp_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
andr(temp_reg, temp_reg, markOopDesc::biased_lock_mask_in_place);
cmp(temp_reg, markOopDesc::biased_lock_pattern);
cmp(temp_reg, (u1)markOopDesc::biased_lock_pattern);
br(Assembler::EQ, done);
}
@ -1137,7 +1137,7 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
if (super_check_offset.is_register()) {
br(Assembler::EQ, *L_success);
cmp(super_check_offset.as_register(), sc_offset);
subs(zr, super_check_offset.as_register(), sc_offset);
if (L_failure == &L_fallthrough) {
br(Assembler::EQ, *L_slow_path);
} else {
@ -3312,7 +3312,7 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len,
add(table3, table0, 3*256*sizeof(juint));
if (UseNeon) {
cmp(len, 64);
cmp(len, (u1)64);
br(Assembler::LT, L_by16);
eor(v16, T16B, v16, v16);
@ -3990,6 +3990,15 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
}
}
void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
// Use stronger ACCESS_WRITE|ACCESS_READ by default.
if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
decorators |= ACCESS_READ | ACCESS_WRITE;
}
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
return bs->resolve(this, decorators, obj);
}
void MacroAssembler::load_heap_oop(Register dst, Address src, Register tmp1,
Register thread_tmp, DecoratorSet decorators) {
access_load_at(T_OBJECT, IN_HEAP | decorators, dst, src, tmp1, thread_tmp);
@ -4362,10 +4371,10 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
if (icnt1 == -1) {
sub(result_tmp, cnt2, cnt1);
cmp(cnt1, 8); // Use Linear Scan if cnt1 < 8 || cnt1 >= 256
cmp(cnt1, (u1)8); // Use Linear Scan if cnt1 < 8 || cnt1 >= 256
br(LT, LINEARSEARCH);
dup(v0, T16B, cnt1); // done in separate FPU pipeline. Almost no penalty
cmp(cnt1, 256);
subs(zr, cnt1, 256);
lsr(tmp1, cnt2, 2);
ccmp(cnt1, tmp1, 0b0000, LT); // Source must be 4 * pattern for BM
br(GE, LINEARSTUB);
@ -4471,7 +4480,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
BIND(BCLOOP);
(this->*str1_load_1chr)(ch1, Address(post(tmp3, str1_chr_size)));
if (!str1_isL) {
cmp(ch1, ASIZE);
subs(zr, ch1, ASIZE);
br(HS, BCSKIP);
}
strb(ch2, Address(sp, ch1));
@ -4535,7 +4544,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
} else {
mov(result_tmp, 1);
}
cmp(skipch, ASIZE);
subs(zr, skipch, ASIZE);
br(HS, BMADV);
}
ldrb(result_tmp, Address(sp, skipch)); // load skip distance
@ -4556,7 +4565,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
b(DONE);
BIND(LINEARSTUB);
cmp(cnt1, 16); // small patterns still should be handled by simple algorithm
cmp(cnt1, (u1)16); // small patterns still should be handled by simple algorithm
br(LT, LINEAR_MEDIUM);
mov(result, zr);
RuntimeAddress stub = NULL;
@ -4585,7 +4594,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
{
Label DOSHORT, FIRST_LOOP, STR2_NEXT, STR1_LOOP, STR1_NEXT;
cmp(cnt1, str1_isL == str2_isL ? 4 : 2);
cmp(cnt1, u1(str1_isL == str2_isL ? 4 : 2));
br(LT, DOSHORT);
BIND(LINEAR_MEDIUM);
(this->*str1_load_1chr)(first, Address(str1));
@ -4620,7 +4629,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
BIND(DOSHORT);
if (str1_isL == str2_isL) {
cmp(cnt1, 2);
cmp(cnt1, (u1)2);
br(LT, DO1);
br(GT, DO3);
}
@ -4695,7 +4704,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
BIND(DO1);
(this->*str1_load_1chr)(ch1, str1);
cmp(cnt2, 8);
cmp(cnt2, (u1)8);
br(LT, DO1_SHORT);
sub(result_tmp, cnt2, 8/str2_chr_size);
@ -4718,7 +4727,7 @@ void MacroAssembler::string_indexof(Register str2, Register str1,
adds(cnt2_neg, cnt2_neg, 8);
br(LT, CH1_LOOP);
cmp(cnt2_neg, 8);
cmp(cnt2_neg, (u1)8);
mov(cnt2_neg, 0);
br(LT, CH1_LOOP);
b(NOMATCH);
@ -4761,7 +4770,7 @@ void MacroAssembler::string_indexof_char(Register str1, Register cnt1,
Register ch1 = rscratch1;
Register result_tmp = rscratch2;
cmp(cnt1, 4);
cmp(cnt1, (u1)4);
br(LT, DO1_SHORT);
orr(ch, ch, ch, LSL, 16);
@ -4784,7 +4793,7 @@ void MacroAssembler::string_indexof_char(Register str1, Register cnt1,
adds(cnt1_neg, cnt1_neg, 8);
br(LT, CH1_LOOP);
cmp(cnt1_neg, 8);
cmp(cnt1_neg, (u1)8);
mov(cnt1_neg, 0);
br(LT, CH1_LOOP);
b(NOMATCH);
@ -4821,7 +4830,7 @@ void MacroAssembler::string_compare(Register str1, Register str2,
DIFFERENCE, NEXT_WORD, SHORT_LOOP_TAIL, SHORT_LAST2, SHORT_LAST_INIT,
SHORT_LOOP_START, TAIL_CHECK;
const int STUB_THRESHOLD = 64 + 8;
const u1 STUB_THRESHOLD = 64 + 8;
bool isLL = ae == StrIntrinsicNode::LL;
bool isLU = ae == StrIntrinsicNode::LU;
bool isUL = ae == StrIntrinsicNode::UL;
@ -5216,10 +5225,10 @@ void MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
ldrw(cnt2, Address(a2, length_offset));
// on most CPUs a2 is still "locked"(surprisingly) in ldrw and it's
// faster to perform another branch before comparing a1 and a2
cmp(cnt1, elem_per_word);
cmp(cnt1, (u1)elem_per_word);
br(LE, SHORT); // short or same
ldr(tmp3, Address(pre(a1, base_offset)));
cmp(cnt1, stubBytesThreshold);
subs(zr, cnt1, stubBytesThreshold);
br(GE, STUB);
ldr(tmp4, Address(pre(a2, base_offset)));
sub(tmp5, zr, cnt1, LSL, 3 + log_elem_size);
@ -5236,7 +5245,7 @@ void MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
cbnz(tmp4, DONE);
ldr(tmp3, Address(pre(a1, wordSize)));
ldr(tmp4, Address(pre(a2, wordSize)));
cmp(cnt1, elem_per_word);
cmp(cnt1, (u1)elem_per_word);
br(LE, TAIL2);
cmp(tmp1, tmp2);
} br(EQ, NEXT_DWORD);
@ -5409,7 +5418,7 @@ void MacroAssembler::zero_words(Register ptr, Register cnt)
assert(ptr == r10 && cnt == r11, "mismatch in register usage");
BLOCK_COMMENT("zero_words {");
cmp(cnt, zero_words_block_size);
cmp(cnt, (u1)zero_words_block_size);
Label around, done, done16;
br(LO, around);
{
@ -5590,15 +5599,15 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
mov(result, len); // Save initial len
#ifndef BUILTIN_SIM
cmp(len, 8); // handle shortest strings first
cmp(len, (u1)8); // handle shortest strings first
br(LT, LOOP_1);
cmp(len, 32);
cmp(len, (u1)32);
br(LT, NEXT_8);
// The following code uses the SIMD 'uzp1' and 'uzp2' instructions
// to convert chars to bytes
if (SoftwarePrefetchHintDistance >= 0) {
ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src);
cmp(len, SoftwarePrefetchHintDistance/2 + 16);
subs(tmp2, len, SoftwarePrefetchHintDistance/2 + 16);
br(LE, NEXT_32_START);
b(NEXT_32_PRFM_START);
BIND(NEXT_32_PRFM);
@ -5618,9 +5627,9 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
sub(len, len, 32);
add(dst, dst, 32);
add(src, src, 64);
cmp(len, SoftwarePrefetchHintDistance/2 + 16);
subs(tmp2, len, SoftwarePrefetchHintDistance/2 + 16);
br(GE, NEXT_32_PRFM);
cmp(len, 32);
cmp(len, (u1)32);
br(LT, LOOP_8);
BIND(NEXT_32);
ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src);
@ -5643,12 +5652,12 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
sub(len, len, 32);
add(dst, dst, 32);
add(src, src, 64);
cmp(len, 32);
cmp(len, (u1)32);
br(GE, NEXT_32);
cbz(len, DONE);
BIND(LOOP_8);
cmp(len, 8);
cmp(len, (u1)8);
br(LT, LOOP_1);
BIND(NEXT_8);
ld1(Vtmp1, T8H, src);
@ -5661,7 +5670,7 @@ void MacroAssembler::encode_iso_array(Register src, Register dst,
sub(len, len, 8);
add(dst, dst, 8);
add(src, src, 16);
cmp(len, 8);
cmp(len, (u1)8);
br(GE, NEXT_8);
BIND(LOOP_1);
@ -5738,7 +5747,7 @@ void MacroAssembler::byte_array_inflate(Register src, Register dst, Register len
const int large_loop_threshold = (64 + 16)/8;
ldrd(vtmp2, post(src, 8));
andw(len, len, 7);
cmp(tmp4, large_loop_threshold);
cmp(tmp4, (u1)large_loop_threshold);
br(GE, to_stub);
b(loop_start);

View File

@ -180,8 +180,9 @@ class MacroAssembler: public Assembler {
template<class T>
inline void cmpw(Register Rd, T imm) { subsw(zr, Rd, imm); }
// imm is limited to 12 bits.
inline void cmp(Register Rd, unsigned imm) { subs(zr, Rd, imm); }
inline void cmp(Register Rd, unsigned char imm8) { subs(zr, Rd, imm8); }
inline void cmp(Register Rd, unsigned imm) __attribute__ ((deprecated));
inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); }
inline void cmn(Register Rd, unsigned imm) { adds(zr, Rd, imm); }
@ -795,6 +796,10 @@ public:
void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
Register tmp1, Register tmp_thread);
// Resolves obj for access. Result is placed in the same register.
// All other registers are preserved.
void resolve(DecoratorSet decorators, Register obj);
void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
Register thread_tmp = noreg, DecoratorSet decorators = 0);

View File

@ -292,7 +292,7 @@ void MacroAssembler::fast_log(FloatRegister vtmp0, FloatRegister vtmp1,
// vtmp1 = AS_DOUBLE_BITS(0x77F0 << 48 | mantissa(X)) == mx
fmovd(vtmp1, tmp4);
subw(tmp2, tmp2, 16);
cmp(tmp2, 0x8000);
subs(zr, tmp2, 0x8000);
br(GE, SMALL_VALUE);
bind(MAIN);
fmovs(tmp3, vtmp5); // int intB0 = AS_INT_BITS(B);

View File

@ -297,7 +297,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
fmsubd(v3, v2, v6, v31); // v3 = r = t - fn * pio2_1
fmuld(v26, v2, v7); // v26 = w = fn * pio2_1t
fsubd(v4, v3, v26); // y[0] = r - w. Calculated before branch
cmp(n, 32);
cmp(n, (u1)32);
br(GT, LARGE_ELSE);
subw(tmp5, n, 1); // tmp5 = n - 1
ldrw(jv, Address(ih, tmp5, Address::lsl(2)));
@ -312,7 +312,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1); // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff);
block_comment("if(i>16)"); {
cmp(tmp3, 16);
cmp(tmp3, (u1)16);
br(LE, X_IS_MEDIUM_BRANCH_DONE);
// i > 16. 2nd iteration needed
ldpd(v6, v7, Address(ih, -32));
@ -328,7 +328,7 @@ void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw,
sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1); // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff);
block_comment("if(i>49)"); {
cmp(tmp3, 49);
cmp(tmp3, (u1)49);
br(LE, X_IS_MEDIUM_BRANCH_DONE);
// 3rd iteration need, 151 bits acc
ldpd(v6, v7, Address(ih, -16));

View File

@ -196,7 +196,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
Label L;
BLOCK_COMMENT("verify_intrinsic_id {");
__ ldrh(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
__ cmp(rscratch1, (int) iid);
__ subs(zr, rscratch1, (int) iid);
__ br(Assembler::EQ, L);
if (iid == vmIntrinsics::_linkToVirtual ||
iid == vmIntrinsics::_linkToSpecial) {

View File

@ -1152,12 +1152,12 @@ class ComputeMoveOrder: public StackObj {
public:
MoveOperation(int src_index, VMRegPair src, int dst_index, VMRegPair dst):
_src(src)
, _src_index(src_index)
, _dst(dst)
, _src_index(src_index)
, _dst_index(dst_index)
, _processed(false)
, _next(NULL)
, _prev(NULL)
, _processed(false) { Unimplemented(); }
, _prev(NULL) { Unimplemented(); }
VMRegPair src() const { Unimplemented(); return _src; }
int src_id() const { Unimplemented(); return 0; }
@ -1839,6 +1839,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Load the oop from the handle
__ ldr(obj_reg, Address(oop_handle_reg, 0));
__ resolve(IS_NOT_NULL, obj_reg);
if (UseBiasedLocking) {
__ biased_locking_enter(lock_reg, obj_reg, swap_reg, tmp, false, lock_done, &slow_path_lock);
}
@ -2001,6 +2003,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Get locked oop from the handle we passed to jni
__ ldr(obj_reg, Address(oop_handle_reg, 0));
__ resolve(IS_NOT_NULL, obj_reg);
Label done;
if (UseBiasedLocking) {

View File

@ -265,7 +265,7 @@ class StubGenerator: public StubCodeGenerator {
{
Label L;
__ ldr(rscratch1, Address(rthread, in_bytes(Thread::pending_exception_offset())));
__ cmp(rscratch1, (unsigned)NULL_WORD);
__ cmp(rscratch1, (u1)NULL_WORD);
__ br(Assembler::EQ, L);
__ stop("StubRoutines::call_stub: entered with pending exception");
__ BIND(L);
@ -322,13 +322,13 @@ class StubGenerator: public StubCodeGenerator {
__ ldr(j_rarg2, result);
Label is_long, is_float, is_double, exit;
__ ldr(j_rarg1, result_type);
__ cmp(j_rarg1, T_OBJECT);
__ cmp(j_rarg1, (u1)T_OBJECT);
__ br(Assembler::EQ, is_long);
__ cmp(j_rarg1, T_LONG);
__ cmp(j_rarg1, (u1)T_LONG);
__ br(Assembler::EQ, is_long);
__ cmp(j_rarg1, T_FLOAT);
__ cmp(j_rarg1, (u1)T_FLOAT);
__ br(Assembler::EQ, is_float);
__ cmp(j_rarg1, T_DOUBLE);
__ cmp(j_rarg1, (u1)T_DOUBLE);
__ br(Assembler::EQ, is_double);
// handle T_INT case
@ -743,7 +743,7 @@ class StubGenerator: public StubCodeGenerator {
// Make sure we are never given < 8 words
{
Label L;
__ cmp(count, 8);
__ cmp(count, (u1)8);
__ br(Assembler::GE, L);
__ stop("genrate_copy_longs called with < 8 words");
__ bind(L);
@ -1103,19 +1103,19 @@ class StubGenerator: public StubCodeGenerator {
if (PrefetchCopyIntervalInBytes > 0)
__ prfm(Address(s, 0), PLDL1KEEP);
__ cmp(count, (UseSIMDForMemoryOps ? 96:80)/granularity);
__ cmp(count, u1((UseSIMDForMemoryOps ? 96:80)/granularity));
__ br(Assembler::HI, copy_big);
__ lea(send, Address(s, count, Address::lsl(exact_log2(granularity))));
__ lea(dend, Address(d, count, Address::lsl(exact_log2(granularity))));
__ cmp(count, 16/granularity);
__ cmp(count, u1(16/granularity));
__ br(Assembler::LS, copy16);
__ cmp(count, 64/granularity);
__ cmp(count, u1(64/granularity));
__ br(Assembler::HI, copy80);
__ cmp(count, 32/granularity);
__ cmp(count, u1(32/granularity));
__ br(Assembler::LS, copy32);
// 33..64 bytes
@ -1170,7 +1170,7 @@ class StubGenerator: public StubCodeGenerator {
// 0..16 bytes
__ bind(copy16);
__ cmp(count, 8/granularity);
__ cmp(count, u1(8/granularity));
__ br(Assembler::LO, copy8);
// 8..16 bytes
@ -3270,7 +3270,7 @@ class StubGenerator: public StubCodeGenerator {
// The pipelined loop needs at least 16 elements for 1 iteration
// It does check this, but it is more effective to skip to the cleanup loop
__ cmp(len, 16);
__ cmp(len, (u1)16);
__ br(Assembler::HS, L_nmax);
__ cbz(len, L_combine);
@ -3654,7 +3654,7 @@ class StubGenerator: public StubCodeGenerator {
address generate_has_negatives(address &has_negatives_long) {
StubCodeMark mark(this, "StubRoutines", "has_negatives");
const int large_loop_size = 64;
const u1 large_loop_size = 64;
const uint64_t UPPER_BIT_MASK=0x8080808080808080;
int dcache_line = VM_Version::dcache_line_size();
@ -3668,7 +3668,7 @@ class StubGenerator: public StubCodeGenerator {
Label RET_TRUE, RET_TRUE_NO_POP, RET_FALSE, ALIGNED, LOOP16, CHECK_16, DONE,
LARGE_LOOP, POST_LOOP16, LEN_OVER_15, LEN_OVER_8, POST_LOOP16_LOAD_TAIL;
__ cmp(len, 15);
__ cmp(len, (u1)15);
__ br(Assembler::GT, LEN_OVER_15);
// The only case when execution falls into this code is when pointer is near
// the end of memory page and we have to avoid reading next page
@ -3764,7 +3764,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(Assembler::GE, LARGE_LOOP);
__ bind(CHECK_16); // small 16-byte load pre-loop
__ cmp(len, 16);
__ cmp(len, (u1)16);
__ br(Assembler::LT, POST_LOOP16);
__ bind(LOOP16); // small 16-byte load loop
@ -3773,11 +3773,11 @@ class StubGenerator: public StubCodeGenerator {
__ orr(tmp2, tmp2, tmp3);
__ tst(tmp2, UPPER_BIT_MASK);
__ br(Assembler::NE, RET_TRUE);
__ cmp(len, 16);
__ cmp(len, (u1)16);
__ br(Assembler::GE, LOOP16); // 16-byte load loop end
__ bind(POST_LOOP16); // 16-byte aligned, so we can read unconditionally
__ cmp(len, 8);
__ cmp(len, (u1)8);
__ br(Assembler::LE, POST_LOOP16_LOAD_TAIL);
__ ldr(tmp3, Address(__ post(ary1, 8)));
__ sub(len, len, 8);
@ -3942,7 +3942,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(__ LE, NO_PREFETCH_LARGE_LOOP);
generate_large_array_equals_loop_simd(prefetchLoopThreshold,
/* prfm = */ true, NOT_EQUAL);
__ cmp(cnt1, nonPrefetchLoopThreshold);
__ subs(zr, cnt1, nonPrefetchLoopThreshold);
__ br(__ LT, TAIL);
}
__ bind(NO_PREFETCH_LARGE_LOOP);
@ -3955,7 +3955,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(__ LE, NO_PREFETCH_LARGE_LOOP);
generate_large_array_equals_loop_nonsimd(prefetchLoopThreshold,
/* prfm = */ true, NOT_EQUAL);
__ cmp(cnt1, nonPrefetchLoopThreshold);
__ subs(zr, cnt1, nonPrefetchLoopThreshold);
__ br(__ LT, TAIL);
}
__ bind(NO_PREFETCH_LARGE_LOOP);
@ -4106,7 +4106,7 @@ class StubGenerator: public StubCodeGenerator {
__ ldr(tmp3, Address(__ post(cnt1, 8)));
if (SoftwarePrefetchHintDistance >= 0) {
__ cmp(cnt2, prefetchLoopExitCondition);
__ subs(rscratch2, cnt2, prefetchLoopExitCondition);
__ br(__ LT, SMALL_LOOP);
__ bind(LARGE_LOOP_PREFETCH);
__ prfm(Address(tmp2, SoftwarePrefetchHintDistance));
@ -4123,7 +4123,7 @@ class StubGenerator: public StubCodeGenerator {
__ subs(tmp4, tmp4, 1);
__ br(__ GT, LARGE_LOOP_PREFETCH_REPEAT2);
__ sub(cnt2, cnt2, 64);
__ cmp(cnt2, prefetchLoopExitCondition);
__ subs(rscratch2, cnt2, prefetchLoopExitCondition);
__ br(__ GE, LARGE_LOOP_PREFETCH);
}
__ cbz(cnt2, LOAD_LAST); // no characters left except last load
@ -4137,7 +4137,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(__ GE, SMALL_LOOP);
__ cbz(cnt2, LOAD_LAST);
__ bind(TAIL); // 1..15 characters left
__ cmp(cnt2, -8);
__ subs(zr, cnt2, -8);
__ br(__ GT, TAIL_LOAD_16);
__ ldrd(vtmp, Address(tmp2));
__ zip1(vtmp3, __ T8B, vtmp, vtmpZ);
@ -4240,7 +4240,7 @@ class StubGenerator: public StubCodeGenerator {
compare_string_16_bytes_same(DIFF, DIFF2);
__ sub(cnt2, cnt2, isLL ? 64 : 32);
compare_string_16_bytes_same(DIFF, DIFF2);
__ cmp(cnt2, largeLoopExitCondition);
__ subs(rscratch2, cnt2, largeLoopExitCondition);
compare_string_16_bytes_same(DIFF, DIFF2);
__ br(__ GT, LARGE_LOOP_PREFETCH);
__ cbz(cnt2, LAST_CHECK_AND_LENGTH_DIFF); // no more chars left?
@ -4416,7 +4416,7 @@ class StubGenerator: public StubCodeGenerator {
__ add(result, result, wordSize/str2_chr_size);
__ br(__ GE, L_LOOP);
__ BIND(L_POST_LOOP);
__ cmp(cnt2, -wordSize/str2_chr_size); // no extra characters to check
__ subs(zr, cnt2, -wordSize/str2_chr_size); // no extra characters to check
__ br(__ LE, NOMATCH);
__ ldr(ch2, Address(str2));
__ sub(cnt2, zr, cnt2, __ LSL, LogBitsPerByte + str2_chr_shift);
@ -4446,7 +4446,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(__ EQ, NOMATCH);
__ BIND(L_SMALL_HAS_ZERO_LOOP);
__ clz(tmp4, tmp2); // potentially long. Up to 4 cycles on some cpu's
__ cmp(cnt1, wordSize/str2_chr_size);
__ cmp(cnt1, u1(wordSize/str2_chr_size));
__ br(__ LE, L_SMALL_CMP_LOOP_LAST_CMP2);
if (str2_isL) { // LL
__ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); // address of "index"
@ -4659,7 +4659,7 @@ class StubGenerator: public StubCodeGenerator {
__ zip1(v2, __ T16B, v2, v0);
__ st1(v1, v2, __ T16B, __ post(dst, 32));
__ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64)));
__ cmp(octetCounter, large_loop_threshold);
__ subs(rscratch1, octetCounter, large_loop_threshold);
__ br(__ LE, LOOP_START);
__ b(LOOP_PRFM_START);
__ bind(LOOP_PRFM);
@ -4667,17 +4667,17 @@ class StubGenerator: public StubCodeGenerator {
__ bind(LOOP_PRFM_START);
__ prfm(Address(src, SoftwarePrefetchHintDistance));
__ sub(octetCounter, octetCounter, 8);
__ cmp(octetCounter, large_loop_threshold);
__ subs(rscratch1, octetCounter, large_loop_threshold);
inflate_and_store_2_fp_registers(true, v3, v4);
inflate_and_store_2_fp_registers(true, v5, v6);
__ br(__ GT, LOOP_PRFM);
__ cmp(octetCounter, 8);
__ cmp(octetCounter, (u1)8);
__ br(__ LT, DONE);
__ bind(LOOP);
__ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64)));
__ bind(LOOP_START);
__ sub(octetCounter, octetCounter, 8);
__ cmp(octetCounter, 8);
__ cmp(octetCounter, (u1)8);
inflate_and_store_2_fp_registers(false, v3, v4);
inflate_and_store_2_fp_registers(false, v5, v6);
__ br(__ GE, LOOP);
@ -5308,7 +5308,7 @@ class StubGenerator: public StubCodeGenerator {
{
ldr(Rn, Address(Pn_base, 0));
mul(Rlo_mn, Rn, inv);
cmp(Rlo_mn, -1);
subs(zr, Rlo_mn, -1);
Label ok;
br(EQ, ok); {
stop("broken inverse in Montgomery multiply");

View File

@ -836,6 +836,7 @@ void TemplateInterpreterGenerator::lock_method() {
#endif // ASSERT
__ bind(done);
__ resolve(IS_NOT_NULL, r0);
}
// add space for monitor & lock
@ -1062,6 +1063,7 @@ address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractI
__ ldrw(crc, Address(esp, 4*wordSize)); // Initial CRC
} else {
__ ldr(buf, Address(esp, 2*wordSize)); // byte[] array
__ resolve(IS_NOT_NULL | ACCESS_READ, buf);
__ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
__ ldrw(off, Address(esp, wordSize)); // offset
__ add(buf, buf, off); // + offset
@ -1106,6 +1108,9 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract
__ ldrw(off, Address(esp, wordSize)); // int offset
__ sub(len, end, off);
__ ldr(buf, Address(esp, 2*wordSize)); // byte[] buf | long buf
if (kind == Interpreter::java_util_zip_CRC32C_updateBytes) {
__ resolve(IS_NOT_NULL | ACCESS_READ, buf);
}
__ add(buf, buf, off); // + offset
if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
__ ldrw(crc, Address(esp, 4*wordSize)); // long crc
@ -1355,7 +1360,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
{
Label L;
__ ldrw(t, Address(rthread, JavaThread::thread_state_offset()));
__ cmp(t, _thread_in_Java);
__ cmp(t, (u1)_thread_in_Java);
__ br(Assembler::EQ, L);
__ stop("Wrong thread state in native stub");
__ bind(L);
@ -1462,7 +1467,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
Label no_reguard;
__ lea(rscratch1, Address(rthread, in_bytes(JavaThread::stack_guard_state_offset())));
__ ldrw(rscratch1, Address(rscratch1));
__ cmp(rscratch1, JavaThread::stack_guard_yellow_reserved_disabled);
__ cmp(rscratch1, (u1)JavaThread::stack_guard_yellow_reserved_disabled);
__ br(Assembler::NE, no_reguard);
__ pusha(); // XXX only save smashed registers

View File

@ -331,16 +331,16 @@ void TemplateTable::ldc(bool wide)
__ ldarb(r3, r3);
// unresolved class - get the resolved class
__ cmp(r3, JVM_CONSTANT_UnresolvedClass);
__ cmp(r3, (u1)JVM_CONSTANT_UnresolvedClass);
__ br(Assembler::EQ, call_ldc);
// unresolved class in error state - call into runtime to throw the error
// from the first resolution attempt
__ cmp(r3, JVM_CONSTANT_UnresolvedClassInError);
__ cmp(r3, (u1)JVM_CONSTANT_UnresolvedClassInError);
__ br(Assembler::EQ, call_ldc);
// resolved class - need to call vm to get java mirror of the class
__ cmp(r3, JVM_CONSTANT_Class);
__ cmp(r3, (u1)JVM_CONSTANT_Class);
__ br(Assembler::NE, notClass);
__ bind(call_ldc);
@ -351,7 +351,7 @@ void TemplateTable::ldc(bool wide)
__ b(Done);
__ bind(notClass);
__ cmp(r3, JVM_CONSTANT_Float);
__ cmp(r3, (u1)JVM_CONSTANT_Float);
__ br(Assembler::NE, notFloat);
// ftos
__ adds(r1, r2, r1, Assembler::LSL, 3);
@ -361,7 +361,7 @@ void TemplateTable::ldc(bool wide)
__ bind(notFloat);
__ cmp(r3, JVM_CONSTANT_Integer);
__ cmp(r3, (u1)JVM_CONSTANT_Integer);
__ br(Assembler::NE, notInt);
// itos
@ -2333,7 +2333,7 @@ void TemplateTable::resolve_cache_and_index(int byte_no,
assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
__ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size);
__ cmp(temp, (int) code); // have we resolved this bytecode?
__ subs(zr, temp, (int) code); // have we resolved this bytecode?
__ br(Assembler::EQ, resolved);
// resolve first time through
@ -2515,7 +2515,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notByte);
__ cmp(flags, ztos);
__ cmp(flags, (u1)ztos);
__ br(Assembler::NE, notBool);
// ztos (same code as btos)
@ -2529,7 +2529,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notBool);
__ cmp(flags, atos);
__ cmp(flags, (u1)atos);
__ br(Assembler::NE, notObj);
// atos
do_oop_load(_masm, field, r0, IN_HEAP);
@ -2540,7 +2540,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notObj);
__ cmp(flags, itos);
__ cmp(flags, (u1)itos);
__ br(Assembler::NE, notInt);
// itos
__ access_load_at(T_INT, IN_HEAP, r0, field, noreg, noreg);
@ -2552,7 +2552,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notInt);
__ cmp(flags, ctos);
__ cmp(flags, (u1)ctos);
__ br(Assembler::NE, notChar);
// ctos
__ access_load_at(T_CHAR, IN_HEAP, r0, field, noreg, noreg);
@ -2564,7 +2564,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notChar);
__ cmp(flags, stos);
__ cmp(flags, (u1)stos);
__ br(Assembler::NE, notShort);
// stos
__ access_load_at(T_SHORT, IN_HEAP, r0, field, noreg, noreg);
@ -2576,7 +2576,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notShort);
__ cmp(flags, ltos);
__ cmp(flags, (u1)ltos);
__ br(Assembler::NE, notLong);
// ltos
__ access_load_at(T_LONG, IN_HEAP, r0, field, noreg, noreg);
@ -2588,7 +2588,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(Done);
__ bind(notLong);
__ cmp(flags, ftos);
__ cmp(flags, (u1)ftos);
__ br(Assembler::NE, notFloat);
// ftos
__ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
@ -2601,7 +2601,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ bind(notFloat);
#ifdef ASSERT
__ cmp(flags, dtos);
__ cmp(flags, (u1)dtos);
__ br(Assembler::NE, notDouble);
#endif
// dtos
@ -2751,7 +2751,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notByte);
__ cmp(flags, ztos);
__ cmp(flags, (u1)ztos);
__ br(Assembler::NE, notBool);
// ztos
@ -2766,7 +2766,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notBool);
__ cmp(flags, atos);
__ cmp(flags, (u1)atos);
__ br(Assembler::NE, notObj);
// atos
@ -2782,7 +2782,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notObj);
__ cmp(flags, itos);
__ cmp(flags, (u1)itos);
__ br(Assembler::NE, notInt);
// itos
@ -2797,7 +2797,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notInt);
__ cmp(flags, ctos);
__ cmp(flags, (u1)ctos);
__ br(Assembler::NE, notChar);
// ctos
@ -2812,7 +2812,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notChar);
__ cmp(flags, stos);
__ cmp(flags, (u1)stos);
__ br(Assembler::NE, notShort);
// stos
@ -2827,7 +2827,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notShort);
__ cmp(flags, ltos);
__ cmp(flags, (u1)ltos);
__ br(Assembler::NE, notLong);
// ltos
@ -2842,7 +2842,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notLong);
__ cmp(flags, ftos);
__ cmp(flags, (u1)ftos);
__ br(Assembler::NE, notFloat);
// ftos
@ -2858,7 +2858,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
__ bind(notFloat);
#ifdef ASSERT
__ cmp(flags, dtos);
__ cmp(flags, (u1)dtos);
__ br(Assembler::NE, notDouble);
#endif
@ -3534,7 +3534,7 @@ void TemplateTable::_new() {
__ lea(rscratch1, Address(r0, r3, Address::lsl(0)));
__ lea(rscratch1, Address(rscratch1, tags_offset));
__ ldarb(rscratch1, rscratch1);
__ cmp(rscratch1, JVM_CONSTANT_Class);
__ cmp(rscratch1, (u1)JVM_CONSTANT_Class);
__ br(Assembler::NE, slow_case);
// get InstanceKlass
@ -3543,7 +3543,7 @@ void TemplateTable::_new() {
// make sure klass is initialized & doesn't have finalizer
// make sure klass is fully initialized
__ ldrb(rscratch1, Address(r4, InstanceKlass::init_state_offset()));
__ cmp(rscratch1, InstanceKlass::fully_initialized);
__ cmp(rscratch1, (u1)InstanceKlass::fully_initialized);
__ br(Assembler::NE, slow_case);
// get instance_size in InstanceKlass (scaled to a count of bytes)
@ -3683,7 +3683,7 @@ void TemplateTable::checkcast()
__ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
__ lea(r1, Address(rscratch1, r19));
__ ldarb(r1, r1);
__ cmp(r1, JVM_CONSTANT_Class);
__ cmp(r1, (u1)JVM_CONSTANT_Class);
__ br(Assembler::EQ, quicked);
__ push(atos); // save receiver for result, and for GC
@ -3737,7 +3737,7 @@ void TemplateTable::instanceof() {
__ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
__ lea(r1, Address(rscratch1, r19));
__ ldarb(r1, r1);
__ cmp(r1, JVM_CONSTANT_Class);
__ cmp(r1, (u1)JVM_CONSTANT_Class);
__ br(Assembler::EQ, quicked);
__ push(atos); // save receiver for result, and for GC
@ -3840,6 +3840,8 @@ void TemplateTable::monitorenter()
// check for NULL object
__ null_check(r0);
__ resolve(IS_NOT_NULL, r0);
const Address monitor_block_top(
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
@ -3939,6 +3941,8 @@ void TemplateTable::monitorexit()
// check for NULL object
__ null_check(r0);
__ resolve(IS_NOT_NULL, r0);
const Address monitor_block_top(
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(

View File

@ -1083,6 +1083,7 @@ class Assembler : public AbstractAssembler {
break;
default:
ShouldNotReachHere();
return;
}
emit_int32(0xf << 28 | 0x1 << 25 | 0x1 << 23 | 0x1 << 4 |
(imm8 >> 7) << 24 | ((imm8 & 0x70) >> 4) << 16 | (imm8 & 0xf) |
@ -1113,6 +1114,7 @@ class Assembler : public AbstractAssembler {
break;
default:
ShouldNotReachHere();
return;
}
emit_int32(cond << 28 | 0x1D /* 0b11101 */ << 23 | 0xB /* 0b1011 */ << 8 | 0x1 << 4 |
quad << 21 | b << 22 | e << 5 | Rs->encoding() << 12 |
@ -1143,6 +1145,7 @@ class Assembler : public AbstractAssembler {
break;
default:
ShouldNotReachHere();
return;
}
emit_int32(0xF /* 0b1111 */ << 28 | 0x3B /* 0b00111011 */ << 20 | 0x6 /* 0b110 */ << 9 |
quad << 6 | imm4 << 16 |

View File

@ -52,13 +52,13 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

View File

@ -3086,7 +3086,7 @@ void LIR_Assembler::emit_assert(LIR_OpAssert* op) {
Label ok;
if (op->condition() != lir_cond_always) {
AsmCondition acond;
AsmCondition acond = al;
switch (op->condition()) {
case lir_cond_equal: acond = eq; break;
case lir_cond_notEqual: acond = ne; break;

View File

@ -733,6 +733,7 @@ void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
default:
ShouldNotReachHere();
return;
}
#else
switch (x->op()) {
@ -757,6 +758,7 @@ void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
break;
default:
ShouldNotReachHere();
return;
}
LIR_Opr result = call_runtime(x->y(), x->x(), entry, x->type(), NULL);
set_result(x, result);
@ -824,7 +826,7 @@ void LIRGenerator::do_ArithmeticOp_Int(ArithmeticOp* x) {
if (x->op() == Bytecodes::_irem) {
out_reg = FrameMap::R0_opr;
__ irem(left_arg->result(), right_arg->result(), out_reg, tmp, info);
} else if (x->op() == Bytecodes::_idiv) {
} else { // (x->op() == Bytecodes::_idiv)
out_reg = FrameMap::R1_opr;
__ idiv(left_arg->result(), right_arg->result(), out_reg, tmp, info);
}

View File

@ -39,13 +39,13 @@
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

View File

@ -359,13 +359,13 @@
// ...
//
// frame pointer for this frame
intptr_t* _fp;
// The frame's stack pointer before it has been extended by a c2i adapter;
// needed by deoptimization
intptr_t* _unextended_sp;
// frame pointer for this frame
intptr_t* _fp;
public:
// Accessors for fields

View File

@ -55,7 +55,7 @@ inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) {
// Constructors
// Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
inline frame::frame() : _sp(NULL), _unextended_sp(NULL), _fp(NULL), _cb(NULL), _pc(NULL), _deopt_state(unknown) {}
inline frame::frame() : _sp(NULL), _pc(NULL), _cb(NULL), _deopt_state(unknown), _unextended_sp(NULL), _fp(NULL) {}
inline frame::frame(intptr_t* sp) : _sp(sp), _unextended_sp(sp) {
find_codeblob_and_set_pc_and_deopt_state((address)own_abi()->lr); // also sets _fp and adjusts _unextended_sp

View File

@ -29,6 +29,7 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
@ -458,7 +459,7 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ mflr(R0);
__ std(R0, _abi(lr), R1_SP);
__ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
__ pop_frame();
__ ld(R0, _abi(lr), R1_SP);
__ mtlr(R0);

View File

@ -41,13 +41,13 @@
#define CHECK_BAILOUT() { if (ce->compilation()->bailed_out()) return; }
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

View File

@ -444,12 +444,12 @@
// NOTE: Stack pointer is now held in the base class, so remove it from here.
// Frame pointer for this frame.
intptr_t* _fp;
// Needed by deoptimization.
intptr_t* _unextended_sp;
// Frame pointer for this frame.
intptr_t* _fp;
public:
// Interface for all frames:

View File

@ -54,7 +54,7 @@ inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) {
// Constructors
// Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
inline frame::frame() : _sp(NULL), _unextended_sp(NULL), _fp(NULL), _cb(NULL), _pc(NULL), _deopt_state(unknown) {}
inline frame::frame() : _sp(NULL), _pc(NULL), _cb(NULL), _deopt_state(unknown), _unextended_sp(NULL), _fp(NULL) {}
inline frame::frame(intptr_t* sp) : _sp(sp), _unextended_sp(sp) {
find_codeblob_and_set_pc_and_deopt_state((address)own_abi()->return_pc);
@ -71,7 +71,7 @@ inline frame::frame(intptr_t* sp, address pc, intptr_t* unextended_sp) : _sp(sp)
// Generic constructor. Used by pns() in debug.cpp only
#ifndef PRODUCT
inline frame::frame(void* sp, void* pc, void* unextended_sp) :
_sp((intptr_t*)sp), _unextended_sp((intptr_t*)unextended_sp), _cb(NULL), _pc(NULL) {
_sp((intptr_t*)sp), _pc(NULL), _cb(NULL), _unextended_sp((intptr_t*)unextended_sp) {
find_codeblob_and_set_pc_and_deopt_state((address)pc); // Also sets _fp and adjusts _unextended_sp.
}
#endif

View File

@ -30,6 +30,7 @@
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
@ -520,7 +521,7 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ bind(refill);
save_volatile_registers(sasm);
__ z_lgr(tmp, pre_val); // save pre_val
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread),
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1SATBMarkQueueSet::handle_zero_index_for_thread),
Z_thread);
__ z_lgr(pre_val, tmp); // restore pre_val
restore_volatile_registers(sasm);

View File

@ -28,6 +28,7 @@
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#include "interpreter/interp_masm.hpp"
@ -160,7 +161,7 @@ static void generate_satb_log_enqueue(bool with_frame) {
address handle_zero =
CAST_FROM_FN_PTR(address,
&SATBMarkQueueSet::handle_zero_index_for_thread);
&G1SATBMarkQueueSet::handle_zero_index_for_thread);
// This should be rare enough that we can afford to save all the
// scratch registers that the calling context might be using.
__ mov(G1_scratch, L0);
@ -606,8 +607,8 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ call_VM_leaf(L7_thread_cache,
CAST_FROM_FN_PTR(address,
SATBMarkQueueSet::handle_zero_index_for_thread),
G2_thread);
G1SATBMarkQueueSet::handle_zero_index_for_thread),
G2_thread);
__ restore_live_registers(true);
@ -694,7 +695,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
__ call_VM_leaf(L7_thread_cache,
CAST_FROM_FN_PTR(address,
DirtyCardQueueSet::handle_zero_index_for_thread),
G2_thread);
G2_thread);
__ restore_live_registers(true);

View File

@ -2219,8 +2219,8 @@ public:
_evex_encoding(0),
_is_clear_context(true),
_is_extended_context(false),
_current_assembler(NULL),
_embedded_opmask_register_specifier(1) { // hard code k1, it will be initialized for now
_embedded_opmask_register_specifier(1), // hard code k1, it will be initialized for now
_current_assembler(NULL) {
if (UseAVX < 3) _legacy_mode = true;
}

View File

@ -89,13 +89,13 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
: _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
: _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}
RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
: _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
: _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
assert(info != NULL, "must have info");
_info = new CodeEmitInfo(info);
}

View File

@ -110,9 +110,9 @@ void LinearScan::allocate_fpu_stack() {
FpuStackAllocator::FpuStackAllocator(Compilation* compilation, LinearScan* allocator)
: _compilation(compilation)
, _allocator(allocator)
, _lir(NULL)
, _pos(-1)
, _allocator(allocator)
, _sim(compilation)
, _temp_sim(compilation)
{}

View File

@ -61,6 +61,10 @@ public:
virtual void obj_equals(MacroAssembler* masm,
Register obj1, Address obj2);
virtual void resolve(MacroAssembler* masm, DecoratorSet decorators, Register obj) {
// Default implementation does not need to do anything.
}
// Support for jniFastGetField to try resolving a jobject/jweak in native
virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
Register obj, Register tmp, Label& slowpath);

View File

@ -6287,6 +6287,15 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Ad
}
}
void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
// Use stronger ACCESS_WRITE|ACCESS_READ by default.
if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
decorators |= ACCESS_READ | ACCESS_WRITE;
}
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
return bs->resolve(this, decorators, obj);
}
void MacroAssembler::load_heap_oop(Register dst, Address src, Register tmp1,
Register thread_tmp, DecoratorSet decorators) {
access_load_at(T_OBJECT, IN_HEAP | decorators, dst, src, tmp1, thread_tmp);

View File

@ -319,6 +319,10 @@ class MacroAssembler: public Assembler {
void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
Register tmp1, Register tmp2);
// Resolves obj access. Result is placed in the same register.
// All other registers are preserved.
void resolve(DecoratorSet decorators, Register obj);
void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
Register thread_tmp = noreg, DecoratorSet decorators = 0);
void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,

View File

@ -1633,12 +1633,12 @@ class ComputeMoveOrder: public StackObj {
public:
MoveOperation(int src_index, VMRegPair src, int dst_index, VMRegPair dst):
_src(src)
, _src_index(src_index)
, _dst(dst)
, _src_index(src_index)
, _dst_index(dst_index)
, _processed(false)
, _next(NULL)
, _prev(NULL)
, _processed(false) {
, _prev(NULL) {
}
VMRegPair src() const { return _src; }
@ -2450,6 +2450,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Load the oop from the handle
__ movptr(obj_reg, Address(oop_handle_reg, 0));
__ resolve(IS_NOT_NULL, obj_reg);
if (UseBiasedLocking) {
__ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch1, false, lock_done, &slow_path_lock);
}
@ -2635,6 +2636,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Get locked oop from the handle we passed to jni
__ movptr(obj_reg, Address(oop_handle_reg, 0));
__ resolve(IS_NOT_NULL, obj_reg);
Label done;

View File

@ -635,6 +635,7 @@ void TemplateInterpreterGenerator::lock_method() {
#endif // ASSERT
__ bind(done);
__ resolve(IS_NOT_NULL, rax);
}
// add space for monitor & lock

View File

@ -257,6 +257,7 @@ address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractI
__ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC
} else {
__ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
__ resolve(IS_NOT_NULL | ACCESS_READ, buf);
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
__ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
__ addq(buf, off); // + offset
@ -312,6 +313,7 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract
// "When calculating operand stack length, values of type long and double have length two."
} else {
__ movptr(buf, Address(rsp, 3 * wordSize)); // byte[] array
__ resolve(IS_NOT_NULL | ACCESS_READ, buf);
__ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
__ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
__ addq(buf, off); // + offset

View File

@ -4357,6 +4357,8 @@ void TemplateTable::monitorenter() {
// check for NULL object
__ null_check(rax);
__ resolve(IS_NOT_NULL, rax);
const Address monitor_block_top(
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
@ -4454,6 +4456,8 @@ void TemplateTable::monitorexit() {
// check for NULL object
__ null_check(rax);
__ resolve(IS_NOT_NULL, rax);
const Address monitor_block_top(
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(

View File

@ -2705,10 +2705,6 @@ OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr)
return (ret == 0) ? OS_OK : OS_ERR;
}
// Hint to the underlying OS that a task switch would not be good.
// Void return because it's a hint and can fail.
void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support

View File

@ -2465,10 +2465,6 @@ OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr)
return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR);
}
// Hint to the underlying OS that a task switch would not be good.
// Void return because it's a hint and can fail.
void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support

View File

@ -4192,10 +4192,6 @@ OSReturn os::get_native_priority(const Thread* const thread,
return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR);
}
// Hint to the underlying OS that a task switch would not be good.
// Void return because it's a hint and can fail.
void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support

View File

@ -1094,7 +1094,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
NetworkInterface* ret = NULL;
for (cur_address = addresses; cur_address != NULL; cur_address = cur_address->ifa_next) {
if (cur_address->ifa_addr->sa_family != AF_PACKET) {
if ((cur_address->ifa_addr == NULL) || (cur_address->ifa_addr->sa_family != AF_PACKET)) {
continue;
}
@ -1105,6 +1105,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
ret = cur;
}
freeifaddrs(addresses);
*network_interfaces = ret;
return OS_OK;

View File

@ -808,6 +808,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
}
}
kstat_close(ctl);
*network_interfaces = ret;
return OS_OK;

View File

@ -78,7 +78,6 @@
# include <link.h>
# include <poll.h>
# include <pthread.h>
# include <schedctl.h>
# include <setjmp.h>
# include <signal.h>
# include <stdio.h>
@ -742,7 +741,6 @@ extern "C" void* thread_native_entry(void* thread_addr) {
OSThread* osthr = thread->osthread();
osthr->set_lwp_id(_lwp_self()); // Store lwp in case we are bound
thread->_schedctl = (void *) schedctl_init();
log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ").",
os::current_thread_id());
@ -812,7 +810,6 @@ static OSThread* create_os_thread(Thread* thread, thread_t thread_id) {
// Store info on the Solaris thread into the OSThread
osthread->set_thread_id(thread_id);
osthread->set_lwp_id(_lwp_self());
thread->_schedctl = (void *) schedctl_init();
if (UseNUMA) {
int lgrp_id = os::numa_get_group_id();
@ -3407,13 +3404,6 @@ OSReturn os::get_native_priority(const Thread* const thread,
return OS_OK;
}
// Hint to the underlying OS that a task switch would not be good.
// Void return because it's a hint and can fail.
void os::hint_no_preempt() {
schedctl_start(schedctl_init());
}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support

View File

@ -3609,11 +3609,6 @@ OSReturn os::get_native_priority(const Thread* const thread,
return OS_OK;
}
// Hint to the underlying OS that a task switch would not be good.
// Void return because it's a hint and can fail.
void os::hint_no_preempt() {}
void os::interrupt(Thread* thread) {
debug_only(Thread::check_for_dangling_thread_pointer(thread);)

View File

@ -1006,19 +1006,19 @@ void ArchDesc::declare_pipe_classes(FILE *fp_hpp) {
fprintf(fp_hpp, " enum machPipelineStages * const stage,\n");
fprintf(fp_hpp, " uint * const cycles,\n");
fprintf(fp_hpp, " Pipeline_Use resource_use)\n");
fprintf(fp_hpp, " : _write_stage(write_stage)\n");
fprintf(fp_hpp, " , _read_stage_count(count)\n");
fprintf(fp_hpp, " , _has_fixed_latency(has_fixed_latency)\n");
fprintf(fp_hpp, " : _read_stage_count(count)\n");
fprintf(fp_hpp, " , _write_stage(write_stage)\n");
fprintf(fp_hpp, " , _fixed_latency(fixed_latency)\n");
fprintf(fp_hpp, " , _read_stages(dst)\n");
fprintf(fp_hpp, " , _resource_stage(stage)\n");
fprintf(fp_hpp, " , _resource_cycles(cycles)\n");
fprintf(fp_hpp, " , _resource_use(resource_use)\n");
fprintf(fp_hpp, " , _instruction_count(instruction_count)\n");
fprintf(fp_hpp, " , _has_fixed_latency(has_fixed_latency)\n");
fprintf(fp_hpp, " , _has_branch_delay(has_branch_delay)\n");
fprintf(fp_hpp, " , _has_multiple_bundles(has_multiple_bundles)\n");
fprintf(fp_hpp, " , _force_serialization(force_serialization)\n");
fprintf(fp_hpp, " , _may_have_no_code(may_have_no_code)\n");
fprintf(fp_hpp, " , _read_stages(dst)\n");
fprintf(fp_hpp, " , _resource_stage(stage)\n");
fprintf(fp_hpp, " , _resource_cycles(cycles)\n");
fprintf(fp_hpp, " , _resource_use(resource_use)\n");
fprintf(fp_hpp, " {};\n");
fprintf(fp_hpp, "\n");
fprintf(fp_hpp, " uint writeStage() const {\n");

View File

@ -714,7 +714,7 @@ void AOTCodeHeap::sweep_dependent_methods(InstanceKlass* ik) {
void AOTCodeHeap::sweep_method(AOTCompiledMethod *aot) {
int indexes[] = {aot->method_index()};
sweep_dependent_methods(indexes, 1);
vmassert(aot->method()->code() != aot && aot->method()->aot_code() == NULL, "method still active");
vmassert(aot->method()->code() != aot TIERED_ONLY( && aot->method()->aot_code() == NULL), "method still active");
}

View File

@ -206,6 +206,7 @@ bool AOTCompiledMethod::make_not_entrant_helper(int new_state) {
return true;
}
#ifdef TIERED
bool AOTCompiledMethod::make_entrant() {
assert(!method()->is_old(), "reviving evolved method!");
assert(*_state_adr != not_entrant, "%s", method()->has_aot_code() ? "has_aot_code() not cleared" : "caller didn't check has_aot_code()");
@ -240,6 +241,7 @@ bool AOTCompiledMethod::make_entrant() {
return true;
}
#endif // TIERED
// We don't have full dependencies for AOT methods, so flushing is
// more conservative than for nmethods.

View File

@ -138,8 +138,8 @@ private:
_heap(heap),
_name(name),
_metadata_size(metadata_size),
_method_index(method_index),
_aot_id(aot_id) {
_aot_id(aot_id),
_method_index(method_index) {
_is_far_code = CodeCache::is_far_target(code) ||
CodeCache::is_far_target(code + meta->code_size());
@ -194,7 +194,7 @@ private:
virtual address verified_entry_point() const { return _code + _meta->verified_entry_offset(); }
virtual void log_identity(xmlStream* stream) const;
virtual void log_state_change() const;
virtual bool make_entrant();
virtual bool make_entrant() NOT_TIERED({ ShouldNotReachHere(); return false; });
virtual bool make_not_entrant() { return make_not_entrant_helper(not_entrant); }
virtual bool make_not_used() { return make_not_entrant_helper(not_used); }
virtual address entry_point() const { return _code + _meta->entry_offset(); }

View File

@ -218,7 +218,7 @@ class ImplicitNullCheckStub: public CodeStub {
public:
ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
: _offset(offset), _info(info) {
: _info(info), _offset(offset) {
}
virtual void emit_code(LIR_Assembler* e);
virtual CodeEmitInfo* info() const { return _info; }
@ -479,7 +479,7 @@ class SimpleExceptionStub: public CodeStub {
public:
SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
_obj(obj), _info(info), _stub(stub) {
_obj(obj), _stub(stub), _info(info) {
}
void set_obj(LIR_Opr obj) {

View File

@ -538,12 +538,13 @@ void Compilation::generate_exception_handler_table() {
}
}
Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
int osr_bci, BufferBlob* buffer_blob, DirectiveSet* directive)
: _compiler(compiler)
, _env(env)
: _next_id(0)
, _next_block_id(0)
, _compiler(compiler)
, _directive(directive)
, _env(env)
, _log(env->log())
, _method(method)
, _osr_bci(osr_bci)
@ -553,19 +554,17 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
, _masm(NULL)
, _has_exception_handlers(false)
, _has_fpu_code(true) // pessimistic assumption
, _would_profile(false)
, _has_unsafe_access(false)
, _would_profile(false)
, _has_method_handle_invokes(false)
, _has_reserved_stack_access(method->has_reserved_stack_access())
, _bailout_msg(NULL)
, _exception_info_list(NULL)
, _allocator(NULL)
, _next_id(0)
, _next_block_id(0)
, _code(buffer_blob)
, _has_access_indexed(false)
, _current_instruction(NULL)
, _interpreter_frame_size(0)
, _current_instruction(NULL)
#ifndef PRODUCT
, _last_instruction_printed(NULL)
, _cfg_printer_output(NULL)

View File

@ -102,11 +102,11 @@ BlockListBuilder::BlockListBuilder(Compilation* compilation, IRScope* scope, int
, _scope(scope)
, _blocks(16)
, _bci2block(new BlockList(scope->method()->code_size(), NULL))
, _next_block_number(0)
, _active() // size not known yet
, _visited() // size not known yet
, _next_loop_index(0)
, _loop_map() // size not known yet
, _next_loop_index(0)
, _next_block_number(0)
{
set_entries(osr_bci);
set_leaders();
@ -680,10 +680,10 @@ GraphBuilder::ScopeData::ScopeData(ScopeData* parent)
, _has_handler(false)
, _stream(NULL)
, _work_list(NULL)
, _parsing_jsr(false)
, _jsr_xhandlers(NULL)
, _caller_stack_size(-1)
, _continuation(NULL)
, _parsing_jsr(false)
, _jsr_xhandlers(NULL)
, _num_returns(0)
, _cleanup_block(NULL)
, _cleanup_return_prev(NULL)
@ -3195,11 +3195,11 @@ ValueStack* GraphBuilder::state_at_entry() {
GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope)
: _scope_data(NULL)
, _compilation(compilation)
, _memory(new MemoryBuffer())
, _inline_bailout_msg(NULL)
, _instruction_count(0)
, _osr_entry(NULL)
, _memory(new MemoryBuffer())
, _compilation(compilation)
, _inline_bailout_msg(NULL)
{
int osr_bci = compilation->osr_bci();

View File

@ -132,8 +132,8 @@ BlockBegin* IRScope::build_graph(Compilation* compilation, int osr_bci) {
IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph)
: _callees(2)
, _compilation(compilation)
: _compilation(compilation)
, _callees(2)
, _requires_phi_function(method->max_locals())
{
_caller = caller;
@ -184,11 +184,11 @@ bool IRScopeDebugInfo::should_reexecute() {
// Stack must be NON-null
CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers, bool deoptimize_on_exception)
: _scope(stack->scope())
, _scope_debug_info(NULL)
: _scope_debug_info(NULL)
, _scope(stack->scope())
, _exception_handlers(exception_handlers)
, _oop_map(NULL)
, _stack(stack)
, _exception_handlers(exception_handlers)
, _is_method_handle_invoke(false)
, _deoptimize_on_exception(deoptimize_on_exception) {
assert(_stack != NULL, "must be non null");
@ -196,9 +196,9 @@ CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers, boo
CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack)
: _scope(info->_scope)
: _scope_debug_info(NULL)
, _scope(info->_scope)
, _exception_handlers(NULL)
, _scope_debug_info(NULL)
, _oop_map(NULL)
, _stack(stack == NULL ? info->_stack : stack)
, _is_method_handle_invoke(info->_is_method_handle_invoke)
@ -497,6 +497,7 @@ class ComputeLinearScanOrder : public StackObj {
// computation of final block order
BlockBegin* common_dominator(BlockBegin* a, BlockBegin* b);
void compute_dominator(BlockBegin* cur, BlockBegin* parent);
void compute_dominator_impl(BlockBegin* cur, BlockBegin* parent);
int compute_weight(BlockBegin* cur);
bool ready_for_processing(BlockBegin* cur);
void sort_into_work_list(BlockBegin* b);
@ -526,14 +527,14 @@ ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start
_num_blocks(0),
_num_loops(0),
_iterative_dominators(false),
_linear_scan_order(NULL), // initialized later with correct size
_visited_blocks(_max_block_id),
_active_blocks(_max_block_id),
_dominator_blocks(_max_block_id),
_forward_branches(_max_block_id, _max_block_id, 0),
_loop_end_blocks(8),
_work_list(8),
_linear_scan_order(NULL), // initialized later with correct size
_loop_map(0), // initialized later with correct size
_work_list(8),
_compilation(c)
{
TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order"));
@ -770,6 +771,14 @@ BlockBegin* ComputeLinearScanOrder::common_dominator(BlockBegin* a, BlockBegin*
}
void ComputeLinearScanOrder::compute_dominator(BlockBegin* cur, BlockBegin* parent) {
init_visited();
compute_dominator_impl(cur, parent);
}
void ComputeLinearScanOrder::compute_dominator_impl(BlockBegin* cur, BlockBegin* parent) {
// Mark as visited to avoid recursive calls with same parent
set_visited(cur);
if (cur->dominator() == NULL) {
TRACE_LINEAR_SCAN(4, tty->print_cr("DOM: initializing dominator of B%d to B%d", cur->block_id(), parent->block_id()));
cur->set_dominator(parent);
@ -788,7 +797,9 @@ void ComputeLinearScanOrder::compute_dominator(BlockBegin* cur, BlockBegin* pare
int num_cur_xhandler = cur->number_of_exception_handlers();
for (int j = 0; j < num_cur_xhandler; j++) {
BlockBegin* xhandler = cur->exception_handler_at(j);
compute_dominator(xhandler, parent);
if (!is_visited(xhandler)) {
compute_dominator_impl(xhandler, parent);
}
}
}

View File

@ -215,8 +215,8 @@ class IRScopeDebugInfo: public CompilationResourceObj {
GrowableArray<MonitorValue*>* monitors,
IRScopeDebugInfo* caller):
_scope(scope)
, _locals(locals)
, _bci(bci)
, _locals(locals)
, _expressions(expressions)
, _monitors(monitors)
, _caller(caller) {}

View File

@ -410,19 +410,20 @@ class Instruction: public CompilationResourceObj {
// creation
Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false)
: _use_count(0)
:
#ifndef PRODUCT
, _printable_bci(-99)
_printable_bci(-99),
#endif
_use_count(0)
, _pin_state(0)
, _type(type)
, _next(NULL)
, _block(NULL)
, _subst(NULL)
, _flags(0)
, _operand(LIR_OprFact::illegalOpr)
, _flags(0)
, _state_before(state_before)
, _exception_handlers(NULL)
, _block(NULL)
{
check_state(state_before);
assert(type != NULL && (!type->is_constant() || type_is_constant), "type must exist");
@ -705,8 +706,8 @@ LEAF(Local, Instruction)
Local(ciType* declared, ValueType* type, int index, bool receiver)
: Instruction(type)
, _java_index(index)
, _declared_type(declared)
, _is_receiver(receiver)
, _declared_type(declared)
{
NOT_PRODUCT(set_printable_bci(-1));
}
@ -1664,19 +1665,21 @@ LEAF(BlockBegin, StateSplit)
, _bci(bci)
, _depth_first_number(-1)
, _linear_scan_number(-1)
, _loop_depth(0)
, _flags(0)
, _dominator_depth(-1)
, _loop_depth(0)
, _loop_index(-1)
, _flags(0)
, _total_preds(0)
, _stores_to_locals()
, _successors(2)
, _predecessors(2)
, _dominates(2)
, _dominator(NULL)
, _end(NULL)
, _predecessors(2)
, _successors(2)
, _dominates(2)
, _exception_handlers(1)
, _exception_states(NULL)
, _exception_handler_pco(-1)
, _lir(NULL)
, _loop_index(-1)
, _live_in()
, _live_out()
, _live_gen()
@ -1685,8 +1688,6 @@ LEAF(BlockBegin, StateSplit)
, _fpu_stack_state(NULL)
, _first_lir_instruction_id(-1)
, _last_lir_instruction_id(-1)
, _total_preds(0)
, _stores_to_locals()
{
_block = this;
#ifndef PRODUCT
@ -1872,18 +1873,18 @@ LEAF(Goto, BlockEnd)
// creation
Goto(BlockBegin* sux, ValueStack* state_before, bool is_safepoint = false)
: BlockEnd(illegalType, state_before, is_safepoint)
, _direction(none)
, _profiled_method(NULL)
, _profiled_bci(0) {
, _profiled_bci(0)
, _direction(none) {
BlockList* s = new BlockList(1);
s->append(sux);
set_sux(s);
}
Goto(BlockBegin* sux, bool is_safepoint) : BlockEnd(illegalType, NULL, is_safepoint)
, _direction(none)
, _profiled_method(NULL)
, _profiled_bci(0) {
, _profiled_bci(0)
, _direction(none) {
BlockList* s = new BlockList(1);
s->append(sux);
set_sux(s);
@ -2550,9 +2551,9 @@ LEAF(RuntimeCall, Instruction)
public:
RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
: Instruction(type)
, _entry_name(entry_name)
, _entry(entry)
, _args(args)
, _entry_name(entry_name)
, _pass_thread(pass_thread) {
ASSERT_VALUES
pin();

View File

@ -47,8 +47,8 @@ class InstructionPrinter: public InstructionVisitor {
public:
InstructionPrinter(bool print_phis = true, outputStream* output = tty)
: _print_phis(print_phis)
, _output(output)
: _output(output)
, _print_phis(print_phis)
{}
outputStream* output() { return _output; }

View File

@ -321,9 +321,9 @@ LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object,
, _tmp2(tmp2)
, _tmp3(tmp3)
, _fast_check(fast_check)
, _stub(stub)
, _info_for_patch(info_for_patch)
, _info_for_exception(info_for_exception)
, _stub(stub)
, _profiled_method(NULL)
, _profiled_bci(-1)
, _should_profile(false)
@ -348,9 +348,9 @@ LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr object, LIR_Opr array, L
, _tmp2(tmp2)
, _tmp3(tmp3)
, _fast_check(false)
, _stub(NULL)
, _info_for_patch(NULL)
, _info_for_exception(info_for_exception)
, _stub(NULL)
, _profiled_method(NULL)
, _profiled_bci(-1)
, _should_profile(false)
@ -367,14 +367,14 @@ LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr object, LIR_Opr array, L
LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length,
LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info)
: LIR_Op(lir_arraycopy, LIR_OprFact::illegalOpr, info)
, _tmp(tmp)
, _src(src)
, _src_pos(src_pos)
, _dst(dst)
, _dst_pos(dst_pos)
, _flags(flags)
, _length(length)
, _tmp(tmp)
, _expected_type(expected_type)
, _length(length) {
, _flags(flags) {
_stub = new ArrayCopyStub(this);
}

View File

@ -516,36 +516,36 @@ class LIR_Address: public LIR_OprPtr {
_base(base)
, _index(index)
, _scale(times_1)
, _type(type)
, _disp(0) { verify(); }
, _disp(0)
, _type(type) { verify(); }
LIR_Address(LIR_Opr base, intx disp, BasicType type):
_base(base)
, _index(LIR_OprDesc::illegalOpr())
, _scale(times_1)
, _type(type)
, _disp(disp) { verify(); }
, _disp(disp)
, _type(type) { verify(); }
LIR_Address(LIR_Opr base, BasicType type):
_base(base)
, _index(LIR_OprDesc::illegalOpr())
, _scale(times_1)
, _type(type)
, _disp(0) { verify(); }
, _disp(0)
, _type(type) { verify(); }
LIR_Address(LIR_Opr base, LIR_Opr index, intx disp, BasicType type):
_base(base)
, _index(index)
, _scale(times_1)
, _type(type)
, _disp(disp) { verify(); }
, _disp(disp)
, _type(type) { verify(); }
LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
_base(base)
, _index(index)
, _scale(scale)
, _type(type)
, _disp(disp) { verify(); }
, _disp(disp)
, _type(type) { verify(); }
LIR_Opr base() const { return _base; }
LIR_Opr index() const { return _index; }
@ -1058,30 +1058,32 @@ class LIR_Op: public CompilationResourceObj {
public:
LIR_Op()
: _result(LIR_OprFact::illegalOpr)
:
#ifdef ASSERT
_file(NULL)
, _line(0),
#endif
_result(LIR_OprFact::illegalOpr)
, _code(lir_none)
, _flags(0)
, _info(NULL)
#ifdef ASSERT
, _file(NULL)
, _line(0)
#endif
, _id(-1)
, _fpu_pop_count(0)
, _source(NULL)
, _id(-1) {}
, _source(NULL) {}
LIR_Op(LIR_Code code, LIR_Opr result, CodeEmitInfo* info)
: _result(result)
:
#ifdef ASSERT
_file(NULL)
, _line(0),
#endif
_result(result)
, _code(code)
, _flags(0)
, _info(info)
#ifdef ASSERT
, _file(NULL)
, _line(0)
#endif
, _id(-1)
, _fpu_pop_count(0)
, _source(NULL)
, _id(-1) {}
, _source(NULL) {}
CodeEmitInfo* info() const { return _info; }
LIR_Code code() const { return (LIR_Code)_code; }
@ -1153,8 +1155,8 @@ class LIR_OpCall: public LIR_Op {
LIR_OpCall(LIR_Code code, address addr, LIR_Opr result,
LIR_OprList* arguments, CodeEmitInfo* info = NULL)
: LIR_Op(code, result, info)
, _arguments(arguments)
, _addr(addr) {}
, _addr(addr)
, _arguments(arguments) {}
public:
address addr() const { return _addr; }
@ -1180,8 +1182,8 @@ class LIR_OpJavaCall: public LIR_OpCall {
address addr, LIR_OprList* arguments,
CodeEmitInfo* info)
: LIR_OpCall(code, addr, result, arguments, info)
, _receiver(receiver)
, _method(method)
, _receiver(receiver)
, _method_handle_invoke_SP_save_opr(LIR_OprFact::illegalOpr)
{ assert(is_in_range(code, begin_opJavaCall, end_opJavaCall), "code check"); }
@ -1189,8 +1191,8 @@ class LIR_OpJavaCall: public LIR_OpCall {
LIR_Opr receiver, LIR_Opr result, intptr_t vtable_offset,
LIR_OprList* arguments, CodeEmitInfo* info)
: LIR_OpCall(code, (address)vtable_offset, result, arguments, info)
, _receiver(receiver)
, _method(method)
, _receiver(receiver)
, _method_handle_invoke_SP_save_opr(LIR_OprFact::illegalOpr)
{ assert(is_in_range(code, begin_opJavaCall, end_opJavaCall), "code check"); }
@ -1345,14 +1347,14 @@ class LIR_Op1: public LIR_Op {
LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result = LIR_OprFact::illegalOpr, BasicType type = T_ILLEGAL, LIR_PatchCode patch = lir_patch_none, CodeEmitInfo* info = NULL)
: LIR_Op(code, result, info)
, _opr(opr)
, _patch(patch)
, _type(type) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
, _type(type)
, _patch(patch) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result, BasicType type, LIR_PatchCode patch, CodeEmitInfo* info, LIR_MoveKind kind)
: LIR_Op(code, result, info)
, _opr(opr)
, _patch(patch)
, _type(type) {
, _type(type)
, _patch(patch) {
assert(code == lir_move, "must be");
set_kind(kind);
}
@ -1360,8 +1362,8 @@ class LIR_Op1: public LIR_Op {
LIR_Op1(LIR_Code code, LIR_Opr opr, CodeEmitInfo* info)
: LIR_Op(code, LIR_OprFact::illegalOpr, info)
, _opr(opr)
, _patch(lir_patch_none)
, _type(T_ILLEGAL) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
, _type(T_ILLEGAL)
, _patch(lir_patch_none) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
LIR_Opr in_opr() const { return _opr; }
LIR_PatchCode patch_code() const { return _patch; }
@ -1462,8 +1464,8 @@ class LIR_OpConvert: public LIR_Op1 {
public:
LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub)
: LIR_Op1(lir_convert, opr, result)
, _stub(stub)
, _bytecode(code) {}
, _bytecode(code)
, _stub(stub) {}
Bytecodes::Code bytecode() const { return _bytecode; }
ConversionStub* stub() const { return _stub; }
@ -1501,8 +1503,8 @@ class LIR_OpAllocObj : public LIR_Op1 {
, _tmp4(t4)
, _hdr_size(hdr_size)
, _obj_size(obj_size)
, _init_check(init_check)
, _stub(stub) { }
, _stub(stub)
, _init_check(init_check) { }
LIR_Opr klass() const { return in_opr(); }
LIR_Opr obj() const { return result_opr(); }
@ -1611,31 +1613,31 @@ class LIR_Op2: public LIR_Op {
public:
LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, CodeEmitInfo* info = NULL)
: LIR_Op(code, LIR_OprFact::illegalOpr, info)
, _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _type(T_ILLEGAL)
, _condition(condition)
, _fpu_stack_size(0)
, _tmp1(LIR_OprFact::illegalOpr)
, _tmp2(LIR_OprFact::illegalOpr)
, _tmp3(LIR_OprFact::illegalOpr)
, _tmp4(LIR_OprFact::illegalOpr)
, _tmp5(LIR_OprFact::illegalOpr) {
, _tmp5(LIR_OprFact::illegalOpr)
, _condition(condition) {
assert(code == lir_cmp || code == lir_assert, "code check");
}
LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type)
: LIR_Op(code, result, NULL)
, _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _type(type)
, _condition(condition)
, _fpu_stack_size(0)
, _tmp1(LIR_OprFact::illegalOpr)
, _tmp2(LIR_OprFact::illegalOpr)
, _tmp3(LIR_OprFact::illegalOpr)
, _tmp4(LIR_OprFact::illegalOpr)
, _tmp5(LIR_OprFact::illegalOpr) {
, _tmp5(LIR_OprFact::illegalOpr)
, _condition(condition) {
assert(code == lir_cmove, "code check");
assert(type != T_ILLEGAL, "cmove should have type");
}
@ -1643,32 +1645,32 @@ class LIR_Op2: public LIR_Op {
LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result = LIR_OprFact::illegalOpr,
CodeEmitInfo* info = NULL, BasicType type = T_ILLEGAL)
: LIR_Op(code, result, info)
, _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _type(type)
, _condition(lir_cond_unknown)
, _fpu_stack_size(0)
, _tmp1(LIR_OprFact::illegalOpr)
, _tmp2(LIR_OprFact::illegalOpr)
, _tmp3(LIR_OprFact::illegalOpr)
, _tmp4(LIR_OprFact::illegalOpr)
, _tmp5(LIR_OprFact::illegalOpr) {
, _tmp5(LIR_OprFact::illegalOpr)
, _condition(lir_cond_unknown) {
assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check");
}
LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr,
LIR_Opr tmp3 = LIR_OprFact::illegalOpr, LIR_Opr tmp4 = LIR_OprFact::illegalOpr, LIR_Opr tmp5 = LIR_OprFact::illegalOpr)
: LIR_Op(code, result, NULL)
, _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _type(T_ILLEGAL)
, _condition(lir_cond_unknown)
, _fpu_stack_size(0)
, _tmp1(tmp1)
, _tmp2(tmp2)
, _tmp3(tmp3)
, _tmp4(tmp4)
, _tmp5(tmp5) {
, _tmp5(tmp5)
, _condition(lir_cond_unknown) {
assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check");
}
@ -1833,8 +1835,8 @@ class LIR_OpAssert : public LIR_Op2 {
public:
LIR_OpAssert(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, const char* msg, bool halt)
: LIR_Op2(lir_assert, condition, opr1, opr2)
, _halt(halt)
, _msg(msg) {
, _msg(msg)
, _halt(halt) {
}
const char* msg() const { return _msg; }
@ -1942,9 +1944,9 @@ class LIR_OpProfileType : public LIR_Op {
: LIR_Op(lir_profile_type, LIR_OprFact::illegalOpr, NULL) // no result, no info
, _mdp(mdp)
, _obj(obj)
, _tmp(tmp)
, _exact_klass(exact_klass)
, _current_klass(current_klass)
, _tmp(tmp)
, _not_null(not_null)
, _no_conflict(no_conflict) { }

View File

@ -99,9 +99,9 @@ PatchingStub::PatchID LIR_Assembler::patching_id(CodeEmitInfo* info) {
LIR_Assembler::LIR_Assembler(Compilation* c):
_compilation(c)
, _masm(c->masm())
_masm(c->masm())
, _bs(BarrierSet::barrier_set())
, _compilation(c)
, _frame_map(c->frame_map())
, _current_block(NULL)
, _pending_non_safepoint(NULL)

View File

@ -74,6 +74,7 @@ LinearScan::LinearScan(IR* ir, LIRGenerator* gen, FrameMap* frame_map)
, _ir(ir)
, _gen(gen)
, _frame_map(frame_map)
, _cached_blocks(*ir->linear_scan_order())
, _num_virtual_regs(gen->max_virtual_register_number())
, _has_fpu_registers(false)
, _num_calls(-1)
@ -87,9 +88,8 @@ LinearScan::LinearScan(IR* ir, LIRGenerator* gen, FrameMap* frame_map)
, _block_of_op(0) // initialized later with correct length
, _has_info(0)
, _has_call(0)
, _scope_value_cache(0) // initialized later with correct length
, _interval_in_loop(0) // initialized later with correct length
, _cached_blocks(*ir->linear_scan_order())
, _scope_value_cache(0) // initialized later with correct length
#ifdef X86
, _fpu_stack_allocator(NULL)
#endif
@ -3717,13 +3717,13 @@ void RegisterVerifier::process_operations(LIR_List* ops, IntervalList* input_sta
MoveResolver::MoveResolver(LinearScan* allocator) :
_allocator(allocator),
_multiple_reads_allowed(false),
_insert_list(NULL),
_insert_idx(-1),
_insertion_buffer(),
_mapping_from(8),
_mapping_from_opr(8),
_mapping_to(8),
_insert_list(NULL),
_insert_idx(-1),
_insertion_buffer()
_multiple_reads_allowed(false)
{
for (int i = 0; i < LinearScan::nof_regs; i++) {
_register_blocked[i] = 0;
@ -4127,9 +4127,9 @@ Interval::Interval(int reg_num) :
_split_children(0),
_canonical_spill_slot(-1),
_insert_move_when_activated(false),
_register_hint(NULL),
_spill_state(noDefinitionFound),
_spill_definition_pos(-1)
_spill_definition_pos(-1),
_register_hint(NULL)
{
_split_parent = this;
_current_split_child = this;

View File

@ -47,7 +47,7 @@ class CE_Eliminator: public BlockClosure {
int _has_substitution;
public:
CE_Eliminator(IR* hir) : _cee_count(0), _ifop_count(0), _hir(hir) {
CE_Eliminator(IR* hir) : _hir(hir), _cee_count(0), _ifop_count(0) {
_has_substitution = false;
_hir->iterate_preorder(this);
if (_has_substitution) {
@ -592,10 +592,10 @@ class NullCheckEliminator: public ValueVisitor {
// constructor
NullCheckEliminator(Optimizer* opt)
: _opt(opt)
, _work_list(new BlockList())
, _set(new ValueSet())
, _last_explicit_null_check(NULL)
, _block_states(BlockBegin::number_of_blocks(), BlockBegin::number_of_blocks(), NULL)
, _work_list(new BlockList()) {
, _last_explicit_null_check(NULL) {
_visitable_instructions = new ValueSet();
_visitor.set_eliminator(this);
CompileLog* log = _opt->ir()->compilation()->log();

View File

@ -568,6 +568,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
if (log_is_enabled(Info, exceptions)) {
ResourceMark rm;
stringStream tempst;
assert(nm->method() != NULL, "Unexpected NULL method()");
tempst.print("compiled method <%s>\n"
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
nm->method()->print_value_string(), p2i(pc), p2i(thread));

View File

@ -485,9 +485,9 @@ bool ShortLoopOptimizer::process(BlockBegin* loop_header) {
GlobalValueNumbering::GlobalValueNumbering(IR* ir)
: _current_map(NULL)
: _compilation(ir->compilation())
, _current_map(NULL)
, _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL)
, _compilation(ir->compilation())
{
TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering"));

View File

@ -104,7 +104,7 @@ class ValueType: public CompilationResourceObj {
const ValueTag _tag;
ValueType();
protected:
ValueType(ValueTag tag, int size): _tag(tag), _size(size) {}
ValueType(ValueTag tag, int size): _size(size), _tag(tag) {}
public:
// initialization

View File

@ -1447,8 +1447,8 @@ void BCEscapeAnalyzer::dump() {
#endif
BCEscapeAnalyzer::BCEscapeAnalyzer(ciMethod* method, BCEscapeAnalyzer* parent)
: _conservative(method == NULL || !EstimateArgEscape)
, _arena(CURRENT_ENV->arena())
: _arena(CURRENT_ENV->arena())
, _conservative(method == NULL || !EstimateArgEscape)
, _method(method)
, _methodData(method ? method->method_data() : NULL)
, _arg_size(method ? method->arg_size() : 0)

View File

@ -596,6 +596,7 @@ ciInstanceKlass* ciInstanceKlass::implementor() {
// Go into the VM to fetch the implementor.
{
VM_ENTRY_MARK;
MutexLocker ml(Compile_lock);
Klass* k = get_instanceKlass()->implementor();
if (k != NULL) {
if (k == get_instanceKlass()) {

View File

@ -166,16 +166,16 @@ ciMethod::ciMethod(ciInstanceKlass* holder,
ciMetadata((Metadata*)NULL),
_name( name),
_holder( holder),
_intrinsic_id( vmIntrinsics::_none),
_liveness( NULL),
_can_be_statically_bound(false),
_method_data( NULL),
_method_blocks( NULL),
_method_data( NULL)
_intrinsic_id( vmIntrinsics::_none),
_instructions_size(-1),
_can_be_statically_bound(false),
_liveness( NULL)
#if defined(COMPILER2)
,
_flow( NULL),
_bcea( NULL),
_instructions_size(-1)
_bcea( NULL)
#endif // COMPILER2
{
// Usually holder and accessor are the same type but in some cases

View File

@ -345,13 +345,13 @@ void ciMethodBlocks::dump() {
}
#endif
ciBlock::ciBlock(ciMethod *method, int index, int start_bci) :
_idx(index), _start_bci(start_bci), _limit_bci(-1), _control_bci(fall_through_bci),
_flags(0), _ex_start_bci(-1), _ex_limit_bci(-1)
#ifndef PRODUCT
_method(method),
, _method(method)
#endif
_idx(index), _flags(0), _start_bci(start_bci), _limit_bci(-1), _control_bci(fall_through_bci),
_ex_start_bci(-1), _ex_limit_bci(-1) {
{
}
void ciBlock::set_exception_range(int start_bci, int limit_bci) {

View File

@ -724,8 +724,8 @@ public:
public:
Loop(Block* head, Block* tail) :
_head(head), _tail(tail),
_parent(NULL), _sibling(NULL), _child(NULL),
_head(head), _tail(tail),
_irreducible(false), _def_locals() {}
Loop* parent() const { return _parent; }

View File

@ -922,10 +922,10 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
assert(has_nonstatic_concrete_methods != NULL, "invariant");
if (itfs_len == 0) {
_local_interfaces = Universe::the_empty_klass_array();
_local_interfaces = Universe::the_empty_instance_klass_array();
} else {
assert(itfs_len > 0, "only called for len>0");
_local_interfaces = MetadataFactory::new_array<Klass*>(_loader_data, itfs_len, NULL, CHECK);
_local_interfaces = MetadataFactory::new_array<InstanceKlass*>(_loader_data, itfs_len, NULL, CHECK);
int index;
for (index = 0; index < itfs_len; index++) {
@ -966,7 +966,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
if (InstanceKlass::cast(interf)->has_nonstatic_concrete_methods()) {
*has_nonstatic_concrete_methods = true;
}
_local_interfaces->at_put(index, interf);
_local_interfaces->at_put(index, InstanceKlass::cast(interf));
}
if (!_need_verify || itfs_len <= 1) {
@ -984,8 +984,8 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
{
debug_only(NoSafepointVerifier nsv;)
for (index = 0; index < itfs_len; index++) {
const Klass* const k = _local_interfaces->at(index);
name = InstanceKlass::cast(k)->name();
const InstanceKlass* const k = _local_interfaces->at(index);
name = k->name();
// If no duplicates, add (name, NULL) in hashtable interface_names.
if (!put_after_lookup(name, NULL, interface_names)) {
dup = true;
@ -4496,7 +4496,7 @@ static void record_defined_class_dependencies(const InstanceKlass* defined_klass
}
// add super interface dependencies
const Array<Klass*>* const local_interfaces = defined_klass->local_interfaces();
const Array<InstanceKlass*>* const local_interfaces = defined_klass->local_interfaces();
if (local_interfaces != NULL) {
const int length = local_interfaces->length();
for (int i = 0; i < length; i++) {
@ -4508,21 +4508,21 @@ static void record_defined_class_dependencies(const InstanceKlass* defined_klass
// utility methods for appending an array with check for duplicates
static void append_interfaces(GrowableArray<Klass*>* result,
const Array<Klass*>* const ifs) {
static void append_interfaces(GrowableArray<InstanceKlass*>* result,
const Array<InstanceKlass*>* const ifs) {
// iterate over new interfaces
for (int i = 0; i < ifs->length(); i++) {
Klass* const e = ifs->at(i);
assert(e->is_klass() && InstanceKlass::cast(e)->is_interface(), "just checking");
InstanceKlass* const e = ifs->at(i);
assert(e->is_klass() && e->is_interface(), "just checking");
// add new interface
result->append_if_missing(e);
}
}
static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
Array<Klass*>* local_ifs,
ClassLoaderData* loader_data,
TRAPS) {
static Array<InstanceKlass*>* compute_transitive_interfaces(const InstanceKlass* super,
Array<InstanceKlass*>* local_ifs,
ClassLoaderData* loader_data,
TRAPS) {
assert(local_ifs != NULL, "invariant");
assert(loader_data != NULL, "invariant");
@ -4537,15 +4537,15 @@ static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
// Add local interfaces' super interfaces
const int local_size = local_ifs->length();
for (int i = 0; i < local_size; i++) {
Klass* const l = local_ifs->at(i);
max_transitive_size += InstanceKlass::cast(l)->transitive_interfaces()->length();
InstanceKlass* const l = local_ifs->at(i);
max_transitive_size += l->transitive_interfaces()->length();
}
// Finally add local interfaces
max_transitive_size += local_size;
// Construct array
if (max_transitive_size == 0) {
// no interfaces, use canonicalized array
return Universe::the_empty_klass_array();
return Universe::the_empty_instance_klass_array();
} else if (max_transitive_size == super_size) {
// no new local interfaces added, share superklass' transitive interface array
return super->transitive_interfaces();
@ -4554,7 +4554,7 @@ static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
return local_ifs;
} else {
ResourceMark rm;
GrowableArray<Klass*>* const result = new GrowableArray<Klass*>(max_transitive_size);
GrowableArray<InstanceKlass*>* const result = new GrowableArray<InstanceKlass*>(max_transitive_size);
// Copy down from superclass
if (super != NULL) {
@ -4563,8 +4563,8 @@ static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
// Copy down from local interfaces' superinterfaces
for (int i = 0; i < local_size; i++) {
Klass* const l = local_ifs->at(i);
append_interfaces(result, InstanceKlass::cast(l)->transitive_interfaces());
InstanceKlass* const l = local_ifs->at(i);
append_interfaces(result, l->transitive_interfaces());
}
// Finally add local interfaces
append_interfaces(result, local_ifs);
@ -4572,10 +4572,10 @@ static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
// length will be less than the max_transitive_size if duplicates were removed
const int length = result->length();
assert(length <= max_transitive_size, "just checking");
Array<Klass*>* const new_result =
MetadataFactory::new_array<Klass*>(loader_data, length, CHECK_NULL);
Array<InstanceKlass*>* const new_result =
MetadataFactory::new_array<InstanceKlass*>(loader_data, length, CHECK_NULL);
for (int i = 0; i < length; i++) {
Klass* const e = result->at(i);
InstanceKlass* const e = result->at(i);
assert(e != NULL, "just checking");
new_result->at_put(i, e);
}
@ -4643,17 +4643,17 @@ static void check_super_class_access(const InstanceKlass* this_klass, TRAPS) {
static void check_super_interface_access(const InstanceKlass* this_klass, TRAPS) {
assert(this_klass != NULL, "invariant");
const Array<Klass*>* const local_interfaces = this_klass->local_interfaces();
const Array<InstanceKlass*>* const local_interfaces = this_klass->local_interfaces();
const int lng = local_interfaces->length();
for (int i = lng - 1; i >= 0; i--) {
Klass* const k = local_interfaces->at(i);
InstanceKlass* const k = local_interfaces->at(i);
assert (k != NULL && k->is_interface(), "invalid interface");
Reflection::VerifyClassAccessResults vca_result =
Reflection::verify_class_access(this_klass, InstanceKlass::cast(k), false);
Reflection::verify_class_access(this_klass, k, false);
if (vca_result != Reflection::ACCESS_OK) {
ResourceMark rm(THREAD);
char* msg = Reflection::verify_class_access_msg(this_klass,
InstanceKlass::cast(k),
k,
vca_result);
if (msg == NULL) {
bool same_module = (this_klass->module() == k->module());
@ -5735,11 +5735,11 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
ik->java_super()->external_name());
}
// print out each of the interface classes referred to by this class.
const Array<Klass*>* const local_interfaces = ik->local_interfaces();
const Array<InstanceKlass*>* const local_interfaces = ik->local_interfaces();
if (local_interfaces != NULL) {
const int length = local_interfaces->length();
for (int i = 0; i < length; i++) {
const Klass* const k = local_interfaces->at(i);
const InstanceKlass* const k = local_interfaces->at(i);
const char * to = k->external_name();
log_debug(class, resolve)("%s %s (interface)", from, to);
}
@ -6272,7 +6272,7 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
assert(_loader_data != NULL, "invariant");
if (_class_name == vmSymbols::java_lang_Object()) {
check_property(_local_interfaces == Universe::the_empty_klass_array(),
check_property(_local_interfaces == Universe::the_empty_instance_klass_array(),
"java.lang.Object cannot implement an interface in class file %s",
CHECK);
}

View File

@ -99,8 +99,8 @@ class ClassFileParser {
Array<u2>* _inner_classes;
Array<u2>* _nest_members;
u2 _nest_host;
Array<Klass*>* _local_interfaces;
Array<Klass*>* _transitive_interfaces;
Array<InstanceKlass*>* _local_interfaces;
Array<InstanceKlass*>* _transitive_interfaces;
Annotations* _combined_annotations;
AnnotationArray* _annotations;
AnnotationArray* _type_annotations;

View File

@ -95,7 +95,7 @@ void ClassLoaderData::init_null_class_loader_data() {
ClassLoaderDataGraph::_head = _the_null_class_loader_data;
assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
LogTarget(Debug, class, loader, data) lt;
LogTarget(Trace, class, loader, data) lt;
if (lt.is_enabled()) {
ResourceMark rm;
LogStream ls(lt);
@ -142,19 +142,22 @@ void ClassLoaderData::initialize_name(Handle class_loader) {
}
ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous) :
_is_anonymous(is_anonymous),
_metaspace(NULL),
_metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
Monitor::_safepoint_check_never)),
_unloading(false), _is_anonymous(is_anonymous),
_modified_oops(true), _accumulated_modified_oops(false),
// An anonymous class loader data doesn't have anything to keep
// it from being unloaded during parsing of the anonymous class.
// The null-class-loader should always be kept alive.
_keep_alive((is_anonymous || h_class_loader.is_null()) ? 1 : 0),
_metaspace(NULL), _unloading(false), _klasses(NULL),
_modules(NULL), _packages(NULL), _unnamed_module(NULL), _dictionary(NULL),
_claimed(0), _modified_oops(true), _accumulated_modified_oops(false),
_jmethod_ids(NULL), _handles(), _deallocate_list(NULL),
_claimed(0),
_handles(),
_klasses(NULL), _packages(NULL), _modules(NULL), _unnamed_module(NULL), _dictionary(NULL),
_jmethod_ids(NULL),
_deallocate_list(NULL),
_next(NULL),
_class_loader_klass(NULL), _name(NULL), _name_and_id(NULL),
_metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
Monitor::_safepoint_check_never)) {
_class_loader_klass(NULL), _name(NULL), _name_and_id(NULL) {
if (!h_class_loader.is_null()) {
_class_loader = _handles.add(h_class_loader());
@ -592,7 +595,7 @@ void ClassLoaderData::remove_class(Klass* scratch_class) {
void ClassLoaderData::unload() {
_unloading = true;
LogTarget(Debug, class, loader, data) lt;
LogTarget(Trace, class, loader, data) lt;
if (lt.is_enabled()) {
ResourceMark rm;
LogStream ls(lt);
@ -603,7 +606,7 @@ void ClassLoaderData::unload() {
// Some items on the _deallocate_list need to free their C heap structures
// if they are not already on the _klasses list.
unload_deallocate_list();
free_deallocate_list_C_heap_structures();
// Tell serviceability tools these classes are unloading
// after erroneous classes are released.
@ -846,7 +849,7 @@ void ClassLoaderData::init_handle_locked(OopHandle& dest, Handle h) {
}
// Add this metadata pointer to be freed when it's safe. This is only during
// class unloading because Handles might point to this metadata field.
// a safepoint which checks if handles point to this metadata field.
void ClassLoaderData::add_to_deallocate_list(Metadata* m) {
// Metadata in shared region isn't deleted.
if (!m->is_shared()) {
@ -855,6 +858,8 @@ void ClassLoaderData::add_to_deallocate_list(Metadata* m) {
_deallocate_list = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(100, true);
}
_deallocate_list->append_if_missing(m);
log_debug(class, loader, data)("deallocate added for %s", m->print_value_string());
ClassLoaderDataGraph::set_should_clean_deallocate_lists();
}
}
@ -888,16 +893,52 @@ void ClassLoaderData::free_deallocate_list() {
assert(!m->is_klass() || !((InstanceKlass*)m)->is_scratch_class(),
"scratch classes on this list should be dead");
// Also should assert that other metadata on the list was found in handles.
// Some cleaning remains.
ClassLoaderDataGraph::set_should_clean_deallocate_lists();
}
}
}
void ClassLoaderDataGraph::clean_deallocate_lists(bool walk_previous_versions) {
uint loaders_processed = 0;
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
// is_alive check will be necessary for concurrent class unloading.
if (cld->is_alive()) {
// clean metaspace
if (walk_previous_versions) {
cld->classes_do(InstanceKlass::purge_previous_versions);
}
cld->free_deallocate_list();
loaders_processed++;
}
}
log_debug(class, loader, data)("clean_deallocate_lists: loaders processed %u %s",
loaders_processed, walk_previous_versions ? "walk_previous_versions" : "");
}
void ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces() {
assert(SafepointSynchronize::is_at_safepoint(), "must only be called at safepoint");
_should_clean_deallocate_lists = false; // assume everything gets cleaned
// Mark metadata seen on the stack so we can delete unreferenced entries.
// Walk all metadata, including the expensive code cache walk, only for class redefinition.
// The MetadataOnStackMark walk during redefinition saves previous versions if it finds old methods
// on the stack or in the code cache, so we only have to repeat the full walk if
// they were found at that time.
// TODO: have redefinition clean old methods out of the code cache. They still exist in some places.
bool walk_all_metadata = InstanceKlass::has_previous_versions_and_reset();
MetadataOnStackMark md_on_stack(walk_all_metadata);
clean_deallocate_lists(walk_all_metadata);
}
// This is distinct from free_deallocate_list. For class loader data that are
// unloading, this frees the C heap memory for items on the list, and unlinks
// scratch or error classes so that unloading events aren't triggered for these
// classes. The metadata is removed with the unloading metaspace.
// There isn't C heap memory allocated for methods, so nothing is done for them.
void ClassLoaderData::unload_deallocate_list() {
void ClassLoaderData::free_deallocate_list_C_heap_structures() {
// Don't need lock, at safepoint
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
assert(is_unloading(), "only called for ClassLoaderData that are unloading");
@ -907,7 +948,6 @@ void ClassLoaderData::unload_deallocate_list() {
// Go backwards because this removes entries that are freed.
for (int i = _deallocate_list->length() - 1; i >= 0; i--) {
Metadata* m = _deallocate_list->at(i);
assert (!m->on_stack(), "wouldn't be unloading if this were so");
_deallocate_list->remove_at(i);
if (m->is_constantPool()) {
((ConstantPool*)m)->release_C_heap_structures();
@ -1023,6 +1063,8 @@ ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
bool ClassLoaderDataGraph::_should_purge = false;
bool ClassLoaderDataGraph::_should_clean_deallocate_lists = false;
bool ClassLoaderDataGraph::_safepoint_cleanup_needed = false;
bool ClassLoaderDataGraph::_metaspace_oom = false;
// Add a new class loader data node to the list. Assign the newly created
@ -1053,7 +1095,7 @@ ClassLoaderData* ClassLoaderDataGraph::add_to_graph(Handle loader, bool is_anony
cld->set_next(next);
ClassLoaderData* exchanged = Atomic::cmpxchg(cld, list_head, next);
if (exchanged == next) {
LogTarget(Debug, class, loader, data) lt;
LogTarget(Trace, class, loader, data) lt;
if (lt.is_enabled()) {
ResourceMark rm;
LogStream ls(lt);
@ -1334,7 +1376,10 @@ static void post_class_unload_events() {
// Move class loader data from main list to the unloaded list for unloading
// and deallocation later.
bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
bool ClassLoaderDataGraph::do_unloading(bool do_cleaning) {
// Indicate whether safepoint cleanup is needed.
_safepoint_cleanup_needed |= do_cleaning;
ClassLoaderData* data = _head;
ClassLoaderData* prev = NULL;
@ -1342,15 +1387,6 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
uint loaders_processed = 0;
uint loaders_removed = 0;
// Mark metadata seen on the stack only so we can delete unneeded entries.
// Only walk all metadata, including the expensive code cache walk, for Full GC
// and only if class redefinition and if there's previous versions of
// Klasses to delete.
bool walk_all_metadata = clean_previous_versions &&
JvmtiExport::has_redefined_a_class() &&
InstanceKlass::has_previous_versions_and_reset();
MetadataOnStackMark md_on_stack(walk_all_metadata);
// Save previous _unloading pointer for CMS which may add to unloading list before
// purging and we don't want to rewalk the previously unloaded class loader data.
_saved_unloading = _unloading;
@ -1358,11 +1394,6 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
data = _head;
while (data != NULL) {
if (data->is_alive()) {
// clean metaspace
if (walk_all_metadata) {
data->classes_do(InstanceKlass::purge_previous_versions);
}
data->free_deallocate_list();
prev = data;
data = data->next();
loaders_processed++;
@ -1387,27 +1418,6 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
}
if (seen_dead_loader) {
data = _head;
while (data != NULL) {
// Remove entries in the dictionary of live class loader that have
// initiated loading classes in a dead class loader.
if (data->dictionary() != NULL) {
data->dictionary()->do_unloading();
}
// Walk a ModuleEntry's reads, and a PackageEntry's exports
// lists to determine if there are modules on those lists that are now
// dead and should be removed. A module's life cycle is equivalent
// to its defining class loader's life cycle. Since a module is
// considered dead if its class loader is dead, these walks must
// occur after each class loader's aliveness is determined.
if (data->packages() != NULL) {
data->packages()->purge_all_package_exports();
}
if (data->modules_defined()) {
data->modules()->purge_all_module_reads();
}
data = data->next();
}
JFR_ONLY(post_class_unload_events();)
}
@ -1416,6 +1426,32 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
return seen_dead_loader;
}
// There's at least one dead class loader. Purge refererences of healthy module
// reads lists and package export lists to modules belonging to dead loaders.
void ClassLoaderDataGraph::clean_module_and_package_info() {
ClassLoaderData* data = _head;
while (data != NULL) {
// Remove entries in the dictionary of live class loader that have
// initiated loading classes in a dead class loader.
if (data->dictionary() != NULL) {
data->dictionary()->do_unloading();
}
// Walk a ModuleEntry's reads, and a PackageEntry's exports
// lists to determine if there are modules on those lists that are now
// dead and should be removed. A module's life cycle is equivalent
// to its defining class loader's life cycle. Since a module is
// considered dead if its class loader is dead, these walks must
// occur after each class loader's aliveness is determined.
if (data->packages() != NULL) {
data->packages()->purge_all_package_exports();
}
if (data->modules_defined()) {
data->modules()->purge_all_module_reads();
}
data = data->next();
}
}
void ClassLoaderDataGraph::purge() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
ClassLoaderData* list = _unloading;

View File

@ -79,6 +79,12 @@ class ClassLoaderDataGraph : public AllStatic {
static ClassLoaderData* _saved_head;
static ClassLoaderData* _saved_unloading;
static bool _should_purge;
// Set if there's anything to purge in the deallocate lists or previous versions
// during a safepoint after class unloading in a full GC.
static bool _should_clean_deallocate_lists;
static bool _safepoint_cleanup_needed;
// OOM has been seen in metaspace allocation. Used to prevent some
// allocations until class unloading
static bool _metaspace_oom;
@ -88,8 +94,10 @@ class ClassLoaderDataGraph : public AllStatic {
static ClassLoaderData* add_to_graph(Handle class_loader, bool anonymous);
static ClassLoaderData* add(Handle class_loader, bool anonymous);
public:
static ClassLoaderData* find_or_create(Handle class_loader);
static void clean_module_and_package_info();
static void purge();
static void clear_claimed_marks();
// oops do
@ -116,7 +124,13 @@ class ClassLoaderDataGraph : public AllStatic {
static void packages_unloading_do(void f(PackageEntry*));
static void loaded_classes_do(KlassClosure* klass_closure);
static void classes_unloading_do(void f(Klass* const));
static bool do_unloading(bool clean_previous_versions);
static bool do_unloading(bool do_cleaning);
// Expose state to avoid logging overhead in safepoint cleanup tasks.
static inline bool should_clean_metaspaces_and_reset();
static void set_should_clean_deallocate_lists() { _should_clean_deallocate_lists = true; }
static void clean_deallocate_lists(bool purge_previous_versions);
static void walk_metadata_and_clean_metaspaces();
// dictionary do
// Iterate over all klasses in dictionary, but
@ -185,7 +199,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
volatile juint _size;
Chunk* _next;
Chunk(Chunk* c) : _next(c), _size(0) { }
Chunk(Chunk* c) : _size(0), _next(c) { }
};
Chunk* volatile _head;
@ -297,8 +311,8 @@ class ClassLoaderData : public CHeapObj<mtClass> {
void packages_do(void f(PackageEntry*));
// Deallocate free list during class unloading.
void free_deallocate_list(); // for the classes that are not unloaded
void unload_deallocate_list(); // for the classes that are unloaded
void free_deallocate_list(); // for the classes that are not unloaded
void free_deallocate_list_C_heap_structures(); // for the classes that are unloaded
// Allocate out of this class loader data
MetaWord* allocate(size_t size);

View File

@ -27,6 +27,7 @@
#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oopHandle.inline.hpp"
#include "oops/weakHandle.inline.hpp"
@ -92,4 +93,13 @@ void ClassLoaderDataGraph::dec_array_classes(size_t count) {
Atomic::sub(count, &_num_array_classes);
}
bool ClassLoaderDataGraph::should_clean_metaspaces_and_reset() {
bool do_cleaning = _safepoint_cleanup_needed && _should_clean_deallocate_lists;
#if INCLUDE_JVMTI
do_cleaning = do_cleaning || InstanceKlass::has_previous_versions();
#endif
_safepoint_cleanup_needed = false; // reset
return do_cleaning;
}
#endif // SHARE_VM_CLASSFILE_CLASSLOADERDATA_INLINE_HPP

View File

@ -299,7 +299,7 @@ public:
LoaderTreeNode(const oop loader_oop)
: _loader_oop(loader_oop), _cld(NULL), _child(NULL), _next(NULL),
_classes(NULL), _anon_classes(NULL), _num_classes(0), _num_anon_classes(0),
_classes(NULL), _num_classes(0), _anon_classes(NULL), _num_anon_classes(0),
_num_folded(0)
{}

View File

@ -87,8 +87,8 @@ public:
_chunk_sz(0),
_block_sz(0),
_classes_count(0),
_anon_block_sz(0),
_anon_chunk_sz(0),
_anon_block_sz(0),
_anon_classes_count(0) {
}
};
@ -118,11 +118,11 @@ protected:
public:
ClassLoaderStatsClosure(outputStream* out) :
_out(out),
_stats(new StatsTable()),
_total_loaders(0),
_total_block_sz(0),
_total_chunk_sz(0),
_total_classes(0),
_stats(new StatsTable()) {
_total_chunk_sz(0),
_total_block_sz(0) {
}
virtual void do_cld(ClassLoaderData* cld);

View File

@ -688,8 +688,8 @@ class FindMethodsByErasedSig : public HierarchyVisitor<FindMethodsByErasedSig> {
public:
FindMethodsByErasedSig(Symbol* name, Symbol* signature, bool is_interf) :
_method_name(name), _method_signature(signature), _cur_class_is_interface(is_interf),
_family(NULL) {}
_method_name(name), _method_signature(signature), _family(NULL),
_cur_class_is_interface(is_interf) {}
void get_discovered_family(MethodFamily** family) {
if (_family != NULL) {

View File

@ -53,16 +53,16 @@ size_t Dictionary::entry_size() {
}
Dictionary::Dictionary(ClassLoaderData* loader_data, int table_size, bool resizable)
: _loader_data(loader_data), _resizable(resizable), _needs_resizing(false),
Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size()) {
: Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size()),
_resizable(resizable), _needs_resizing(false), _loader_data(loader_data) {
};
Dictionary::Dictionary(ClassLoaderData* loader_data,
int table_size, HashtableBucket<mtClass>* t,
int number_of_entries, bool resizable)
: _loader_data(loader_data), _resizable(resizable), _needs_resizing(false),
Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries) {
: Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries),
_resizable(resizable), _needs_resizing(false), _loader_data(loader_data) {
};
Dictionary::~Dictionary() {

View File

@ -2005,7 +2005,7 @@ class BacktraceBuilder: public StackObj {
public:
// constructor for new backtrace
BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL), _names(NULL) {
BacktraceBuilder(TRAPS): _head(NULL), _methods(NULL), _bcis(NULL), _mirrors(NULL), _names(NULL) {
expand(CHECK);
_backtrace = Handle(THREAD, _head);
_index = 0;
@ -2102,7 +2102,7 @@ struct BacktraceElement : public StackObj {
Symbol* _name;
Handle _mirror;
BacktraceElement(Handle mirror, int mid, int version, int bci, Symbol* name) :
_mirror(mirror), _method_id(mid), _version(version), _bci(bci), _name(name) {}
_method_id(mid), _bci(bci), _version(version), _name(name), _mirror(mirror) {}
};
class BacktraceIterator : public StackObj {
@ -4250,6 +4250,12 @@ int reflect_UnsafeStaticFieldAccessorImpl::_base_offset;
int jdk_internal_module_ArchivedModuleGraph::_archivedSystemModules_offset;
int jdk_internal_module_ArchivedModuleGraph::_archivedModuleFinder_offset;
int jdk_internal_module_ArchivedModuleGraph::_archivedMainModule_offset;
int jdk_internal_module_ArchivedModuleGraph::_archivedConfiguration_offset;
int java_lang_Integer_IntegerCache::_archivedCache_offset;
int java_lang_module_Configuration::_EMPTY_CONFIGURATION_offset;
int java_util_ImmutableCollections_ListN::_EMPTY_LIST_offset;
int java_util_ImmutableCollections_SetN::_EMPTY_SET_offset;
int java_util_ImmutableCollections_MapN::_EMPTY_MAP_offset;
#define STACKTRACEELEMENT_FIELDS_DO(macro) \
macro(declaringClassObject_offset, k, "declaringClassObject", class_signature, false); \
@ -4412,20 +4418,96 @@ static int member_offset(int hardcoded_offset) {
return (hardcoded_offset * heapOopSize) + instanceOopDesc::base_offset_in_bytes();
}
#define MODULEBOOTSTRAP_FIELDS_DO(macro) \
#define INTEGERCACHE_FIELDS_DO(macro) \
macro(_archivedCache_offset, k, "archivedCache", java_lang_Integer_array_signature, true)
void java_lang_Integer_IntegerCache::compute_offsets() {
InstanceKlass* k = SystemDictionary::Integer_IntegerCache_klass();
assert(k != NULL, "must be loaded");
INTEGERCACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_lang_Integer_IntegerCache::serialize(SerializeClosure* f) {
INTEGERCACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
#define ARCHIVEDMODULEGRAPH_FIELDS_DO(macro) \
macro(_archivedSystemModules_offset, k, "archivedSystemModules", systemModules_signature, true); \
macro(_archivedModuleFinder_offset, k, "archivedModuleFinder", moduleFinder_signature, true); \
macro(_archivedMainModule_offset, k, "archivedMainModule", string_signature, true)
macro(_archivedMainModule_offset, k, "archivedMainModule", string_signature, true); \
macro(_archivedConfiguration_offset, k, "archivedConfiguration", configuration_signature, true)
void jdk_internal_module_ArchivedModuleGraph::compute_offsets() {
InstanceKlass* k = SystemDictionary::ArchivedModuleGraph_klass();
assert(k != NULL, "must be loaded");
MODULEBOOTSTRAP_FIELDS_DO(FIELD_COMPUTE_OFFSET);
ARCHIVEDMODULEGRAPH_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void jdk_internal_module_ArchivedModuleGraph::serialize(SerializeClosure* f) {
MODULEBOOTSTRAP_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
ARCHIVEDMODULEGRAPH_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
#define CONFIGURATION_FIELDS_DO(macro) \
macro(_EMPTY_CONFIGURATION_offset, k, "EMPTY_CONFIGURATION", configuration_signature, true)
void java_lang_module_Configuration::compute_offsets() {
InstanceKlass* k = SystemDictionary::Configuration_klass();
assert(k != NULL, "must be loaded");
CONFIGURATION_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_lang_module_Configuration::serialize(SerializeClosure* f) {
CONFIGURATION_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
#define LISTN_FIELDS_DO(macro) \
macro(_EMPTY_LIST_offset, k, "EMPTY_LIST", list_signature, true)
void java_util_ImmutableCollections_ListN::compute_offsets() {
InstanceKlass* k = SystemDictionary::ImmutableCollections_ListN_klass();
assert(k != NULL, "must be loaded");
LISTN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_util_ImmutableCollections_ListN::serialize(SerializeClosure* f) {
LISTN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
#define SETN_FIELDS_DO(macro) \
macro(_EMPTY_SET_offset, k, "EMPTY_SET", set_signature, true)
void java_util_ImmutableCollections_SetN::compute_offsets() {
InstanceKlass* k = SystemDictionary::ImmutableCollections_SetN_klass();
assert(k != NULL, "must be loaded");
SETN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_util_ImmutableCollections_SetN::serialize(SerializeClosure* f) {
SETN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
#define MAPN_FIELDS_DO(macro) \
macro(_EMPTY_MAP_offset, k, "EMPTY_MAP", map_signature, true)
void java_util_ImmutableCollections_MapN::compute_offsets() {
InstanceKlass* k = SystemDictionary::ImmutableCollections_MapN_klass();
assert(k != NULL, "must be loaded");
MAPN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
#if INCLUDE_CDS
void java_util_ImmutableCollections_MapN::serialize(SerializeClosure* f) {
MAPN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
}
#endif
@ -4487,6 +4569,11 @@ void JavaClasses::compute_offsets() {
java_lang_LiveStackFrameInfo::compute_offsets();
java_util_concurrent_locks_AbstractOwnableSynchronizer::compute_offsets();
java_lang_Integer_IntegerCache::compute_offsets();
java_lang_module_Configuration::compute_offsets();
java_util_ImmutableCollections_ListN::compute_offsets();
java_util_ImmutableCollections_MapN::compute_offsets();
java_util_ImmutableCollections_SetN::compute_offsets();
jdk_internal_module_ArchivedModuleGraph::compute_offsets();
// generated interpreter code wants to know about the offsets we just computed:

View File

@ -1485,15 +1485,62 @@ class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class java_lang_Integer_IntegerCache: AllStatic {
private:
static int _archivedCache_offset;
public:
static int archivedCache_offset() { return _archivedCache_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class jdk_internal_module_ArchivedModuleGraph: AllStatic {
private:
static int _archivedSystemModules_offset;
static int _archivedModuleFinder_offset;
static int _archivedMainModule_offset;
static int _archivedConfiguration_offset;
public:
static int archivedSystemModules_offset() { return _archivedSystemModules_offset; }
static int archivedModuleFinder_offset() { return _archivedModuleFinder_offset; }
static int archivedMainModule_offset() { return _archivedMainModule_offset; }
static int archivedConfiguration_offset() { return _archivedConfiguration_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class java_lang_module_Configuration: AllStatic {
private:
static int _EMPTY_CONFIGURATION_offset;
public:
static int EMPTY_CONFIGURATION_offset() { return _EMPTY_CONFIGURATION_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class java_util_ImmutableCollections_ListN : AllStatic {
private:
static int _EMPTY_LIST_offset;
public:
static int EMPTY_LIST_offset() { return _EMPTY_LIST_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class java_util_ImmutableCollections_SetN : AllStatic {
private:
static int _EMPTY_SET_offset;
public:
static int EMPTY_SET_offset() { return _EMPTY_SET_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};
class java_util_ImmutableCollections_MapN : AllStatic {
private:
static int _EMPTY_MAP_offset;
public:
static int EMPTY_MAP_offset() { return _EMPTY_MAP_offset; }
static void compute_offsets();
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
};

View File

@ -65,7 +65,7 @@ void LoaderConstraintTable::free_entry(LoaderConstraintEntry *entry) {
LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
Symbol* name, Handle loader) {
assert_lock_strong(SystemDictionary_lock);
unsigned int hash = compute_hash(name);
int index = hash_to_index(hash);
LoaderConstraintEntry** pp = bucket_addr(index);
@ -89,7 +89,7 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
void LoaderConstraintTable::purge_loader_constraints() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(SystemDictionary_lock);
LogTarget(Info, class, loader, constraints) lt;
// Remove unloaded entries from constraint table
for (int index = 0; index < table_size(); index++) {

View File

@ -436,7 +436,7 @@ ModuleEntry* ModuleEntryTable::lookup_only(Symbol* name) {
// Remove dead modules from all other alive modules' reads list.
// This should only occur at class unloading.
void ModuleEntryTable::purge_all_module_reads() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(Module_lock);
for (int i = 0; i < table_size(); i++) {
for (ModuleEntry* entry = bucket(i);
entry != NULL;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2018, 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
@ -302,7 +302,7 @@ bool PackageEntry::exported_pending_delete() const {
// Remove dead entries from all packages' exported list
void PackageEntryTable::purge_all_package_exports() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(Module_lock);
for (int i = 0; i < table_size(); i++) {
for (PackageEntry* entry = bucket(i);
entry != NULL;

View File

@ -100,7 +100,7 @@ ResolutionErrorTable::ResolutionErrorTable(int table_size)
// RedefineClasses support - remove matching entry of a
// constant pool that is going away
void ResolutionErrorTable::delete_entry(ConstantPool* c) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(SystemDictionary_lock);
for (int i = 0; i < table_size(); i++) {
for (ResolutionErrorEntry** p = bucket_addr(i); *p != NULL; ) {
ResolutionErrorEntry* entry = *p;
@ -118,7 +118,7 @@ void ResolutionErrorTable::delete_entry(ConstantPool* c) {
// Remove unloaded entries from the table
void ResolutionErrorTable::purge_resolution_errors() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
assert_locked_or_safepoint(SystemDictionary_lock);
for (int i = 0; i < table_size(); i++) {
for (ResolutionErrorEntry** p = bucket_addr(i); *p != NULL; ) {
ResolutionErrorEntry* entry = *p;

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