comparison src/cpu/ppc/vm/frame_ppc.hpp @ 17804:fd1b9f02cc91

8036976: PPC64: implement the template interpreter Reviewed-by: kvn, coleenp Contributed-by: axel.siebenborn@sap.com, martin.doerr@sap.com
author goetz
date Mon, 10 Mar 2014 12:58:02 +0100
parents 31e80afe3fed
children 92aa6797d639
comparison
equal deleted inserted replaced
17803:31e80afe3fed 17804:fd1b9f02cc91
1 /* 1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2013 SAP AG. All rights reserved. 3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * 5 *
6 * This code is free software; you can redistribute it and/or modify it 6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as 7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
27 #define CPU_PPC_VM_FRAME_PPC_HPP 27 #define CPU_PPC_VM_FRAME_PPC_HPP
28 28
29 #include "runtime/synchronizer.hpp" 29 #include "runtime/synchronizer.hpp"
30 #include "utilities/top.hpp" 30 #include "utilities/top.hpp"
31 31
32 #ifndef CC_INTERP
33 #error "CC_INTERP must be defined on PPC64"
34 #endif
35
36 // C frame layout on PPC-64. 32 // C frame layout on PPC-64.
37 // 33 //
38 // In this figure the stack grows upwards, while memory grows 34 // In this figure the stack grows upwards, while memory grows
39 // downwards. See "64-bit PowerPC ELF ABI Supplement Version 1.7", 35 // downwards. See "64-bit PowerPC ELF ABI Supplement Version 1.7",
40 // IBM Corp. (2003-10-29) 36 // IBM Corp. (2003-10-29)
195 }; 191 };
196 192
197 #define _spill_nonvolatiles_neg(_component) \ 193 #define _spill_nonvolatiles_neg(_component) \
198 (int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component)) 194 (int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component))
199 195
200 // Frame layout for the Java interpreter on PPC64. 196
197
198 #ifndef CC_INTERP
199 // Frame layout for the Java template interpreter on PPC64.
200 //
201 // Diffs to the CC_INTERP are marked with 'X'.
202 //
203 // TOP_IJAVA_FRAME:
204 //
205 // 0 [TOP_IJAVA_FRAME_ABI]
206 // alignment (optional)
207 // [operand stack]
208 // [monitors] (optional)
209 // X[IJAVA_STATE]
210 // note: own locals are located in the caller frame.
211 //
212 // PARENT_IJAVA_FRAME:
213 //
214 // 0 [PARENT_IJAVA_FRAME_ABI]
215 // alignment (optional)
216 // [callee's Java result]
217 // [callee's locals w/o arguments]
218 // [outgoing arguments]
219 // [used part of operand stack w/o arguments]
220 // [monitors] (optional)
221 // X[IJAVA_STATE]
222 //
223
224 struct parent_ijava_frame_abi : abi_minframe {
225 };
226
227 enum {
228 parent_ijava_frame_abi_size = sizeof(parent_ijava_frame_abi)
229 };
230
231 #define _parent_ijava_frame_abi(_component) \
232 (offset_of(frame::parent_ijava_frame_abi, _component))
233
234 struct top_ijava_frame_abi : abi_reg_args {
235 };
236
237 enum {
238 top_ijava_frame_abi_size = sizeof(top_ijava_frame_abi)
239 };
240
241 #define _top_ijava_frame_abi(_component) \
242 (offset_of(frame::top_ijava_frame_abi, _component))
243
244 struct ijava_state {
245 #ifdef ASSERT
246 uint64_t ijava_reserved; // Used for assertion.
247 uint64_t ijava_reserved2; // Inserted for alignment.
248 #endif
249 uint64_t method;
250 uint64_t locals;
251 uint64_t monitors;
252 uint64_t cpoolCache;
253 uint64_t bcp;
254 uint64_t esp;
255 uint64_t mdx;
256 uint64_t top_frame_sp; // Maybe define parent_frame_abi and move there.
257 uint64_t sender_sp;
258 // Slots only needed for native calls. Maybe better to move elsewhere.
259 uint64_t oop_tmp;
260 uint64_t lresult;
261 uint64_t fresult;
262 // Aligned to frame::alignment_in_bytes (16).
263 };
264
265 enum {
266 ijava_state_size = sizeof(ijava_state)
267 };
268
269 #define _ijava_state_neg(_component) \
270 (int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component))
271
272 #else // CC_INTERP:
273
274 // Frame layout for the Java C++ interpreter on PPC64.
201 // 275 //
202 // This frame layout provides a C-like frame for every Java frame. 276 // This frame layout provides a C-like frame for every Java frame.
203 // 277 //
204 // In these figures the stack grows upwards, while memory grows 278 // In these figures the stack grows upwards, while memory grows
205 // downwards. Square brackets denote regions possibly larger than 279 // downwards. Square brackets denote regions possibly larger than
298 }; 372 };
299 373
300 #define _top_ijava_frame_abi(_component) \ 374 #define _top_ijava_frame_abi(_component) \
301 (offset_of(frame::top_ijava_frame_abi, _component)) 375 (offset_of(frame::top_ijava_frame_abi, _component))
302 376
377 #endif // CC_INTERP
378
303 // ENTRY_FRAME 379 // ENTRY_FRAME
304 380
305 struct entry_frame_locals { 381 struct entry_frame_locals {
306 uint64_t call_wrapper_address; 382 uint64_t call_wrapper_address;
307 uint64_t result_address; //_16 383 uint64_t result_address; //_16
421 public: 497 public:
422 498
423 #ifdef CC_INTERP 499 #ifdef CC_INTERP
424 // Additional interface for interpreter frames: 500 // Additional interface for interpreter frames:
425 inline interpreterState get_interpreterState() const; 501 inline interpreterState get_interpreterState() const;
502 #else
503 inline ijava_state* get_ijava_state() const;
504 // Some convenient register frame setters/getters for deoptimization.
505 inline intptr_t* interpreter_frame_esp() const;
506 inline void interpreter_frame_set_cpcache(ConstantPoolCache* cp);
507 inline void interpreter_frame_set_esp(intptr_t* esp);
508 inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
509 inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);
426 #endif // CC_INTERP 510 #endif // CC_INTERP
427 511
428 // Size of a monitor in bytes. 512 // Size of a monitor in bytes.
429 static int interpreter_frame_monitor_size_in_bytes(); 513 static int interpreter_frame_monitor_size_in_bytes();
430 514