Skip to content

Commit 69a5579

Browse files
authored
Update (2023.03.03)
29668: Delete VectorTest temporarily beacause of 8292289 29667: LA port of 8297036: Generalize C2 stub mechanism
1 parent 990b191 commit 69a5579

File tree

4 files changed

+46
-26
lines changed

4 files changed

+46
-26
lines changed

src/hotspot/cpu/loongarch/c2_safepointPollStubTable_loongarch.cpp renamed to src/hotspot/cpu/loongarch/c2_CodeStubs_loongarch.cpp

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2021, 2022, Loongson Technology. All rights reserved.
3+
* Copyright (c) 2021, 2023, Loongson Technology. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,41 @@
2424
*/
2525

2626
#include "precompiled.hpp"
27-
#include "asm/macroAssembler.hpp"
28-
#include "opto/compile.hpp"
29-
#include "opto/node.hpp"
30-
#include "opto/output.hpp"
27+
#include "opto/c2_MacroAssembler.hpp"
28+
#include "opto/c2_CodeStubs.hpp"
3129
#include "runtime/sharedRuntime.hpp"
30+
#include "runtime/stubRoutines.hpp"
3231

3332
#define __ masm.
34-
void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const {
33+
34+
int C2SafepointPollStub::max_size() const {
35+
return 4 * 4;
36+
}
37+
38+
void C2SafepointPollStub::emit(C2_MacroAssembler& masm) {
3539
assert(SharedRuntime::polling_page_return_handler_blob() != NULL,
3640
"polling page return stub not created yet");
3741
address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
3842

39-
__ bind(entry->_stub_label);
40-
InternalAddress safepoint_pc(masm.pc() - masm.offset() + entry->_safepoint_offset);
43+
__ bind(entry());
44+
InternalAddress safepoint_pc(masm.pc() - masm.offset() + _safepoint_offset);
4145
__ lea(AT, safepoint_pc);
4246
__ st_d(AT, Address(TREG, JavaThread::saved_exception_pc_offset()));
4347
__ jmp(stub, relocInfo::runtime_call_type);
4448
}
49+
50+
int C2EntryBarrierStub::max_size() const {
51+
return 5 * 4;
52+
}
53+
54+
void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
55+
__ bind(entry());
56+
__ call_long(StubRoutines::la::method_entry_barrier());
57+
__ b(continuation());
58+
59+
__ bind(guard());
60+
__ relocate(entry_guard_Relocation::spec());
61+
__ emit_int32(0); // nmethod guard value
62+
}
63+
4564
#undef __

src/hotspot/cpu/loongarch/c2_MacroAssembler_loongarch.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2021, 2022, Loongson Technology. All rights reserved.
3+
* Copyright (c) 2021, 2023, Loongson Technology. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -1674,17 +1674,3 @@ bool C2_MacroAssembler::in_scratch_emit_size() {
16741674
}
16751675
return MacroAssembler::in_scratch_emit_size();
16761676
}
1677-
1678-
void C2_MacroAssembler::emit_entry_barrier_stub(C2EntryBarrierStub* stub) {
1679-
bind(stub->slow_path());
1680-
call_long(StubRoutines::la::method_entry_barrier());
1681-
b(stub->continuation());
1682-
1683-
bind(stub->guard());
1684-
relocate(entry_guard_Relocation::spec());
1685-
emit_int32(0); // nmethod guard value
1686-
}
1687-
1688-
int C2_MacroAssembler::entry_barrier_stub_size() {
1689-
return 5 * 4;
1690-
}

src/hotspot/cpu/loongarch/loongarch_64.ad

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,9 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
18601860
Label dummy_label;
18611861
Label* code_stub = &dummy_label;
18621862
if (!C->output()->in_scratch_emit_size()) {
1863-
code_stub = &C->output()->safepoint_poll_table()->add_safepoint(__ offset());
1863+
C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
1864+
C->output()->add_stub(stub);
1865+
code_stub = &stub->entry();
18641866
}
18651867
__ relocate(relocInfo::poll_return_type);
18661868
__ safepoint_poll(*code_stub, TREG, true /* at_return */, false /* acquire */, true /* in_nmethod */);
@@ -2108,8 +2110,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
21082110
Label* guard = &dummy_guard;
21092111
if (!Compile::current()->output()->in_scratch_emit_size()) {
21102112
// Use real labels from actual stub when not emitting code for purpose of measuring its size
2111-
C2EntryBarrierStub* stub = Compile::current()->output()->entry_barrier_table()->add_entry_barrier();
2112-
slow_path = &stub->slow_path();
2113+
C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
2114+
Compile::current()->output()->add_stub(stub);
2115+
slow_path = &stub->entry();
21132116
continuation = &stub->continuation();
21142117
guard = &stub->guard();
21152118
}
@@ -16669,6 +16672,7 @@ instruct storemask16S(vecX dst, vecY src, immI_2 size, vecX tmp) %{
1666916672

1667016673
// ----------------------------- VectorTest -----------------------------------
1667116674

16675+
/*
1667216676
instruct anytrue_in_maskV16(mRegI dst, vecX src1, vecX src2)
1667316677
%{
1667416678
predicate(UseCF2GR && static_cast<const VectorTestNode*>(n)->get_predicate() == BoolTest::ne);
@@ -16780,6 +16784,7 @@ instruct alltrue_in_maskV32_indir(mRegI dst, vecY src1, vecY src2, regF tmp)
1678016784
%}
1678116785
ins_pipe( pipe_slow );
1678216786
%}
16787+
*/
1678316788

1678416789
// ----------------------------- VectorMaskTrueCount ----------------------------
1678516790

src/hotspot/cpu/loongarch/matcher_loongarch.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@
147147
// Implements a variant of EncodeISOArrayNode that encode ASCII only
148148
static const bool supports_encode_ascii_array = true;
149149

150+
// Some architecture needs a helper to check for alltrue vector
151+
static constexpr bool vectortest_needs_second_argument(bool is_alltrue, bool is_predicate) {
152+
return false;
153+
}
154+
155+
// BoolTest mask for vector test intrinsics
156+
static constexpr BoolTest::mask vectortest_mask(bool is_alltrue, bool is_predicate, int vlen) {
157+
return BoolTest::illegal;
158+
}
159+
150160
// Returns pre-selection estimated size of a vector operation.
151161
static int vector_op_pre_select_sz_estimate(int vopc, BasicType ety, int vlen) {
152162
switch(vopc) {

0 commit comments

Comments
 (0)