Skip to content
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
11 changes: 6 additions & 5 deletions src/lib/libasync.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ addToLibrary({

#if ASYNCIFY
$Asyncify__force: true,
$Asyncify__deps: ['$runAndAbortIfError', '$callUserCallback',
#if ASSERTIONS
'$createNamedFunction',
#endif
#if !MINIMAL_RUNTIME
$Asyncify__deps: [
#if useRuntimeKeepaliveStack()
'$runtimeKeepalivePush', '$runtimeKeepalivePop',
#endif
#if ASYNCIFY == 1
'$runAndAbortIfError', '$callUserCallback',
#if ASSERTIONS
'$createNamedFunction',
#endif
// Needed by allocateData and handleSleep respectively
'malloc', 'free',
#endif
Expand Down
9 changes: 8 additions & 1 deletion src/lib/libbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,14 @@ var LibraryBrowser = {
},

// TODO: currently not callable from a pthread, but immediately calls onerror() if not on main thread.
emscripten_async_load_script__deps: ['$UTF8ToString', '$runDependencies', '$resolveRunDependencies', '$callUserCallback'],
emscripten_async_load_script__deps: [
'$UTF8ToString',
#if ASSERTIONS
'$runDependencies',
#endif
'$resolveRunDependencies',
'$callUserCallback',
],
emscripten_async_load_script: async (url, onload, onerror) => {
url = UTF8ToString(url);
#if PTHREADS
Expand Down
7 changes: 3 additions & 4 deletions src/lib/libdylink.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ var LibraryDylink = {
// the canonical name of the symbol (in some cases modifying the symbol as
// part of the loop process, so that actual symbol looked up has a different
// name).
$resolveGlobalSymbol__deps: ['$isSymbolDefined', '$createNamedFunction',
$resolveGlobalSymbol__deps: ['$isSymbolDefined',
#if !DISABLE_EXCEPTION_CATCHING || SUPPORT_LONGJMP == 'emscripten'
'$createNamedFunction',
'$createInvokeFunction',
#endif
],
Expand Down Expand Up @@ -392,7 +393,7 @@ var LibraryDylink = {
// Allocate memory even if malloc isn't ready yet. The allocated memory here
// must be zero initialized since its used for all static data, including bss.
$getMemory__noleakcheck: true,
$getMemory__deps: ['$GOT', 'emscripten_get_sbrk_ptr', '__heap_base', '$alignMemory', 'calloc'],
$getMemory__deps: ['emscripten_get_sbrk_ptr', '__heap_base', '$alignMemory', 'calloc'],
$getMemory: (size) => {
// After the runtime is initialized, we must only use sbrk() normally.
#if DYLINK_DEBUG
Expand Down Expand Up @@ -1015,9 +1016,7 @@ var LibraryDylink = {
'_emscripten_find_dylib',
'$withStackSave',
'$stackAlloc',
'$lengthBytesUTF8',
'$stringToUTF8OnStack',
'$stringToUTF8',
'$FS',
'$PATH',
#if WASMFS
Expand Down
7 changes: 3 additions & 4 deletions src/lib/libemval.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ ${functionBody}
return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
},

_emval_invoke__deps: ['$getStringOrSymbol', '$emval_methodCallers', '$Emval'],
_emval_invoke__deps: ['$emval_methodCallers'],
_emval_invoke: (caller, handle, methodName, destructorsRef, args) => {
return emval_methodCallers[caller](handle, methodName, destructorsRef, args);
},
Expand Down Expand Up @@ -410,7 +410,6 @@ ${functionBody}
},

#if !DISABLE_EXCEPTION_CATCHING || WASM_EXCEPTIONS
$isCppExceptionObject__deps: ['$Emval'],
$isCppExceptionObject: (object) => {
#if !DISABLE_EXCEPTION_CATCHING
return object instanceof CppException;
Expand All @@ -420,12 +419,12 @@ ${functionBody}
},
#endif

#if !DISABLE_EXCEPTION_CATCHING || WASM_EXCEPTIONS
_emval_is_catchable_cpp_exception_object__deps: [
'$Emval',
#if !DISABLE_EXCEPTION_CATCHING || WASM_EXCEPTIONS
'$isCppExceptionObject',
#endif
],
#endif
_emval_is_catchable_cpp_exception_object: (object) => {
#if !DISABLE_EXCEPTION_CATCHING || WASM_EXCEPTIONS
return isCppExceptionObject(Emval.toValue(object));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libfetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var LibraryFetch = {
$Fetch: Fetch,
_emscripten_fetch_get_response_headers_length__deps: ['$lengthBytesUTF8'],
_emscripten_fetch_get_response_headers_length: fetchGetResponseHeadersLength,
_emscripten_fetch_get_response_headers__deps: ['$lengthBytesUTF8', '$stringToUTF8'],
_emscripten_fetch_get_response_headers__deps: ['$stringToUTF8'],
_emscripten_fetch_get_response_headers: fetchGetResponseHeaders,
emscripten_fetch_free: fetchFree,

Expand Down
5 changes: 4 additions & 1 deletion src/lib/libfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ var LibraryFS = {
'$PROXYFS',
#endif
#if ASSERTIONS
'$strError', '$ERRNO_CODES', '$warnOnce',
'$strError', '$ERRNO_CODES',
#if !STRICT
'$warnOnce',
#endif
#endif
#if !MINIMAL_RUNTIME
'$FS_createPreloadedFile',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libglew.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

var LibraryGLEW = {
$GLEW__deps: ['glGetString', '$stringToNewUTF8', '$UTF8ToString', '$webglGetExtensions'],
$GLEW__deps: ['glGetString', '$stringToNewUTF8', '$webglGetExtensions'],
$GLEW: {
isLinaroFork: 1,
extensions: null,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/libglut.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ var LibraryGLUT = {
},

glutDestroyWindow__proxy: 'sync',
glutDestroyWindow__deps: ['$Browser'],
glutDestroyWindow: (name) => {
delete Module['ctx'];
return 1;
Expand All @@ -601,7 +600,7 @@ var LibraryGLUT = {
},

glutPositionWindow__proxy: 'sync',
glutPositionWindow__deps: ['$GLUT', 'glutPostRedisplay'],
glutPositionWindow__deps: ['$Browser', 'glutPostRedisplay'],
glutPositionWindow: (x, y) => {
Browser.exitFullscreen();
/* TODO */
Expand Down
8 changes: 7 additions & 1 deletion src/lib/libhtml5.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ var LibraryHTML5 = {
#if PTHREADS
'_emscripten_run_callback_on_thread',
#endif
#if EXIT_RUNTIME
'$addOnExit',
#endif
],
$JSEvents: {

Expand Down Expand Up @@ -1418,7 +1420,11 @@ var LibraryHTML5 = {
return doRequestFullscreen(target, strategy);
},

emscripten_enter_soft_fullscreen__deps: ['$JSEvents', '$hideEverythingExceptGivenElement', '$restoreOldWindowedStyle', '$restoreHiddenElements', '$currentFullscreenStrategy', '$softFullscreenResizeWebGLRenderTarget', '$JSEvents_resizeCanvasForFullscreen', '$findEventTarget', '$callCanvasResizedCallback'],
emscripten_enter_soft_fullscreen__deps: [
#if PTHREADS
'$JSEvents',
#endif
'$hideEverythingExceptGivenElement', '$restoreOldWindowedStyle', '$restoreHiddenElements', '$currentFullscreenStrategy', '$softFullscreenResizeWebGLRenderTarget', '$JSEvents_resizeCanvasForFullscreen', '$findEventTarget', '$callCanvasResizedCallback'],
Comment thread
sbc100 marked this conversation as resolved.
emscripten_enter_soft_fullscreen__proxy: 'sync',
emscripten_enter_soft_fullscreen: (target, fullscreenStrategy) => {
#if !DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR
Expand Down
3 changes: 2 additions & 1 deletion src/lib/libnoderawfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

addToLibrary({
$NODERAWFS__deps: ['$ERRNO_CODES', '$FS', '$NODEFS', '$TTY', '$mmapAlloc', '$FS_modeStringToFlags', '$NODERAWFS_stream_funcs'],
$NODERAWFS__deps: ['$ERRNO_CODES', '$FS', '$NODEFS', '$TTY', '$FS_modeStringToFlags', '$NODERAWFS_stream_funcs'],
Comment thread
sbc100 marked this conversation as resolved.
$NODERAWFS__postset: `
if (!ENVIRONMENT_IS_NODE) {
throw new Error('NODERAWFS is currently only supported on Node.js environment.')
Expand Down Expand Up @@ -220,6 +220,7 @@ addToLibrary({
* could either be a stream created by NODERAWFS itself, or, for example
* one created by PIPEFS. We wrap all these function in an extra check.
*/
$NODERAWFS_stream_funcs__deps: ['$mmapAlloc'],
$NODERAWFS_stream_funcs: {
close(stream) {
VFS.closeStream(stream.fd);
Expand Down
10 changes: 6 additions & 4 deletions src/lib/libpthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ var LibraryPThread = {
$PThread__deps: ['_emscripten_thread_init',
'$terminateWorker',
'$cleanupThread',
#if !MINIMAL_RUNTIME && PTHREAD_POOL_SIZE
'$addOnPreRun',
#if MAIN_MODULE
'$markAsFinished',
#endif
#if !MINIMAL_RUNTIME && PTHREAD_POOL_SIZE && !PTHREAD_POOL_DELAY_LOAD
#if !PTHREAD_POOL_DELAY_LOAD
'$addRunDependency',
'$removeRunDependency',
#endif
#endif
#if MAIN_MODULE
'$markAsFinished',
#endif
'$spawnThread',
'_emscripten_thread_free_data',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/libsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

var LibrarySDL = {
$SDL__deps: [
'$PATH', '$Browser', 'SDL_GetTicks', 'SDL_LockSurface',
'$Browser', 'SDL_GetTicks', 'SDL_LockSurface',
'$MainLoop',
'$warnOnce',
// For makeCEvent().
Expand Down Expand Up @@ -3079,6 +3079,7 @@ var LibrarySDL = {
return 0;
},

TTF_OpenFont__deps: ['$PATH'],
TTF_OpenFont__proxy: 'sync',
TTF_OpenFont: (name, size) => {
name = PATH.normalize(UTF8ToString(name));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libsockfs_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ var NodeSockFSLibrary = {
});
},
},
$nodeSockOps__deps: ['$nodeSockHelpers', '$SOCKFS', '$ERRNO_CODES', '$readI53FromI64', '$writeI53ToI64'],
$nodeSockOps__deps: ['$nodeSockHelpers', '$SOCKFS', '$readI53FromI64', '$writeI53ToI64'],
$nodeSockOps__postset: `
if (!ENVIRONMENT_IS_NODE) {
throw new Error('NODERAWSOCKETS is currently only supported on Node.js environment.')
Expand Down
11 changes: 7 additions & 4 deletions src/lib/libwasmfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,21 @@ addToLibrary({
'$PATH',
'$stringToUTF8OnStack',
'$withStackSave',
'$readI53FromI64',
'$readI53FromU64',
'$FS_createDataFile',
'$FS_createPreloadedFile',
'$FS_preloadFile',
'$FS_getMode',
// For FS.readFile
'$UTF8ArrayToString',
#if hasExportedSymbol('_wasmfs_read_file') || FORCE_FILESYSTEM || INCLUDE_FULL_LIBRARY
'$readI53FromI64',
#endif
#if hasExportedSymbol('_wasmfs_read_file') || hasExportedSymbol('_wasmfs_get_cwd') || FORCE_FILESYSTEM || INCLUDE_FULL_LIBRARY
'$UTF8ToString',
#endif
#if FORCE_FILESYSTEM || INCLUDE_FULL_LIBRARY // FULL_LIBRARY will include JS
// code in other places that ends
// up requiring all of our code
// here.
'$readI53FromU64',
'$FS_modeStringToFlags',
'$FS_create',
'$FS_mknod',
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_dylink_all.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"a.out.js": 272709,
"a.out.js": 272705,
"a.out.nodebug.wasm": 588152,
"total": 860861,
"total": 860857,
"sent": [
"IMG_Init",
"IMG_Load",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_minimal_pthreads.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 6930,
"a.out.js.gz": 3435,
"a.out.js": 6889,
"a.out.js.gz": 3411,
"a.out.nodebug.wasm": 19139,
"a.out.nodebug.wasm.gz": 8818,
"total": 26069,
"total_gz": 12253,
"total": 26028,
"total_gz": 12229,
"sent": [
"a (memory)",
"b (exit)",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_minimal_pthreads_memgrowth.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 7388,
"a.out.js.gz": 3652,
"a.out.js": 7347,
"a.out.js.gz": 3626,
"a.out.nodebug.wasm": 19140,
"a.out.nodebug.wasm.gz": 8819,
"total": 26528,
"total_gz": 12471,
"total": 26487,
"total_gz": 12445,
"sent": [
"a (memory)",
"b (exit)",
Expand Down
Loading