示例#1
0
func _getGoField(fieldObj *heap.Object) *heap.Field {
	extra := fieldObj.Extra()
	if extra != nil {
		return extra.(*heap.Field)
	}

	root := fieldObj.GetFieldValue("root", "Ljava/lang/reflect/Field;").(*heap.Object)
	return root.Extra().(*heap.Field)
}
示例#2
0
文件: helper.go 项目: kingljl/jvm.go
func _getGoMethod(methodObj *heap.Object, isConstructor bool) *heap.Method {
	extra := methodObj.Extra()
	if extra != nil {
		return extra.(*heap.Method)
	}

	if isConstructor {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Constructor;").(*heap.Object)
		return root.Extra().(*heap.Method)
	} else {
		root := methodObj.GetFieldValue("root", "Ljava/lang/reflect/Method;").(*heap.Object)
		return root.Extra().(*heap.Method)
	}
}
示例#3
0
文件: boxing.go 项目: Rearcher/jvm.go
func Unbox(obj *heap.Object, primitiveDescriptor string) interface{} {
	return obj.GetFieldValue("value", primitiveDescriptor)
}
示例#4
0
func _getPath(fileObj *heap.Object) string {
	pathStr := fileObj.GetFieldValue("path", "Ljava/lang/String;").(*heap.Object)
	return rtda.GoString(pathStr)
}
示例#5
0
// java.lang.String -> go string
func GoString(jStr *heap.Object) string {
	charArr := jStr.GetFieldValue("value", "[C").(*heap.Object)
	return _utf16ToString(charArr.Chars())
}