1553 if (HAS_PENDING_EXCEPTION) { 1554 CLEAR_PENDING_EXCEPTION; 1555 return methodHandle(); 1556 } 1557 return info.selected_method(); 1558 } 1559 1560 1561 1562 //------------------------------------------------------------------------------------------------------------------------ 1563 // ConstantPool entries 1564 1565 void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) { 1566 switch (byte) { 1567 case Bytecodes::_invokestatic : resolve_invokestatic (result, pool, index, CHECK); break; 1568 case Bytecodes::_invokespecial : resolve_invokespecial (result, recv, pool, index, CHECK); break; 1569 case Bytecodes::_invokevirtual : resolve_invokevirtual (result, recv, pool, index, CHECK); break; 1570 case Bytecodes::_invokehandle : resolve_invokehandle (result, pool, index, CHECK); break; 1571 case Bytecodes::_invokedynamic : resolve_invokedynamic (result, pool, index, CHECK); break; 1572 case Bytecodes::_invokeinterface: resolve_invokeinterface(result, recv, pool, index, CHECK); break; 1573 } 1574 return; 1575 } 1576 1577 void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv, 1578 const methodHandle& attached_method, 1579 Bytecodes::Code byte, TRAPS) { 1580 Klass* defc = attached_method->method_holder(); 1581 Symbol* name = attached_method->name(); 1582 Symbol* type = attached_method->signature(); 1583 LinkInfo link_info(defc, name, type); 1584 switch(byte) { 1585 case Bytecodes::_invokevirtual: 1586 resolve_virtual_call(result, recv, recv->klass(), link_info, 1587 /*check_null_and_abstract=*/true, CHECK); 1588 break; 1589 case Bytecodes::_invokeinterface: 1590 resolve_interface_call(result, recv, recv->klass(), link_info, 1591 /*check_null_and_abstract=*/true, CHECK); 1592 break; 1593 case Bytecodes::_invokestatic: 1594 resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK); 1595 break; 1596 case Bytecodes::_invokespecial: 1597 resolve_special_call(result, recv, link_info, CHECK); 1598 break; 1599 default: 1600 fatal("bad call: %s", Bytecodes::name(byte)); 1601 } 1602 } 1603 1604 void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) { 1605 LinkInfo link_info(pool, index, CHECK); 1606 resolve_static_call(result, link_info, /*initialize_class*/true, CHECK); 1607 } 1608 1609 1610 void LinkResolver::resolve_invokespecial(CallInfo& result, Handle recv, 1611 const constantPoolHandle& pool, int index, TRAPS) { 1612 LinkInfo link_info(pool, index, CHECK); 1613 resolve_special_call(result, recv, link_info, CHECK); 1614 } 1615 1616 1617 void LinkResolver::resolve_invokevirtual(CallInfo& result, Handle recv, 1618 const constantPoolHandle& pool, int index, 1619 TRAPS) { 1620 | 1553 if (HAS_PENDING_EXCEPTION) { 1554 CLEAR_PENDING_EXCEPTION; 1555 return methodHandle(); 1556 } 1557 return info.selected_method(); 1558 } 1559 1560 1561 1562 //------------------------------------------------------------------------------------------------------------------------ 1563 // ConstantPool entries 1564 1565 void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) { 1566 switch (byte) { 1567 case Bytecodes::_invokestatic : resolve_invokestatic (result, pool, index, CHECK); break; 1568 case Bytecodes::_invokespecial : resolve_invokespecial (result, recv, pool, index, CHECK); break; 1569 case Bytecodes::_invokevirtual : resolve_invokevirtual (result, recv, pool, index, CHECK); break; 1570 case Bytecodes::_invokehandle : resolve_invokehandle (result, pool, index, CHECK); break; 1571 case Bytecodes::_invokedynamic : resolve_invokedynamic (result, pool, index, CHECK); break; 1572 case Bytecodes::_invokeinterface: resolve_invokeinterface(result, recv, pool, index, CHECK); break; 1573 default : break; 1574 } 1575 return; 1576 } 1577 1578 void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv, 1579 const methodHandle& attached_method, 1580 Bytecodes::Code byte, TRAPS) { 1581 Klass* defc = attached_method->method_holder(); 1582 Symbol* name = attached_method->name(); 1583 Symbol* type = attached_method->signature(); 1584 LinkInfo link_info(defc, name, type); 1585 switch(byte) { 1586 case Bytecodes::_invokevirtual: 1587 resolve_virtual_call(result, recv, recv->klass(), link_info, 1588 /*check_null_and_abstract=*/true, CHECK); 1589 break; 1590 case Bytecodes::_invokeinterface: 1591 resolve_interface_call(result, recv, recv->klass(), link_info, 1592 /*check_null_and_abstract=*/true, CHECK); 1593 break; 1594 case Bytecodes::_invokestatic: 1595 resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK); 1596 break; 1597 case Bytecodes::_invokespecial: 1598 resolve_special_call(result, recv, link_info, CHECK); 1599 break; 1600 default: 1601 fatal("bad call: %s", Bytecodes::name(byte)); 1602 break; 1603 } 1604 } 1605 1606 void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) { 1607 LinkInfo link_info(pool, index, CHECK); 1608 resolve_static_call(result, link_info, /*initialize_class*/true, CHECK); 1609 } 1610 1611 1612 void LinkResolver::resolve_invokespecial(CallInfo& result, Handle recv, 1613 const constantPoolHandle& pool, int index, TRAPS) { 1614 LinkInfo link_info(pool, index, CHECK); 1615 resolve_special_call(result, recv, link_info, CHECK); 1616 } 1617 1618 1619 void LinkResolver::resolve_invokevirtual(CallInfo& result, Handle recv, 1620 const constantPoolHandle& pool, int index, 1621 TRAPS) { 1622 |