src/share/vm/runtime/deoptimization.cpp

Print this page
rev 4267 : 8009981: nashorn tests fail with -XX:+VerifyStack
Summary: nmethod::preserve_callee_argument_oops() must take appendix into account.
Reviewed-by:


 621       // Get the oop map for this bci
 622       InterpreterOopMap mask;
 623       int cur_invoke_parameter_size = 0;
 624       bool try_next_mask = false;
 625       int next_mask_expression_stack_size = -1;
 626       int top_frame_expression_stack_adjustment = 0;
 627       methodHandle mh(thread, iframe->interpreter_frame_method());
 628       OopMapCache::compute_one_oop_map(mh, iframe->interpreter_frame_bci(), &mask);
 629       BytecodeStream str(mh);
 630       str.set_start(iframe->interpreter_frame_bci());
 631       int max_bci = mh->code_size();
 632       // Get to the next bytecode if possible
 633       assert(str.bci() < max_bci, "bci in interpreter frame out of bounds");
 634       // Check to see if we can grab the number of outgoing arguments
 635       // at an uncommon trap for an invoke (where the compiler
 636       // generates debug info before the invoke has executed)
 637       Bytecodes::Code cur_code = str.next();
 638       if (cur_code == Bytecodes::_invokevirtual ||
 639           cur_code == Bytecodes::_invokespecial ||
 640           cur_code == Bytecodes::_invokestatic  ||
 641           cur_code == Bytecodes::_invokeinterface) {

 642         Bytecode_invoke invoke(mh, iframe->interpreter_frame_bci());
 643         Symbol* signature = invoke.signature();
 644         ArgumentSizeComputer asc(signature);
 645         cur_invoke_parameter_size = asc.size();
 646         if (cur_code != Bytecodes::_invokestatic) {
 647           // Add in receiver
 648           ++cur_invoke_parameter_size;
 649         }



 650       }
 651       if (str.bci() < max_bci) {
 652         Bytecodes::Code bc = str.next();
 653         if (bc >= 0) {
 654           // The interpreter oop map generator reports results before
 655           // the current bytecode has executed except in the case of
 656           // calls. It seems to be hard to tell whether the compiler
 657           // has emitted debug information matching the "state before"
 658           // a given bytecode or the state after, so we try both
 659           switch (cur_code) {
 660             case Bytecodes::_invokevirtual:
 661             case Bytecodes::_invokespecial:
 662             case Bytecodes::_invokestatic:
 663             case Bytecodes::_invokeinterface:

 664             case Bytecodes::_athrow:
 665               break;
 666             default: {
 667               InterpreterOopMap next_mask;
 668               OopMapCache::compute_one_oop_map(mh, str.bci(), &next_mask);
 669               next_mask_expression_stack_size = next_mask.expression_stack_size();
 670               // Need to subtract off the size of the result type of
 671               // the bytecode because this is not described in the
 672               // debug info but returned to the interpreter in the TOS
 673               // caching register
 674               BasicType bytecode_result_type = Bytecodes::result_type(cur_code);
 675               if (bytecode_result_type != T_ILLEGAL) {
 676                 top_frame_expression_stack_adjustment = type2size[bytecode_result_type];
 677               }
 678               assert(top_frame_expression_stack_adjustment >= 0, "");
 679               try_next_mask = true;
 680               break;
 681             }
 682           }
 683         }




 621       // Get the oop map for this bci
 622       InterpreterOopMap mask;
 623       int cur_invoke_parameter_size = 0;
 624       bool try_next_mask = false;
 625       int next_mask_expression_stack_size = -1;
 626       int top_frame_expression_stack_adjustment = 0;
 627       methodHandle mh(thread, iframe->interpreter_frame_method());
 628       OopMapCache::compute_one_oop_map(mh, iframe->interpreter_frame_bci(), &mask);
 629       BytecodeStream str(mh);
 630       str.set_start(iframe->interpreter_frame_bci());
 631       int max_bci = mh->code_size();
 632       // Get to the next bytecode if possible
 633       assert(str.bci() < max_bci, "bci in interpreter frame out of bounds");
 634       // Check to see if we can grab the number of outgoing arguments
 635       // at an uncommon trap for an invoke (where the compiler
 636       // generates debug info before the invoke has executed)
 637       Bytecodes::Code cur_code = str.next();
 638       if (cur_code == Bytecodes::_invokevirtual   ||
 639           cur_code == Bytecodes::_invokespecial   ||
 640           cur_code == Bytecodes::_invokestatic    ||
 641           cur_code == Bytecodes::_invokeinterface ||
 642           cur_code == Bytecodes::_invokedynamic) {
 643         Bytecode_invoke invoke(mh, iframe->interpreter_frame_bci());
 644         Symbol* signature = invoke.signature();
 645         ArgumentSizeComputer asc(signature);
 646         cur_invoke_parameter_size = asc.size();
 647         if (cur_code != Bytecodes::_invokestatic && cur_code != Bytecodes::_invokedynamic) {
 648           // Add in receiver
 649           ++cur_invoke_parameter_size;
 650         }
 651         if (!invoke.is_invokedynamic() && MethodHandles::has_member_arg(invoke.klass(), invoke.name())) {
 652           callee_size_of_parameters++;
 653         }
 654       }
 655       if (str.bci() < max_bci) {
 656         Bytecodes::Code bc = str.next();
 657         if (bc >= 0) {
 658           // The interpreter oop map generator reports results before
 659           // the current bytecode has executed except in the case of
 660           // calls. It seems to be hard to tell whether the compiler
 661           // has emitted debug information matching the "state before"
 662           // a given bytecode or the state after, so we try both
 663           switch (cur_code) {
 664             case Bytecodes::_invokevirtual:
 665             case Bytecodes::_invokespecial:
 666             case Bytecodes::_invokestatic:
 667             case Bytecodes::_invokeinterface:
 668             case Bytecodes::_invokedynamic:
 669             case Bytecodes::_athrow:
 670               break;
 671             default: {
 672               InterpreterOopMap next_mask;
 673               OopMapCache::compute_one_oop_map(mh, str.bci(), &next_mask);
 674               next_mask_expression_stack_size = next_mask.expression_stack_size();
 675               // Need to subtract off the size of the result type of
 676               // the bytecode because this is not described in the
 677               // debug info but returned to the interpreter in the TOS
 678               // caching register
 679               BasicType bytecode_result_type = Bytecodes::result_type(cur_code);
 680               if (bytecode_result_type != T_ILLEGAL) {
 681                 top_frame_expression_stack_adjustment = type2size[bytecode_result_type];
 682               }
 683               assert(top_frame_expression_stack_adjustment >= 0, "");
 684               try_next_mask = true;
 685               break;
 686             }
 687           }
 688         }