ソースを参照

Optimize: VM self operation fast path

Akeit0 11 ヶ月 前
コミット
05718bcb04
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/Lua/Runtime/LuaVirtualMachine.cs

+ 2 - 2
src/Lua/Runtime/LuaVirtualMachine.cs

@@ -424,8 +424,8 @@ public static partial class LuaVirtualMachine
                         vc = ref RKC(ref stackHead, ref constHead, instruction);
                         table = Unsafe.Add(ref stackHead, instruction.UIntB);
 
-
-                        if (GetTableValueSlowPath(table, vc, ref context, out resultValue, out doRestart))
+                        doRestart = false;
+                        if ((table.TryReadTable(out luaTable) && luaTable.TryGetValue(vc, out resultValue)) || GetTableValueSlowPath(table, vc, ref context, out resultValue, out doRestart))
                         {
                             if (doRestart) goto Restart;
                             Unsafe.Add(ref stackHead, iA) = resultValue;