def call_method_parts(t, ids, asm, arg_types, arg_asm): '''Calls a method starting from a type followed by a list of IDs ex. (Foo.static_field.field).field.method() t <= typeof(Foo.static_field.field) ids <= field, method''' annotation = annotate_ids.annotate_from_type(t, ids.parts) t, code = access._get_to_final_from_type(t, annotation, asm) return call_method_with_final(t.definition, ids, code, arg_types, arg_asm)
def get_field_from_parts(t, ids, init_asm, get_addr=False): import annotate_ids annotation = annotate_ids.annotate_from_type(t, ids.parts) t, field_asm = _get_to_final_from_type(t, annotation, init_asm) # Handle array field. Note: You should never be getting the address # of an array field. if not get_addr and t.is_array: return get_array_field(ids, field_asm) return [ '; Get field off eax', get_field_from_final(t.definition, ids, field_asm, get_addr) ]