本文整理汇总了C#中StackFrame.pushOperand方法的典型用法代码示例。如果您正苦于以下问题:C# StackFrame.pushOperand方法的具体用法?C# StackFrame.pushOperand怎么用?C# StackFrame.pushOperand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackFrame
的用法示例。
在下文中一共展示了StackFrame.pushOperand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute
public override void execute(StackFrame frame)
{
if (depth > 0){
throw new ToyVMException("Don't support dup2 with depth of " + depth,frame);
}
Object obj = frame.popOperand();
Object obj2 = null;
if (frame.hasMoreOperands()){
obj2 = frame.popOperand();
}
/*System.Collections.Stack temp = new System.Collections.Stack();
for (int i = 0; i < depth; i++){
temp.Push(frame.popOperand());
}
frame.pushOperand(obj); // insert at depth depth
while (temp.Count > 0){
frame.pushOperand(temp.Pop());
}
*/
frame.pushOperand(obj); // put the duplicated one back on top
if (obj2 != null){
frame.pushOperand(obj2);
}
frame.pushOperand(obj); // put the duplicated one back on top
if (obj2 != null){
frame.pushOperand(obj2);
}
}
示例2: execute
public override void execute(StackFrame frame)
{
Object o = frame.popOperand();
if (! (o is NullValue)){
Heap.HeapReference heapRef = (Heap.HeapReference) o;
// we only handle class right now
ClassFile tClass = (ClassFile) heapRef.type;
do {
if (tClass.GetName().Equals(className)){
frame.pushOperand(1);
return;
}
if (tClass.implements(className)){
frame.pushOperand(1);
return;
}
tClass = tClass.GetSuperClassFile();
} while (tClass != null);
}
frame.pushOperand(0);
}
示例3: execute
public override void execute(StackFrame frame)
{
float value2 = Single.Parse(frame.popOperand().ToString());
float value1 = Single.Parse(frame.popOperand().ToString());
// TODO: handle NaN
if (value1 > value2) { frame.pushOperand(1); }
else if (value1.Equals(value2)) { frame.pushOperand(0); }
else { frame.pushOperand(-1); }
}
示例4: execute
public override void execute(StackFrame frame)
{
int count = (int) frame.popOperand();
string className = reference.getClassName();
if (! className.StartsWith("[")){
frame.pushOperand(Heap.GetInstance().newArray(ToyVMClassLoader.loadClass(className),count));
}
else {
frame.pushOperand(Heap.GetInstance().new2DArray(className.Substring(1),count));
}
}
示例5: execute
public override void execute(StackFrame frame)
{
long val1 = (long) frame.popOperand();
long val2 = (long) frame.popOperand();
frame.pushOperand(val1 & val2);
}
示例6: execute
public override void execute(StackFrame frame)
{
double val1 = (double) frame.popOperand();
double val2 = (double) frame.popOperand();
frame.pushOperand(val2 - val1);
}
示例7: execute
public override void execute(StackFrame frame)
{
int val1 = (int) frame.popOperand();
int val2 = (int) frame.popOperand();
frame.pushOperand(val1 & val2);
}
示例8: execute
public override void execute(StackFrame frame)
{
Object obj = frame.popOperand();
System.Collections.Stack temp = new System.Collections.Stack();
for (int i = 0; i < depth; i++){
temp.Push(frame.popOperand());
}
frame.pushOperand(obj); // insert at depth depth
while (temp.Count > 0){
frame.pushOperand(temp.Pop());
}
frame.pushOperand(obj); // put the duplicated one back on top
}
示例9: execute
public override void execute(StackFrame frame)
{
float val1 = (float) frame.popOperand();
float val2 = (float) frame.popOperand();
frame.pushOperand(val1 + val2);
}
示例10: execute
public override void execute(StackFrame frame)
{
//ToyVMObject obj = new ToyVMObject(classRef);
Heap.HeapReference heapRef = Heap.GetInstance().newInstance(ToyVMClassLoader.loadClass(classRef.getClassName()));
if (log.IsDebugEnabled) log.DebugFormat("executing new from {0}",frame);
frame.pushOperand(heapRef);
}
示例11: execute
/**
* Right shift val1 by amount in low 5 bits of val2
*/
public override void execute(StackFrame frame)
{
int val2 = (int) frame.popOperand();
int val1 = (int) frame.popOperand();
val1 = (0xFFFF & ((val1 >> (val2 & 0x1F))));
frame.pushOperand(val1);
}
示例12: execute
// value1,value2 => ...
public override void execute(StackFrame frame)
{
int value2 = (int) frame.popOperand();
int value1 = (int) frame.popOperand();
frame.pushOperand(value1 - (value1 / value2) * value2);
// TODO: something is broken up higher
//frame.pushOperand(0);
}
示例13: execute
/**
* Left shift val1 by amount in low 5 bits of val2
*/
public override void execute(StackFrame frame)
{
long val2 = (long) frame.popOperand();
long val1 = (long) frame.popOperand();
val1 = (0xFFFFFFFF & ((val1 << (int)(val2 & 0x3F))));
frame.pushOperand(val1);
}
示例14: execute
public override void execute(StackFrame frame)
{
double val1 = Double.Parse(frame.popOperand().ToString());
double val2 = Double.Parse(frame.popOperand().ToString());
//if (log.IsDebugEnabled) log.DebugFormat("val1 is {0}",val1.GetType());
//if (log.IsDebugEnabled) log.DebugFormat("val2 is {0}",val2.GetType());
frame.pushOperand(val1 * val2);
}
示例15: execute
public override void execute(StackFrame frame)
{
float val1 = Single.Parse(frame.popOperand().ToString());
float val2 = Single.Parse(frame.popOperand().ToString());
//if (log.IsDebugEnabled) log.DebugFormat("val1 is {0}",val1.GetType());
//if (log.IsDebugEnabled) log.DebugFormat("val2 is {0}",val2.GetType());
frame.pushOperand((float)val1 * (float)val2);
}