Skip to content

Commit 3a89cd5

Browse files
shipilevpron
authored andcommitted
Loom: PPC64, S390, ARM32, Zero stubs
Reviewed-by: rpressler
1 parent f77e547 commit 3a89cd5

Some content is hidden

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

49 files changed

+2253
-83
lines changed

src/hotspot/cpu/aarch64/continuation_aarch64.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const int ContinuationHelper::align_wiggle = 1;
3535
#ifdef ASSERT
3636
bool Frame::assert_frame_laid_out(frame f) {
3737
intptr_t* sp = f.sp();
38-
address pc = *(address*)(sp - SENDER_SP_RET_ADDRESS_OFFSET);
38+
address pc = *(address*)(sp - frame::sender_sp_ret_address_offset());
3939
intptr_t* fp = *(intptr_t**)(sp - frame::sender_sp_offset);
4040
assert (f.raw_pc() == pc, "f.ra_pc: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.raw_pc()), p2i(pc));
4141
assert (f.fp() == fp, "f.fp: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.fp()), p2i(fp));
@@ -418,7 +418,7 @@ intptr_t* Thaw<ConfigT>::push_interpreter_return_frame(intptr_t* sp) {
418418
assert((intptr_t)sp % 16 == 0, "");
419419

420420
sp -= ContinuationHelper::frame_metadata;
421-
*(address*)(sp - SENDER_SP_RET_ADDRESS_OFFSET) = pc;
421+
*(address*)(sp - frame::sender_sp_ret_address_offset()) = pc;
422422
*(intptr_t**)(sp - frame::sender_sp_offset) = fp;
423423
return sp;
424424
}

src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ inline bool frame::is_interpreted_frame() const {
399399
return Interpreter::contains(pc());
400400
}
401401

402+
inline int frame::sender_sp_ret_address_offset() {
403+
return frame::sender_sp_offset - frame::return_addr_offset;
404+
}
405+
402406
inline const ImmutableOopMap* frame::get_oop_map() const {
403407
if (_cb == NULL) return NULL;
404408
if (_cb->oop_maps() != NULL) {

src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,3 +1327,7 @@ void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
13271327
}
13281328
__ load(address, result, info, lir_patch_none);
13291329
}
1330+
1331+
void LIRGenerator::do_continuation_doYield(Intrinsic* x) {
1332+
fatal("Continuation.doYield intrinsic is not implemented on this platform");
1333+
}
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
/*
2+
* Copyright (c) 2019, 2021 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+
*/
24+
25+
#ifndef CPU_ARM_CONTINUATION_ARM_INLINE_HPP
26+
#define CPU_ARM_CONTINUATION_ARM_INLINE_HPP
27+
28+
#include "oops/instanceStackChunkKlass.inline.hpp"
29+
#include "runtime/frame.hpp"
30+
#include "runtime/frame.inline.hpp"
31+
32+
// TODO: Implement
33+
const int ContinuationHelper::frame_metadata = 0;
34+
const int ContinuationHelper::align_wiggle = 0;
35+
36+
#ifdef ASSERT
37+
bool Frame::assert_frame_laid_out(frame f) {
38+
Unimplemented();
39+
return false;
40+
}
41+
#endif
42+
43+
inline intptr_t** Frame::callee_link_address(const frame& f) {
44+
Unimplemented();
45+
return NULL;
46+
}
47+
48+
template<typename FKind>
49+
static inline intptr_t* real_fp(const frame& f) {
50+
Unimplemented();
51+
return NULL;
52+
}
53+
54+
template<typename FKind> // TODO: maybe do the same CRTP trick with Interpreted and Compiled as with hframe
55+
static inline intptr_t** link_address(const frame& f) {
56+
Unimplemented();
57+
return NULL;
58+
}
59+
60+
inline address* Interpreted::return_pc_address(const frame& f) {
61+
Unimplemented();
62+
return NULL;
63+
}
64+
65+
template <bool relative>
66+
void Interpreted::patch_sender_sp(frame& f, intptr_t* sp) {
67+
Unimplemented();
68+
}
69+
70+
inline address* Frame::return_pc_address(const frame& f) {
71+
Unimplemented();
72+
return NULL;
73+
}
74+
75+
inline address Frame::real_pc(const frame& f) {
76+
Unimplemented();
77+
return NULL;
78+
}
79+
80+
inline void Frame::patch_pc(const frame& f, address pc) {
81+
Unimplemented();
82+
}
83+
84+
inline intptr_t* Interpreted::frame_top(const frame& f, InterpreterOopMap* mask) { // inclusive; this will be copied with the frame
85+
Unimplemented();
86+
return NULL;
87+
}
88+
89+
template <bool relative>
90+
inline intptr_t* Interpreted::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
91+
Unimplemented();
92+
return NULL;
93+
}
94+
95+
inline intptr_t* Interpreted::frame_top(const frame& f, int callee_argsize, bool callee_interpreted) {
96+
Unimplemented();
97+
return NULL;
98+
}
99+
100+
template<typename FKind, typename RegisterMapT>
101+
inline void ContinuationHelper::update_register_map(RegisterMapT* map, const frame& f) {
102+
Unimplemented();
103+
}
104+
105+
template<typename RegisterMapT>
106+
inline void ContinuationHelper::update_register_map_with_callee(RegisterMapT* map, const frame& f) {
107+
Unimplemented();
108+
}
109+
110+
inline void ContinuationHelper::push_pd(const frame& f) {
111+
Unimplemented();
112+
}
113+
114+
// creates the yield stub frame faster than JavaThread::last_frame
115+
inline frame ContinuationHelper::last_frame(JavaThread* thread) {
116+
Unimplemented();
117+
return frame();
118+
}
119+
120+
frame ContinuationEntry::to_frame() {
121+
Unimplemented();
122+
return frame();
123+
}
124+
125+
void ContinuationEntry::update_register_map(RegisterMap* map) {
126+
Unimplemented();
127+
}
128+
129+
void ContinuationHelper::set_anchor_to_entry_pd(JavaFrameAnchor* anchor, ContinuationEntry* cont) {
130+
Unimplemented();
131+
}
132+
133+
void ContinuationHelper::set_anchor_pd(JavaFrameAnchor* anchor, intptr_t* sp) {
134+
Unimplemented();
135+
}
136+
137+
template <typename ConfigT>
138+
inline void Freeze<ConfigT>::set_top_frame_metadata_pd(const frame& hf) {
139+
Unimplemented();
140+
}
141+
142+
template <typename ConfigT>
143+
inline intptr_t* Freeze<ConfigT>::align_bottom(intptr_t* bottom, int argsize) {
144+
Unimplemented();
145+
return NULL;
146+
}
147+
148+
template <typename ConfigT>
149+
template<typename FKind>
150+
inline frame Freeze<ConfigT>::sender(const frame& f) {
151+
Unimplemented();
152+
return frame();
153+
}
154+
155+
template <typename ConfigT>
156+
template<typename FKind> frame Freeze<ConfigT>::new_hframe(frame& f, frame& caller) {
157+
Unimplemented();
158+
return frame();
159+
}
160+
161+
template <typename ConfigT>
162+
inline void Freeze<ConfigT>::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
163+
Unimplemented();
164+
}
165+
166+
template <typename ConfigT>
167+
template <typename FKind, bool bottom>
168+
inline void Freeze<ConfigT>::patch_pd(frame& hf, const frame& caller) {
169+
Unimplemented();
170+
}
171+
172+
template <typename ConfigT>
173+
inline void Freeze<ConfigT>::patch_chunk_pd(intptr_t* vsp, intptr_t* hsp) {
174+
Unimplemented();
175+
}
176+
177+
template <typename ConfigT>
178+
inline frame Thaw<ConfigT>::new_entry_frame() {
179+
Unimplemented();
180+
return frame();
181+
}
182+
183+
template <typename ConfigT>
184+
template<typename FKind> frame Thaw<ConfigT>::new_frame(const frame& hf, frame& caller, bool bottom) {
185+
Unimplemented();
186+
return frame();
187+
}
188+
189+
template <typename ConfigT>
190+
inline void Thaw<ConfigT>::set_interpreter_frame_bottom(const frame& f, intptr_t* bottom) {
191+
Unimplemented();
192+
}
193+
194+
template <typename ConfigT>
195+
inline void Thaw<ConfigT>::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) {
196+
Unimplemented();
197+
}
198+
199+
template <typename ConfigT>
200+
inline intptr_t* Thaw<ConfigT>::align(const frame& hf, intptr_t* vsp, frame& caller, bool bottom) {
201+
Unimplemented();
202+
return NULL;
203+
}
204+
205+
template <typename ConfigT>
206+
template<typename FKind, bool bottom>
207+
inline void Thaw<ConfigT>::patch_pd(frame& f, const frame& caller) {
208+
Unimplemented();
209+
}
210+
211+
template <typename ConfigT>
212+
intptr_t* Thaw<ConfigT>::push_interpreter_return_frame(intptr_t* sp) {
213+
Unimplemented();
214+
return NULL;
215+
}
216+
217+
template <typename ConfigT>
218+
void Thaw<ConfigT>::patch_chunk_pd(intptr_t* sp) {
219+
Unimplemented();
220+
}
221+
222+
template <typename ConfigT>
223+
inline void Thaw<ConfigT>::prefetch_chunk_pd(void* start, int size) {
224+
Unimplemented();
225+
}
226+
227+
template <typename ConfigT>
228+
inline intptr_t* Thaw<ConfigT>::align_chunk(intptr_t* vsp) {
229+
Unimplemented();
230+
return NULL;
231+
}
232+
233+
#endif // CPU_ARM_CONTINUATION_ARM_INLINE_HPP

src/hotspot/cpu/arm/frame_arm.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,6 @@ bool frame::is_interpreted_frame() const {
248248
return Interpreter::contains(pc());
249249
}
250250

251-
int frame::frame_size(RegisterMap* map) const {
252-
frame sender = this->sender(map);
253-
return sender.sp() - sp();
254-
}
255-
256251
intptr_t* frame::entry_frame_argument_at(int offset) const {
257252
assert(is_entry_frame(), "entry frame expected");
258253
// convert offset to index to deal with tsi
@@ -279,7 +274,12 @@ BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
279274
return (BasicObjectLock*) addr_at(interpreter_frame_monitor_block_bottom_offset);
280275
}
281276

282-
BasicObjectLock* frame::interpreter_frame_monitor_end() const {
277+
// Pointer beyond the "oldest/deepest" BasicObjectLock on stack.
278+
template BasicObjectLock* frame::interpreter_frame_monitor_end<true>() const;
279+
template BasicObjectLock* frame::interpreter_frame_monitor_end<false>() const;
280+
281+
template <bool relative>
282+
inline BasicObjectLock* frame::interpreter_frame_monitor_end() const {
283283
BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset);
284284
// make sure the pointer points inside the frame
285285
assert((intptr_t) fp() > (intptr_t) result, "result must < than frame pointer");
@@ -399,6 +399,7 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
399399
return frame(sender_sp, unextended_sp, link(), sender_pc());
400400
}
401401

402+
template <bool stub>
402403
frame frame::sender_for_compiled_frame(RegisterMap* map) const {
403404
assert(map != NULL, "map must be set");
404405

@@ -442,7 +443,7 @@ frame frame::sender(RegisterMap* map) const {
442443
assert(_cb == CodeCache::find_blob(pc()),"Must be the same");
443444

444445
if (_cb != NULL) {
445-
return sender_for_compiled_frame(map);
446+
return sender_for_compiled_frame<false>(map);
446447
}
447448

448449
assert(false, "should not be called for a C frame");
@@ -547,8 +548,11 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
547548
return type;
548549
}
549550

551+
template intptr_t* frame::interpreter_frame_tos_at<false>(jint offset) const;
552+
template intptr_t* frame::interpreter_frame_tos_at<true >(jint offset) const;
550553

551-
intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
554+
template <bool relative>
555+
inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
552556
int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
553557
return &interpreter_frame_tos_address()[index];
554558
}
@@ -576,6 +580,9 @@ frame::frame(void* sp, void* fp, void* pc) {
576580
init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
577581
}
578582

583+
void frame::describe_top_pd(FrameValues& values) {
584+
Unimplemented();
585+
}
579586
#endif
580587

581588
intptr_t *frame::initial_deoptimization_info() {

src/hotspot/cpu/arm/frame_arm.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
}
9191
#endif
9292

93+
const ImmutableOopMap* get_oop_map() const;
94+
9395
public:
9496
// Constructors
9597

@@ -110,6 +112,9 @@
110112
// expression stack tos if we are nested in a java call
111113
intptr_t* interpreter_frame_last_sp() const;
112114

115+
template <typename RegisterMapT>
116+
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);
117+
113118
// deoptimization support
114119
void interpreter_frame_set_last_sp(intptr_t* sp);
115120

@@ -118,4 +123,7 @@
118123

119124
static jint interpreter_frame_expression_stack_direction() { return -1; }
120125

126+
template <bool relative = false>
127+
inline intptr_t* interpreter_frame_last_sp() const;
128+
121129
#endif // CPU_ARM_FRAME_ARM_HPP

0 commit comments

Comments
 (0)