mirror of
https://github.com/janet-lang/janet
synced 2025-07-03 18:42:54 +00:00
Small changes to help with latest emscripten.
This commit is contained in:
parent
e528b86a2a
commit
21a355c89f
@ -57,7 +57,11 @@ JANET_THREAD_LOCAL jmp_buf *janet_vm_jmp_buf = NULL;
|
|||||||
/* How we dispatch instructions. By default, we use
|
/* How we dispatch instructions. By default, we use
|
||||||
* a switch inside an infinite loop. For GCC/clang, we use
|
* a switch inside an infinite loop. For GCC/clang, we use
|
||||||
* computed gotos. */
|
* computed gotos. */
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) && !defined(EMSCRIPTEN)
|
||||||
|
#define JANET_USE_COMPUTED_GOTOS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef JANET_USE_COMPUTED_GOTOS
|
||||||
#define VM_START() { goto *op_lookup[first_opcode];
|
#define VM_START() { goto *op_lookup[first_opcode];
|
||||||
#define VM_END() }
|
#define VM_END() }
|
||||||
#define VM_OP(op) label_##op :
|
#define VM_OP(op) label_##op :
|
||||||
@ -192,7 +196,7 @@ static Janet call_nonfn(JanetFiber *fiber, Janet callee) {
|
|||||||
static JanetSignal run_vm(JanetFiber *fiber, Janet in, JanetFiberStatus status) {
|
static JanetSignal run_vm(JanetFiber *fiber, Janet in, JanetFiberStatus status) {
|
||||||
|
|
||||||
/* opcode -> label lookup if using clang/GCC */
|
/* opcode -> label lookup if using clang/GCC */
|
||||||
#ifdef __GNUC__
|
#ifdef JANET_USE_COMPUTED_GOTOS
|
||||||
static void *op_lookup[255] = {
|
static void *op_lookup[255] = {
|
||||||
&&label_JOP_NOOP,
|
&&label_JOP_NOOP,
|
||||||
&&label_JOP_ERROR,
|
&&label_JOP_ERROR,
|
||||||
|
@ -238,9 +238,9 @@ typedef struct {
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/* Names of all of the types */
|
/* Names of all of the types */
|
||||||
JANET_API const char *const janet_type_names[16];
|
JANET_API extern const char *const janet_type_names[16];
|
||||||
JANET_API const char *const janet_signal_names[14];
|
JANET_API extern const char *const janet_signal_names[14];
|
||||||
JANET_API const char *const janet_status_names[16];
|
JANET_API extern const char *const janet_status_names[16];
|
||||||
|
|
||||||
/* Fiber signals */
|
/* Fiber signals */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user