Beispiel #1
0
 public void PushStack(VirtualRegister r)
 {
     m_stack.Push(r);
     if (r is TemporaryRegister || r.RegisterNumber < 0)
         m_stackDepth++;
     m_maxStackDepth = Math.Max(m_maxStackDepth, m_stackDepth);
 }
Beispiel #2
0
        /// <summary>
        /// Emits instructions for pushing a value onto the stack
        /// </summary>
        /// <param name="sourceRegister"></param>
        public void PushStack(VirtualRegister sourceRegister)
        {
            m_state.PushStack(sourceRegister);
            if (sourceRegister is TemporaryRegister || sourceRegister.RegisterNumber < 0)
            {
                if (m_state.StackDepth > 511)
                    throw new Exception("Too deep stack");

                m_state.Instructions.Add(new SPEEmulator.OpCodes.stqd((uint)sourceRegister.RegisterNumber, _SP, (uint)m_state.StackDepth + 1));
            }
        }