diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-28 15:24:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:18 -0800 |
commit | 98e48e462b4a46fa0a8e33d6be976fa6abfe0c2e (patch) | |
tree | e43d4a9a70fd6ee6483bf79b3164afe9bb1a959f | |
parent | 123aeffa163828d93d75e4f498bb4f84f57562ac (diff) |
function table fixes
-rwxr-xr-x | emscripten.py | 5 | ||||
-rw-r--r-- | src/modules.js | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index bb78e311..a93095a9 100755 --- a/emscripten.py +++ b/emscripten.py @@ -312,9 +312,12 @@ for (var _export in asm) Module[_export] = asm[_export]; post_file = temp_files.get('.post.ll').name open(post_file, 'w').write('\n') # no input, just processing of forwarded data out = shared.run_js(compiler, shared.COMPILER_ENGINE, [settings_file, post_file, 'post', forwarded_file] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src')) + post, forwarded_data = out.split('//FORWARDED_DATA:') + forwarded_json = json.loads(forwarded_data) + outfile.write(forwarded_json['Functions']['tables']) #if DEBUG: outfile.write('// post\n') - outfile.write(indexize(out)) + outfile.write(indexize(post)) if DEBUG: print >> sys.stderr, ' emscript: phase 3 took %s seconds' % (time.time() - t) outfile.close() diff --git a/src/modules.js b/src/modules.js index 2dc6c342..dbe1e43a 100644 --- a/src/modules.js +++ b/src/modules.js @@ -274,7 +274,7 @@ var Functions = { // Shared libraries reuse the parent's function table. ret += 'FUNCTION_TABLE.push.apply(FUNCTION_TABLE_' + t + ', [' + indices + ']);\n'; } else { - ret += 'FUNCTION_TABLE_' + t + ' = [' + indices + '];\nModule["FUNCTION_TABLE_' + t + '"] = FUNCTION_TABLE_' + t + ';\n'; + ret += 'var FUNCTION_TABLE_' + t + ' = [' + indices + '];\n'; } } Functions.tables = ret; @@ -341,7 +341,6 @@ var PassManager = { } })); } else if (phase == 'post') { -printErr('forward post!'); print('\n//FORWARDED_DATA:' + JSON.stringify({ Functions: { tables: Functions.tables } })); |