aboutsummaryrefslogtreecommitdiff
path: root/tools/asm_module.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-01 20:32:10 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-01 20:32:10 -0700
commit543131f3dd830d567f672c7185cad131242ee8fa (patch)
treefb9ecc6a47ea3e9d910601ead572da087d9b6a66 /tools/asm_module.py
parentad11d72f5066e7a2f509e6cad411612c655a90e6 (diff)
add tools to split and merge asm modules from the surrounding code
Diffstat (limited to 'tools/asm_module.py')
-rw-r--r--tools/asm_module.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/asm_module.py b/tools/asm_module.py
index e3fc9a76..e54cfc21 100644
--- a/tools/asm_module.py
+++ b/tools/asm_module.py
@@ -14,8 +14,9 @@ class AsmModule():
self.end_funcs = self.js.rfind(js_optimizer.end_funcs_marker)
self.end_asm = self.js.rfind(js_optimizer.end_asm_marker)
- # pre
+ # pre and asm
self.pre_js = self.js[:self.start_asm]
+ self.asm_js = self.js[self.start_asm:self.end_asm]
# heap initializer
self.staticbump = int(re.search(shared.JS.memory_staticbump_pattern, self.pre_js).group(1))
@@ -238,8 +239,8 @@ class AsmModule():
for part in parts:
if '=' not in part: continue
part = part.split('var ')[1]
- name, data = part.split(' = ')
- tables[name] = data
+ name, data = part.split('=')
+ tables[name.strip()] = data.strip()
return tables
def merge_tables(self, table, main, side, replacements, f_bases, f_sizes):