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@7f09d98

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
@@ -373,7 +373,14 @@ std::optional<SeaConfig> ParseSingleExecutableConfig(
373373
return std::nullopt;
374374
}
375375
if (use_code_cache.value()) {
376-
result.flags |= SeaFlags::kUseCodeCache;
376+
if (use_snapshot.value()) {
377+
// TODO(joyeecheung): code cache in snapshot should be configured by
378+
// separate snapshot configurations.
379+
FPrintF(stderr,
380+
"\"useCodeCache\" is redundant when \"useSnapshot\" is true\n");
381+
} else {
382+
result.flags |= SeaFlags::kUseCodeCache;
383+
}
377384
}
378385

379386
auto assets_opt = parser.GetTopLevelStringDict("assets");
@@ -529,19 +536,14 @@ ExitCode GenerateSingleExecutableBlob(
529536
std::optional<std::string_view> optional_sv_code_cache;
530537
std::string code_cache;
531538
if (static_cast<bool>(config.flags & SeaFlags::kUseCodeCache)) {
532-
if (builds_snapshot_from_main) {
533-
FPrintF(stderr,
534-
"\"useCodeCache\" is redundant when \"useSnapshot\" is true\n");
535-
} else {
536-
std::optional<std::string> optional_code_cache =
537-
GenerateCodeCache(config.main_path, main_script);
538-
if (!optional_code_cache.has_value()) {
539-
FPrintF(stderr, "Cannot generate V8 code cache\n");
540-
return ExitCode::kGenericUserError;
541-
}
542-
code_cache = optional_code_cache.value();
543-
optional_sv_code_cache = code_cache;
539+
std::optional<std::string> optional_code_cache =
540+
GenerateCodeCache(config.main_path, main_script);
541+
if (!optional_code_cache.has_value()) {
542+
FPrintF(stderr, "Cannot generate V8 code cache\n");
543+
return ExitCode::kGenericUserError;
544544
}
545+
code_cache = optional_code_cache.value();
546+
optional_sv_code_cache = code_cache;
545547
}
546548

547549
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.