@@ -1829,9 +1829,7 @@ java_bytecode_parsert::parse_method_handle(const pool_entryt &entry)
1829
1829
(entry.ref1 > 0 && entry.ref1 < 10 ),
1830
1830
" reference kind of Methodhandle must be in the range of 1 to 9" );
1831
1831
1832
- const pool_entryt ref_entry = pool_entry (entry.ref2 );
1833
- const auto &class_entry = pool_entry (ref_entry.ref1 );
1834
- const auto &nameandtype_entry = pool_entry (ref_entry.ref2 );
1832
+ const base_ref_infot ref_entry{pool_entry (entry.ref2 )};
1835
1833
1836
1834
method_handle_kindt method_handle_kind = (method_handle_kindt)entry.ref1 ;
1837
1835
switch (method_handle_kind)
@@ -1841,35 +1839,43 @@ java_bytecode_parsert::parse_method_handle(const pool_entryt &entry)
1841
1839
case method_handle_kindt::REF_putField:
1842
1840
case method_handle_kindt::REF_putStatic:
1843
1841
{
1844
- INVARIANT (ref_entry.tag == CONSTANT_Fieldref, " 4.4.2" );
1842
+ INVARIANT (ref_entry.get_tag () == CONSTANT_Fieldref, " 4.4.2" );
1845
1843
break ;
1846
1844
}
1847
1845
case method_handle_kindt::REF_invokeVirtual:
1848
1846
case method_handle_kindt::REF_newInvokeSpecial:
1849
1847
{
1850
1848
1851
- INVARIANT (ref_entry.tag == CONSTANT_Methodref, " 4.4.2" );
1849
+ INVARIANT (ref_entry.get_tag () == CONSTANT_Methodref, " 4.4.2" );
1852
1850
break ;
1853
1851
}
1854
1852
case method_handle_kindt::REF_invokeStatic:
1855
1853
case method_handle_kindt::REF_invokeSpecial:
1856
1854
{
1857
1855
INVARIANT (
1858
- ref_entry.tag == CONSTANT_Methodref ||
1859
- ref_entry.tag == CONSTANT_InterfaceMethodref,
1856
+ ref_entry.get_tag () == CONSTANT_Methodref ||
1857
+ ref_entry.get_tag () == CONSTANT_InterfaceMethodref,
1860
1858
" 4.4.2" );
1861
1859
break ;
1862
1860
}
1863
1861
case method_handle_kindt::REF_invokeInterface:
1864
1862
{
1865
- INVARIANT (ref_entry.tag == CONSTANT_InterfaceMethodref," " );
1863
+ INVARIANT (ref_entry.get_tag () == CONSTANT_InterfaceMethodref," " );
1866
1864
break ;
1867
1865
}
1868
1866
}
1867
+
1868
+ const std::function<pool_entryt &(u2)> pool_entry_lambda =
1869
+ [this ](u2 index ) -> pool_entryt & { return pool_entry (index ); };
1870
+
1871
+ const class_infot &class_entry=ref_entry.get_class (pool_entry_lambda);
1872
+ const name_and_type_infot &name_and_type =
1873
+ ref_entry.get_name_and_type (pool_entry_lambda);
1874
+
1869
1875
const std::string method_name =
1870
- id2string ( pool_entry ( class_entry.ref1 ). s ) + " ." +
1871
- id2string ( pool_entry (nameandtype_entry. ref1 ). s ) +
1872
- id2string ( pool_entry (nameandtype_entry. ref2 ). s );
1876
+ class_entry.get_name (pool_entry_lambda ) + " ." +
1877
+ name_and_type. get_name (pool_entry_lambda ) +
1878
+ name_and_type. get_descriptor (pool_entry_lambda );
1873
1879
1874
1880
if (
1875
1881
method_name ==
0 commit comments