Exemplo n.º 1
0
        internal void ExecuteSubroutine(AThread Thread, long Position)
        {
            do
            {
                if (EnableCpuTrace)
                {
                    if (!SymbolTable.TryGetValue(Position, out string SubName))
                    {
                        SubName = string.Empty;
                    }

                    CpuTrace?.Invoke(this, new ACpuTraceEventArgs(Position, SubName));
                }

                if (!CachedSubs.TryGetValue(Position, out ATranslatedSub Sub))
                {
                    Sub = TranslateTier0(Thread.Memory, Position);
                }

                if (Sub.ShouldReJit())
                {
                    TranslateTier1(Thread.Memory, Position);
                }

                Position = Sub.Execute(Thread.ThreadState, Thread.Memory);
            }while (Position != 0 && Thread.ThreadState.Running);
        }
Exemplo n.º 2
0
        public ATranslator(AThread Parent)
        {
            this.Thread = Parent;

            CachedSubs = new Dictionary <long, ATranslatedSub>();

            KeepRunning = true;
        }
Exemplo n.º 3
0
        internal void ExecuteSubroutine(AThread Thread, long Position)
        {
            //TODO: Both the execute A32/A64 methods should be merged on the future,
            //when both ISAs are implemented with the interpreter and JIT.
            //As of now, A32 only has a interpreter and A64 a JIT.
            AThreadState State  = Thread.ThreadState;
            AMemory      Memory = Thread.Memory;

            if (State.ExecutionMode == AExecutionMode.AArch32)
            {
                ExecuteSubroutineA32(State, Memory);
            }
            else
            {
                ExecuteSubroutineA64(State, Memory, Position);
            }
        }
Exemplo n.º 4
0
        public void ExecuteSubroutine(AThread Thread, long Position)
        {
            do
            {
                if (EnableCpuTrace)
                {
                    if (!SymbolTable.TryGetValue(Position, out string SubName))
                    {
                        SubName = string.Empty;
                    }

                    CpuTrace?.Invoke(this, new ACpuTraceEventArgs(Position, SubName));
                }

                if (!CachedSubs.TryGetValue(Position, out ATranslatedSub Sub) || Sub.NeedsReJit)
                {
                    Sub = TranslateSubroutine(Thread.Memory, Position);
                }

                Position = Sub.Execute(Thread.ThreadState, Thread.Memory);
            }while (Position != 0 && KeepRunning);
        }