GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sea: don't set code cache flags when snapshot is used · nodejs/node@31adeea

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_sea.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sea.cc‎

Copy file name to clipboardExpand all lines: src/node_sea.cc
+15-13Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ std::optional<SeaConfig> ParseSingleExecutableConfig(
355355
return std::nullopt;
356356
}
357357
if (use_code_cache.value()) {
358-
result.flags |= SeaFlags::kUseCodeCache;
358+
if (use_snapshot.value()) {
359+
// TODO(joyeecheung): code cache in snapshot should be configured by
360+
// separate snapshot configurations.
361+
FPrintF(stderr,
362+
"\"useCodeCache\" is redundant when \"useSnapshot\" is true\n");
363+
} else {
364+
result.flags |= SeaFlags::kUseCodeCache;
365+
}
359366
}
360367

361368
auto assets_opt = parser.GetTopLevelStringDict("assets");
@@ -511,19 +518,14 @@ ExitCode GenerateSingleExecutableBlob(
511518
std::optional<std::string_view> optional_sv_code_cache;
512519
std::string code_cache;
513520
if (static_cast<bool>(config.flags & SeaFlags::kUseCodeCache)) {
514-
if (builds_snapshot_from_main) {
515-
FPrintF(stderr,
516-
"\"useCodeCache\" is redundant when \"useSnapshot\" is true\n");
517-
} else {
518-
std::optional<std::string> optional_code_cache =
519-
GenerateCodeCache(config.main_path, main_script);
520-
if (!optional_code_cache.has_value()) {
521-
FPrintF(stderr, "Cannot generate V8 code cache\n");
522-
return ExitCode::kGenericUserError;
523-
}
524-
code_cache = optional_code_cache.value();
525-
optional_sv_code_cache = code_cache;
521+
std::optional<std::string> optional_code_cache =
522+
GenerateCodeCache(config.main_path, main_script);
523+
if (!optional_code_cache.has_value()) {
524+
FPrintF(stderr, "Cannot generate V8 code cache\n");
525+
return ExitCode::kGenericUserError;
526526
}
527+
code_cache = optional_code_cache.value();
528+
optional_sv_code_cache = code_cache;
527529
}
528530

529531
std::unordered_map<std::string, std::string> assets;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.