1491 } |
1491 } |
1492 |
1492 |
1493 // Check to see whether we are inlining. If so, Return |
1493 // Check to see whether we are inlining. If so, Return |
1494 // instructions become Gotos to the continuation point. |
1494 // instructions become Gotos to the continuation point. |
1495 if (continuation() != NULL) { |
1495 if (continuation() != NULL) { |
|
1496 |
|
1497 int invoke_bci = state()->caller_state()->bci(); |
|
1498 |
|
1499 if (x != NULL && !ignore_return) { |
|
1500 ciMethod* caller = state()->scope()->caller()->method(); |
|
1501 Bytecodes::Code invoke_raw_bc = caller->raw_code_at_bci(invoke_bci); |
|
1502 if (invoke_raw_bc == Bytecodes::_invokehandle || invoke_raw_bc == Bytecodes::_invokedynamic) { |
|
1503 ciType* declared_ret_type = caller->get_declared_signature_at_bci(invoke_bci)->return_type(); |
|
1504 if (declared_ret_type->is_klass() && x->exact_type() == NULL && |
|
1505 x->declared_type() != declared_ret_type && declared_ret_type != compilation()->env()->Object_klass()) { |
|
1506 x = append(new TypeCast(declared_ret_type->as_klass(), x, copy_state_before())); |
|
1507 } |
|
1508 } |
|
1509 } |
|
1510 |
1496 assert(!method()->is_synchronized() || InlineSynchronizedMethods, "can not inline synchronized methods yet"); |
1511 assert(!method()->is_synchronized() || InlineSynchronizedMethods, "can not inline synchronized methods yet"); |
1497 |
1512 |
1498 if (compilation()->env()->dtrace_method_probes()) { |
1513 if (compilation()->env()->dtrace_method_probes()) { |
1499 // Report exit from inline methods |
1514 // Report exit from inline methods |
1500 Values* args = new Values(1); |
1515 Values* args = new Values(1); |
1514 } |
1529 } |
1515 |
1530 |
1516 // State at end of inlined method is the state of the caller |
1531 // State at end of inlined method is the state of the caller |
1517 // without the method parameters on stack, including the |
1532 // without the method parameters on stack, including the |
1518 // return value, if any, of the inlined method on operand stack. |
1533 // return value, if any, of the inlined method on operand stack. |
1519 int invoke_bci = state()->caller_state()->bci(); |
|
1520 set_state(state()->caller_state()->copy_for_parsing()); |
1534 set_state(state()->caller_state()->copy_for_parsing()); |
1521 if (x != NULL) { |
1535 if (x != NULL) { |
1522 if (!ignore_return) { |
1536 if (!ignore_return) { |
1523 state()->push(x->type(), x); |
1537 state()->push(x->type(), x); |
1524 } |
1538 } |