当前位置: 首页>>代码示例>>Golang>>正文


Golang Frame.OperandStack方法代码示例

本文整理汇总了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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:ZipFile.go

示例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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:ZipFile.go

示例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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:ZipFile.go

示例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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:7,代码来源:xrem.go

示例5: Execute

func (self *fadd) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	v2 := stack.PopFloat()
	v1 := stack.PopFloat()
	result := v1 + v2
	stack.PushFloat(result)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:7,代码来源:xadd.go

示例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())
	}

}
开发者ID:cretz,项目名称:jvm.go,代码行数:30,代码来源:SocketInputStream.go

示例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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:Unsafe_memory.go

示例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))
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:Class.go

示例9: Execute

func (self *ixor) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	v1 := stack.PopInt()
	v2 := stack.PopInt()
	result := v1 ^ v2
	stack.PushInt(result)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:7,代码来源:xxor.go

示例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),
	//	})
	//}
}
开发者ID:cretz,项目名称:jvm.go,代码行数:29,代码来源:Inet6AddressImpl.go

示例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)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:VMManagementImpl.go

示例12: Execute

func (self *swap) Execute(frame *rtda.Frame) {
	stack := frame.OperandStack()
	val1 := stack.PopSlot()
	val2 := stack.PopSlot()
	stack.PushSlot(val1)
	stack.PushSlot(val2)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:7,代码来源:swap.go

示例13: getStartupTime

// public native long getStartupTime();
// ()J
func getStartupTime(frame *rtda.Frame) {
	// todo
	startupTime := int64(0)

	stack := frame.OperandStack()
	stack.PushLong(startupTime)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:VMManagementImpl.go

示例14: getUptime0

// private native long getUptime0();
// ()J
func getUptime0(frame *rtda.Frame) {
	// todo
	uptime := int64(0)

	stack := frame.OperandStack()
	stack.PushLong(uptime)
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:VMManagementImpl.go

示例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
}
开发者ID:cretz,项目名称:jvm.go,代码行数:9,代码来源:Signal.go


注:本文中的github.com/zxh0/jvm/go/jvmgo/jvm/rtda.Frame.OperandStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。