Skip to content

Commit

Permalink
Remove fastcomp-only RUNNING_JS_OPTS option (#12133)
Browse files Browse the repository at this point in the history
See #11860
  • Loading branch information
kripken authored Sep 8, 2020
1 parent bf07fda commit bf9352b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
7 changes: 0 additions & 7 deletions src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,6 @@ function JSify(data, functionsOnly) {

var shellParts = read(shellFile).split('{{BODY}}');
print(processMacros(preprocess(shellParts[1], shellFile)));
// Print out some useful metadata
if (RUNNING_JS_OPTS) {
var generatedFunctions = JSON.stringify(keys(Functions.implementedFunctions));
if (RUNNING_JS_OPTS) {
print('// EMSCRIPTEN_GENERATED_FUNCTIONS: ' + generatedFunctions + '\n');
}
}

PassManager.serialize();
}
Expand Down
7 changes: 3 additions & 4 deletions src/parseTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function parseNumerical(value, type) {
if (value[0] === '-' && ret === 0) { return '-.0'; } // fix negative 0, toString makes it 0
}
if (type === 'double' || type === 'float') {
if (!RUNNING_JS_OPTS) ret = asmEnsureFloat(ret, type);
ret = asmEnsureFloat(ret, type);
}
return ret.toString();
} else {
Expand Down Expand Up @@ -747,8 +747,7 @@ function ensureDot(value) {
value = value.toString();
// if already dotted, or Infinity or NaN, nothing to do here
// if smaller than 1 and running js opts, we always need to force a coercion (0.001 will turn into 1e-3, which has no .)
if ((value.indexOf('.') >= 0 || /[IN]/.test(value)) && (!RUNNING_JS_OPTS || Math.abs(value) >= 1)) return value;
if (RUNNING_JS_OPTS) return '(+' + value + ')'; // JS optimizer will run, we must do +x, and it will be corrected later
if ((value.indexOf('.') >= 0 || /[IN]/.test(value))) return value;
var e = value.indexOf('e');
if (e < 0) return value + '.0';
return value.substr(0, e) + '.0' + value.substr(e);
Expand All @@ -772,7 +771,7 @@ function asmEnsureFloat(value, type) { // ensures that a float type has either 5
function asmInitializer(type) {
if (type in Compiletime.FLOAT_TYPES) {
if (type === 'float') return 'Math_fround(0)';
return RUNNING_JS_OPTS ? '+0' : '.0';
return '.0';
} else {
return '0';
}
Expand Down
5 changes: 1 addition & 4 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,9 +1045,6 @@ var EXPORT_NAME = 'Module';
// to warnings instead of throwing an exception.
var DYNAMIC_EXECUTION = 1;

// whether js opts will be run, after the main compiler
var RUNNING_JS_OPTS = 0;

// whether we are in the generate struct_info bootstrap phase
var BOOTSTRAPPING_STRUCT_INFO = 0;

Expand Down Expand Up @@ -1161,7 +1158,6 @@ var EMIT_EMSCRIPTEN_LICENSE = 0;
// to automatically demote i64 to i32 and promote f32 to f64. This is necessary
// in order to interface with JavaScript, both for asm.js and wasm. For
// non-web/non-JS embeddings, setting this to 0 may be desirable.
// LEGALIZE_JS_FFI=0 is incompatible with RUNNING_JS_OPTS.
var LEGALIZE_JS_FFI = 1;

// Ports
Expand Down Expand Up @@ -1692,5 +1688,6 @@ var LEGACY_SETTINGS = [
['DEAD_FUNCTIONS', [[]], 'The wasm backend does not support dead function removal'],
['WASM_BACKEND', [-1], 'Only the wasm backend is now supported (note that setting it as -s has never been allowed anyhow)'],
['EXPORT_BINDINGS', [0, 1], 'No longer needed'],
['RUNNING_JS_OPTS', [0], 'Fastcomp cared about running JS which could alter asm.js validation, but not upstream'],
['EXPORT_FUNCTION_TABLES', [0], 'No longer needed'],
];

0 comments on commit bf9352b

Please sign in to comment.