Mercurial > hg > truffle
comparison src/share/vm/runtime/vframeArray.cpp @ 3369:3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
Reviewed-by: kvn, coleenp
author | never |
---|---|
date | Thu, 12 May 2011 10:29:02 -0700 |
parents | 8012aa3ccede |
children | be4ca325525a d2a62e0f25eb |
comparison
equal
deleted
inserted
replaced
3365:3cfb240033d1 | 3369:3d2ab563047a |
---|---|
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 int unpack_counter = 0; | 155 int unpack_counter = 0; |
156 | 156 |
157 void vframeArrayElement::unpack_on_stack(int callee_parameters, | 157 void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, |
158 int callee_parameters, | |
158 int callee_locals, | 159 int callee_locals, |
159 frame* caller, | 160 frame* caller, |
160 bool is_top_frame, | 161 bool is_top_frame, |
161 int exec_mode) { | 162 int exec_mode) { |
162 JavaThread* thread = (JavaThread*) Thread::current(); | 163 JavaThread* thread = (JavaThread*) Thread::current(); |
268 | 269 |
269 Interpreter::layout_activation(method(), | 270 Interpreter::layout_activation(method(), |
270 temps + callee_parameters, | 271 temps + callee_parameters, |
271 popframe_preserved_args_size_in_words, | 272 popframe_preserved_args_size_in_words, |
272 locks, | 273 locks, |
274 caller_actual_parameters, | |
273 callee_parameters, | 275 callee_parameters, |
274 callee_locals, | 276 callee_locals, |
275 caller, | 277 caller, |
276 iframe(), | 278 iframe(), |
277 is_top_frame); | 279 is_top_frame); |
413 | 415 |
414 _locals = _expressions = NULL; | 416 _locals = _expressions = NULL; |
415 | 417 |
416 } | 418 } |
417 | 419 |
418 int vframeArrayElement::on_stack_size(int callee_parameters, | 420 int vframeArrayElement::on_stack_size(int caller_actual_parameters, |
421 int callee_parameters, | |
419 int callee_locals, | 422 int callee_locals, |
420 bool is_top_frame, | 423 bool is_top_frame, |
421 int popframe_extra_stack_expression_els) const { | 424 int popframe_extra_stack_expression_els) const { |
422 assert(method()->max_locals() == locals()->size(), "just checking"); | 425 assert(method()->max_locals() == locals()->size(), "just checking"); |
423 int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); | 426 int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); |
424 int temps = expressions()->size(); | 427 int temps = expressions()->size(); |
425 return Interpreter::size_activation(method(), | 428 return Interpreter::size_activation(method(), |
426 temps + callee_parameters, | 429 temps + callee_parameters, |
427 popframe_extra_stack_expression_els, | 430 popframe_extra_stack_expression_els, |
428 locks, | 431 locks, |
432 caller_actual_parameters, | |
429 callee_parameters, | 433 callee_parameters, |
430 callee_locals, | 434 callee_locals, |
431 is_top_frame); | 435 is_top_frame); |
432 } | 436 } |
433 | 437 |
494 } | 498 } |
495 } | 499 } |
496 } | 500 } |
497 } | 501 } |
498 | 502 |
499 void vframeArray::unpack_to_stack(frame &unpack_frame, int exec_mode) { | 503 void vframeArray::unpack_to_stack(frame &unpack_frame, int exec_mode, int caller_actual_parameters) { |
500 // stack picture | 504 // stack picture |
501 // unpack_frame | 505 // unpack_frame |
502 // [new interpreter frames ] (frames are skeletal but walkable) | 506 // [new interpreter frames ] (frames are skeletal but walkable) |
503 // caller_frame | 507 // caller_frame |
504 // | 508 // |
523 // Unpack the frames from the oldest (frames() -1) to the youngest (0) | 527 // Unpack the frames from the oldest (frames() -1) to the youngest (0) |
524 | 528 |
525 for (index = frames() - 1; index >= 0 ; index--) { | 529 for (index = frames() - 1; index >= 0 ; index--) { |
526 int callee_parameters = index == 0 ? 0 : element(index-1)->method()->size_of_parameters(); | 530 int callee_parameters = index == 0 ? 0 : element(index-1)->method()->size_of_parameters(); |
527 int callee_locals = index == 0 ? 0 : element(index-1)->method()->max_locals(); | 531 int callee_locals = index == 0 ? 0 : element(index-1)->method()->max_locals(); |
528 element(index)->unpack_on_stack(callee_parameters, | 532 element(index)->unpack_on_stack(caller_actual_parameters, |
533 callee_parameters, | |
529 callee_locals, | 534 callee_locals, |
530 &caller_frame, | 535 &caller_frame, |
531 index == 0, | 536 index == 0, |
532 exec_mode); | 537 exec_mode); |
533 if (index == frames() - 1) { | 538 if (index == frames() - 1) { |
534 Deoptimization::unwind_callee_save_values(element(index)->iframe(), this); | 539 Deoptimization::unwind_callee_save_values(element(index)->iframe(), this); |
535 } | 540 } |
536 caller_frame = *element(index)->iframe(); | 541 caller_frame = *element(index)->iframe(); |
542 caller_actual_parameters = callee_parameters; | |
537 } | 543 } |
538 | 544 |
539 | 545 |
540 deallocate_monitor_chunks(); | 546 deallocate_monitor_chunks(); |
541 } | 547 } |