Skip to content
Open
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
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"acorn": "^8.18.0",
"acorn-import-phases": "^1.0.4",
"google-closure-compiler": "20260726.0.0",
"google-closure-compiler": "20260831.0.0",
"html-minifier-terser": "7.2.0"
},
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions src/closure-externs/closure-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ WebAssembly.Exception.stack;
* Note: Closure compiler does not support function overloading, omit this overload for now.
* {function(!WebAssembly.Module, Object=):!Promise<!WebAssembly.Instance>}
*/
/**
* @returns {ArrayBuffer}
*/
WebAssembly.Memory.prototype.toResizableBuffer = function() {};
/**
* @param {!Function} func
* @returns {Function}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libwebgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
// version field in above check.
if (!canvas.getContextSafariWebGL2Fixed) {
canvas.getContextSafariWebGL2Fixed = canvas.getContext;
/** @type {function(this:HTMLCanvasElement, string, (Object|null)=): (Object|null)} */
/** @type {function(this:HTMLCanvasElement, string, (Object|null)=): (RenderingContext|null)} */
function fixedGetContext(ver, attrs) {
var gl = canvas.getContextSafariWebGL2Fixed(ver, attrs);
return ((ver == 'webgl') == (gl instanceof WebGLRenderingContext)) ? gl : null;
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_ctors1.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19224,
"a.out.js.gz": 8124,
"a.out.js": 19225,
"a.out.js.gz": 8125,
"a.out.nodebug.wasm": 133884,
"a.out.nodebug.wasm.gz": 51214,
"total": 153108,
"total_gz": 59338,
"total": 153109,
"total_gz": 59339,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_ctors2.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19201,
"a.out.js.gz": 8107,
"a.out.js": 19202,
"a.out.js.gz": 8109,
"a.out.nodebug.wasm": 133313,
"a.out.nodebug.wasm.gz": 50910,
"total": 152514,
"total_gz": 59017,
"total": 152515,
"total_gz": 59019,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 22917,
"a.out.js.gz": 9078,
"a.out.js": 22919,
"a.out.js.gz": 9082,
"a.out.nodebug.wasm": 176341,
"a.out.nodebug.wasm.gz": 58740,
"total": 199258,
"total_gz": 67818,
"total": 199260,
"total_gz": 67822,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except_wasm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19023,
"a.out.js.gz": 8039,
"a.out.js": 19024,
"a.out.js.gz": 8041,
"a.out.nodebug.wasm": 149601,
"a.out.nodebug.wasm.gz": 56302,
"total": 168624,
"total_gz": 64341,
"total": 168625,
"total_gz": 64343,
"sent": [
"_abort_js",
"_tzset_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except_wasm_legacy.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19101,
"a.out.js.gz": 8065,
"a.out.js": 19102,
"a.out.js.gz": 8066,
"a.out.nodebug.wasm": 147383,
"a.out.nodebug.wasm.gz": 55981,
"total": 166484,
"total_gz": 64046,
"total": 166485,
"total_gz": 64047,
"sent": [
"_abort_js",
"_tzset_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_mangle.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 22967,
"a.out.js.gz": 9098,
"a.out.js": 22969,
"a.out.js.gz": 9103,
"a.out.nodebug.wasm": 242621,
"a.out.nodebug.wasm.gz": 80965,
"total": 265588,
"total_gz": 90063,
"total": 265590,
"total_gz": 90068,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_noexcept.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19224,
"a.out.js.gz": 8124,
"a.out.js": 19225,
"a.out.js.gz": 8125,
"a.out.nodebug.wasm": 135794,
"a.out.nodebug.wasm.gz": 51836,
"total": 155018,
"total_gz": 59960,
"total": 155019,
"total_gz": 59961,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_file_preload.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 22203,
"a.out.js.gz": 9267,
"a.out.js": 22205,
"a.out.js.gz": 9269,
"a.out.nodebug.wasm": 1198,
"a.out.nodebug.wasm.gz": 730,
"total": 23401,
"total_gz": 9997,
"total": 23403,
"total_gz": 9999,
"sent": [
"a (fd_write)"
],
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_O0.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 23471,
"a.out.js.gz": 8555,
"a.out.js.gz": 8556,
"a.out.nodebug.wasm": 14228,
"a.out.nodebug.wasm.gz": 7062,
"total": 37699,
"total_gz": 15617,
"total_gz": 15618,
"sent": [
"fd_write"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_dylink.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 26258,
"a.out.js.gz": 11211,
"a.out.js": 26261,
"a.out.js.gz": 11210,
"a.out.nodebug.wasm": 16992,
"a.out.nodebug.wasm.gz": 8679,
"total": 43250,
"total_gz": 19890,
"total": 43253,
"total_gz": 19889,
"sent": [
"__syscall_stat64",
"emscripten_resize_heap",
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": 270584,
"a.out.js": 270729,
"a.out.nodebug.wasm": 588233,
"total": 858817,
"total": 858962,
"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": 6883,
"a.out.js.gz": 3422,
"a.out.js": 6895,
"a.out.js.gz": 3425,
"a.out.nodebug.wasm": 19132,
"a.out.nodebug.wasm.gz": 8845,
"total": 26015,
"total_gz": 12267,
"total": 26027,
"total_gz": 12270,
"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": 7341,
"a.out.js.gz": 3639,
"a.out.js": 7353,
"a.out.js.gz": 3642,
"a.out.nodebug.wasm": 19133,
"a.out.nodebug.wasm.gz": 8846,
"total": 26474,
"total_gz": 12485,
"total": 26486,
"total_gz": 12488,
"sent": [
"a (memory)",
"b (exit)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"a.html": 17338,
"a.html.gz": 7629
"a.html": 17341,
"a.html.gz": 7631
}
23 changes: 23 additions & 0 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
diagnostics,
feature_matrix,
js_optimizer,
ports,
response_file,
shared,
utils,
Expand Down Expand Up @@ -570,6 +571,26 @@ def version_split(v):
return f'{int(major)}.{int(minor)}.{int(rev)}'


def filter_closure_args(args):
# TODO: this can be removed once emdawnwebgpu no longer passes in
# --externs=webgpu-externs.js
# Closure compiler includes WebGPU externs natively (w3c_webgpu.js).
# Exclude webgpu-externs.js (provided by emdawnwebgpu) to avoid duplicate definition errors.
filtered = []
skip_next = False
for i, arg in enumerate(args):
if skip_next:
skip_next = False
continue
if arg == '--externs' and i + 1 < len(args) and args[i + 1].strip('\'"').endswith('webgpu-externs.js'):
skip_next = True
continue
if arg.startswith('--externs=') and arg.split('=', 1)[1].strip('\'"').endswith('webgpu-externs.js'):
continue
filtered.append(arg)
return filtered


@ToolchainProfiler.profile()
def closure_compiler(filename, advanced=True, extra_closure_args=None):
user_args = []
Expand All @@ -578,6 +599,8 @@ def closure_compiler(filename, advanced=True, extra_closure_args=None):
user_args += shlex.split(env_args)
if extra_closure_args:
user_args += extra_closure_args
if any('emdawnwebgpu' in p.name for p in ports.get_needed_ports(settings)):
user_args = filter_closure_args(user_args)

closure_cmd, env = get_closure_compiler_and_env(user_args)

Expand Down
Loading