Skip to content

Commit

Permalink
node-v10.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
madanagopaltcomcast committed Jul 1, 2019
1 parent e286e64 commit 96703c2
Show file tree
Hide file tree
Showing 20 changed files with 410 additions and 78 deletions.
72 changes: 57 additions & 15 deletions examples/pxScene2d/external/libnode-v10.15.3/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@
'v8_enable_handle_zapping': 1,
},
'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ],
'cflags': [ '-g', '-O0' ],
# MODIFIED CODE BEGIN
'cflags': [ '-Os' ],
# MODIFIED CODE END
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
Expand Down Expand Up @@ -178,7 +180,9 @@
'variables': {
'v8_enable_handle_zapping': 0,
},
'cflags': [ '-O3' ],
# MODIFIED CODE BEGIN
'cflags': [ '-Os' ],
# MODIFIED CODE END
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
Expand Down Expand Up @@ -215,6 +219,35 @@
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
# MODIFIED CODE BEGIN
[ 'no_optimization==1', {
'cflags': [ '-O0' ],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': 0, # /Od, no optimization
}
}
}],
[ 'no_optimization!=1', {
'cflags': [ '-Os' ],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
},
'VCLibrarianTool': {
'AdditionalOptions': [
'/LTCG', # link time code generation
],
},
'VCLinkerTool': {
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
}
}
}],
['node_shared=="true"', {
'msvs_settings': {
'VCCLCompilerTool': {
Expand All @@ -231,17 +264,21 @@
}],
['node_with_ltcg=="true"', {
'msvs_settings': {
'VCCLCompilerTool': {
'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG
},
'VCLibrarianTool': {
'AdditionalOptions': [
'/LTCG:INCREMENTAL', # link time code generation
]
},
# MODIFIED CODE BEGIN
#'VCCLCompilerTool': {
# 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG
#},
#'VCLibrarianTool': {
# 'AdditionalOptions': [
# '/LTCG:INCREMENTAL', # link time code generation
# ]
#},
# MODIFIED CODE END
'VCLinkerTool': {
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
# MODIFIED CODE BEGIN
#'OptimizeReferences': 2, # /OPT:REF
#'EnableCOMDATFolding': 2, # /OPT:ICF
# MODIFIED CODE END
'LinkIncremental': 1, # disable incremental linking
'AdditionalOptions': [
'/LTCG:INCREMENTAL', # incremental link-time code generation
Expand All @@ -261,9 +298,11 @@
],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
# MODIFIED CODE BEGIN
#'Optimization': 3, # /Ox, full optimization
#'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
#'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
# MODIFIED CODE END
'OmitFramePointers': 'true',
'EnableFunctionLevelLinking': 'true',
'EnableIntrinsicFunctions': 'true',
Expand Down Expand Up @@ -513,6 +552,9 @@
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++1y', # -std=gnu++1y
'CLANG_CXX_LIBRARY': 'libc++',
# MODIFIED CODE BEGIN
'MACOSX_DEPLOYMENT_TARGET': '10.9',
# MODIFIED CODE END
},
}],
],
Expand Down
10 changes: 10 additions & 0 deletions examples/pxScene2d/external/libnode-v10.15.3/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,13 @@
help='do not use V8 includes from the bundled deps folder. ' +
'(This mode is not officially supported for regular applications)')

# MODIFIED CODE BEGIN
parser.add_option('--no-optimization',
action='store_true',
dest='no_optimization',
help='build without optimization')
# MODIFIED CODE END

parser.add_option('--build-v8-with-gn',
action='store_true',
dest='build_v8_with_gn',
Expand Down Expand Up @@ -1608,6 +1615,9 @@ def make_bin_override():
configure_intl(output)
configure_static(output)
configure_inspector(output)
# MODIFIED CODE BEGIN
output['variables']['no_optimization'] = 1 if options.no_optimization else 0
# MODIFIED CODE END

# variables should be a root level element,
# move everything else to target_defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# RuntimeLibrary MUST MATCH across the entire project
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
# MODIFIED CODE BEGIN
'cflags': [ '-Wall', '-Wextra', '-Os', '-g', '-ftrapv' ],
# MODIFIED CODE END
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
Expand All @@ -21,7 +23,9 @@
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [ '-Wall', '-Wextra', '-O3' ],
# MODIFIED CODE BEGIN
'cflags': [ '-Wall', '-Wextra', '-Os' ],
# MODIFIED CODE END
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [
'-O3',
# MODIFIED CODE BEGIN
'-Os',
# MODIFIED CODE END
],
'msvs_settings': {
'VCCLCompilerTool': {
Expand Down
10 changes: 7 additions & 3 deletions examples/pxScene2d/external/libnode-v10.15.3/deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,6 @@ v8_source_set("v8_base") {
"//base/trace_event/common/trace_event_common.h",

### gcmole(all) ###
"include/v8-inspector-protocol.h",
"include/v8-inspector.h",
"include/v8-platform.h",
"include/v8-profiler.h",
"include/v8-testing.h",
Expand Down Expand Up @@ -2753,8 +2751,14 @@ v8_source_set("v8_base") {
":v8_headers",
":v8_libbase",
":v8_libsampler",
"src/inspector:inspector",
]
#MODIFIED CODE BEGIN
if (v8_enable_inspector) {
deps += ["src/inspector:inspector",]
sources += [ "include/v8-inspector-protocol.h",]
sources += [ "include/v8-inspector.h",]
}
#MODIFIED CODE END

if (v8_enable_i18n_support) {
public_deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,10 +1225,14 @@
# Don't use -O3 with sanitizers.
['asan==0 and msan==0 and lsan==0 \
and tsan==0 and ubsan==0 and ubsan_vptr==0', {
'cflags': ['-O3'],
# MODIFIED CODE BEGIN
'cflags': ['-Os'],
# MODIFIED CODE END
'cflags!': ['-O2'],
}, {
'cflags': ['-O2'],
# MODIFIED CODE BEGIN
'cflags': ['-Os'],
# MODIFIED CODE END
'cflags!': ['-O3'],
}],
],
Expand Down Expand Up @@ -1347,10 +1351,14 @@
# Don't use -O3 with sanitizers.
['asan==0 and msan==0 and lsan==0 \
and tsan==0 and ubsan==0 and ubsan_vptr==0', {
'cflags': ['-O3'],
# MODIFIED CODE BEGIN
'cflags': ['-Os'],
# MODIFIED CODE END
'cflags!': ['-O2'],
}, {
'cflags': ['-O2'],
# MODIFIED CODE BEGIN
'cflags': ['-Os'],
# MODIFIED CODE end
'cflags!': ['-O3'],
}],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@
# Since this target is a static-library, but as a side effect it generates
# header files, it needs to be a hard dependency.
'hard_dependency': 1,
'includes': [ 'inspector.gypi' ],
'dependencies': [
'v8_libbase',
'v8_libsampler',
Expand All @@ -453,9 +452,6 @@
'<(SHARED_INTERMEDIATE_DIR)'
],
'sources': [
'<@(inspector_all_sources)',
'../include//v8-inspector-protocol.h',
'../include//v8-inspector.h',
'../include//v8-platform.h',
'../include//v8-profiler.h',
'../include//v8-testing.h',
Expand Down Expand Up @@ -1480,6 +1476,16 @@
'<@(torque_generated_pure_headers)',
],
'conditions': [
# MODIFIED CODE BEGIN
['v8_enable_inspector==1', {
'sources': [
'<@(inspector_all_sources)',
'../include//v8-inspector-protocol.h',
'../include//v8-inspector.h',
],
'includes': [ 'inspector.gypi' ],
}],
# MODIFIED CODE END
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,14 @@ Object* Isolate::Throw(Object* exception, MessageLocation* location) {
HandleScope scope(this);
Handle<Object> exception_handle(exception, this);

/* MODIFIED CODE BEGIN */
char const* stack_on_exception_enabled = getenv("DUMP_STACK_ON_EXCEPTION");
if (stack_on_exception_enabled && (strcmp(stack_on_exception_enabled,"1") == 0))
{
PrintCurrentStackTrace(stderr);
}
/* MODIFIED CODE END */

if (FLAG_print_all_exceptions) {
printf("=========================================================\n");
printf("Exception thrown:\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,12 @@
// User passed '-e' or '--eval' arguments to Node without '-i' or
// '--interactive'.
preloadModules();

const {
addBuiltinLibsToObject
} = NativeModule.require('internal/modules/cjs/helpers');
addBuiltinLibsToObject(global);
/* MODIFIED CODE BEGIN */
//const {
// addBuiltinLibsToObject
//} = NativeModule.require('internal/modules/cjs/helpers');
//addBuiltinLibsToObject(global);
/* MODIFIED CODE END */
evalScript('[eval]');
} else if (process.argv[1] && process.argv[1] !== '-') {
// Make process.argv[1] into a full path.
Expand All @@ -284,7 +285,9 @@
} else {
preloadModules();
// If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
/* MODIFIED CODE BEGIN */
//if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
/* MODIFIED CODE END */
// REPL
const cliRepl = NativeModule.require('internal/repl');
cliRepl.createInternalRepl(process.env, (err, repl) => {
Expand All @@ -306,6 +309,8 @@
// User passed '-e' or '--eval'
evalScript('[eval]');
}
/* MODIFIED CODE BEGIN */
/*
} else {
// Read all of stdin - execute it.
process.stdin.setEncoding('utf8');
Expand All @@ -324,6 +329,8 @@
}
});
}
*/
/* MODIFIED CODE END */
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions examples/pxScene2d/external/libnode-v10.15.3/lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const EventEmitter = require('events');
const stream = require('stream');
const util = require('util');
const internalUtil = require('internal/util');
/*MODIFIED CODE BEGIN*/
const fileSystem = require('fs');
/*MODIFIED CODE END*/
const {
isIP,
isIPv4,
Expand Down Expand Up @@ -985,6 +988,27 @@ function lookupAndConnect(self, options) {
dnsopts.hints === 0) {
dnsopts.hints = dns.ADDRCONFIG;
}
/*MODIFIED CODE BEGIN*/
var ipMode = 0;
try {
fileSystem.accessSync('/tmp/ipmode_v4');
ipMode = 4;
} catch(e) {
debug('/tmp/ipmode_v4 does not exist');
}

try {
fileSystem.accessSync('/tmp/ipmode_v6');
ipMode = 6;
} catch(e) {
debug('/tmp/ipmode_v6 does not exist');
}

if (ipMode == 4 || ipMode == 6) {
dnsopts.family = ipMode;
}
/*MODIFIED CODE END*/


debug('connect: find host', host);
debug('connect: dns options', dnsopts);
Expand Down
Loading

0 comments on commit 96703c2

Please sign in to comment.