allow adding more functions to emterpreter blacklist

This commit is contained in:
Alon Zakai 2014-10-10 11:04:35 -07:00
Родитель 4fcace592c
Коммит 722d8d4495
3 изменённых файлов: 5 добавлений и 1 удалений

3
emcc
Просмотреть файл

@ -1488,10 +1488,11 @@ try:
if shared.Settings.EMTERPRETIFY:
logging.debug('emterpretifying')
assert memory_init_file, 'emterpreter requires a mem init file'
import json
try:
# move temp js to final position, alongside its mem init file
shutil.move(final, js_target)
execute([shared.PYTHON, shared.path_from_root('tools', 'emterpretify.py'), js_target, final + '.em.js', memfile])
execute([shared.PYTHON, shared.path_from_root('tools', 'emterpretify.py'), js_target, final + '.em.js', memfile, json.dumps(shared.Settings.EMTERPRETIFY_BLACKLIST)])
final = final + '.em.js'
finally:
shared.try_delete(js_target)

Просмотреть файл

@ -563,6 +563,7 @@ var NO_DYNAMIC_EXECUTION = 0; // When enabled, we do not emit eval() and new Fun
// privileged firefox app, etc.)
var EMTERPRETIFY = 0; // Runs tools/emterpretify on the compiler output
var EMTERPRETIFY_BLACKLIST = []; // Functions to not emterpret, that is, to run normally at full speed
var RUNNING_JS_OPTS = 0; // whether js opts will be run, after the main compiler
var RUNNING_FASTCOMP = 1; // whether we are running the fastcomp backend

Просмотреть файл

@ -558,6 +558,8 @@ function emterpret%s(pc) {
infile = sys.argv[1]
outfile = sys.argv[2]
force_memfile = sys.argv[3] if len(sys.argv) >= 4 else None
if len(sys.argv) >= 5:
BLACKLIST = set(list(BLACKLIST) + json.loads(sys.argv[4]))
#print 'emterpretifying %s to %s' % (infile, outfile)