diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-25 18:15:51 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-03 15:31:03 -0700 |
commit | 405928b6971d536c14b886eb3908c4a8b9351a9e (patch) | |
tree | 2176bbdde45641b440f331e9ee195e248696e821 /emlink.py | |
parent | 20e81c40735a5c98672900d3793f1cc8452b2471 (diff) |
merge exports
Diffstat (limited to 'emlink.py')
-rw-r--r-- | emlink.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -64,9 +64,11 @@ class AsmModule(): ret = post_js.find('return') self.tables_js = post_js[:ret] self.exports_js = post_js[ret:] + self.exports = set([export.strip() for export in self.exports_js[self.exports_js.find('{')+1:self.exports_js.find('}')].split(',')]) + #print >> sys.stderr, self.exports def relocate_into(self, main): - # heap initializer TODO + # heap initializer concat = '.concat(' if main.mem_init_js and self.mem_init_js else '' end = ')' if main.mem_init_js and self.mem_init_js else '' allocation = main.mem_init_js + concat + self.mem_init_js + end @@ -102,7 +104,9 @@ class AsmModule(): # tables TODO - # exports TODO + # exports + exports = main.exports.union(self.exports) + main.exports_js = 'return {' + ','.join(list(exports)) + '};\n})\n' def write(self, out): f = open(out, 'w') |