comparison src/share/vm/runtime/vframe.cpp @ 1506:2338d41fbd81

6943304: remove tagged stack interpreter Reviewed-by: coleenp, never, gbenson
author twisti
date Fri, 30 Apr 2010 08:37:24 -0700
parents cd37471eaecc
children fb1a39993f69
comparison
equal deleted inserted replaced
1505:0c5b3cf3c1f5 1506:2338d41fbd81
242 } 242 }
243 243
244 StackValueCollection* result = new StackValueCollection(length); 244 StackValueCollection* result = new StackValueCollection(length);
245 245
246 // Get oopmap describing oops and int for current bci 246 // Get oopmap describing oops and int for current bci
247 if (TaggedStackInterpreter) { 247 InterpreterOopMap oop_mask;
248 for(int i=0; i < length; i++) { 248 if (TraceDeoptimization && Verbose) {
249 // Find stack location 249 methodHandle m_h(thread(), method());
250 intptr_t *addr = locals_addr_at(i); 250 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
251
252 // Depending on oop/int put it in the right package
253 StackValue *sv;
254 frame::Tag tag = fr().interpreter_frame_local_tag(i);
255 if (tag == frame::TagReference) {
256 // oop value
257 Handle h(*(oop *)addr);
258 sv = new StackValue(h);
259 } else {
260 // integer
261 sv = new StackValue(*addr);
262 }
263 assert(sv != NULL, "sanity check");
264 result->add(sv);
265 }
266 } else { 251 } else {
267 InterpreterOopMap oop_mask; 252 method()->mask_for(bci(), &oop_mask);
268 if (TraceDeoptimization && Verbose) { 253 }
269 methodHandle m_h(thread(), method()); 254 // handle locals
270 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); 255 for(int i=0; i < length; i++) {
256 // Find stack location
257 intptr_t *addr = locals_addr_at(i);
258
259 // Depending on oop/int put it in the right package
260 StackValue *sv;
261 if (oop_mask.is_oop(i)) {
262 // oop value
263 Handle h(*(oop *)addr);
264 sv = new StackValue(h);
271 } else { 265 } else {
272 method()->mask_for(bci(), &oop_mask); 266 // integer
273 } 267 sv = new StackValue(*addr);
274 // handle locals 268 }
275 for(int i=0; i < length; i++) { 269 assert(sv != NULL, "sanity check");
276 // Find stack location 270 result->add(sv);
277 intptr_t *addr = locals_addr_at(i);
278
279 // Depending on oop/int put it in the right package
280 StackValue *sv;
281 if (oop_mask.is_oop(i)) {
282 // oop value
283 Handle h(*(oop *)addr);
284 sv = new StackValue(h);
285 } else {
286 // integer
287 sv = new StackValue(*addr);
288 }
289 assert(sv != NULL, "sanity check");
290 result->add(sv);
291 }
292 } 271 }
293 return result; 272 return result;
294 } 273 }
295 274
296 void interpretedVFrame::set_locals(StackValueCollection* values) const { 275 void interpretedVFrame::set_locals(StackValueCollection* values) const {
329 } 308 }
330 309
331 int nof_locals = method()->max_locals(); 310 int nof_locals = method()->max_locals();
332 StackValueCollection* result = new StackValueCollection(length); 311 StackValueCollection* result = new StackValueCollection(length);
333 312
334 if (TaggedStackInterpreter) { 313 InterpreterOopMap oop_mask;
335 // handle expressions 314 // Get oopmap describing oops and int for current bci
336 for(int i=0; i < length; i++) { 315 if (TraceDeoptimization && Verbose) {
337 // Find stack location 316 methodHandle m_h(method());
338 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i); 317 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
339 frame::Tag tag = fr().interpreter_frame_expression_stack_tag(i);
340
341 // Depending on oop/int put it in the right package
342 StackValue *sv;
343 if (tag == frame::TagReference) {
344 // oop value
345 Handle h(*(oop *)addr);
346 sv = new StackValue(h);
347 } else {
348 // otherwise
349 sv = new StackValue(*addr);
350 }
351 assert(sv != NULL, "sanity check");
352 result->add(sv);
353 }
354 } else { 318 } else {
355 InterpreterOopMap oop_mask; 319 method()->mask_for(bci(), &oop_mask);
356 // Get oopmap describing oops and int for current bci 320 }
357 if (TraceDeoptimization && Verbose) { 321 // handle expressions
358 methodHandle m_h(method()); 322 for(int i=0; i < length; i++) {
359 OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask); 323 // Find stack location
324 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
325
326 // Depending on oop/int put it in the right package
327 StackValue *sv;
328 if (oop_mask.is_oop(i + nof_locals)) {
329 // oop value
330 Handle h(*(oop *)addr);
331 sv = new StackValue(h);
360 } else { 332 } else {
361 method()->mask_for(bci(), &oop_mask); 333 // integer
362 } 334 sv = new StackValue(*addr);
363 // handle expressions 335 }
364 for(int i=0; i < length; i++) { 336 assert(sv != NULL, "sanity check");
365 // Find stack location 337 result->add(sv);
366 intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
367
368 // Depending on oop/int put it in the right package
369 StackValue *sv;
370 if (oop_mask.is_oop(i + nof_locals)) {
371 // oop value
372 Handle h(*(oop *)addr);
373 sv = new StackValue(h);
374 } else {
375 // integer
376 sv = new StackValue(*addr);
377 }
378 assert(sv != NULL, "sanity check");
379 result->add(sv);
380 }
381 } 338 }
382 return result; 339 return result;
383 } 340 }
384 341
385 342