本文整理汇总了Golang中github.com/zxh0/jvm/go/jvmgo/jvm/rtda.Frame.OperandStack方法的典型用法代码示例。如果您正苦于以下问题:Golang Frame.OperandStack方法的具体用法?Golang Frame.OperandStack怎么用?Golang Frame.OperandStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/zxh0/jvm/go/jvmgo/jvm/rtda.Frame
的用法示例。
在下文中一共展示了Frame.OperandStack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: getEntryCrc
// private static native long getEntryCrc(long jzentry);
// (J)J
func getEntryCrc(frame *rtda.Frame) {
entry := _getEntryPop(frame)
crc := int64(entry.CRC32)
stack := frame.OperandStack()
stack.PushLong(crc)
}
示例2: getEntryFlag
// private static native int getEntryFlag(long jzentry);
// (J)I
func getEntryFlag(frame *rtda.Frame) {
entry := _getEntryPop(frame)
flag := int32(entry.Flags)
stack := frame.OperandStack()
stack.PushInt(flag)
}
示例3: getEntrySize
// private static native long getEntrySize(long jzentry);
// (J)J
func getEntrySize(frame *rtda.Frame) {
entry := _getEntryPop(frame)
size := int64(entry.UncompressedSize64)
stack := frame.OperandStack()
stack.PushLong(size)
}
示例4: Execute
func (self *frem) Execute(frame *rtda.Frame) {
stack := frame.OperandStack()
v2 := stack.PopFloat()
v1 := stack.PopFloat()
result := float32(math.Mod(float64(v1), float64(v2))) // todo
stack.PushFloat(result)
}
示例5: Execute
func (self *fadd) Execute(frame *rtda.Frame) {
stack := frame.OperandStack()
v2 := stack.PopFloat()
v1 := stack.PopFloat()
result := v1 + v2
stack.PushFloat(result)
}
示例6: sis_socketRead0
//private native int socketRead0(FileDescriptor fd, byte b[], int off, int len, int timeout)
// java/net/SocketInputStream~socketRead0~(Ljava/io/FileDescriptor;[BIII)I
func sis_socketRead0(frame *rtda.Frame) {
vars := frame.LocalVars()
//this := vars.GetThis()
fd := vars.GetRef(1)
buf := vars.GetRef(2)
off := vars.GetInt(3)
_len := vars.GetInt(4)
conn := fd.Extra().(net.Conn)
_timeout := vars.GetInt(5)
if _timeout > 0 {
conn.SetDeadline(time.Now().Add(time.Duration(_timeout) * time.Millisecond))
}
goBuf := buf.GoBytes()
goBuf = goBuf[off : off+_len]
n, err := conn.Read(goBuf)
if err == nil || n > 0 || err == io.EOF {
frame.OperandStack().PushInt(int32(n))
} else {
// todo
panic(err.Error())
//frame.Thread().ThrowIOException(err.Error())
}
}
示例7: addressSize
// public native int addressSize();
// ()I
func addressSize(frame *rtda.Frame) {
// vars := frame.LocalVars()
// vars.GetRef(0) // this
stack := frame.OperandStack()
stack.PushInt(8) // todo unsafe.Sizeof(int)
}
示例8: getModifiers
// public native int getModifiers();
// ()I
func getModifiers(frame *rtda.Frame) {
class := _popClass(frame)
modifiers := class.GetAccessFlags()
stack := frame.OperandStack()
stack.PushInt(int32(modifiers))
}
示例9: Execute
func (self *ixor) Execute(frame *rtda.Frame) {
stack := frame.OperandStack()
v1 := stack.PopInt()
v2 := stack.PopInt()
result := v1 ^ v2
stack.PushInt(result)
}
示例10: i6di_lookupAllHostAddr
//(Ljava/lang/String;)[Ljava/net/InetAddress;
func i6di_lookupAllHostAddr(frame *rtda.Frame) {
vars := frame.LocalVars()
host := rtda.GoString(vars.GetRef(1))
address, _ := net.LookupHost(host)
constructorCount := uint(len(address))
inetAddress := rtc.BootLoader().LoadClass("java/net/InetAddress")
inetAddressArr := inetAddress.NewArray(constructorCount)
stack := frame.OperandStack()
stack.PushRef(inetAddressArr)
//TODO
//getByName descriptor:(Ljava/lang/String;)Ljava/net/InetAddress;
//if constructorCount > 0 {
// thread := frame.Thread()
// constructorObjs := inetAddressArr.Refs()
// inetAddressGetByNameMethod := inetAddress.GetStaticMethod("getByName", "(Ljava/lang/String;)Ljava/net/InetAddress;")
// fmt.Println(constructorObjs[0])
// fmt.Println(inetAddressGetByNameMethod)
// fmt.Println(thread)
// thread.InvokeMethodWithShim(inetAddressGetByNameMethod, []Any{
// constructorObjs[0],
// rtda.JString(host),
// })
//}
}
示例11: getVersion0
// private static native String getVersion0();
// ()Ljava/lang/String;
func getVersion0(frame *rtda.Frame) {
// todo
version := rtda.JString("0")
stack := frame.OperandStack()
stack.PushRef(version)
}
示例12: Execute
func (self *swap) Execute(frame *rtda.Frame) {
stack := frame.OperandStack()
val1 := stack.PopSlot()
val2 := stack.PopSlot()
stack.PushSlot(val1)
stack.PushSlot(val2)
}
示例13: getStartupTime
// public native long getStartupTime();
// ()J
func getStartupTime(frame *rtda.Frame) {
// todo
startupTime := int64(0)
stack := frame.OperandStack()
stack.PushLong(startupTime)
}
示例14: getUptime0
// private native long getUptime0();
// ()J
func getUptime0(frame *rtda.Frame) {
// todo
uptime := int64(0)
stack := frame.OperandStack()
stack.PushLong(uptime)
}
示例15: findSignal
// private static native int findSignal(String string);
// (Ljava/lang/String;)I
func findSignal(frame *rtda.Frame) {
vars := frame.LocalVars()
vars.GetRef(0) // name
stack := frame.OperandStack()
stack.PushInt(0) // todo
}