Mercurial > hg > graal-compiler
annotate src/cpu/ppc/vm/frame_ppc.cpp @ 20128:7ad60a16bbb0
better virtualization of BasicArrayCopyNode
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 02 Apr 2015 14:28:27 +0200 |
parents | 58cf34613a72 |
children | 92aa6797d639 327e7269f90d |
rev | line source |
---|---|
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
1 /* |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
14694 | 3 * Copyright 2012, 2014 SAP AG. All rights reserved. |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
5 * |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
6 * This code is free software; you can redistribute it and/or modify it |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
7 * under the terms of the GNU General Public License version 2 only, as |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
8 * published by the Free Software Foundation. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
9 * |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
10 * This code is distributed in the hope that it will be useful, but WITHOUT |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
13 * version 2 for more details (a copy is included in the LICENSE file that |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
14 * accompanied this code). |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
15 * |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License version |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
17 * 2 along with this work; if not, write to the Free Software Foundation, |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
19 * |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
22 * questions. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
23 * |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
24 */ |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
25 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
26 #include "precompiled.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
27 #include "interpreter/interpreter.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
28 #include "memory/resourceArea.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
29 #include "oops/markOop.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
30 #include "oops/method.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
31 #include "oops/oop.inline.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
32 #include "runtime/frame.inline.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
33 #include "runtime/handles.inline.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
34 #include "runtime/javaCalls.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
35 #include "runtime/monitorChunk.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
36 #include "runtime/signature.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
37 #include "runtime/stubCodeGenerator.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
38 #include "runtime/stubRoutines.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
39 #include "vmreg_ppc.inline.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
40 #ifdef COMPILER1 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
41 #include "c1/c1_Runtime1.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
42 #include "runtime/vframeArray.hpp" |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
43 #endif |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
44 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
45 #ifdef ASSERT |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
46 void RegisterMap::check_location_valid() { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
47 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
48 #endif // ASSERT |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
49 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
50 bool frame::safe_for_sender(JavaThread *thread) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
51 bool safe = false; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
52 address cursp = (address)sp(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
53 address curfp = (address)fp(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
54 if ((cursp != NULL && curfp != NULL && |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
55 (cursp <= thread->stack_base() && cursp >= thread->stack_base() - thread->stack_size())) && |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
56 (curfp <= thread->stack_base() && curfp >= thread->stack_base() - thread->stack_size())) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
57 safe = true; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
58 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
59 return safe; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
60 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
61 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
62 bool frame::is_interpreted_frame() const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
63 return Interpreter::contains(pc()); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
64 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
65 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
66 frame frame::sender_for_entry_frame(RegisterMap *map) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
67 assert(map != NULL, "map must be set"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
68 // Java frame called from C; skip all C frames and return top C |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
69 // frame of that chunk as the sender. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
70 JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
71 assert(!entry_frame_is_first(), "next Java fp must be non zero"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
72 assert(jfa->last_Java_sp() > _sp, "must be above this frame on stack"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
73 map->clear(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
74 assert(map->include_argument_oops(), "should be set by clear"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
75 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
76 if (jfa->last_Java_pc() != NULL) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
77 frame fr(jfa->last_Java_sp(), jfa->last_Java_pc()); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
78 return fr; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
79 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
80 // Last_java_pc is not set, if we come here from compiled code. The |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
81 // constructor retrieves the PC from the stack. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
82 frame fr(jfa->last_Java_sp()); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
83 return fr; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
84 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
85 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
86 frame frame::sender_for_interpreter_frame(RegisterMap *map) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
87 // Pass callers initial_caller_sp as unextended_sp. |
14694 | 88 return frame(sender_sp(), sender_pc(), |
89 CC_INTERP_ONLY((intptr_t*)((parent_ijava_frame_abi *)callers_abi())->initial_caller_sp) | |
90 NOT_CC_INTERP((intptr_t*)get_ijava_state()->sender_sp) | |
91 ); | |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
92 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
93 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
94 frame frame::sender_for_compiled_frame(RegisterMap *map) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
95 assert(map != NULL, "map must be set"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
96 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
97 // Frame owned by compiler. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
98 address pc = *compiled_sender_pc_addr(_cb); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
99 frame caller(compiled_sender_sp(_cb), pc); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
100 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
101 // Now adjust the map. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
102 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
103 // Get the rest. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
104 if (map->update_map()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
105 // Tell GC to use argument oopmaps for some runtime stubs that need it. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
106 map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread())); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
107 if (_cb->oop_maps() != NULL) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
108 OopMapSet::update_register_map(this, map); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
109 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
110 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
111 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
112 return caller; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
113 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
114 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
115 intptr_t* frame::compiled_sender_sp(CodeBlob* cb) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
116 return sender_sp(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
117 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
118 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
119 address* frame::compiled_sender_pc_addr(CodeBlob* cb) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
120 return sender_pc_addr(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
121 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
122 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
123 frame frame::sender(RegisterMap* map) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
124 // Default is we do have to follow them. The sender_for_xxx will |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
125 // update it accordingly. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
126 map->set_include_argument_oops(false); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
127 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
128 if (is_entry_frame()) return sender_for_entry_frame(map); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
129 if (is_interpreted_frame()) return sender_for_interpreter_frame(map); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
130 assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
131 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
132 if (_cb != NULL) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
133 return sender_for_compiled_frame(map); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
134 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
135 // Must be native-compiled frame, i.e. the marshaling code for native |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
136 // methods that exists in the core system. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
137 return frame(sender_sp(), sender_pc()); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
138 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
139 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
140 void frame::patch_pc(Thread* thread, address pc) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
141 if (TracePcPatching) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
142 tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]", |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
143 &((address*) _sp)[-1], ((address*) _sp)[-1], pc); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
144 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
145 own_abi()->lr = (uint64_t)pc; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
146 _cb = CodeCache::find_blob(pc); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
147 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
148 address orig = (((nmethod*)_cb)->get_original_pc(this)); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
149 assert(orig == _pc, "expected original to be stored before patching"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
150 _deopt_state = is_deoptimized; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
151 // Leave _pc as is. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
152 } else { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
153 _deopt_state = not_deoptimized; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
154 _pc = pc; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
155 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
156 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
157 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
158 void frame::pd_gc_epilog() { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
159 if (is_interpreted_frame()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
160 // Set constant pool cache entry for interpreter. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
161 Method* m = interpreter_frame_method(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
162 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
163 *interpreter_frame_cpoolcache_addr() = m->constants()->cache(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
164 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
165 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
166 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
167 bool frame::is_interpreted_frame_valid(JavaThread* thread) const { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
168 // Is there anything to do? |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
169 assert(is_interpreted_frame(), "Not an interpreted frame"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
170 return true; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
171 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
172 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
173 BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
174 assert(is_interpreted_frame(), "interpreted frame expected"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
175 Method* method = interpreter_frame_method(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
176 BasicType type = method->result_type(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
177 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
178 if (method->is_native()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
179 // Prior to calling into the runtime to notify the method exit the possible |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
180 // result value is saved into the interpreter frame. |
14445 | 181 #ifdef CC_INTERP |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
182 interpreterState istate = get_interpreterState(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
183 address lresult = (address)istate + in_bytes(BytecodeInterpreter::native_lresult_offset()); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
184 address fresult = (address)istate + in_bytes(BytecodeInterpreter::native_fresult_offset()); |
14694 | 185 #else |
186 address lresult = (address)&(get_ijava_state()->lresult); | |
187 address fresult = (address)&(get_ijava_state()->fresult); | |
14445 | 188 #endif |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
189 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
190 switch (method->result_type()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
191 case T_OBJECT: |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
192 case T_ARRAY: { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
193 oop* obj_p = *(oop**)lresult; |
14433
018b357638aa
8028514: PPC64: Fix C++ Interpreter after '7195622: CheckUnhandledOops has limited usefulness now'
simonis
parents:
14408
diff
changeset
|
194 oop obj = (obj_p == NULL) ? (oop)NULL : *obj_p; |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
195 assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
196 *oop_result = obj; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
197 break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
198 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
199 // We use std/stfd to store the values. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
200 case T_BOOLEAN : value_result->z = (jboolean) *(unsigned long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
201 case T_INT : value_result->i = (jint) *(long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
202 case T_CHAR : value_result->c = (jchar) *(unsigned long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
203 case T_SHORT : value_result->s = (jshort) *(long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
204 case T_BYTE : value_result->z = (jbyte) *(long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
205 case T_LONG : value_result->j = (jlong) *(long*)lresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
206 case T_FLOAT : value_result->f = (jfloat) *(double*)fresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
207 case T_DOUBLE : value_result->d = (jdouble) *(double*)fresult; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
208 case T_VOID : /* Nothing to do */ break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
209 default : ShouldNotReachHere(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
210 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
211 } else { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
212 intptr_t* tos_addr = interpreter_frame_tos_address(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
213 switch (method->result_type()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
214 case T_OBJECT: |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
215 case T_ARRAY: { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
216 oop obj = *(oop*)tos_addr; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
217 assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
218 *oop_result = obj; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
219 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
220 case T_BOOLEAN : value_result->z = (jboolean) *(jint*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
221 case T_BYTE : value_result->b = (jbyte) *(jint*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
222 case T_CHAR : value_result->c = (jchar) *(jint*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
223 case T_SHORT : value_result->s = (jshort) *(jint*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
224 case T_INT : value_result->i = *(jint*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
225 case T_LONG : value_result->j = *(jlong*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
226 case T_FLOAT : value_result->f = *(jfloat*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
227 case T_DOUBLE : value_result->d = *(jdouble*)tos_addr; break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
228 case T_VOID : /* Nothing to do */ break; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
229 default : ShouldNotReachHere(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
230 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
231 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
232 return type; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
233 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
234 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
235 #ifndef PRODUCT |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
236 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
237 void frame::describe_pd(FrameValues& values, int frame_no) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
238 if (is_interpreted_frame()) { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
239 #ifdef CC_INTERP |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
240 interpreterState istate = get_interpreterState(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
241 values.describe(frame_no, (intptr_t*)istate, "istate"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
242 values.describe(frame_no, (intptr_t*)&(istate->_thread), " thread"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
243 values.describe(frame_no, (intptr_t*)&(istate->_bcp), " bcp"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
244 values.describe(frame_no, (intptr_t*)&(istate->_locals), " locals"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
245 values.describe(frame_no, (intptr_t*)&(istate->_constants), " constants"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
246 values.describe(frame_no, (intptr_t*)&(istate->_method), err_msg(" method = %s", istate->_method->name_and_sig_as_C_string())); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
247 values.describe(frame_no, (intptr_t*)&(istate->_mdx), " mdx"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
248 values.describe(frame_no, (intptr_t*)&(istate->_stack), " stack"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
249 values.describe(frame_no, (intptr_t*)&(istate->_msg), err_msg(" msg = %s", BytecodeInterpreter::C_msg(istate->_msg))); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
250 values.describe(frame_no, (intptr_t*)&(istate->_result), " result"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
251 values.describe(frame_no, (intptr_t*)&(istate->_prev_link), " prev_link"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
252 values.describe(frame_no, (intptr_t*)&(istate->_oop_temp), " oop_temp"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
253 values.describe(frame_no, (intptr_t*)&(istate->_stack_base), " stack_base"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
254 values.describe(frame_no, (intptr_t*)&(istate->_stack_limit), " stack_limit"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
255 values.describe(frame_no, (intptr_t*)&(istate->_monitor_base), " monitor_base"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
256 values.describe(frame_no, (intptr_t*)&(istate->_frame_bottom), " frame_bottom"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
257 values.describe(frame_no, (intptr_t*)&(istate->_last_Java_pc), " last_Java_pc"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
258 values.describe(frame_no, (intptr_t*)&(istate->_last_Java_fp), " last_Java_fp"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
259 values.describe(frame_no, (intptr_t*)&(istate->_last_Java_sp), " last_Java_sp"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
260 values.describe(frame_no, (intptr_t*)&(istate->_self_link), " self_link"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
261 values.describe(frame_no, (intptr_t*)&(istate->_native_fresult), " native_fresult"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
262 values.describe(frame_no, (intptr_t*)&(istate->_native_lresult), " native_lresult"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
263 #else |
14694 | 264 #define DESCRIBE_ADDRESS(name) \ |
265 values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name); | |
266 | |
267 DESCRIBE_ADDRESS(method); | |
268 DESCRIBE_ADDRESS(locals); | |
269 DESCRIBE_ADDRESS(monitors); | |
270 DESCRIBE_ADDRESS(cpoolCache); | |
271 DESCRIBE_ADDRESS(bcp); | |
272 DESCRIBE_ADDRESS(esp); | |
273 DESCRIBE_ADDRESS(mdx); | |
274 DESCRIBE_ADDRESS(top_frame_sp); | |
275 DESCRIBE_ADDRESS(sender_sp); | |
276 DESCRIBE_ADDRESS(oop_tmp); | |
277 DESCRIBE_ADDRESS(lresult); | |
278 DESCRIBE_ADDRESS(fresult); | |
14408
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
279 #endif |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
280 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
281 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
282 #endif |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
283 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
284 void frame::adjust_unextended_sp() { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
285 // If we are returning to a compiled MethodHandle call site, the |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
286 // saved_fp will in fact be a saved value of the unextended SP. The |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
287 // simplest way to tell whether we are returning to such a call site |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
288 // is as follows: |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
289 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
290 if (is_compiled_frame() && false /*is_at_mh_callsite()*/) { // TODO PPC port |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
291 // If the sender PC is a deoptimization point, get the original |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
292 // PC. For MethodHandle call site the unextended_sp is stored in |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
293 // saved_fp. |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
294 _unextended_sp = _fp - _cb->frame_size(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
295 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
296 #ifdef ASSERT |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
297 nmethod *sender_nm = _cb->as_nmethod_or_null(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
298 assert(sender_nm && *_sp == *_unextended_sp, "backlink changed"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
299 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
300 intptr_t* sp = _unextended_sp; // check if stack can be walked from here |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
301 for (int x = 0; x < 5; ++x) { // check up to a couple of backlinks |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
302 intptr_t* prev_sp = *(intptr_t**)sp; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
303 if (prev_sp == 0) break; // end of stack |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
304 assert(prev_sp>sp, "broken stack"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
305 sp = prev_sp; |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
306 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
307 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
308 if (sender_nm->is_deopt_mh_entry(_pc)) { // checks for deoptimization |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
309 address original_pc = sender_nm->get_original_pc(this); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
310 assert(sender_nm->insts_contains(original_pc), "original PC must be in nmethod"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
311 assert(sender_nm->is_method_handle_return(original_pc), "must be"); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
312 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
313 #endif |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
314 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
315 } |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
316 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
317 intptr_t *frame::initial_deoptimization_info() { |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
318 // unused... but returns fp() to minimize changes introduced by 7087445 |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
319 return fp(); |
ec28f9c041ff
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
320 } |