Beispiel #1
0
def java_lang_Class_getPrimitiveClass__Ljava_lang_String__Ljava_lang_Class_(frame, args):
    ref = args[0]
    assert type(ref) is tuple and ref[0] == "ref"
    instance = frame.vm.heap[ref[1]]
    assert instance.java_class.this_name == "java/lang/String"
    value_ref = instance.fields["value"]
    value = arr_to_string(frame.vm.heap[value_ref[1]].values)
    jc = frame.vm.get_class(value)
    frame.stack.append(jc.heap_ref)
Beispiel #2
0
def java_lang_String_intern___Ljava_lang_String_(frame, args):
    ref = args[0]
    assert type(ref) is tuple and ref[0] == "ref"
    o = frame.vm.heap[ref[1]]
    ref = o.fields["value"]
    o = frame.vm.heap[ref[1]]  # this is JArray
    s = arr_to_string(o.values)
    ref = frame.vm.make_heap_string(s)
    frame.stack.append(ref)
Beispiel #3
0
def java_lang_Class_getPrimitiveClass__Ljava_lang_String__Ljava_lang_Class_(
        frame, args):
    ref = args[0]
    assert type(ref) is tuple and ref[0] == "ref"
    instance = frame.vm.heap[ref[1]]
    assert instance.java_class.this_name == "java/lang/String"
    value_ref = instance.fields["value"]
    value = arr_to_string(frame.vm.heap[value_ref[1]].values)
    jc = frame.vm.get_class(value)
    frame.stack.append(jc.heap_ref)