Mercurial > hg > truffle
comparison src/cpu/ppc/vm/frame_ppc.inline.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 | 67fa91961822 |
children | 92aa6797d639 63c5920a038d |
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. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 #ifndef CPU_PPC_VM_FRAME_PPC_INLINE_HPP | 26 #ifndef CPU_PPC_VM_FRAME_PPC_INLINE_HPP |
27 #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP | 27 #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP |
28 | |
29 #ifndef CC_INTERP | |
30 #error "CC_INTERP must be defined on PPC64" | |
31 #endif | |
32 | 28 |
33 // Inline functions for ppc64 frames: | 29 // Inline functions for ppc64 frames: |
34 | 30 |
35 // Find codeblob and set deopt_state. | 31 // Find codeblob and set deopt_state. |
36 inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) { | 32 inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) { |
197 | 193 |
198 inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { | 194 inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { |
199 interpreterState istate = get_interpreterState(); | 195 interpreterState istate = get_interpreterState(); |
200 return &istate->_constants; | 196 return &istate->_constants; |
201 } | 197 } |
198 | |
199 #else // !CC_INTERP | |
200 | |
201 // Template Interpreter frame value accessors. | |
202 | |
203 inline frame::ijava_state* frame::get_ijava_state() const { | |
204 return (ijava_state*) ((uintptr_t)fp() - ijava_state_size); | |
205 } | |
206 | |
207 inline intptr_t** frame::interpreter_frame_locals_addr() const { | |
208 return (intptr_t**) &(get_ijava_state()->locals); | |
209 } | |
210 inline intptr_t* frame::interpreter_frame_bcx_addr() const { | |
211 return (intptr_t*) &(get_ijava_state()->bcp); | |
212 } | |
213 inline intptr_t* frame::interpreter_frame_mdx_addr() const { | |
214 return (intptr_t*) &(get_ijava_state()->mdx); | |
215 } | |
216 // Pointer beyond the "oldest/deepest" BasicObjectLock on stack. | |
217 inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { | |
218 return (BasicObjectLock *) get_ijava_state()->monitors; | |
219 } | |
220 | |
221 inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const { | |
222 return (BasicObjectLock *) get_ijava_state(); | |
223 } | |
224 | |
225 // SAPJVM ASc 2012-11-21. Return register stack slot addr at which currently interpreted method is found | |
226 inline Method** frame::interpreter_frame_method_addr() const { | |
227 return (Method**) &(get_ijava_state()->method); | |
228 } | |
229 inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const { | |
230 return (ConstantPoolCache**) &(get_ijava_state()->cpoolCache); | |
231 } | |
232 inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { | |
233 return (ConstantPoolCache**) &(get_ijava_state()->cpoolCache); | |
234 } | |
235 | |
236 inline oop* frame::interpreter_frame_temp_oop_addr() const { | |
237 return (oop *) &(get_ijava_state()->oop_tmp); | |
238 } | |
239 inline intptr_t* frame::interpreter_frame_esp() const { | |
240 return (intptr_t*) get_ijava_state()->esp; | |
241 } | |
242 | |
243 // Convenient setters | |
244 inline void frame::interpreter_frame_set_monitor_end(BasicObjectLock* end) { get_ijava_state()->monitors = (intptr_t) end;} | |
245 inline void frame::interpreter_frame_set_cpcache(ConstantPoolCache* cp) { *frame::interpreter_frame_cpoolcache_addr() = cp; } | |
246 inline void frame::interpreter_frame_set_esp(intptr_t* esp) { get_ijava_state()->esp = (intptr_t) esp; } | |
247 inline void frame::interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp) { get_ijava_state()->top_frame_sp = (intptr_t) top_frame_sp; } | |
248 inline void frame::interpreter_frame_set_sender_sp(intptr_t* sender_sp) { get_ijava_state()->sender_sp = (intptr_t) sender_sp; } | |
249 | |
250 inline intptr_t* frame::interpreter_frame_expression_stack() const { | |
251 return (intptr_t*)interpreter_frame_monitor_end() - 1; | |
252 } | |
253 | |
254 inline jint frame::interpreter_frame_expression_stack_direction() { | |
255 return -1; | |
256 } | |
257 | |
258 // top of expression stack | |
259 inline intptr_t* frame::interpreter_frame_tos_address() const { | |
260 return ((intptr_t*) get_ijava_state()->esp) + Interpreter::stackElementWords; | |
261 } | |
262 | |
263 inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const { | |
264 return &interpreter_frame_tos_address()[offset]; | |
265 } | |
266 | |
202 #endif // CC_INTERP | 267 #endif // CC_INTERP |
203 | 268 |
204 inline int frame::interpreter_frame_monitor_size() { | 269 inline int frame::interpreter_frame_monitor_size() { |
205 // Number of stack slots for a monitor. | 270 // Number of stack slots for a monitor. |
206 return round_to(BasicObjectLock::size(), // number of stack slots | 271 return round_to(BasicObjectLock::size(), // number of stack slots |