Skip to content

Commit

Permalink
Fix build error in computed-goto interpreter for window platform
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 committed Sep 7, 2023
1 parent 40fd829 commit 185457e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Walrus.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ if (f.type == Type::B) { puts("failed in msvc."); }
#if defined(COMPILER_GCC) || defined(COMPILER_CLANG)
#define WALRUS_ENABLE_COMPUTED_GOTO
// some devices cannot support getting label address from outside well
#if (defined(CPU_ARM64) || (defined(CPU_ARM32) && defined(COMPILER_CLANG))) || defined(OS_DARWIN)
#if (defined(CPU_ARM64) || (defined(CPU_ARM32) && defined(COMPILER_CLANG))) || defined(OS_DARWIN) || defined(OS_ANDROID) || defined(OS_WINDOWS)
#define WALRUS_COMPUTED_GOTO_INTERPRETER_INIT_WITH_NULL
#endif
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "runtime/Tag.h"
#include "util/MathOperation.h"

#if defined(WALRUS_ENABLE_COMPUTED_GOTO)
#if defined(WALRUS_ENABLE_COMPUTED_GOTO) && !defined(WALRUS_COMPUTED_GOTO_INTERPRETER_INIT_WITH_NULL)
extern char FillByteCodeOpcodeTableAsmLbl[];
const void* FillByteCodeOpcodeAddress[] = { &FillByteCodeOpcodeTableAsmLbl[0] };
#endif
Expand Down Expand Up @@ -1287,14 +1287,14 @@ ByteCodeStackOffset* Interpreter::interpret(ExecutionState& state,
#if defined(COMPILER_GCC) && __GNUC__ >= 9
__attribute__((cold));
#endif
#if defined(WALRUS_ENABLE_COMPUTED_GOTO)
#if !defined(WALRUS_COMPUTED_GOTO_INTERPRETER_INIT_WITH_NULL)
asm volatile("FillByteCodeOpcodeTableAsmLbl:");
#endif

#define REGISTER_TABLE(name, ...) \
g_byteCodeTable.m_addressTable[ByteCode::name##Opcode] = &&name##OpcodeLbl;
FOR_EACH_BYTECODE(REGISTER_TABLE)
#undef REGISTER_TABLE
#endif
initAddressToOpcodeTable();
return nullptr;
}
Expand Down

0 comments on commit 185457e

Please sign in to comment.