Exemplo n.º 1
0
 public static void ReturnLargeValue(long retVal)
 {
     DebugWriter.ReturnedValueDebugWrite(retVal);
     Program.MethodFrameStack.Pop();
     if (Program.MethodFrameStack.Count >= 0)
     {
         MethodFrame parentFrame = Program.MethodFrameStack.Peek();
         Utility.Push(ref parentFrame.Stack, ref parentFrame.sp, retVal);
     }
 }
Exemplo n.º 2
0
 public static void PrintStack(MethodFrame[] stack)
 {
     Console.ForegroundColor = DebugDefaultColor;
     Console.WriteLine("\nStack:");
     Program.MethodFrameStack.CopyTo(stack, 0);
     for (int i = stack.Length - 1; i >= 0; i--)
     {
         Console.CursorLeft = (stack.Length - 1 - i) * Spacing;
         MethodFrame frame = stack[i];
         Console.WriteLine($"{frame.ClassFile.Name}.{frame.MethodInfo.Name}{frame.MethodInfo.Descriptor}");
     }
 }
Exemplo n.º 3
0
 public static void RunJavaFunction(MethodInfo methodInfo, params int[] arguments)
 {
     DebugWriter.CallFuncDebugWrite(methodInfo, arguments);
     if (methodInfo.HasFlag(MethodInfoFlag.Native))
     {
         NativeMethodFrame methodFrame = new NativeMethodFrame(methodInfo);
         arguments.CopyTo(methodFrame.Locals, 0);
         methodFrame.Execute();
     }
     else
     {
         MethodFrame methodFrame = new MethodFrame(methodInfo);
         arguments.CopyTo(methodFrame.Locals, 0);
         methodFrame.Execute();
     }
 }
Exemplo n.º 4
0
 public static void PrintStack()
 {
     MethodFrame[] stack = new MethodFrame[Program.MethodFrameStack.Count];
     PrintStack(stack);
 }