Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,6 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
test/fixtures/*.c \
test/js-native-api/*/*.cc \
test/node-api/*/*.cc \
tools/js2c.cc \
tools/icu/*.cc \
tools/icu/*.h \
tools/code_cache/*.cc \
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,7 @@ def make_bin_override():

print_verbose(output)

# Dump as JSON to allow js2c.cc read it as a simple json file.
# Dump as JSON to allow js2c to read it as a simple json file.
write('config.gypi', do_not_edit +
json.dumps(output, indent=2) + '\n')

Expand Down
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/realm.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Internal JavaScript module loader:
// - BuiltinModule: a minimal module system used to load the JavaScript core
// modules found in lib/**/*.js and deps/**/*.js. All core modules are
// compiled into the node binary via node_javascript.cc generated by js2c.cc,
// compiled into the node binary via node_javascript.cc generated by js2c,
// so they can be loaded faster without the cost of I/O. This class makes the
// lib/internal/*, deps/internal/* modules and internalBinding() available by
// default to core modules, and lets the core modules require itself via
Expand Down
73 changes: 44 additions & 29 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'ossfuzz' : 'false',
'linked_module_files': [
],
# We list the deps/ files out instead of globbing them in js2c.cc since we
# We list the deps/ files out instead of globbing them in js2c.rs since we
# only include a subset of all the files under these directories.
# The lengths of their file names combined should not exceed the
# Windows command length limit or there would be an error.
Expand Down Expand Up @@ -1552,40 +1552,55 @@
}, # nop
{
'target_name': 'node_js2c',
'type': 'executable',
'type': 'none',
'toolsets': ['host'],
'include_dirs': [
'tools',
'src',
],
'sources': [
'tools/js2c.cc',
'tools/executable_wrapper.h',
'src/embedded_data.h',
'src/embedded_data.cc',
'src/builtin_info.h',
'src/builtin_info.cc',
'variables': {
'node_js2c_rustc_flags': [
'--edition=2021',
'--crate-name',
'node_js2c',
'-C',
'opt-level=2',
],
},
'actions': [
{
'action_name': 'build_node_js2c',
'inputs': [
'tools/js2c.rs',
],
'outputs': [
'<(node_js2c_exec)',
],
'action': [
'rustc',
'<@(node_js2c_rustc_flags)',
'tools/js2c.rs',
'-o',
'<@(_outputs)',
],
},
],
'conditions': [
[ 'OS=="mac"', {
'libraries': [ '-framework CoreFoundation -framework Security' ],
}],
[ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', {
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf#host' ],
}],
[ 'node_shared_libuv=="false"', {
'dependencies': [ 'deps/uv/uv.gyp:libuv#host' ],
}],
[ 'OS in "linux mac openharmony"', {
'defines': ['NODE_JS2C_USE_STRING_LITERALS'],
'variables': {
'node_js2c_rustc_flags+': [
'--cfg',
'node_js2c_use_string_literals',
],
},
}],
[ 'debug_node=="true"', {
'cflags!': [ '-O3' ],
'cflags': [ '-g', '-O0' ],
'defines': [ 'DEBUG' ],
'xcode_settings': {
'OTHER_CFLAGS': [
'-g', '-O0'
'variables': {
'node_js2c_rustc_flags!': [
'-C',
'opt-level=2',
],
'node_js2c_rustc_flags+': [
'-C',
'debuginfo=2',
'-C',
'opt-level=0',
],
},
}],
Expand Down
4 changes: 2 additions & 2 deletions src/node_builtins.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ using BuiltinSourceMap = std::map<std::string, BuiltinSource>;
using BuiltinCodeCacheMap =
std::unordered_map<std::string, BuiltinCodeCacheData>;

// Generated by tools/js2c.cc as node_javascript.cc
// Generated by tools/js2c as node_javascript.cc
void RegisterExternalReferencesForInternalizedBuiltinCode(
ExternalReferenceRegistry* registry);

Expand Down Expand Up @@ -139,7 +139,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
// Only allow access from friends.
friend class CodeCacheBuilder;

// Generated by tools/js2c.cc as node_javascript.cc
// Generated by tools/js2c as node_javascript.cc
void LoadJavaScriptSource(); // Loads data into source_
UnionBytes GetConfig(); // Return data for config.gypi

Expand Down
Loading
Loading