mini_racer 0.17.0.pre5 → 0.17.0.pre6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/ext/mini_racer_extension/extconf.rb +2 -0
- data/ext/mini_racer_extension/mini_racer_extension.c +1564 -0
- data/ext/mini_racer_extension/mini_racer_v8.cc +840 -0
- data/ext/mini_racer_extension/mini_racer_v8.h +56 -0
- data/ext/mini_racer_extension/serde.c +747 -0
- data/lib/mini_racer/truffleruby.rb +31 -4
- data/lib/mini_racer/version.rb +1 -1
- data/lib/mini_racer.rb +14 -387
- metadata +10 -7
- data/ext/mini_racer_extension/mini_racer_extension.cc +0 -1942
@@ -0,0 +1,56 @@
|
|
1
|
+
#pragma once
|
2
|
+
#include <stddef.h>
|
3
|
+
#include <stdint.h>
|
4
|
+
|
5
|
+
#ifdef __cplusplus
|
6
|
+
extern "C" {
|
7
|
+
#endif
|
8
|
+
|
9
|
+
enum
|
10
|
+
{
|
11
|
+
NO_ERROR = '\0',
|
12
|
+
INTERNAL_ERROR = 'I',
|
13
|
+
MEMORY_ERROR = 'M',
|
14
|
+
PARSE_ERROR = 'P',
|
15
|
+
RUNTIME_ERROR = 'R',
|
16
|
+
TERMINATED_ERROR = 'T',
|
17
|
+
};
|
18
|
+
|
19
|
+
static const uint16_t js_function_marker[] = {0xBFF,'J','a','v','a','S','c','r','i','p','t','F','u','n','c','t','i','o','n'};
|
20
|
+
|
21
|
+
// defined in mini_racer_extension.c, opaque to mini_racer_v8.cc
|
22
|
+
struct Context;
|
23
|
+
|
24
|
+
// defined in mini_racer_v8.cc, opaque to mini_racer_extension.c
|
25
|
+
struct State;
|
26
|
+
|
27
|
+
// defined in mini_racer_extension.c
|
28
|
+
extern int single_threaded;
|
29
|
+
void v8_get_flags(char **p, size_t *n);
|
30
|
+
void v8_thread_main(struct Context *c, struct State *pst);
|
31
|
+
void v8_dispatch(struct Context *c);
|
32
|
+
void v8_reply(struct Context *c, const uint8_t *p, size_t n);
|
33
|
+
void v8_roundtrip(struct Context *c, const uint8_t **p, size_t *n);
|
34
|
+
|
35
|
+
// defined in mini_racer_v8.cc
|
36
|
+
void v8_global_init(void);
|
37
|
+
struct State *v8_thread_init(struct Context *c, const uint8_t *snapshot_buf,
|
38
|
+
size_t snapshot_len, int64_t max_memory,
|
39
|
+
int verbose_exceptions); // calls v8_thread_main
|
40
|
+
void v8_attach(struct State *pst, const uint8_t *p, size_t n);
|
41
|
+
void v8_call(struct State *pst, const uint8_t *p, size_t n);
|
42
|
+
void v8_eval(struct State *pst, const uint8_t *p, size_t n);
|
43
|
+
void v8_heap_stats(struct State *pst);
|
44
|
+
void v8_heap_snapshot(struct State *pst);
|
45
|
+
void v8_pump_message_loop(struct State *pst);
|
46
|
+
void v8_snapshot(struct State *pst, const uint8_t *p, size_t n);
|
47
|
+
void v8_warmup(struct State *pst, const uint8_t *p, size_t n);
|
48
|
+
void v8_idle_notification(struct State *pst, const uint8_t *p, size_t n);
|
49
|
+
void v8_low_memory_notification(struct State *pst);
|
50
|
+
void v8_terminate_execution(struct State *pst); // called from ruby or watchdog thread
|
51
|
+
void v8_single_threaded_enter(struct State *pst, struct Context *c, void (*f)(struct Context *c));
|
52
|
+
void v8_single_threaded_dispose(struct State *pst);
|
53
|
+
|
54
|
+
#ifdef __cplusplus
|
55
|
+
}
|
56
|
+
#endif
|