Skip to content

Commit c7f5c1a

Browse files
committed
Merge remote-tracking branch 'origin/master' into JDK-8357660
2 parents e0707fb + b5cfd76 commit c7f5c1a

File tree

63 files changed

+2831
-788
lines changed

Some content is hidden

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

63 files changed

+2831
-788
lines changed

make/Init.gmk

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,18 @@ reconfigure:
110110
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
111111
$(RECONFIGURE_COMMAND) )
112112

113-
.PHONY: print-modules print-targets print-tests print-configuration reconfigure
113+
# Create files that are needed to run most targets in Main.gmk
114+
create-make-helpers:
115+
( cd $(TOPDIR) && \
116+
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
117+
$(USER_MAKE_VARS) )
118+
( cd $(TOPDIR) && \
119+
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
120+
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
121+
create-main-targets-include )
122+
123+
.PHONY: print-modules print-targets print-tests print-configuration \
124+
reconfigure create-make-helpers
114125

115126
##############################################################################
116127
# The main target. This will delegate all other targets into Main.gmk.
@@ -130,7 +141,7 @@ TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
130141
# variables are explicitly propagated using $(USER_MAKE_VARS).
131142
main: MAKEOVERRIDES :=
132143

133-
main: $(INIT_TARGETS)
144+
main: $(INIT_TARGETS) create-make-helpers
134145
ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), )
135146
$(call RotateLogFiles)
136147
$(ECHO) "Building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
@@ -142,12 +153,7 @@ main: $(INIT_TARGETS)
142153
$(SEQUENTIAL_TARGETS) )
143154
# We might have cleaned away essential files, recreate them.
144155
( cd $(TOPDIR) && \
145-
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
146-
$(USER_MAKE_VARS) )
147-
( cd $(TOPDIR) && \
148-
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
149-
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
150-
create-main-targets-include )
156+
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk create-make-helpers )
151157
endif
152158
ifneq ($(PARALLEL_TARGETS), )
153159
$(call PrepareFailureLogs)

make/Main.gmk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,6 @@ bootcycle-images:
423423
ifneq ($(COMPILE_TYPE), cross)
424424
$(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
425425
$(call MakeDir, $(OUTPUTDIR)/bootcycle-build)
426-
# We need to create essential files for the bootcycle spec dir
427-
( cd $(TOPDIR) && \
428-
$(MAKE) $(MAKE_ARGS) -f make/GenerateFindTests.gmk \
429-
SPEC=$(BOOTCYCLE_SPEC))
430-
( cd $(TOPDIR) && \
431-
$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Main.gmk \
432-
SPEC=$(BOOTCYCLE_SPEC) UPDATE_MODULE_DEPS=true NO_RECIPES=true \
433-
create-main-targets-include )
434426
+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
435427
LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(BOOTCYCLE_SPEC) main
436428
else

make/PreInit.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ include $(TOPDIR)/make/Global.gmk
5050

5151
# Targets provided by Init.gmk.
5252
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
53-
print-tests reconfigure pre-compare-build post-compare-build
53+
print-tests reconfigure pre-compare-build post-compare-build \
54+
create-make-helpers
5455

5556
# CALLED_TARGETS is the list of targets that the user provided,
5657
# or "default" if unspecified.

src/hotspot/cpu/riscv/interp_masm_riscv.cpp

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -955,47 +955,29 @@ void InterpreterMacroAssembler::set_mdp_data_at(Register mdp_in,
955955

956956

957957
void InterpreterMacroAssembler::increment_mdp_data_at(Register mdp_in,
958-
int constant,
959-
bool decrement) {
960-
increment_mdp_data_at(mdp_in, noreg, constant, decrement);
958+
int constant) {
959+
increment_mdp_data_at(mdp_in, noreg, constant);
961960
}
962961

963962
void InterpreterMacroAssembler::increment_mdp_data_at(Register mdp_in,
964-
Register reg,
965-
int constant,
966-
bool decrement) {
963+
Register index,
964+
int constant) {
967965
assert(ProfileInterpreter, "must be profiling interpreter");
968-
// %%% this does 64bit counters at best it is wasting space
969-
// at worst it is a rare bug when counters overflow
970966

971-
assert_different_registers(t1, t0, mdp_in, reg);
967+
assert_different_registers(t1, t0, mdp_in, index);
972968

973969
Address addr1(mdp_in, constant);
974970
Address addr2(t1, 0);
975971
Address &addr = addr1;
976-
if (reg != noreg) {
972+
if (index != noreg) {
977973
la(t1, addr1);
978-
add(t1, t1, reg);
974+
add(t1, t1, index);
979975
addr = addr2;
980976
}
981977

982-
if (decrement) {
983-
ld(t0, addr);
984-
subi(t0, t0, DataLayout::counter_increment);
985-
Label L;
986-
bltz(t0, L); // skip store if counter underflow
987-
sd(t0, addr);
988-
bind(L);
989-
} else {
990-
assert(DataLayout::counter_increment == 1,
991-
"flow-free idiom only works with 1");
992-
ld(t0, addr);
993-
addi(t0, t0, DataLayout::counter_increment);
994-
Label L;
995-
blez(t0, L); // skip store if counter overflow
996-
sd(t0, addr);
997-
bind(L);
998-
}
978+
ld(t0, addr);
979+
addi(t0, t0, DataLayout::counter_increment);
980+
sd(t0, addr);
999981
}
1000982

1001983
void InterpreterMacroAssembler::set_mdp_flag_at(Register mdp_in,

src/hotspot/cpu/riscv/interp_masm_riscv.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
233233
void verify_method_data_pointer();
234234

235235
void set_mdp_data_at(Register mdp_in, int constant, Register value);
236-
void increment_mdp_data_at(Address data, bool decrement = false);
237-
void increment_mdp_data_at(Register mdp_in, int constant,
238-
bool decrement = false);
239-
void increment_mdp_data_at(Register mdp_in, Register reg, int constant,
240-
bool decrement = false);
236+
void increment_mdp_data_at(Register mdp_in, int constant);
237+
void increment_mdp_data_at(Register mdp_in, Register index, int constant);
241238
void increment_mask_and_jump(Address counter_addr,
242239
int increment, Address mask,
243240
Register tmp1, Register tmp2,

src/hotspot/cpu/x86/interp_masm_x86.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,25 +1355,15 @@ void InterpreterMacroAssembler::update_mdp_for_ret(Register return_bci) {
13551355
}
13561356

13571357

1358-
void InterpreterMacroAssembler::profile_taken_branch(Register mdp,
1359-
Register bumped_count) {
1358+
void InterpreterMacroAssembler::profile_taken_branch(Register mdp) {
13601359
if (ProfileInterpreter) {
13611360
Label profile_continue;
13621361

13631362
// If no method data exists, go to profile_continue.
1364-
// Otherwise, assign to mdp
13651363
test_method_data_pointer(mdp, profile_continue);
13661364

13671365
// We are taking a branch. Increment the taken count.
1368-
// We inline increment_mdp_data_at to return bumped_count in a register
1369-
//increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
1370-
Address data(mdp, in_bytes(JumpData::taken_offset()));
1371-
movptr(bumped_count, data);
1372-
assert(DataLayout::counter_increment == 1,
1373-
"flow-free idiom only works with 1");
1374-
addptr(bumped_count, DataLayout::counter_increment);
1375-
sbbptr(bumped_count, 0);
1376-
movptr(data, bumped_count); // Store back out
1366+
increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
13771367

13781368
// The method data pointer needs to be updated to reflect the new target.
13791369
update_mdp_by_offset(mdp, in_bytes(JumpData::displacement_offset()));
@@ -1389,7 +1379,7 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) {
13891379
// If no method data exists, go to profile_continue.
13901380
test_method_data_pointer(mdp, profile_continue);
13911381

1392-
// We are taking a branch. Increment the not taken count.
1382+
// We are not taking a branch. Increment the not taken count.
13931383
increment_mdp_data_at(mdp, in_bytes(BranchData::not_taken_offset()));
13941384

13951385
// The method data pointer needs to be updated to correspond to

src/hotspot/cpu/x86/interp_masm_x86.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
236236
void update_mdp_by_constant(Register mdp_in, int constant);
237237
void update_mdp_for_ret(Register return_bci);
238238

239-
void profile_taken_branch(Register mdp, Register bumped_count);
239+
void profile_taken_branch(Register mdp);
240240
void profile_not_taken_branch(Register mdp);
241241
void profile_call(Register mdp);
242242
void profile_final_call(Register mdp);

src/hotspot/cpu/x86/templateTable_x86.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,7 @@ void TemplateTable::float_cmp(bool is_float, int unordered_result) {
16871687

16881688
void TemplateTable::branch(bool is_jsr, bool is_wide) {
16891689
__ get_method(rcx); // rcx holds method
1690-
__ profile_taken_branch(rax, rbx); // rax holds updated MDP, rbx
1691-
// holds bumped taken count
1690+
__ profile_taken_branch(rax); // rax holds updated MDP
16921691

16931692
const ByteSize be_offset = MethodCounters::backedge_counter_offset() +
16941693
InvocationCounter::counter_offset();
@@ -1739,7 +1738,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
17391738
if (UseLoopCounter) {
17401739
// increment backedge counter for backward branches
17411740
// rax: MDO
1742-
// rbx: MDO bumped taken-count
17431741
// rcx: method
17441742
// rdx: target offset
17451743
// r13: target bcp

src/hotspot/share/classfile/javaClasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ ByteSize java_lang_Thread::thread_id_offset() {
18721872
}
18731873

18741874
oop java_lang_Thread::park_blocker(oop java_thread) {
1875-
return java_thread->obj_field(_park_blocker_offset);
1875+
return java_thread->obj_field_access<MO_RELAXED>(_park_blocker_offset);
18761876
}
18771877

18781878
oop java_lang_Thread::async_get_stack_trace(oop java_thread, TRAPS) {

src/hotspot/share/classfile/vmSymbols.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ class SerializeClosure;
742742
template(jdk_internal_vm_ThreadDumper, "jdk/internal/vm/ThreadDumper") \
743743
template(dumpThreads_name, "dumpThreads") \
744744
template(dumpThreadsToJson_name, "dumpThreadsToJson") \
745+
template(jdk_internal_vm_ThreadSnapshot, "jdk/internal/vm/ThreadSnapshot") \
746+
template(jdk_internal_vm_ThreadLock, "jdk/internal/vm/ThreadSnapshot$ThreadLock") \
747+
template(jdk_internal_vm_ThreadLock_signature, "Ljdk/internal/vm/ThreadSnapshot$ThreadLock;") \
748+
template(jdk_internal_vm_ThreadLock_array, "[Ljdk/internal/vm/ThreadSnapshot$ThreadLock;") \
749+
template(java_lang_StackTraceElement_of_name, "of") \
750+
template(java_lang_StackTraceElement_of_signature, "([Ljava/lang/StackTraceElement;)[Ljava/lang/StackTraceElement;") \
745751
\
746752
/* jcmd Thread.vthread_scheduler and Thread.vthread_pollers */ \
747753
template(jdk_internal_vm_JcmdVThreadCommands, "jdk/internal/vm/JcmdVThreadCommands") \

0 commit comments

Comments
 (0)