diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules.js | 7 | ||||
-rw-r--r-- | src/parseTools.js | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/modules.js b/src/modules.js index de84d9e4..6847e1de 100644 --- a/src/modules.js +++ b/src/modules.js @@ -218,7 +218,8 @@ var Types = { var Functions = { // All functions that will be implemented in this file. Maps id to signature implementedFunctions: {}, - libraryFunctions: {}, // functions added from the library. Maps id to 1, or to a signature if we need indexing + libraryFunctions: {}, // functions added from the library + unimplementedFunctions: {}, // library etc. functions that we need to index, maps id to signature indexedFunctions: {}, nextIndex: 2, // Start at a non-0 (even, see below) value @@ -264,7 +265,7 @@ var Functions = { }); } for (var ident in this.indexedFunctions) { - var sig = ASM_JS ? Functions.implementedFunctions[ident] || Functions.libraryFunctions[ident] : 'x'; + var sig = ASM_JS ? Functions.implementedFunctions[ident] || Functions.unimplementedFunctions[ident] : 'x'; assert(sig, ident); if (!tables[sig]) tables[sig] = zeros(this.nextIndex); // TODO: make them compact tables[sig][this.indexedFunctions[ident]] = ident; @@ -348,7 +349,7 @@ var PassManager = { blockAddresses: Functions.blockAddresses, indexedFunctions: Functions.indexedFunctions, implementedFunctions: ASM_JS ? Functions.implementedFunctions : [], - libraryFunctions: Functions.libraryFunctions, + unimplementedFunctions: Functions.unimplementedFunctions, } })); } else if (phase == 'post') { diff --git a/src/parseTools.js b/src/parseTools.js index 080ef6fd..eb1c6ab0 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1006,8 +1006,8 @@ function indexizeFunctions(value, type) { var out = {}; if (type && isFunctionType(type, out) && value[0] === '_') { // checking for _ differentiates from $ (local vars) // add signature to library functions that we now know need indexing - if (!(value in Functions.implementedFunctions) && !(value in Functions.libraryFunctions)) { - Functions.libraryFunctions[value] = Functions.getSignature(out.returnType, out.segments ? out.segments.map(function(segment) { return segment[0].text }) : []); + if (!(value in Functions.implementedFunctions) && !(value in Functions.unimplementedFunctions)) { + Functions.unimplementedFunctions[value] = Functions.getSignature(out.returnType, out.segments ? out.segments.map(function(segment) { return segment[0].text }) : []); } if (BUILD_AS_SHARED_LIB) { |