diff --git a/build_g.sh b/build_g.sh index 190078ea..314b42b6 100644 --- a/build_g.sh +++ b/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 diff --git a/src/ceval.cpp b/src/ceval.cpp index 5a1460ed..fd8fc2ba 100644 --- a/src/ceval.cpp +++ b/src/ceval.cpp @@ -107,15 +107,16 @@ PyVar VM::__run_top_frame(){ if(_ceval_on_step) _ceval_on_step(this, frame, byte); #endif -__NEXT_FRAME: - // cache - const CodeObject* co = frame->co; - Bytecode byte = frame->next_bytecode(); - CEVAL_STEP_CALLBACK(); +#define DISPATCH() goto __NEXT_STEP; -#define DISPATCH() { byte = frame->next_bytecode(); CEVAL_STEP_CALLBACK(); goto __NEXT_STEP; } +__NEXT_FRAME: + const CodeObject* co = frame->co; + Bytecode byte; __NEXT_STEP:; + byte = frame->next_bytecode(); + CEVAL_STEP_CALLBACK(); + #if PK_DEBUG_CEVAL_STEP __log_s_data(); #endif