aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-08 13:04:13 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-08 13:04:13 -0700
commit649f00422986e1e41551bcb49568adcb7897faa6 (patch)
tree87879d2c9803e9024f009e0d59429d38509066e8 /src
parent458567779b54a321ee65c30a80b8a1b0d984d359 (diff)
track if there is inline js, and if so do not mark as valid asm.js
Diffstat (limited to 'src')
-rw-r--r--src/intertyper.js3
-rw-r--r--src/modules.js7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index ddb93d71..f9633549 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -708,7 +708,8 @@ function intertyper(data, sidePass, baseLineNums) {
item.ident = eatLLVMIdent(tokensLeft);
if (item.ident == 'asm') {
if (ASM_JS) {
- warnOnce('inline JS in asm.js mode can cause the code to no longer fall in the asm.js subset of JavaScript');
+ Types.hasInlineJS = true;
+ warnOnce('inline JavaScript (asm, EM_ASM) will cause the code to no longer fall in the asm.js subset of JavaScript, which can reduce performance');
}
assert(TARGET_LE32, 'inline js is only supported in le32');
// Inline assembly is just JavaScript that we paste into the code
diff --git a/src/modules.js b/src/modules.js
index 373e60d9..1a931572 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -227,6 +227,8 @@ var Types = {
needAnalysis: {}, // Types noticed during parsing, that need analysis
+ hasInlineJS: false, // whether the program has inline JS anywhere
+
// Set to true if we actually use precise i64 math: If PRECISE_I64_MATH is set, and also such math is actually
// needed (+,-,*,/,% - we do not need it for bitops), or PRECISE_I64_MATH is 2 (forced)
preciseI64MathUsed: (PRECISE_I64_MATH == 2)
@@ -467,7 +469,10 @@ var PassManager = {
}));
} else if (phase == 'funcs') {
print('\n//FORWARDED_DATA:' + JSON.stringify({
- Types: { preciseI64MathUsed: Types.preciseI64MathUsed },
+ Types: {
+ hasInlineJS: Types.hasInlineJS,
+ preciseI64MathUsed: Types.preciseI64MathUsed
+ },
Functions: {
blockAddresses: Functions.blockAddresses,
indexedFunctions: Functions.indexedFunctions,