nvm placeholder, enable nvm by default

This commit is contained in:
dzaima 2021-06-26 03:31:55 +03:00
parent d4be37469e
commit 98166dd809
4 changed files with 20 additions and 4 deletions

View File

@ -472,8 +472,8 @@ static B m_atop( B g, B h);
#include <time.h>
static inline u64 nsTime() {
struct timespec t;
timespec_get(&t, TIME_UTC);
// clock_gettime(CLOCK_REALTIME, &t);
// timespec_get(&t, TIME_UTC); // doesn't seem to exist on Android
clock_gettime(CLOCK_REALTIME, &t);
return t.tv_sec*1000000000ull + t.tv_nsec;
}

5
src/jit/nvm.c Normal file
View File

@ -0,0 +1,5 @@
#if defined(__x86_64) || defined(__amd64__)
#include "nvm_x86_64.c"
#else
#include "nvm_placeholder.c"
#endif

View File

@ -0,0 +1,5 @@
#include "../core.h"
#include "nvm.h"
B evalJIT(Body* b, Scope* sc, u8* ptr) { thrM("JIT: Not supported"); }
Nvm_res m_nvm(Body* b) { thrM("JIT: Not supported"); }
void nvm_free(u8* ptr) { thrM("JIT: Not supported"); }

View File

@ -1,7 +1,13 @@
#pragma once
#ifndef JIT_START
#define JIT_START -1 // number of calls for when to start JITting. -1: never JIT; 0: JIT everything, 1: JIT after 1 non-JIT invocation; max ¯1+2⋆16
#if defined(__x86_64) || defined(__amd64__)
#ifndef JIT_START
#define JIT_START 2 // number of calls for when to start JITting. -1: never JIT; 0: JIT everything, n: JIT after n non-JIT invocations; max ¯1+2⋆16
#endif
#else
#undef JIT_START
#define JIT_START -1
#endif
enum {