Skip to content

no_dyncall_garbage #4894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function emscripten_start_fetch(fetch, successcb, errorcb, progresscb) {
#if FETCH_DEBUG
console.log('fetch: operation success. e: ' + e);
#endif
if (onsuccess && Runtime.dynCall) Runtime.dynCall('vi', onsuccess, [fetch]);
if (onsuccess && Runtime.dynCall) Module['dynCall_vi'](onsuccess, fetch);
else if (successcb) successcb(fetch);
};

Expand All @@ -497,20 +497,20 @@ function emscripten_start_fetch(fetch, successcb, errorcb, progresscb) {
#endif
};
__emscripten_fetch_cache_data(Fetch.dbInstance, fetch, xhr.response, storeSuccess, storeError);
if (onsuccess && Runtime.dynCall) Runtime.dynCall('vi', onsuccess, [fetch]);
if (onsuccess && Runtime.dynCall) Module['dynCall_vi'](onsuccess, fetch);
else if (successcb) successcb(fetch);
};

var reportProgress = function(fetch, xhr, e) {
if (onprogress && Runtime.dynCall) Runtime.dynCall('vi', onprogress, [fetch]);
if (onprogress && Runtime.dynCall) Module['dynCall_vi'](onprogress, fetch);
else if (progresscb) progresscb(fetch);
};

var reportError = function(fetch, xhr, e) {
#if FETCH_DEBUG
console.error('fetch: operation failed: ' + e);
#endif
if (onerror && Runtime.dynCall) Runtime.dynCall('vi', onerror, [fetch]);
if (onerror && Runtime.dynCall) Module['dynCall_vi'](onerror, fetch);
else if (errorcb) errorcb(fetch);
};

Expand Down
6 changes: 3 additions & 3 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -1092,10 +1092,10 @@ LibraryManager.library = {
if (info.refcount === 0 && !info.rethrown) {
if (info.destructor) {
#if WASM_BACKEND == 0
Runtime.dynCall('vi', info.destructor, [ptr]);
Module['dynCall_vi'](info.destructor, ptr);
#else
// In Wasm, destructors return 'this' as in ARM
Runtime.dynCall('ii', info.destructor, [ptr]);
Module['dynCall_ii'](info.destructor, ptr);
#endif
}
delete EXCEPTIONS.infos[ptr];
Expand Down Expand Up @@ -4192,7 +4192,7 @@ LibraryManager.library = {
var trace = _emscripten_get_callstack_js();
var parts = trace.split('\n');
for (var i = 0; i < parts.length; i++) {
var ret = Runtime.dynCall('iii', [0, arg]);
var ret = Module['dynCall_iii'](func, 0, arg);
if (ret !== 0) return;
}
},
Expand Down
39 changes: 19 additions & 20 deletions src/library_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ var LibraryBrowser = {
function doCallback(callback) {
if (callback) {
var stack = Runtime.stackSave();
Runtime.dynCall('vi', callback, [allocate(intArrayFromString(_file), 'i8', ALLOC_STACK)]);
Module['dynCall_vi'](callback, allocate(intArrayFromString(_file), 'i8', ALLOC_STACK));
Runtime.stackRestore(stack);
}
}
Expand Down Expand Up @@ -778,10 +778,10 @@ var LibraryBrowser = {
Browser.asyncLoad(Pointer_stringify(url), function(byteArray) {
var buffer = _malloc(byteArray.length);
HEAPU8.set(byteArray, buffer);
Runtime.dynCall('viii', onload, [arg, buffer, byteArray.length]);
Module['dynCall_viii'](onload, arg, buffer, byteArray.length);
_free(buffer);
}, function() {
if (onerror) Runtime.dynCall('vi', onerror, [arg]);
if (onerror) Module['dynCall_vi'](onerror, arg);
}, true /* no need for run dependency, this is async but will not do any prepare etc. step */ );
},

Expand Down Expand Up @@ -816,27 +816,27 @@ var LibraryBrowser = {
FS.createDataFile( _file.substr(0, index), _file.substr(index + 1), new Uint8Array(http.response), true, true, false);
if (onload) {
var stack = Runtime.stackSave();
Runtime.dynCall('viii', onload, [handle, arg, allocate(intArrayFromString(_file), 'i8', ALLOC_STACK)]);
Module['dynCall_viii'](onload, handle, arg, allocate(intArrayFromString(_file), 'i8', ALLOC_STACK));
Runtime.stackRestore(stack);
}
} else {
if (onerror) Runtime.dynCall('viii', onerror, [handle, arg, http.status]);
if (onerror) Module['dynCall_viii'](onerror, handle, arg, http.status);
}

delete Browser.wgetRequests[handle];
};

// ERROR
http.onerror = function http_onerror(e) {
if (onerror) Runtime.dynCall('viii', onerror, [handle, arg, http.status]);
if (onerror) Module['dynCall_viii'](onerror, handle, arg, http.status);
delete Browser.wgetRequests[handle];
};

// PROGRESS
http.onprogress = function http_onprogress(e) {
if (e.lengthComputable || (e.lengthComputable === undefined && e.total != 0)) {
var percentComplete = (e.loaded / e.total)*100;
if (onprogress) Runtime.dynCall('viii', onprogress, [handle, arg, percentComplete]);
if (onprogress) Module['dynCall_viii'](onprogress, handle, arg, percentComplete);
}
};

Expand Down Expand Up @@ -881,25 +881,25 @@ var LibraryBrowser = {
var byteArray = new Uint8Array(http.response);
var buffer = _malloc(byteArray.length);
HEAPU8.set(byteArray, buffer);
if (onload) Runtime.dynCall('viiii', onload, [handle, arg, buffer, byteArray.length]);
if (onload) Module['dynCall_viiii'](onload, handle, arg, buffer, byteArray.length);
if (free) _free(buffer);
} else {
if (onerror) Runtime.dynCall('viiii', onerror, [handle, arg, http.status, http.statusText]);
if (onerror) Module['dynCall_viiii'](onerror, handle, arg, http.status, http.statusText);
}
delete Browser.wgetRequests[handle];
};

// ERROR
http.onerror = function http_onerror(e) {
if (onerror) {
Runtime.dynCall('viiii', onerror, [handle, arg, http.status, http.statusText]);
Module['dynCall_viiii'](onerror, handle, arg, http.status, http.statusText);
}
delete Browser.wgetRequests[handle];
};

// PROGRESS
http.onprogress = function http_onprogress(e) {
if (onprogress) Runtime.dynCall('viiii', onprogress, [handle, arg, e.loaded, e.lengthComputable || e.lengthComputable === undefined ? e.total : 0]);
if (onprogress) Module['dynCall_viiii'](onprogress, handle, arg, e.loaded, e.lengthComputable || e.lengthComputable === undefined ? e.total : 0);
};

// ABORT
Expand Down Expand Up @@ -945,10 +945,10 @@ var LibraryBrowser = {
PATH.basename(_file),
new Uint8Array(data.object.contents), true, true,
function() {
if (onload) Runtime.dynCall('vi', onload, [file]);
if (onload) Module['dynCall_vi'](onload, file);
},
function() {
if (onerror) Runtime.dynCall('vi', onerror, [file]);
if (onerror) Module['dynCall_vi'](onerror, file);
},
true // don'tCreateFile - it's already there
);
Expand All @@ -970,10 +970,10 @@ var LibraryBrowser = {
{{{ makeHEAPView('U8', 'data', 'data + size') }}},
true, true,
function() {
if (onload) Runtime.dynCall('vii', onload, [arg, cname]);
if (onload) Module['dynCall_vii'](onload, arg, cname);
},
function() {
if (onerror) Runtime.dynCall('vi', onerror, [arg]);
if (onerror) Module['dynCall_vi'](onerror, arg);
},
true // don'tCreateFile - it's already there
);
Expand Down Expand Up @@ -1076,13 +1076,12 @@ var LibraryBrowser = {

var browserIterationFunc;
if (typeof arg !== 'undefined') {
var argArray = [arg];
browserIterationFunc = function() {
Runtime.dynCall('vi', func, argArray);
Module['dynCall_vi'](func, arg);
};
} else {
browserIterationFunc = function() {
Runtime.dynCall('v', func);
Module['dynCall_v'](func);
};
}

Expand Down Expand Up @@ -1197,14 +1196,14 @@ var LibraryBrowser = {

_emscripten_push_main_loop_blocker: function(func, arg, name) {
Browser.mainLoop.queue.push({ func: function() {
Runtime.dynCall('vi', func, [arg]);
Module['dynCall_vi'](func, arg);
}, name: Pointer_stringify(name), counted: true });
Browser.mainLoop.updateStatus();
},

_emscripten_push_uncounted_main_loop_blocker: function(func, arg, name) {
Browser.mainLoop.queue.push({ func: function() {
Runtime.dynCall('vi', func, [arg]);
Module['dynCall_vi'](func, arg);
}, name: Pointer_stringify(name), counted: false });
Browser.mainLoop.updateStatus();
},
Expand Down
38 changes: 19 additions & 19 deletions src/library_glfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ var LibraryGLFW = {
if (charCode == 0 || (charCode >= 0x00 && charCode <= 0x1F)) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', GLFW.active.charFunc, [charCode, 1]);
Module['dynCall_vii'](GLFW.active.charFunc, charCode, 1);
#endif

#if USE_GLFW == 3
Runtime.dynCall('vii', GLFW.active.charFunc, [GLFW.active.id, charCode]);
Module['dynCall_vii'](GLFW.active.charFunc, GLFW.active.id, charCode);
#endif
},

Expand All @@ -370,12 +370,12 @@ var LibraryGLFW = {
if (!GLFW.active.keyFunc) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', GLFW.active.keyFunc, [key, status]);
Module['dynCall_vii'](GLFW.active.keyFunc, key, status);
#endif

#if USE_GLFW == 3
if (repeat) status = 2; // GLFW_REPEAT
Runtime.dynCall('viiiii', GLFW.active.keyFunc, [GLFW.active.id, key, event.keyCode, status, GLFW.getModBits(GLFW.active)]);
Module['dynCall_viiiii'](GLFW.active.keyFunc, GLFW.active.id, key, event.keyCode, status, GLFW.getModBits(GLFW.active));
#endif
},

Expand All @@ -402,11 +402,11 @@ var LibraryGLFW = {
if (event.target != Module["canvas"] || !GLFW.active.cursorPosFunc) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', GLFW.active.cursorPosFunc, [Browser.mouseX, Browser.mouseY]);
Module['dynCall_vii'](GLFW.active.cursorPosFunc, Browser.mouseX, Browser.mouseY);
#endif

#if USE_GLFW == 3
Runtime.dynCall('vidd', GLFW.active.cursorPosFunc, [GLFW.active.id, Browser.mouseX, Browser.mouseY]);
Module['dynCall_vidd'](GLFW.active.cursorPosFunc, GLFW.active.id, Browser.mouseX, Browser.mouseY);
#endif
},

Expand All @@ -430,7 +430,7 @@ var LibraryGLFW = {
if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;

#if USE_GLFW == 3
Runtime.dynCall('vii', GLFW.active.cursorEnterFunc, [GLFW.active.id, 1]);
Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 1);
#endif
},

Expand All @@ -440,7 +440,7 @@ var LibraryGLFW = {
if (event.target != Module["canvas"] || !GLFW.active.cursorEnterFunc) return;

#if USE_GLFW == 3
Runtime.dynCall('vii', GLFW.active.cursorEnterFunc, [GLFW.active.id, 0]);
Module['dynCall_vii'](GLFW.active.cursorEnterFunc, GLFW.active.id, 0);
#endif
},

Expand All @@ -465,11 +465,11 @@ var LibraryGLFW = {
if (!GLFW.active.mouseButtonFunc) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', GLFW.active.mouseButtonFunc, [eventButton, status]);
Module['dynCall_vii'](GLFW.active.mouseButtonFunc, eventButton, status);
#endif

#if USE_GLFW == 3
Runtime.dynCall('viiii', GLFW.active.mouseButtonFunc, [GLFW.active.id, eventButton, status, GLFW.getModBits(GLFW.active)]);
Module['dynCall_viiii'](GLFW.active.mouseButtonFunc, GLFW.active.id, eventButton, status, GLFW.getModBits(GLFW.active));
#endif
},

Expand All @@ -492,7 +492,7 @@ var LibraryGLFW = {
if (!GLFW.active || !GLFW.active.scrollFunc || event.target != Module['canvas']) return;

#if USE_GLFW == 2
Runtime.dynCall('vi', GLFW.active.scrollFunc, [GLFW.wheelPos]);
Module['dynCall_vi'](GLFW.active.scrollFunc, GLFW.wheelPos);
#endif

#if USE_GLFW == 3
Expand All @@ -506,7 +506,7 @@ var LibraryGLFW = {
sy = event.deltaY;
}

Runtime.dynCall('vidd', GLFW.active.scrollFunc, [GLFW.active.id, sx, sy]);
Module['dynCall_vidd'](GLFW.active.scrollFunc, GLFW.active.id, sx, sy);
#endif

event.preventDefault();
Expand Down Expand Up @@ -561,11 +561,11 @@ var LibraryGLFW = {
if (!GLFW.active.windowSizeFunc) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', GLFW.active.windowSizeFunc, [GLFW.active.width, GLFW.active.height]);
Module['dynCall_vii'](GLFW.active.windowSizeFunc, GLFW.active.width, GLFW.active.height);
#endif

#if USE_GLFW == 3
Runtime.dynCall('viii', GLFW.active.windowSizeFunc, [GLFW.active.id, GLFW.active.width, GLFW.active.height]);
Module['dynCall_viii'](GLFW.active.windowSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
#endif
},

Expand All @@ -575,7 +575,7 @@ var LibraryGLFW = {
if (!GLFW.active.framebufferSizeFunc) return;

#if USE_GLFW == 3
Runtime.dynCall('viii', GLFW.active.framebufferSizeFunc, [GLFW.active.id, GLFW.active.width, GLFW.active.height]);
Module['dynCall_viii'](GLFW.active.framebufferSizeFunc, GLFW.active.id, GLFW.active.width, GLFW.active.height);
#endif
},

Expand Down Expand Up @@ -669,7 +669,7 @@ var LibraryGLFW = {
// function returns.
// GLFW3 on the over hand doesn't have this behavior (https://github.com/glfw/glfw/issues/62).
if (!win.windowSizeFunc) return;
Runtime.dynCall('vii', win.windowSizeFunc, [win.width, win.height]);
Module['dynCall_vii'](win.windowSizeFunc, win.width, win.height);
#endif
},

Expand Down Expand Up @@ -815,11 +815,11 @@ var LibraryGLFW = {
if (!win.windowSizeFunc) return;

#if USE_GLFW == 2
Runtime.dynCall('vii', win.windowSizeFunc, [width, height]);
Module['dynCall_vii'](win.windowSizeFunc, width, height);
#endif

#if USE_GLFW == 3
Runtime.dynCall('viii', win.windowSizeFunc, [win.id, width, height]);
Module['dynCall_viii'](win.windowSizeFunc, win.id, width, height);
#endif
},

Expand Down Expand Up @@ -875,7 +875,7 @@ var LibraryGLFW = {

#if USE_GLFW == 3
if (win.windowCloseFunc)
Runtime.dynCall('vi', win.windowCloseFunc, [win.id]);
Module['dynCall_vi'](win.windowCloseFunc, win.id);
#endif

GLFW.windows[win.id - 1] = null;
Expand Down
Loading