Skip to content

Commit 78ce70b

Browse files
committed
Revert "remove EnableJVMCI flag"
This reverts commit c4f083c.
1 parent e0c076f commit 78ce70b

File tree

134 files changed

+502
-352
lines changed

Some content is hidden

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

134 files changed

+502
-352
lines changed

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,15 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
603603
__ ldr(rscratch1, Address(rmethod, in_bytes(Method::from_compiled_offset())));
604604

605605
#if INCLUDE_JVMCI
606-
// check if this call should be routed towards a specific entry point
607-
__ ldr(rscratch2, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
608-
Label no_alternative_target;
609-
__ cbz(rscratch2, no_alternative_target);
610-
__ mov(rscratch1, rscratch2);
611-
__ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
612-
__ bind(no_alternative_target);
606+
if (EnableJVMCI) {
607+
// check if this call should be routed towards a specific entry point
608+
__ ldr(rscratch2, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
609+
Label no_alternative_target;
610+
__ cbz(rscratch2, no_alternative_target);
611+
__ mov(rscratch1, rscratch2);
612+
__ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
613+
__ bind(no_alternative_target);
614+
}
613615
#endif // INCLUDE_JVMCI
614616

615617
// Now generate the shuffle code.
@@ -2210,7 +2212,9 @@ void SharedRuntime::generate_deopt_blob() {
22102212
// Setup code generation tools
22112213
int pad = 0;
22122214
#if INCLUDE_JVMCI
2213-
pad += 512; // Increase the buffer size for JVMCI
2215+
if (EnableJVMCI) {
2216+
pad += 512; // Increase the buffer size when compiling for JVMCI
2217+
}
22142218
#endif
22152219
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
22162220
CodeBuffer buffer(name, 2048+pad, 1024);
@@ -2281,9 +2285,12 @@ void SharedRuntime::generate_deopt_blob() {
22812285

22822286
#if INCLUDE_JVMCI
22832287
Label after_fetch_unroll_info_call;
2284-
int implicit_exception_uncommon_trap_offset = __ pc() - start;
2285-
int uncommon_trap_offset;
2286-
{
2288+
int implicit_exception_uncommon_trap_offset = 0;
2289+
int uncommon_trap_offset = 0;
2290+
2291+
if (EnableJVMCI) {
2292+
implicit_exception_uncommon_trap_offset = __ pc() - start;
2293+
22872294
__ ldr(lr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
22882295
__ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
22892296

@@ -2303,16 +2310,16 @@ void SharedRuntime::generate_deopt_blob() {
23032310
__ mov(c_rarg0, rthread);
23042311
__ movw(c_rarg2, rcpool); // exec mode
23052312
__ lea(rscratch1,
2306-
RuntimeAddress(CAST_FROM_FN_PTR(address,
2307-
Deoptimization::uncommon_trap)));
2313+
RuntimeAddress(CAST_FROM_FN_PTR(address,
2314+
Deoptimization::uncommon_trap)));
23082315
__ blr(rscratch1);
23092316
__ bind(retaddr);
23102317
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
23112318

23122319
__ reset_last_Java_frame(false);
23132320

23142321
__ b(after_fetch_unroll_info_call);
2315-
}
2322+
} // EnableJVMCI
23162323
#endif // INCLUDE_JVMCI
23172324

23182325
int exception_offset = __ pc() - start;
@@ -2406,7 +2413,9 @@ void SharedRuntime::generate_deopt_blob() {
24062413
__ reset_last_Java_frame(false);
24072414

24082415
#if INCLUDE_JVMCI
2409-
__ bind(after_fetch_unroll_info_call);
2416+
if (EnableJVMCI) {
2417+
__ bind(after_fetch_unroll_info_call);
2418+
}
24102419
#endif
24112420

24122421
// Load UnrollBlock* into r5
@@ -2566,8 +2575,10 @@ void SharedRuntime::generate_deopt_blob() {
25662575
_deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words);
25672576
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
25682577
#if INCLUDE_JVMCI
2569-
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2570-
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
2578+
if (EnableJVMCI) {
2579+
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2580+
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
2581+
}
25712582
#endif
25722583
}
25732584

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
527527
#if INCLUDE_JVMCI
528528
// Check if we need to take lock at entry of synchronized method. This can
529529
// only occur on method entry so emit it only for vtos with step 0.
530-
if (state == vtos && step == 0) {
530+
if (EnableJVMCI && state == vtos && step == 0) {
531531
Label L;
532532
__ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
533533
__ cbz(rscratch1, L);
@@ -538,11 +538,13 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
538538
__ bind(L);
539539
} else {
540540
#ifdef ASSERT
541-
Label L;
542-
__ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
543-
__ cbz(rscratch1, L);
544-
__ stop("unexpected pending monitor in deopt entry");
545-
__ bind(L);
541+
if (EnableJVMCI) {
542+
Label L;
543+
__ ldrb(rscratch1, Address(rthread, JavaThread::pending_monitorenter_offset()));
544+
__ cbz(rscratch1, L);
545+
__ stop("unexpected pending monitor in deopt entry");
546+
__ bind(L);
547+
}
546548
#endif
547549
}
548550
#endif

src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,15 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
493493
__ ld(t1, Address(xmethod, in_bytes(Method::from_compiled_offset())));
494494

495495
#if INCLUDE_JVMCI
496-
// check if this call should be routed towards a specific entry point
497-
__ ld(t0, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
498-
Label no_alternative_target;
499-
__ beqz(t0, no_alternative_target);
500-
__ mv(t1, t0);
501-
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
502-
__ bind(no_alternative_target);
496+
if (EnableJVMCI) {
497+
// check if this call should be routed towards a specific entry point
498+
__ ld(t0, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
499+
Label no_alternative_target;
500+
__ beqz(t0, no_alternative_target);
501+
__ mv(t1, t0);
502+
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
503+
__ bind(no_alternative_target);
504+
}
503505
#endif // INCLUDE_JVMCI
504506

505507
// Now generate the shuffle code.
@@ -2082,7 +2084,9 @@ void SharedRuntime::generate_deopt_blob() {
20822084
// Setup code generation tools
20832085
int pad = 0;
20842086
#if INCLUDE_JVMCI
2085-
pad += 512; // Increase the buffer size for JVMCI
2087+
if (EnableJVMCI) {
2088+
pad += 512; // Increase the buffer size when compiling for JVMCI
2089+
}
20862090
#endif
20872091
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
20882092
CodeBuffer buffer(name, 2048 + pad, 1024);
@@ -2154,33 +2158,38 @@ void SharedRuntime::generate_deopt_blob() {
21542158

21552159
#if INCLUDE_JVMCI
21562160
Label after_fetch_unroll_info_call;
2157-
int implicit_exception_uncommon_trap_offset = __ pc() - start;
2161+
int implicit_exception_uncommon_trap_offset = 0;
2162+
int uncommon_trap_offset = 0;
21582163

2159-
__ ld(ra, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
2160-
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
2164+
if (EnableJVMCI) {
2165+
implicit_exception_uncommon_trap_offset = __ pc() - start;
21612166

2162-
int uncommon_trap_offset = __ pc() - start;
2167+
__ ld(ra, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
2168+
__ sd(zr, Address(xthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
21632169

2164-
// Save everything in sight.
2165-
reg_saver.save_live_registers(masm, 0, &frame_size_in_words);
2166-
// fetch_unroll_info needs to call last_java_frame()
2167-
Label retaddr;
2168-
__ set_last_Java_frame(sp, noreg, retaddr, t0);
2170+
uncommon_trap_offset = __ pc() - start;
2171+
2172+
// Save everything in sight.
2173+
reg_saver.save_live_registers(masm, 0, &frame_size_in_words);
2174+
// fetch_unroll_info needs to call last_java_frame()
2175+
Label retaddr;
2176+
__ set_last_Java_frame(sp, noreg, retaddr, t0);
21692177

2170-
__ lw(c_rarg1, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
2171-
__ mv(t0, -1);
2172-
__ sw(t0, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
2178+
__ lw(c_rarg1, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
2179+
__ mv(t0, -1);
2180+
__ sw(t0, Address(xthread, in_bytes(JavaThread::pending_deoptimization_offset())));
21732181

2174-
__ mv(xcpool, Deoptimization::Unpack_reexecute);
2175-
__ mv(c_rarg0, xthread);
2176-
__ orrw(c_rarg2, zr, xcpool); // exec mode
2177-
__ rt_call(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap));
2178-
__ bind(retaddr);
2179-
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
2182+
__ mv(xcpool, Deoptimization::Unpack_reexecute);
2183+
__ mv(c_rarg0, xthread);
2184+
__ orrw(c_rarg2, zr, xcpool); // exec mode
2185+
__ rt_call(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap));
2186+
__ bind(retaddr);
2187+
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
21802188

2181-
__ reset_last_Java_frame(false);
2189+
__ reset_last_Java_frame(false);
21822190

2183-
__ j(after_fetch_unroll_info_call);
2191+
__ j(after_fetch_unroll_info_call);
2192+
} // EnableJVMCI
21842193
#endif // INCLUDE_JVMCI
21852194

21862195
int exception_offset = __ pc() - start;
@@ -2275,7 +2284,9 @@ void SharedRuntime::generate_deopt_blob() {
22752284
__ reset_last_Java_frame(false);
22762285

22772286
#if INCLUDE_JVMCI
2278-
__ bind(after_fetch_unroll_info_call);
2287+
if (EnableJVMCI) {
2288+
__ bind(after_fetch_unroll_info_call);
2289+
}
22792290
#endif
22802291

22812292
// Load UnrollBlock* into x15
@@ -2432,8 +2443,10 @@ void SharedRuntime::generate_deopt_blob() {
24322443
assert(_deopt_blob != nullptr, "create deoptimization blob fail!");
24332444
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
24342445
#if INCLUDE_JVMCI
2435-
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2436-
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
2446+
if (EnableJVMCI) {
2447+
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2448+
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
2449+
}
24372450
#endif
24382451
}
24392452

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -936,13 +936,15 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
936936
__ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset())));
937937

938938
#if INCLUDE_JVMCI
939-
// check if this call should be routed towards a specific entry point
940-
__ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
941-
Label no_alternative_target;
942-
__ jcc(Assembler::equal, no_alternative_target);
943-
__ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
944-
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
945-
__ bind(no_alternative_target);
939+
if (EnableJVMCI) {
940+
// check if this call should be routed towards a specific entry point
941+
__ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
942+
Label no_alternative_target;
943+
__ jcc(Assembler::equal, no_alternative_target);
944+
__ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
945+
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0);
946+
__ bind(no_alternative_target);
947+
}
946948
#endif // INCLUDE_JVMCI
947949

948950
// Now generate the shuffle code. Pick up all register args and move the
@@ -2641,7 +2643,9 @@ void SharedRuntime::generate_deopt_blob() {
26412643
pad += 1024;
26422644
}
26432645
#if INCLUDE_JVMCI
2644-
pad += 512; // Increase the buffer size for JVMCI
2646+
if (EnableJVMCI) {
2647+
pad += 512; // Increase the buffer size when compiling for JVMCI
2648+
}
26452649
#endif
26462650
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
26472651
CodeBuffer buffer(name, 2560+pad, 1024);
@@ -2711,30 +2715,35 @@ void SharedRuntime::generate_deopt_blob() {
27112715

27122716
#if INCLUDE_JVMCI
27132717
Label after_fetch_unroll_info_call;
2714-
int implicit_exception_uncommon_trap_offset = __ pc() - start;
2718+
int implicit_exception_uncommon_trap_offset = 0;
2719+
int uncommon_trap_offset = 0;
27152720

2716-
__ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
2717-
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), NULL_WORD);
2721+
if (EnableJVMCI) {
2722+
implicit_exception_uncommon_trap_offset = __ pc() - start;
27182723

2719-
int uncommon_trap_offset = __ pc() - start;
2724+
__ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
2725+
__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), NULL_WORD);
27202726

2721-
// Save everything in sight.
2722-
RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
2723-
// fetch_unroll_info needs to call last_java_frame()
2724-
__ set_last_Java_frame(noreg, noreg, nullptr, rscratch1);
2727+
uncommon_trap_offset = __ pc() - start;
27252728

2726-
__ movl(c_rarg1, Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())));
2727-
__ movl(Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())), -1);
2729+
// Save everything in sight.
2730+
RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, /*save_wide_vectors*/ true);
2731+
// fetch_unroll_info needs to call last_java_frame()
2732+
__ set_last_Java_frame(noreg, noreg, nullptr, rscratch1);
27282733

2729-
__ movl(r14, Deoptimization::Unpack_reexecute);
2730-
__ mov(c_rarg0, r15_thread);
2731-
__ movl(c_rarg2, r14); // exec mode
2732-
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
2733-
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
2734+
__ movl(c_rarg1, Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())));
2735+
__ movl(Address(r15_thread, in_bytes(JavaThread::pending_deoptimization_offset())), -1);
27342736

2735-
__ reset_last_Java_frame(false);
2737+
__ movl(r14, Deoptimization::Unpack_reexecute);
2738+
__ mov(c_rarg0, r15_thread);
2739+
__ movl(c_rarg2, r14); // exec mode
2740+
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)));
2741+
oop_maps->add_gc_map( __ pc()-start, map->deep_copy());
2742+
2743+
__ reset_last_Java_frame(false);
27362744

2737-
__ jmp(after_fetch_unroll_info_call);
2745+
__ jmp(after_fetch_unroll_info_call);
2746+
} // EnableJVMCI
27382747
#endif // INCLUDE_JVMCI
27392748

27402749
int exception_offset = __ pc() - start;
@@ -2822,7 +2831,9 @@ void SharedRuntime::generate_deopt_blob() {
28222831
__ reset_last_Java_frame(false);
28232832

28242833
#if INCLUDE_JVMCI
2825-
__ bind(after_fetch_unroll_info_call);
2834+
if (EnableJVMCI) {
2835+
__ bind(after_fetch_unroll_info_call);
2836+
}
28262837
#endif
28272838

28282839
// Load UnrollBlock* into rdi
@@ -2983,8 +2994,10 @@ void SharedRuntime::generate_deopt_blob() {
29832994
_deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words);
29842995
_deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
29852996
#if INCLUDE_JVMCI
2986-
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2987-
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
2997+
if (EnableJVMCI) {
2998+
_deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
2999+
_deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
3000+
}
29883001
#endif
29893002
}
29903003

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i
227227
#if INCLUDE_JVMCI
228228
// Check if we need to take lock at entry of synchronized method. This can
229229
// only occur on method entry so emit it only for vtos with step 0.
230-
if (state == vtos && step == 0) {
230+
if (EnableJVMCI && state == vtos && step == 0) {
231231
Label L;
232232
__ cmpb(Address(thread, JavaThread::pending_monitorenter_offset()), 0);
233233
__ jcc(Assembler::zero, L);
@@ -240,11 +240,13 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i
240240
__ bind(L);
241241
} else {
242242
#ifdef ASSERT
243-
Label L;
244-
__ cmpb(Address(r15_thread, JavaThread::pending_monitorenter_offset()), 0);
245-
__ jcc(Assembler::zero, L);
246-
__ stop("unexpected pending monitor in deopt entry");
247-
__ bind(L);
243+
if (EnableJVMCI) {
244+
Label L;
245+
__ cmpb(Address(r15_thread, JavaThread::pending_monitorenter_offset()), 0);
246+
__ jcc(Assembler::zero, L);
247+
__ stop("unexpected pending monitor in deopt entry");
248+
__ bind(L);
249+
}
248250
#endif
249251
}
250252
#endif

0 commit comments

Comments
 (0)