Skip to content
This repository was archived by the owner on Mar 2, 2019. It is now read-only.

Commit 63e9543

Browse files
author
never
committed
8205824: Update Graal
Reviewed-by: iveresov, kvn
1 parent c03a501 commit 63e9543

File tree

2,690 files changed

+7132
-1198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,690 files changed

+7132
-1198
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
2+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,8 @@ void CodeInstaller::assumption_ConcreteMethod(Thread* thread, Handle assumption)
966966
}
967967

968968
void CodeInstaller::assumption_CallSiteTargetValue(Thread* thread, Handle assumption) {
969-
Handle callSite(thread, Assumptions_CallSiteTargetValue::callSite(assumption()));
970-
Handle methodHandle(thread, Assumptions_CallSiteTargetValue::methodHandle(assumption()));
969+
Handle callSite(thread, HotSpotObjectConstantImpl::object(Assumptions_CallSiteTargetValue::callSite(assumption())));
970+
Handle methodHandle(thread, HotSpotObjectConstantImpl::object(Assumptions_CallSiteTargetValue::methodHandle(assumption())));
971971

972972
_dependencies->assert_call_site_target_value(callSite(), methodHandle());
973973
}

src/hotspot/share/jvmci/jvmciCompiler.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ void JVMCICompiler::exit_on_pending_exception(oop exception, const char* message
215215
Handle ex(THREAD, exception);
216216
java_lang_Throwable::java_printStackTrace(ex, THREAD);
217217
} else {
218-
// Allow error reporting thread to print the stack trace.
219-
os::sleep(THREAD, 200, false);
218+
// Allow error reporting thread to print the stack trace. Windows
219+
// doesn't allow uninterruptible wait for JavaThreads
220+
const bool interruptible = true;
221+
os::sleep(THREAD, 200, interruptible);
220222
}
221223

222224
before_exit(THREAD);
@@ -228,13 +230,6 @@ void JVMCICompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci,
228230
ShouldNotReachHere();
229231
}
230232

231-
bool JVMCICompiler::is_trivial(Method* method) {
232-
if (_bootstrapping) {
233-
return false;
234-
}
235-
return JVMCIRuntime::treat_as_trivial(method);
236-
}
237-
238233
// Print compilation timers and statistics
239234
void JVMCICompiler::print_timers() {
240235
print_compilation_timers();

src/hotspot/share/jvmci/jvmciCompiler.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ class JVMCICompiler : public AbstractCompiler {
9292

9393
void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env);
9494

95-
virtual bool is_trivial(Method* method);
96-
9795
// Print compilation timers and statistics
9896
virtual void print_timers();
9997

src/hotspot/share/jvmci/jvmciJavaClasses.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class JVMCIJavaClasses : AllStatic {
147147
oop_field(Assumptions_ConcreteMethod, impl, "Ljdk/vm/ci/meta/ResolvedJavaMethod;") \
148148
end_class \
149149
start_class(Assumptions_CallSiteTargetValue) \
150-
oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \
151-
oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;") \
150+
oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljdk/vm/ci/meta/JavaConstant;") \
151+
oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljdk/vm/ci/meta/JavaConstant;") \
152152
end_class \
153153
start_class(site_Site) \
154154
int_field(site_Site, pcOffset) \
@@ -288,7 +288,7 @@ class JVMCIJavaClasses : AllStatic {
288288
boolean_field(StackLockValue, eliminated) \
289289
end_class \
290290
start_class(HotSpotSpeculationLog) \
291-
oop_field(HotSpotSpeculationLog, lastFailed, "Ljava/lang/Object;") \
291+
long_field(HotSpotSpeculationLog, lastFailed) \
292292
end_class \
293293
start_class(HotSpotStackFrameReference) \
294294
oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/vm/ci/hotspot/CompilerToVM;") \
@@ -312,7 +312,6 @@ class JVMCIJavaClasses : AllStatic {
312312
long_field(HotSpotConstantPool, metaspaceConstantPool) \
313313
end_class \
314314
start_class(HotSpotJVMCIRuntime) \
315-
objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \
316315
int_field(HotSpotJVMCIRuntime, compilationLevelAdjustment) \
317316
end_class \
318317
/* end*/

src/hotspot/share/jvmci/jvmciRuntime.cpp

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL;
6262
bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false;
6363
bool JVMCIRuntime::_well_known_classes_initialized = false;
64-
int JVMCIRuntime::_trivial_prefixes_count = 0;
65-
char** JVMCIRuntime::_trivial_prefixes = NULL;
6664
JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none;
6765
bool JVMCIRuntime::_shutdown_called = false;
6866

@@ -536,11 +534,9 @@ JRT_END
536534

537535
PRAGMA_DIAG_PUSH
538536
PRAGMA_FORMAT_NONLITERAL_IGNORED
539-
JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3))
537+
JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, const char* format, jlong v1, jlong v2, jlong v3))
540538
ResourceMark rm;
541-
assert(format != NULL && java_lang_String::is_instance(format), "must be");
542-
char *buf = java_lang_String::as_utf8_string(format);
543-
tty->print((const char*)buf, v1, v2, v3);
539+
tty->print(format, v1, v2, v3);
544540
JRT_END
545541
PRAGMA_DIAG_POP
546542

@@ -685,20 +681,6 @@ void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) {
685681
Handle result = callStatic("jdk/vm/ci/hotspot/HotSpotJVMCIRuntime",
686682
"runtime",
687683
"()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;", NULL, CHECK);
688-
objArrayOop trivial_prefixes = HotSpotJVMCIRuntime::trivialPrefixes(result);
689-
if (trivial_prefixes != NULL) {
690-
char** prefixes = NEW_C_HEAP_ARRAY(char*, trivial_prefixes->length(), mtCompiler);
691-
for (int i = 0; i < trivial_prefixes->length(); i++) {
692-
oop str = trivial_prefixes->obj_at(i);
693-
if (str == NULL) {
694-
THROW(vmSymbols::java_lang_NullPointerException());
695-
} else {
696-
prefixes[i] = strdup(java_lang_String::as_utf8_string(str));
697-
}
698-
}
699-
_trivial_prefixes = prefixes;
700-
_trivial_prefixes_count = trivial_prefixes->length();
701-
}
702684
int adjustment = HotSpotJVMCIRuntime::compilationLevelAdjustment(result);
703685
assert(adjustment >= JVMCIRuntime::none &&
704686
adjustment <= JVMCIRuntime::by_full_signature,
@@ -918,14 +900,3 @@ void JVMCIRuntime::bootstrap_finished(TRAPS) {
918900
args.push_oop(receiver);
919901
JavaCalls::call_special(&result, receiver->klass(), vmSymbols::bootstrapFinished_method_name(), vmSymbols::void_method_signature(), &args, CHECK);
920902
}
921-
922-
bool JVMCIRuntime::treat_as_trivial(Method* method) {
923-
if (_HotSpotJVMCIRuntime_initialized) {
924-
for (int i = 0; i < _trivial_prefixes_count; i++) {
925-
if (method->method_holder()->name()->starts_with(_trivial_prefixes[i])) {
926-
return true;
927-
}
928-
}
929-
}
930-
return false;
931-
}

src/hotspot/share/jvmci/jvmciRuntime.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ class JVMCIRuntime: public AllStatic {
5656
static bool _HotSpotJVMCIRuntime_initialized;
5757
static bool _well_known_classes_initialized;
5858

59-
static int _trivial_prefixes_count;
60-
static char** _trivial_prefixes;
61-
6259
static CompLevelAdjustment _comp_level_adjustment;
6360

6461
static bool _shutdown_called;
@@ -110,8 +107,6 @@ class JVMCIRuntime: public AllStatic {
110107
return _shutdown_called;
111108
}
112109

113-
static bool treat_as_trivial(Method* method);
114-
115110
/**
116111
* Lets JVMCI modify the compilation level currently selected for a method by
117112
* the VM compilation policy.
@@ -143,7 +138,7 @@ class JVMCIRuntime: public AllStatic {
143138
static jboolean object_notifyAll(JavaThread* thread, oopDesc* obj);
144139
static void vm_error(JavaThread* thread, jlong where, jlong format, jlong value);
145140
static oopDesc* load_and_clear_exception(JavaThread* thread);
146-
static void log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3);
141+
static void log_printf(JavaThread* thread, const char* format, jlong v1, jlong v2, jlong v3);
147142
static void log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline);
148143
// Print the passed in object, optionally followed by a newline. If
149144
// as_string is true and the object is a java.lang.String then it

src/hotspot/share/jvmci/vmStructs_jvmci.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \
177177
nonstatic_field(JavaThread, _osthread, OSThread*) \
178178
nonstatic_field(JavaThread, _pending_deoptimization, int) \
179-
nonstatic_field(JavaThread, _pending_failed_speculation, oop) \
179+
nonstatic_field(JavaThread, _pending_failed_speculation, long) \
180180
nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \
181181
nonstatic_field(JavaThread, _jvmci_counters, jlong*) \
182182
nonstatic_field(JavaThread, _reserved_stack_activation, address) \

src/hotspot/share/runtime/deoptimization.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,13 +1547,13 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
15471547
methodHandle trap_method = trap_scope->method();
15481548
int trap_bci = trap_scope->bci();
15491549
#if INCLUDE_JVMCI
1550-
oop speculation = thread->pending_failed_speculation();
1550+
long speculation = thread->pending_failed_speculation();
15511551
if (nm->is_compiled_by_jvmci()) {
1552-
if (speculation != NULL) {
1552+
if (speculation != 0) {
15531553
oop speculation_log = nm->as_nmethod()->speculation_log();
15541554
if (speculation_log != NULL) {
15551555
if (TraceDeoptimization || TraceUncollectedSpeculations) {
1556-
if (HotSpotSpeculationLog::lastFailed(speculation_log) != NULL) {
1556+
if (HotSpotSpeculationLog::lastFailed(speculation_log) != 0) {
15571557
tty->print_cr("A speculation that was not collected by the compiler is being overwritten");
15581558
}
15591559
}
@@ -1566,14 +1566,14 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
15661566
tty->print_cr("Speculation present but no speculation log");
15671567
}
15681568
}
1569-
thread->set_pending_failed_speculation(NULL);
1569+
thread->set_pending_failed_speculation(0);
15701570
} else {
15711571
if (TraceDeoptimization) {
15721572
tty->print_cr("No speculation");
15731573
}
15741574
}
15751575
} else {
1576-
assert(speculation == NULL, "There should not be a speculation for method compiled by non-JVMCI compilers");
1576+
assert(speculation == 0, "There should not be a speculation for method compiled by non-JVMCI compilers");
15771577
}
15781578

15791579
if (trap_bci == SynchronizationEntryBCI) {

src/hotspot/share/runtime/thread.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ void JavaThread::initialize() {
15011501
#if INCLUDE_JVMCI
15021502
_pending_monitorenter = false;
15031503
_pending_deoptimization = -1;
1504-
_pending_failed_speculation = NULL;
1504+
_pending_failed_speculation = 0;
15051505
_pending_transfer_to_interpreter = false;
15061506
_adjusting_comp_level = false;
15071507
_jvmci._alternate_call_target = NULL;
@@ -2770,8 +2770,6 @@ void JavaThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
27702770
// Traverse the GCHandles
27712771
Thread::oops_do(f, cf);
27722772

2773-
JVMCI_ONLY(f->do_oop((oop*)&_pending_failed_speculation);)
2774-
27752773
assert((!has_last_Java_frame() && java_call_counter() == 0) ||
27762774
(has_last_Java_frame() && java_call_counter() > 0), "wrong java_sp info!");
27772775

src/hotspot/share/runtime/thread.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,9 @@ class JavaThread: public Thread {
10171017
// Guard for re-entrant call to JVMCIRuntime::adjust_comp_level
10181018
bool _adjusting_comp_level;
10191019

1020-
// An object that JVMCI compiled code can use to further describe and
1020+
// An id of a speculation that JVMCI compiled code can use to further describe and
10211021
// uniquely identify the speculative optimization guarded by the uncommon trap
1022-
oop _pending_failed_speculation;
1022+
long _pending_failed_speculation;
10231023

10241024
// These fields are mutually exclusive in terms of live ranges.
10251025
union {
@@ -1426,13 +1426,13 @@ class JavaThread: public Thread {
14261426

14271427
#if INCLUDE_JVMCI
14281428
int pending_deoptimization() const { return _pending_deoptimization; }
1429-
oop pending_failed_speculation() const { return _pending_failed_speculation; }
1429+
long pending_failed_speculation() const { return _pending_failed_speculation; }
14301430
bool adjusting_comp_level() const { return _adjusting_comp_level; }
14311431
void set_adjusting_comp_level(bool b) { _adjusting_comp_level = b; }
14321432
bool has_pending_monitorenter() const { return _pending_monitorenter; }
14331433
void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
14341434
void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
1435-
void set_pending_failed_speculation(oop failed_speculation) { _pending_failed_speculation = failed_speculation; }
1435+
void set_pending_failed_speculation(long failed_speculation) { _pending_failed_speculation = failed_speculation; }
14361436
void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
14371437
void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; }
14381438
void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; }

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,17 @@ public AArch64Kind getScalar() {
7171
return scalar;
7272
}
7373

74+
@Override
7475
public int getSizeInBytes() {
7576
return size;
7677
}
7778

79+
@Override
7880
public int getVectorLength() {
7981
return vectorLength;
8082
}
8183

84+
@Override
8285
public Key getKey() {
8386
return key;
8487
}
@@ -116,6 +119,7 @@ public boolean isSIMD() {
116119
}
117120
}
118121

122+
@Override
119123
public char getTypeChar() {
120124
switch (this) {
121125
case BYTE:

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,17 @@ public AMD64Kind getScalar() {
9292
return scalar;
9393
}
9494

95+
@Override
9596
public int getSizeInBytes() {
9697
return size;
9798
}
9899

100+
@Override
99101
public int getVectorLength() {
100102
return vectorLength;
101103
}
102104

105+
@Override
103106
public Key getKey() {
104107
return key;
105108
}
@@ -161,6 +164,7 @@ public boolean isMask() {
161164
}
162165
}
163166

167+
@Override
164168
public char getTypeChar() {
165169
switch (this) {
166170
case BYTE:

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ public String formatStackSlot(int frameRefMapIndex) {
371371

372372
public static class NumberedRefMapFormatter implements RefMapFormatter {
373373

374+
@Override
374375
public String formatStackSlot(int frameRefMapIndex) {
375376
return "s" + frameRefMapIndex;
376377
}

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public Register[] toArray() {
7878
return registers.clone();
7979
}
8080

81+
@Override
8182
public Iterator<Register> iterator() {
8283
return Arrays.asList(registers).iterator();
8384
}

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ default int getMaximumFrameSize() {
7575

7676
/**
7777
* Gets the set of all registers that might be used by the register allocator.
78-
*
79-
* To get the set of registers the register allocator is allowed to use see
80-
* {@link RegisterAllocationConfig#getAllocatableRegisters()}
8178
*/
82-
@SuppressWarnings("javadoc")
8379
RegisterArray getAllocatableRegisters();
8480

8581
/**

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private InitTimer(String name) {
4646
System.out.println("START: " + SPACES.substring(0, n * 2) + name);
4747
}
4848

49+
@Override
4950
@SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "only the initializing thread accesses this field")
5051
public void close() {
5152
final long end = System.currentTimeMillis();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
package jdk.vm.ci.common;
24+
25+
import java.lang.annotation.ElementType;
26+
import java.lang.annotation.Retention;
27+
import java.lang.annotation.RetentionPolicy;
28+
import java.lang.annotation.Target;
29+
30+
/**
31+
* Denotes a field that should have the default value for its type when building a native image.
32+
*/
33+
@Retention(RetentionPolicy.RUNTIME)
34+
@Target({ElementType.FIELD})
35+
public @interface NativeImageReinitialize {
36+
}

0 commit comments

Comments
 (0)