Skip to content

Commit 1519632

Browse files
author
Igor Veresov
committed
8251462: Simplify compilation policy
Reviewed-by: cjplummer, kvn
1 parent 71128cf commit 1519632

File tree

98 files changed

+2320
-3795
lines changed

Some content is hidden

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

98 files changed

+2320
-3795
lines changed

src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -1411,7 +1411,7 @@ void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
14111411
// membar it's possible for a simple Dekker test to fail if loads
14121412
// use LD;DMB but stores use STLR. This can happen if C2 compiles
14131413
// the stores in one method and C1 compiles the loads in another.
1414-
if (!is_c1_or_interpreter_only()) {
1414+
if (!CompilerConfig::is_c1_only_no_aot_or_jvmci()) {
14151415
__ membar();
14161416
}
14171417
__ volatile_load_mem_reg(address, result, info);

src/hotspot/cpu/aarch64/c1_globals_aarch64.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -32,7 +32,7 @@
3232
// Sets the default values for platform dependent flags used by the client compiler.
3333
// (see c1_globals.hpp)
3434

35-
#ifndef TIERED
35+
#ifndef COMPILER2
3636
define_pd_global(bool, BackgroundCompilation, true );
3737
define_pd_global(bool, InlineIntrinsics, true );
3838
define_pd_global(bool, PreferInterpreterNativeStubs, false);
@@ -56,7 +56,7 @@ define_pd_global(uintx, MetaspaceSize, 12*M );
5656
define_pd_global(bool, NeverActAsServerClassMachine, true );
5757
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
5858
define_pd_global(bool, CICompileOSR, true );
59-
#endif // !TIERED
59+
#endif // !COMPILER2
6060
define_pd_global(bool, UseTypeProfile, false);
6161

6262
define_pd_global(bool, OptimizeSinglePrecision, true );

src/hotspot/cpu/aarch64/c2_globals_aarch64.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -39,7 +39,7 @@ define_pd_global(bool, PreferInterpreterNativeStubs, false);
3939
define_pd_global(bool, ProfileTraps, true);
4040
define_pd_global(bool, UseOnStackReplacement, true);
4141
define_pd_global(bool, ProfileInterpreter, true);
42-
define_pd_global(bool, TieredCompilation, trueInTiered);
42+
define_pd_global(bool, TieredCompilation, COMPILER1_PRESENT(true) NOT_COMPILER1(false));
4343
define_pd_global(intx, CompileThreshold, 10000);
4444

4545
define_pd_global(intx, OnStackReplacePercentage, 140);

src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
5151

5252
ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmpval, newval, /*acquire*/ true, /*release*/ true, /*is_cae*/ false, result);
5353

54-
if (is_c1_or_interpreter_only()) {
54+
if (CompilerConfig::is_c1_only_no_aot_or_jvmci()) {
5555
// The membar here is necessary to prevent reordering between the
5656
// release store in the CAS above and a subsequent volatile load.
5757
// However for tiered compilation C1 inserts a full barrier before

src/hotspot/cpu/aarch64/globals_aarch64.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2015, 2019, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -36,7 +36,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im
3636
define_pd_global(bool, TrapBasedNullChecks, false);
3737
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast
3838

39-
define_pd_global(uintx, CodeCacheSegmentSize, 64 TIERED_ONLY(+64)); // Tiered compilation has large code-entry alignment.
39+
define_pd_global(uintx, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment.
4040
define_pd_global(intx, CodeEntryAlignment, 64);
4141
define_pd_global(intx, OptoLoopAlignment, 16);
4242
define_pd_global(intx, InlineFrequencyCount, 100);

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 24 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -589,82 +589,31 @@ address TemplateInterpreterGenerator::generate_safept_entry_for(
589589
//
590590
// rmethod: method
591591
//
592-
void TemplateInterpreterGenerator::generate_counter_incr(
593-
Label* overflow,
594-
Label* profile_method,
595-
Label* profile_method_continue) {
592+
void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow) {
596593
Label done;
597594
// Note: In tiered we increment either counters in Method* or in MDO depending if we're profiling or not.
598-
if (TieredCompilation) {
599-
int increment = InvocationCounter::count_increment;
600-
Label no_mdo;
601-
if (ProfileInterpreter) {
602-
// Are we profiling?
603-
__ ldr(r0, Address(rmethod, Method::method_data_offset()));
604-
__ cbz(r0, no_mdo);
605-
// Increment counter in the MDO
606-
const Address mdo_invocation_counter(r0, in_bytes(MethodData::invocation_counter_offset()) +
607-
in_bytes(InvocationCounter::counter_offset()));
608-
const Address mask(r0, in_bytes(MethodData::invoke_mask_offset()));
609-
__ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rscratch1, rscratch2, false, Assembler::EQ, overflow);
610-
__ b(done);
611-
}
612-
__ bind(no_mdo);
613-
// Increment counter in MethodCounters
614-
const Address invocation_counter(rscratch2,
615-
MethodCounters::invocation_counter_offset() +
616-
InvocationCounter::counter_offset());
617-
__ get_method_counters(rmethod, rscratch2, done);
618-
const Address mask(rscratch2, in_bytes(MethodCounters::invoke_mask_offset()));
619-
__ increment_mask_and_jump(invocation_counter, increment, mask, rscratch1, r1, false, Assembler::EQ, overflow);
620-
__ bind(done);
621-
} else { // not TieredCompilation
622-
const Address backedge_counter(rscratch2,
623-
MethodCounters::backedge_counter_offset() +
624-
InvocationCounter::counter_offset());
625-
const Address invocation_counter(rscratch2,
626-
MethodCounters::invocation_counter_offset() +
627-
InvocationCounter::counter_offset());
628-
629-
__ get_method_counters(rmethod, rscratch2, done);
630-
631-
if (ProfileInterpreter) { // %%% Merge this into MethodData*
632-
__ ldrw(r1, Address(rscratch2, MethodCounters::interpreter_invocation_counter_offset()));
633-
__ addw(r1, r1, 1);
634-
__ strw(r1, Address(rscratch2, MethodCounters::interpreter_invocation_counter_offset()));
635-
}
636-
// Update standard invocation counters
637-
__ ldrw(r1, invocation_counter);
638-
__ ldrw(r0, backedge_counter);
639-
640-
__ addw(r1, r1, InvocationCounter::count_increment);
641-
__ andw(r0, r0, InvocationCounter::count_mask_value);
642-
643-
__ strw(r1, invocation_counter);
644-
__ addw(r0, r0, r1); // add both counters
645-
646-
// profile_method is non-null only for interpreted method so
647-
// profile_method != NULL == !native_call
648-
649-
if (ProfileInterpreter && profile_method != NULL) {
650-
// Test to see if we should create a method data oop
651-
__ ldr(rscratch2, Address(rmethod, Method::method_counters_offset()));
652-
__ ldrw(rscratch2, Address(rscratch2, in_bytes(MethodCounters::interpreter_profile_limit_offset())));
653-
__ cmpw(r0, rscratch2);
654-
__ br(Assembler::LT, *profile_method_continue);
655-
656-
// if no method data exists, go to profile_method
657-
__ test_method_data_pointer(rscratch2, *profile_method);
658-
}
659-
660-
{
661-
__ ldr(rscratch2, Address(rmethod, Method::method_counters_offset()));
662-
__ ldrw(rscratch2, Address(rscratch2, in_bytes(MethodCounters::interpreter_invocation_limit_offset())));
663-
__ cmpw(r0, rscratch2);
664-
__ br(Assembler::HS, *overflow);
665-
}
666-
__ bind(done);
595+
int increment = InvocationCounter::count_increment;
596+
Label no_mdo;
597+
if (ProfileInterpreter) {
598+
// Are we profiling?
599+
__ ldr(r0, Address(rmethod, Method::method_data_offset()));
600+
__ cbz(r0, no_mdo);
601+
// Increment counter in the MDO
602+
const Address mdo_invocation_counter(r0, in_bytes(MethodData::invocation_counter_offset()) +
603+
in_bytes(InvocationCounter::counter_offset()));
604+
const Address mask(r0, in_bytes(MethodData::invoke_mask_offset()));
605+
__ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rscratch1, rscratch2, false, Assembler::EQ, overflow);
606+
__ b(done);
667607
}
608+
__ bind(no_mdo);
609+
// Increment counter in MethodCounters
610+
const Address invocation_counter(rscratch2,
611+
MethodCounters::invocation_counter_offset() +
612+
InvocationCounter::counter_offset());
613+
__ get_method_counters(rmethod, rscratch2, done);
614+
const Address mask(rscratch2, in_bytes(MethodCounters::invoke_mask_offset()));
615+
__ increment_mask_and_jump(invocation_counter, increment, mask, rscratch1, r1, false, Assembler::EQ, overflow);
616+
__ bind(done);
668617
}
669618

670619
void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue) {
@@ -1205,7 +1154,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
12051154
// increment invocation count & check for overflow
12061155
Label invocation_counter_overflow;
12071156
if (inc_counter) {
1208-
generate_counter_incr(&invocation_counter_overflow, NULL, NULL);
1157+
generate_counter_incr(&invocation_counter_overflow);
12091158
}
12101159

12111160
Label continue_after_compile;
@@ -1649,15 +1598,8 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
16491598

16501599
// increment invocation count & check for overflow
16511600
Label invocation_counter_overflow;
1652-
Label profile_method;
1653-
Label profile_method_continue;
16541601
if (inc_counter) {
1655-
generate_counter_incr(&invocation_counter_overflow,
1656-
&profile_method,
1657-
&profile_method_continue);
1658-
if (ProfileInterpreter) {
1659-
__ bind(profile_method_continue);
1660-
}
1602+
generate_counter_incr(&invocation_counter_overflow);
16611603
}
16621604

16631605
Label continue_after_compile;
@@ -1709,15 +1651,6 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
17091651

17101652
// invocation counter overflow
17111653
if (inc_counter) {
1712-
if (ProfileInterpreter) {
1713-
// We have decided to profile this method in the interpreter
1714-
__ bind(profile_method);
1715-
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1716-
__ set_method_data_pointer_for_bcp();
1717-
// don't think we need this
1718-
__ get_method(r1);
1719-
__ b(profile_method_continue);
1720-
}
17211654
// Handle overflow of counter and compile method
17221655
__ bind(invocation_counter_overflow);
17231656
generate_counter_overflow(continue_after_compile);

0 commit comments

Comments
 (0)