forked from rogchap/v8go
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathisolate.h
64 lines (51 loc) · 1.67 KB
/
isolate.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 V8GO_ISOLATE_H
#define V8GO_ISOLATE_H
#include "unbound_script.h"
#ifdef __cplusplus
namespace v8 {
class Isolate;
}
typedef v8::Isolate v8Isolate;
extern "C" {
#else
typedef struct v8Isolate v8Isolate;
#endif
typedef v8Isolate* IsolatePtr;
typedef struct m_value m_value;
typedef m_value* ValuePtr;
// ScriptCompiler::CompileOptions values
extern const int ScriptCompilerNoCompileOptions;
extern const int ScriptCompilerConsumeCodeCache;
extern const int ScriptCompilerEagerCompile;
typedef struct {
ScriptCompilerCachedData cachedData;
int compileOption;
} CompileOptions;
typedef struct {
size_t total_heap_size;
size_t total_heap_size_executable;
size_t total_physical_size;
size_t total_available_size;
size_t used_heap_size;
size_t heap_size_limit;
size_t malloced_memory;
size_t external_memory;
size_t peak_malloced_memory;
size_t number_of_native_contexts;
size_t number_of_detached_contexts;
} IsolateHStatistics;
extern IsolatePtr NewIsolate();
extern void IsolatePerformMicrotaskCheckpoint(IsolatePtr ptr);
extern void IsolateDispose(IsolatePtr ptr);
extern void IsolateTerminateExecution(IsolatePtr ptr);
extern int IsolateIsExecutionTerminating(IsolatePtr ptr);
extern IsolateHStatistics IsolationGetHeapStatistics(IsolatePtr ptr);
extern ValuePtr IsolateThrowException(IsolatePtr iso, ValuePtr value);
extern RtnUnboundScript IsolateCompileUnboundScript(IsolatePtr iso_ptr,
const char* source,
const char* origin,
CompileOptions options);
#ifdef __cplusplus
} // extern "C"
#endif
#endif