99
100 void frame::patch_pc(Thread* thread, address pc) {
101
102 if (pc != NULL) {
103 _cb = CodeCache::find_blob(pc);
104 SharkFrame* sharkframe = zeroframe()->as_shark_frame();
105 sharkframe->set_pc(pc);
106 _pc = pc;
107 _deopt_state = is_deoptimized;
108
109 } else {
110 // We borrow this call to set the thread pointer in the interpreter
111 // state; the hook to set up deoptimized frames isn't supplied it.
112 assert(pc == NULL, "should be");
113 get_interpreterState()->set_thread((JavaThread *) thread);
114 }
115 }
116
117 bool frame::safe_for_sender(JavaThread *thread) {
118 ShouldNotCallThis();
119 }
120
121 void frame::pd_gc_epilog() {
122 }
123
124 bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
125 ShouldNotCallThis();
126 }
127
128 BasicType frame::interpreter_frame_result(oop* oop_result,
129 jvalue* value_result) {
130 assert(is_interpreted_frame(), "interpreted frame expected");
131 Method* method = interpreter_frame_method();
132 BasicType type = method->result_type();
133 intptr_t* tos_addr = (intptr_t *) interpreter_frame_tos_address();
134 oop obj;
135
136 switch (type) {
137 case T_VOID:
138 break;
139 case T_BOOLEAN:
140 value_result->z = *(jboolean *) tos_addr;
141 break;
142 case T_BYTE:
143 value_result->b = *(jbyte *) tos_addr;
144 break;
145 case T_CHAR:
167 obj = get_interpreterState()->oop_temp();
168 }
169 else {
170 oop* obj_p = (oop *) tos_addr;
171 obj = (obj_p == NULL) ? (oop) NULL : *obj_p;
172 }
173 assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
174 *oop_result = obj;
175 break;
176
177 default:
178 ShouldNotReachHere();
179 }
180
181 return type;
182 }
183
184 int frame::frame_size(RegisterMap* map) const {
185 #ifdef PRODUCT
186 ShouldNotCallThis();
187 #else
188 return 0; // make javaVFrame::print_value work
189 #endif // PRODUCT
190 }
191
192 intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
193 int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize);
194 return &interpreter_frame_tos_address()[index];
195 }
196
197 void frame::zero_print_on_error(int frame_index,
198 outputStream* st,
199 char* buf,
200 int buflen) const {
201 // Divide the buffer between the field and the value
202 buflen >>= 1;
203 char *fieldbuf = buf;
204 char *valuebuf = buf + buflen;
205
206 // Print each word of the frame
207 for (intptr_t *addr = sp(); addr <= fp(); addr++) {
208 int offset = fp() - addr;
209
|
99
100 void frame::patch_pc(Thread* thread, address pc) {
101
102 if (pc != NULL) {
103 _cb = CodeCache::find_blob(pc);
104 SharkFrame* sharkframe = zeroframe()->as_shark_frame();
105 sharkframe->set_pc(pc);
106 _pc = pc;
107 _deopt_state = is_deoptimized;
108
109 } else {
110 // We borrow this call to set the thread pointer in the interpreter
111 // state; the hook to set up deoptimized frames isn't supplied it.
112 assert(pc == NULL, "should be");
113 get_interpreterState()->set_thread((JavaThread *) thread);
114 }
115 }
116
117 bool frame::safe_for_sender(JavaThread *thread) {
118 ShouldNotCallThis();
119 return false;
120 }
121
122 void frame::pd_gc_epilog() {
123 }
124
125 bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
126 ShouldNotCallThis();
127 return false;
128 }
129
130 BasicType frame::interpreter_frame_result(oop* oop_result,
131 jvalue* value_result) {
132 assert(is_interpreted_frame(), "interpreted frame expected");
133 Method* method = interpreter_frame_method();
134 BasicType type = method->result_type();
135 intptr_t* tos_addr = (intptr_t *) interpreter_frame_tos_address();
136 oop obj;
137
138 switch (type) {
139 case T_VOID:
140 break;
141 case T_BOOLEAN:
142 value_result->z = *(jboolean *) tos_addr;
143 break;
144 case T_BYTE:
145 value_result->b = *(jbyte *) tos_addr;
146 break;
147 case T_CHAR:
169 obj = get_interpreterState()->oop_temp();
170 }
171 else {
172 oop* obj_p = (oop *) tos_addr;
173 obj = (obj_p == NULL) ? (oop) NULL : *obj_p;
174 }
175 assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
176 *oop_result = obj;
177 break;
178
179 default:
180 ShouldNotReachHere();
181 }
182
183 return type;
184 }
185
186 int frame::frame_size(RegisterMap* map) const {
187 #ifdef PRODUCT
188 ShouldNotCallThis();
189 #endif // PRODUCT
190 return 0; // make javaVFrame::print_value work
191 }
192
193 intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
194 int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize);
195 return &interpreter_frame_tos_address()[index];
196 }
197
198 void frame::zero_print_on_error(int frame_index,
199 outputStream* st,
200 char* buf,
201 int buflen) const {
202 // Divide the buffer between the field and the value
203 buflen >>= 1;
204 char *fieldbuf = buf;
205 char *valuebuf = buf + buflen;
206
207 // Print each word of the frame
208 for (intptr_t *addr = sp(); addr <= fp(); addr++) {
209 int offset = fp() - addr;
210
|