_Jv_LookupInterfaceMethod

Bryce McKinlay bryce@albatross.co.nz
Wed Dec 1 19:02:00 GMT 1999


Per Bothner wrote:

> Alex is right.  (I am a bit rusty ...)
> I meant `TREE_TYPE (method)' should give you the `IFACE'.

Cheers, that seems to work. Now, with the code:

  i = 1;
  for (meth = TYPE_METHODS (iface); ; meth = TREE_CHAIN (meth), i++)
    {
      if (meth == method)
        {
	  idx = build_int_2 (i, 0);
	  break;
	}
      if (meth == NULL_TREE)
        fatal ("internal error");
    }

I'm getting the "internal error". Debugging shows:

(gdb) p debug_tree (meth)
 <record_type 0x82219f8 Interface allocated from permanent_obstack
    permanent type_2 type_4 DI
    size <integer_cst 0x8221d40 type <integer_type 0x81fe24c> constant permanent
 64>
    align 32 symtab 0 alias set -1
    fields <field_decl 0x8221cc4
        type <record_type 0x8203a94 java.lang.Object allocated from permanent_ob
stack
            permanent type_2 type_4 DI
            size <integer_cst 0x82050b8 constant permanent 64>
            align 32 symtab 18 alias set -1 fields <field_decl 0x8204f7c vtable>
            pointer_to_this <pointer_type 0x8203bec> chain <type_decl 0x8203b54 
java.lang.Object>>
        allocated from permanent_obstack
        permanent ignored DI file Interface.java line 0 size <integer_cst 0x8205
0b8 64>
        align 32
        bitpos <integer_cst 0x82046a4 constant permanent 0> arguments <integer_c
st 0x82046a4 0>>
    pointer_to_this <pointer_type 0x8221b10> chain <type_decl 0x8221a80 Interfac
e>

and:

(gdb) p debug_tree (iface)
 <method_type 0x8221bac
    type <integer_type 0x81fe7b4 int allocated from permanent_obstack
        permanent SI
        size <integer_cst 0x81fe3fc constant permanent 32>
        align 32 symtab 1 alias set -1 precision 32
        min <integer_cst 0x81fe814 constant permanent -2147483648>
        max <integer_cst 0x81fe82c constant permanent 2147483647>
        chain <type_decl 0x81fe868 int>>
    allocated from permanent_obstack
    permanent DI
    size <integer_cst 0x81fe33c type <integer_type 0x81fe2ac> constant permanent
 64>
    align 32 symtab 0 alias set -1 method basetype <record_type 0x82219f8 Interf
ace>
    arg-types <tree_list 0x8221c0c allocated from permanent_obstack
        permanent
        value <pointer_type 0x8221b10 type <record_type 0x82219f8 Interface>
            allocated from permanent_obstack
            unsigned permanent SI size <integer_cst 0x81fe3fc 32>
            align 32 symtab 0 alias set -1>
        chain <tree_list 0x8207564 allocated from permanent_obstack
            permanent value <void_type 0x81fef08 void>>>>

?

regards

  [ bryce ]


More information about the Java mailing list