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