forked from just-js/just
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
26 lines (25 loc) · 764 Bytes
/
main.cc
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
#include "just.h"
#include "main.h"
int main(int argc, char** argv) {
uint64_t start = just::hrtime();
setvbuf(stdout, nullptr, _IONBF, 0);
setvbuf(stderr, nullptr, _IONBF, 0);
std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
v8::V8::InitializePlatform(platform.get());
v8::V8::SetFlagsFromString(v8flags);
if (_v8flags_from_commandline == 1) {
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
}
v8::V8::Initialize();
register_builtins();
if (_use_index) {
just::CreateIsolate(argc, argv, just_js, just_js_len,
index_js, index_js_len,
NULL, 0, start);
} else {
just::CreateIsolate(argc, argv, just_js, just_js_len, start);
}
v8::V8::Dispose();
platform.reset();
return 0;
}