mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 06:31:15 +00:00
Snapshot clean ups
- Don't call eval() in mock_runtime - not allowed - see js2c.py. - Don't use v8_use_external_startup_data - Move MakeSnapshot to snapshot_creator.cc - Use logging.h in from_snapshot.cc
This commit is contained in:
parent
064d889af0
commit
cc2ae2d316
9 changed files with 56 additions and 97 deletions
|
@ -44,16 +44,18 @@ class StartupDataCppWriter {
|
|||
void WritePrefix() {
|
||||
file_ << "// Autogenerated snapshot file. Do not edit.\n\n";
|
||||
file_ << "#include \"v8/include/v8.h\"\n\n";
|
||||
file_ << "namespace deno { \n\n";
|
||||
}
|
||||
|
||||
void WriteSuffix() {
|
||||
char buffer[500];
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"const v8::StartupData* StartupBlob_%s() {\n", name_);
|
||||
snprintf(buffer, sizeof(buffer), "v8::StartupData* StartupBlob_%s() {\n",
|
||||
name_);
|
||||
file_ << buffer;
|
||||
snprintf(buffer, sizeof(buffer), " return &%s_blob;\n", name_);
|
||||
file_ << buffer;
|
||||
file_ << "}\n\n";
|
||||
file_ << "} // namespace deno\n\n";
|
||||
}
|
||||
|
||||
void WriteBinaryContentsAsCArray() {
|
||||
|
@ -78,7 +80,7 @@ class StartupDataCppWriter {
|
|||
snprintf(buffer, sizeof(buffer), "static const int %s_blob_size = %llu;\n",
|
||||
name_, static_cast<unsigned long long>(data_.size()));
|
||||
file_ << buffer;
|
||||
snprintf(buffer, sizeof(buffer), "static const v8::StartupData %s_blob =\n",
|
||||
snprintf(buffer, sizeof(buffer), "static v8::StartupData %s_blob =\n",
|
||||
name_);
|
||||
file_ << buffer;
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue