-
Notifications
You must be signed in to change notification settings - Fork 0
/
slowjit.h
64 lines (52 loc) · 1.51 KB
/
slowjit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _SLOWJIT_H_
#define _SLOWJIT_H_
#include "postgres.h"
#include "executor/execExpr.h"
#include "executor/tuptable.h"
#include "fmgr.h"
#include "jit/jit.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "nodes/execnodes.h"
#include "nodes/pg_list.h"
#include "port.h"
#include "portability/instr_time.h"
#include "storage/ipc.h"
#include "utils/expandeddatum.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/palloc.h"
#include "utils/resowner.h"
#include "utils/resowner_private.h"
#include <dlfcn.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
extern char *slowjit_cc_path;
extern void _PG_init(void);
extern void _PG_jit_provider_init(JitProviderCallbacks *cb);
typedef struct SlowJitHandle {
/* Shared library path, for error reporting. */
char *shared_library_path;
/* Handle of the shared library. */
void *handle;
} SlowJitHandle;
typedef struct SlowJitContext {
JitContext base;
StringInfoData code_holder;
/* Is there any pending code that needs to be emitted */
bool compiled;
/* # of objects emitted, used to generate non-conflicting names */
int counter;
size_t module_generation;
/* Handles of the compiled shared libraries. */
List *handles;
} SlowJitContext;
typedef struct SlowJitCompiledExprState {
SlowJitContext *jit_ctx;
const char *funcname;
} SlowJitCompiledExprState;
extern bool slowjit_compile_expr(ExprState *state);
extern void slowjit_release_context(JitContext *jit_ctx);
extern void slowjit_reset_after_error(void);
#endif