-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't force the use of imported memory under WASM2JS (#21195)
Setting `IMPORTED_MEMORY` can have other implications and don't want t by default just because we chose WASM2JS. The there is a very minor code size regression here that only effects WASM2JS, but when combined with #21196 the overall effect is still a win. See #21071
- Loading branch information
Showing
7 changed files
with
66 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"a.html": 567, | ||
"a.html.gz": 379, | ||
"a.js": 17760, | ||
"a.js.gz": 7958, | ||
"a.js": 17790, | ||
"a.js.gz": 7987, | ||
"a.mem": 3123, | ||
"a.mem.gz": 2693, | ||
"total": 21450, | ||
"total_gz": 11030 | ||
"total": 21480, | ||
"total_gz": 11059 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"a.html": 567, | ||
"a.html.gz": 379, | ||
"a.js": 17239, | ||
"a.js.gz": 7781, | ||
"a.js": 17263, | ||
"a.js.gz": 7819, | ||
"a.mem": 3123, | ||
"a.mem.gz": 2693, | ||
"total": 20929, | ||
"total_gz": 10853 | ||
"total": 20953, | ||
"total_gz": 10891 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,64 @@ | ||
var b = Module, g = new function(a) { | ||
this.buffer = new ArrayBuffer(65536 * a.initial); | ||
}({ | ||
initial: 256, | ||
maximum: 256 | ||
}), k = g.buffer, d = new Uint8Array(k), l = new TextDecoder("utf8"), m; | ||
var c = Module, g, h, k = new TextDecoder("utf8"), l; | ||
|
||
function c(a) { | ||
this.exports = function(h) { | ||
function n(f) { | ||
f.set = function(e, p) { | ||
this[e] = p; | ||
function d(b) { | ||
this.exports = function(f) { | ||
function m(e) { | ||
e.set = function(a, n) { | ||
this[a] = n; | ||
}; | ||
f.get = function(e) { | ||
return this[e]; | ||
e.get = function(a) { | ||
return this[a]; | ||
}; | ||
return f; | ||
return e; | ||
} | ||
return function(f) { | ||
var e = f.a.a; | ||
return function(e) { | ||
var a = new ArrayBuffer(16777216), n = e.a.a; | ||
e = m([]); | ||
return { | ||
b: function() {}, | ||
c: function(p, q) { | ||
e(1024); | ||
b: Object.create(Object.prototype, { | ||
grow: {}, | ||
buffer: { | ||
get: function() { | ||
return a; | ||
} | ||
} | ||
}), | ||
c: function() {}, | ||
d: function(p, q) { | ||
n(1024); | ||
return 0; | ||
}, | ||
d: n([]) | ||
e: e | ||
}; | ||
}(h); | ||
}(a); | ||
}(f); | ||
}(b); | ||
} | ||
|
||
(function(a, h) { | ||
(function(b, f) { | ||
return { | ||
then: function(n) { | ||
n({ | ||
instance: new c(h) | ||
then: function(m) { | ||
m({ | ||
instance: new d(f) | ||
}); | ||
} | ||
}; | ||
})(b.wasm, { | ||
})(c.wasm, { | ||
a: { | ||
a: a => { | ||
var h = console, n = h.log; | ||
if (a) { | ||
for (var f = a + void 0, e = a; !(e >= f) && d[e]; ) ++e; | ||
a = l.decode(d.subarray(a, e)); | ||
} else a = ""; | ||
n.call(h, a); | ||
}, | ||
memory: g | ||
a: b => { | ||
var f = console, m = f.log; | ||
if (b) { | ||
for (var e = b + void 0, a = b; !(a >= e) && g[a]; ) ++a; | ||
b = k.decode(g.subarray(b, a)); | ||
} else b = ""; | ||
m.call(f, b); | ||
} | ||
} | ||
}).then((a => { | ||
a = a.instance.exports; | ||
m = a.c; | ||
d.set(new Uint8Array(b.mem), 1024); | ||
a.b(); | ||
m(); | ||
}).then((b => { | ||
b = b.instance.exports; | ||
l = b.d; | ||
h = b.b; | ||
g = new Uint8Array(h.buffer); | ||
g.set(new Uint8Array(c.mem), 1024); | ||
b.c(); | ||
l(); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"a.html": 671, | ||
"a.html.gz": 430, | ||
"a.js": 692, | ||
"a.js.gz": 430, | ||
"a.js": 708, | ||
"a.js.gz": 444, | ||
"a.mem": 6, | ||
"a.mem.gz": 32, | ||
"total": 1369, | ||
"total_gz": 892 | ||
"total": 1385, | ||
"total_gz": 906 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"a.html": 17264, | ||
"a.html.gz": 7529, | ||
"total": 17264, | ||
"total_gz": 7529 | ||
"a.html": 17279, | ||
"a.html.gz": 7541, | ||
"total": 17279, | ||
"total_gz": 7541 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters