Ver Fonte

some fix

blueloveTH há 1 ano atrás
pai
commit
39dd1a8e21
2 ficheiros alterados com 7 adições e 6 exclusões
  1. 1 1
      build_g.sh
  2. 6 5
      src/ceval.cpp

+ 1 - 1
build_g.sh

@@ -1,5 +1,5 @@
 SRC=$(find src/ -name "*.cpp")
 
-FLAGS="-std=c++17 -O0 -stdlib=libc++ -Iinclude -frtti -Wfatal-errors -g"
+FLAGS="-std=c++17 -O2 -stdlib=libc++ -Iinclude -frtti -Wfatal-errors -g"
 
 clang++ $FLAGS -o main src2/main.cpp $SRC

+ 6 - 5
src/ceval.cpp

@@ -107,15 +107,16 @@ PyVar VM::__run_top_frame(){
     if(_ceval_on_step) _ceval_on_step(this, frame, byte);
 #endif
 
+#define DISPATCH() goto __NEXT_STEP;
+
 __NEXT_FRAME:
-    // cache
     const CodeObject* co = frame->co;
-    Bytecode byte = frame->next_bytecode();
-    CEVAL_STEP_CALLBACK();
-
-#define DISPATCH() { byte = frame->next_bytecode(); CEVAL_STEP_CALLBACK(); goto __NEXT_STEP; }
+    Bytecode byte;
 
 __NEXT_STEP:;
+    byte = frame->next_bytecode();
+    CEVAL_STEP_CALLBACK();
+
 #if PK_DEBUG_CEVAL_STEP
     __log_s_data();
 #endif