aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-15 11:34:18 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-15 11:34:18 -0700
commit8ed84f09e75083b19fa6b2ad2a3651b01af41fb7 (patch)
tree137067d532ecb0f84af204758f8017d4a64040b3 /src/modules.js
parentede562fea850fb0e3e9c9e84cc25603e7587c02b (diff)
refactor code to generate empty function tables
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js
index c5c0db88..bd453add 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -237,6 +237,8 @@ var Functions = {
indexedFunctions: {},
nextIndex: (ASM_JS ? 2*RESERVED_FUNCTION_POINTERS : 0) + 2, // Start at a non-0 (even, see below) value
+ neededTables: set('v', 'vi', 'ii', 'iii'), // signatures that appeared (initialized with library stuff
+ // we always use), and we will need a function table for
blockAddresses: {}, // maps functions to a map of block labels to label ids
@@ -286,7 +288,7 @@ var Functions = {
}
var tables = { pre: '' };
if (ASM_JS) {
- ['v', 'vi', 'ii', 'iii'].forEach(function(sig) { // add some default signatures that are used in the library
+ keys(Functions.neededTables).forEach(function(sig) { // add some default signatures that are used in the library
tables[sig] = emptyTable(sig); // TODO: make them compact
});
}
@@ -429,6 +431,7 @@ var PassManager = {
indexedFunctions: Functions.indexedFunctions,
implementedFunctions: ASM_JS ? Functions.implementedFunctions : [],
unimplementedFunctions: Functions.unimplementedFunctions,
+ neededTables: Functions.neededTables
}
}));
} else if (phase == 'post') {