aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemscripten.py3
-rwxr-xr-xtests/runner.py5
-rw-r--r--tools/shared.py13
3 files changed, 18 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py
index aeef5f9a..ae3e671f 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -105,8 +105,7 @@ def emscript(infile, settings, outfile, libraries=[]):
if line.startswith(';'): continue
if line.startswith('define '):
in_func = True
- ident = shared.JS.to_nice_ident(line.split('(')[0].split(' ')[-1])
- funcs.append((ident, [line]))
+ funcs.append((line, [line])) # use the entire line as the identifier
pre.append(line) # pre needs it to, so we know about all implemented functions
elif line.find(' = type { ') > 0:
pre.append(line) # type
diff --git a/tests/runner.py b/tests/runner.py
index 8297da53..6a0c9eee 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10490,6 +10490,11 @@ fi
(['--jcache'], 'hello_malloc.cpp', True, False, []),
(['--jcache'], 'hello_malloc.cpp', False, True, []),
([], 'hello_malloc.cpp', False, False, []),
+ # new, huge file
+ ([], 'hello_libcxx.cpp', False, False, ('2 chunks', '3 chunks')),
+ (['--jcache'], 'hello_libcxx.cpp', True, False, []),
+ (['--jcache'], 'hello_libcxx.cpp', False, True, []),
+ ([], 'hello_libcxx.cpp', False, False, []),
]:
print >> sys.stderr, args, input_file, expect_save, expect_load, expected
self.clear()
diff --git a/tools/shared.py b/tools/shared.py
index 6f14c078..7bafd51d 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1180,7 +1180,7 @@ class JCache:
# Returns a cached value, if it exists. Make sure the full key matches
@staticmethod
def get(shortkey, keys):
- #if DEBUG: print >> sys.stderr, 'jcache get?'
+ #if DEBUG: print >> sys.stderr, 'jcache get?', shortkey
cachename = JCache.get_cachename(shortkey)
if not os.path.exists(cachename):
#if DEBUG: print >> sys.stderr, 'jcache none at all'
@@ -1205,6 +1205,10 @@ class JCache:
def set(shortkey, keys, value):
cachename = JCache.get_cachename(shortkey)
cPickle.Pickler(open(cachename, 'wb')).dump([keys, value])
+ #if DEBUG:
+ # for i in range(len(keys)):
+ # open(cachename + '.key' + str(i), 'w').write(keys[i])
+ # open(cachename + '.value', 'w').write(value)
# Given a set of functions of form (ident, text), and a preferred chunk size,
# generates a set of chunks for parallel processing and caching.
@@ -1279,6 +1283,13 @@ class JCache:
for ident, data in chunk:
new_mapping[ident] = i
cPickle.Pickler(open(chunking_file, 'wb')).dump(new_mapping)
+ #if DEBUG:
+ # if previous_mapping:
+ # for ident in set(previous_mapping.keys() + new_mapping.keys()):
+ # if previous_mapping.get(ident) != new_mapping.get(ident):
+ # print >> sys.stderr, 'mapping inconsistency', ident, previous_mapping.get(ident), new_mapping.get(ident)
+ # for key, value in new_mapping.iteritems():
+ # print >> sys.stderr, 'mapping:', key, value
return [''.join([func[1] for func in chunk]) for chunk in chunks] # remove function names
class JS: