cfsolve 0.1.3 → 0.1.5
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/README.md +30 -5
- data/UPSTREAM.md +24 -3
- data/lib/cfsolve/profiles/safari-26-ios/answers.json +805 -797
- data/lib/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +909 -899
- data/lib/cfsolve/version.rb +2 -2
- data/lib/cfsolve.rb +21 -10
- data/vendor/cfsolve/examples/listing_dump.rs +24 -0
- data/vendor/cfsolve/examples/probe_similarity.rs +37 -0
- data/vendor/cfsolve/examples/rebase_reference.rs +96 -0
- data/vendor/cfsolve/examples/reread_capture.rs +31 -0
- data/vendor/cfsolve/examples/turnstile_smoke.rs +79 -0
- data/vendor/cfsolve/profiles/safari-26-ios/answers.json +805 -797
- data/vendor/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +909 -899
- data/vendor/cfsolve/src/capture/sessions.rs +88 -4
- data/vendor/cfsolve/src/capture.rs +1 -0
- data/vendor/cfsolve/src/deobfuscate/ast.rs +16 -0
- data/vendor/cfsolve/src/deobfuscate/control_flow.rs +1 -1
- data/vendor/cfsolve/src/deobfuscate/dead_branches.rs +33 -0
- data/vendor/cfsolve/src/deobfuscate/merged_functions.rs +24 -4
- data/vendor/cfsolve/src/embedding_page/extra_params.rs +3 -3
- data/vendor/cfsolve/src/embedding_page/page.rs +76 -65
- data/vendor/cfsolve/src/stage2/analysis/discovery.rs +7 -4
- data/vendor/cfsolve/src/stage2/benchmark.rs +29 -8
- data/vendor/cfsolve/src/stage2/call_stack.rs +134 -95
- data/vendor/cfsolve/src/stage2/challenge_page.rs +10 -3
- data/vendor/cfsolve/src/stage2/probes/parent_info.rs +345 -61
- data/vendor/cfsolve/src/stage2/probes/performance.rs +42 -5
- data/vendor/cfsolve/src/stage2/probes/stack.rs +41 -0
- data/vendor/cfsolve/src/stage2/probes/websocket_echo.rs +11 -2
- data/vendor/cfsolve/src/stage2/reference.json +1 -1
- data/vendor/cfsolve/src/stage2/reference.rs +70 -110
- data/vendor/cfsolve/src/stage2/registry.rs +4 -3
- data/vendor/cfsolve/src/stage2/trace.rs +1 -1
- data/vendor/cfsolve/src/vm/dataflow.rs +15 -6
- data/vendor/cfsolve/src/vm/disassemble.rs +2 -1
- data/vendor/cfsolve/src/vm/encoded_strings.rs +1553 -0
- data/vendor/cfsolve/src/vm/extract.rs +205 -152
- data/vendor/cfsolve/src/vm/interpret/access.rs +0 -2
- data/vendor/cfsolve/src/vm/interpret/builtin.rs +0 -13
- data/vendor/cfsolve/src/vm/interpret/intrinsic.rs +30 -7
- data/vendor/cfsolve/src/vm/interpret/mix32.rs +216 -86
- data/vendor/cfsolve/src/vm/interpret/native_dispatch.rs +42 -21
- data/vendor/cfsolve/src/vm/interpret/pattern.rs +268 -67
- data/vendor/cfsolve/src/vm/interpret/register_helpers.rs +261 -30
- data/vendor/cfsolve/src/vm/machine.rs +14 -12
- data/vendor/cfsolve/src/vm/output.rs +4 -1
- data/vendor/cfsolve/src/vm/registers.rs +17 -23
- data/vendor/cfsolve/src/vm/session.rs +9 -4
- data/vendor/cfsolve/src/vm.rs +1 -0
- metadata +7 -1
|
@@ -31,148 +31,114 @@ pub(crate) static REFERENCE: LazyLock<Reference> = LazyLock::new(|| {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
/// The challenge option (`_cf_chl_opt`) naming the platform segment of a probe's request path.
|
|
34
|
-
pub(crate) const PLATFORM_OPTION: &str = "
|
|
34
|
+
pub(crate) const PLATFORM_OPTION: &str = "_e30715545c342d2c7172508f";
|
|
35
35
|
/// The option holding the session's ray, which the worker fetch requests.
|
|
36
|
-
pub(crate) const RAY_OPTION: &str = "
|
|
36
|
+
pub(crate) const RAY_OPTION: &str = "_b57b772c6cbf614381ea1c9b";
|
|
37
37
|
/// The option holding the nonce the worker fetch requests.
|
|
38
|
-
pub(crate) const NONCE_OPTION: &str = "
|
|
38
|
+
pub(crate) const NONCE_OPTION: &str = "_5f03e51a908e7c7f4a90a1ca";
|
|
39
39
|
|
|
40
40
|
/// Shared result field used by clock and private-token probes.
|
|
41
|
-
pub(crate) const SHARED_RESULT: &str = "
|
|
41
|
+
pub(crate) const SHARED_RESULT: &str = "_62845f21bd76642fe7607006";
|
|
42
42
|
|
|
43
43
|
/// What the clock probe reports when its worker fails.
|
|
44
|
-
pub(crate) const CLOCK_FALLBACK: &str = "
|
|
44
|
+
pub(crate) const CLOCK_FALLBACK: &str = "_7de8bfec8afbfc6c0a7f7228";
|
|
45
45
|
|
|
46
|
-
pub(crate) const DATES_TODAY: &str = "
|
|
47
|
-
pub(crate) const DATES_OFFSET: &str = "
|
|
48
|
-
pub(crate) const DATES_ZONE: &str = "
|
|
46
|
+
pub(crate) const DATES_TODAY: &str = "_8462a594ae41b7c8900438ca";
|
|
47
|
+
pub(crate) const DATES_OFFSET: &str = "_daa71e2bf5d4de20599870b8";
|
|
48
|
+
pub(crate) const DATES_ZONE: &str = "_606c6ae129decf99cc72f7bd";
|
|
49
49
|
|
|
50
|
-
pub(crate) const DOM_MUTATION_RESULT: &str = "
|
|
50
|
+
pub(crate) const DOM_MUTATION_RESULT: &str = "_ab16b242260d08ce77aaf2d7";
|
|
51
51
|
|
|
52
52
|
// Environment and environment-audit names with session-specific replay patches.
|
|
53
53
|
|
|
54
54
|
/// The environment probe's `document.referrer`.
|
|
55
|
-
pub(crate) const ENVIRONMENT_REFERRER: &str = "
|
|
55
|
+
pub(crate) const ENVIRONMENT_REFERRER: &str = "_6adf411141c3ede7490c3a87";
|
|
56
56
|
/// The audit's groups of readers, by the value they read.
|
|
57
|
-
pub(crate) const ENVIRONMENT_AUDIT_GROUPS: &str = "
|
|
57
|
+
pub(crate) const ENVIRONMENT_AUDIT_GROUPS: &str = "_498acb3af906a5f1ad524b55";
|
|
58
58
|
/// The audit's measured values.
|
|
59
|
-
pub(crate) const ENVIRONMENT_AUDIT_VALUES: &str = "
|
|
59
|
+
pub(crate) const ENVIRONMENT_AUDIT_VALUES: &str = "_58775d9322eb1c51ea1c9de3";
|
|
60
60
|
/// Navigation decoded size minus a Server-Timing duration.
|
|
61
|
-
pub(crate) const ENVIRONMENT_AUDIT_REDUCTION: &str = "
|
|
61
|
+
pub(crate) const ENVIRONMENT_AUDIT_REDUCTION: &str = "_fc47349735427db7e5f565e1";
|
|
62
62
|
/// Navigation decoded size.
|
|
63
|
-
pub(crate) const ENVIRONMENT_AUDIT_DECODED: &str = "
|
|
63
|
+
pub(crate) const ENVIRONMENT_AUDIT_DECODED: &str = "_d1e50e6ff9e2ba34399058f3";
|
|
64
64
|
/// Navigation encoded size.
|
|
65
|
-
pub(crate) const ENVIRONMENT_AUDIT_ENCODED: &str = "
|
|
65
|
+
pub(crate) const ENVIRONMENT_AUDIT_ENCODED: &str = "_ea7ac764fd2860c697cbf813";
|
|
66
66
|
/// Whether the probe's frame supports touch events.
|
|
67
|
-
pub(crate) const ENVIRONMENT_AUDIT_TOUCH: &str = "
|
|
67
|
+
pub(crate) const ENVIRONMENT_AUDIT_TOUCH: &str = "_9cd866a3511f517879f4516b";
|
|
68
68
|
/// The probe frame's `isSecureContext` value.
|
|
69
|
-
pub(crate) const ENVIRONMENT_AUDIT_SECURE: &str = "
|
|
69
|
+
pub(crate) const ENVIRONMENT_AUDIT_SECURE: &str = "_05547ddcb67150366764f887";
|
|
70
70
|
/// The value of `Notification.permission`.
|
|
71
|
-
pub(crate) const ENVIRONMENT_AUDIT_PERMISSION: &str = "
|
|
71
|
+
pub(crate) const ENVIRONMENT_AUDIT_PERMISSION: &str = "_ae82ebb109ab253d3f05a980";
|
|
72
72
|
|
|
73
73
|
/// The isolation probe's results for blocked evaluation and cross-origin history writes.
|
|
74
74
|
pub(crate) const ISOLATION_FAILURE_FIELDS: [&str; 2] =
|
|
75
|
-
["
|
|
76
|
-
pub(crate) const STYLESHEETS_TEXT: &str = "
|
|
77
|
-
pub(crate) const STYLESHEETS_HASH: &str = "
|
|
78
|
-
|
|
79
|
-
pub(crate) const ERROR_MESSAGE_LENGTH_RESULT: &str = "
|
|
80
|
-
|
|
81
|
-
pub(crate) const IMAGE_WIDTH: &str = "
|
|
82
|
-
pub(crate) const IMAGE_HEIGHT: &str = "
|
|
83
|
-
pub(crate) const IMAGE_EFFECTIVE_TYPE: &str = "
|
|
84
|
-
pub(crate) const IMAGE_ONLINE: &str = "
|
|
85
|
-
pub(crate) const IMAGE_COMPLETE: &str = "
|
|
86
|
-
pub(crate) const IMAGE_NATURAL_WIDTH: &str = "
|
|
87
|
-
pub(crate) const IMAGE_TIMESTAMP: &str = "
|
|
75
|
+
["_0d933758da8afefe31570be9", "_f25bb13aa3dd8a386af7c1dc"];
|
|
76
|
+
pub(crate) const STYLESHEETS_TEXT: &str = "_fc71c1abadf551a615b367db";
|
|
77
|
+
pub(crate) const STYLESHEETS_HASH: &str = "_137a63be904787b00109cacd";
|
|
78
|
+
|
|
79
|
+
pub(crate) const ERROR_MESSAGE_LENGTH_RESULT: &str = "_81fab77ed2f23f790181a6f7";
|
|
80
|
+
|
|
81
|
+
pub(crate) const IMAGE_WIDTH: &str = "_78a72dd3637eb6fb0b4f86d4";
|
|
82
|
+
pub(crate) const IMAGE_HEIGHT: &str = "_5daa91bb069e46e542190bad";
|
|
83
|
+
pub(crate) const IMAGE_EFFECTIVE_TYPE: &str = "_2d11906e809fc8fd8574d281";
|
|
84
|
+
pub(crate) const IMAGE_ONLINE: &str = "_c744ece5552965265043fa60";
|
|
85
|
+
pub(crate) const IMAGE_COMPLETE: &str = "_8d310517c48e7b458e12ef89";
|
|
86
|
+
pub(crate) const IMAGE_NATURAL_WIDTH: &str = "_8cd60bdd4935672b05587476";
|
|
87
|
+
pub(crate) const IMAGE_TIMESTAMP: &str = "_12b0e3e0814b017bd235bc6e";
|
|
88
88
|
/// What the probe reports as both dimensions when the image fails to load.
|
|
89
|
-
pub(crate) const IMAGE_LOAD_ERROR: &str = "
|
|
89
|
+
pub(crate) const IMAGE_LOAD_ERROR: &str = "_df3d3a69189f46fae9de3d46";
|
|
90
90
|
/// Dimension values reported before the image load finishes.
|
|
91
|
-
pub(crate) const IMAGE_PENDING: &str = "
|
|
91
|
+
pub(crate) const IMAGE_PENDING: &str = "_951054c8356dc7089dd99299";
|
|
92
92
|
/// The key the probe's worker replies with when its deadline passes.
|
|
93
|
-
pub(crate) const IMAGE_WORKER_TIMEOUT: &str = "
|
|
93
|
+
pub(crate) const IMAGE_WORKER_TIMEOUT: &str = "_f91aefe3a5aa9c6bd7b610d8";
|
|
94
94
|
/// A name the probe shares with the other probes that await a promise.
|
|
95
|
-
pub(crate) const IMAGE_AWAITING: &str = "
|
|
96
|
-
|
|
97
|
-
pub(crate) const MEDIA_STATE: &str = "
|
|
98
|
-
pub(crate) const MEDIA_CODECS: &str = "
|
|
99
|
-
pub(crate) const MEDIA_CANDIDATES: &str = "
|
|
100
|
-
pub(crate) const MEDIA_SDP: &str = "
|
|
101
|
-
pub(crate) const MEDIA_SUPPORT: &str = "
|
|
102
|
-
pub(crate) const MEDIA_ICE_STATE: &str = "
|
|
103
|
-
pub(crate) const MEDIA_UNAVAILABLE: &str = "
|
|
104
|
-
pub(crate) const MEDIA_CANDIDATE: &str = "
|
|
105
|
-
pub(crate) const MEDIA_CANDIDATE_TIME: &str = "
|
|
106
|
-
pub(crate) const MEDIA_DATA_CHANNEL: &str = "
|
|
107
|
-
pub(crate) const MEDIA_REUSED: &str = "
|
|
108
|
-
pub(crate) const MEDIA_PRIOR_COUNT: &str = "
|
|
109
|
-
pub(crate) const MEDIA_FIRST_CANDIDATE: &str = "
|
|
110
|
-
pub(crate) const MEDIA_ELAPSED: &str = "
|
|
111
|
-
pub(crate) const MEDIA_CHANNEL_ERROR: &str = "
|
|
112
|
-
pub(crate) const MEDIA_SEED_OFFER_ERROR: &str = "
|
|
113
|
-
pub(crate) const MEDIA_SEED_GATHER_ERROR: &str = "
|
|
95
|
+
pub(crate) const IMAGE_AWAITING: &str = "_68b6422aa18fedc6d9fa7dc3";
|
|
96
|
+
|
|
97
|
+
pub(crate) const MEDIA_STATE: &str = "_f7da15e7ffdacb47a0cdfdf0";
|
|
98
|
+
pub(crate) const MEDIA_CODECS: &str = "_138e30bf2198594f2ded2588";
|
|
99
|
+
pub(crate) const MEDIA_CANDIDATES: &str = "_47d0c4f028335a349928a882";
|
|
100
|
+
pub(crate) const MEDIA_SDP: &str = "_c07cc41874125a9add025bfd";
|
|
101
|
+
pub(crate) const MEDIA_SUPPORT: &str = "_3354f14d23df4b2a88c3fa44";
|
|
102
|
+
pub(crate) const MEDIA_ICE_STATE: &str = "_f6d472be910ab1d7322bbadf";
|
|
103
|
+
pub(crate) const MEDIA_UNAVAILABLE: &str = "_53a4bc8e7faec89e93d6b000";
|
|
104
|
+
pub(crate) const MEDIA_CANDIDATE: &str = "_f6e0345d8c29ab2055f72609";
|
|
105
|
+
pub(crate) const MEDIA_CANDIDATE_TIME: &str = "_b77ac88bc96e1b8f478fee4a";
|
|
106
|
+
pub(crate) const MEDIA_DATA_CHANNEL: &str = "_538af0a1cfc635f286a37a76";
|
|
107
|
+
pub(crate) const MEDIA_REUSED: &str = "_c72defce69f0c94b1c40b17a";
|
|
108
|
+
pub(crate) const MEDIA_PRIOR_COUNT: &str = "_ba31acd3ba1c651c58268d2c";
|
|
109
|
+
pub(crate) const MEDIA_FIRST_CANDIDATE: &str = "_cd80a8ef68163ad6ce4c080e";
|
|
110
|
+
pub(crate) const MEDIA_ELAPSED: &str = "_fa5971a527a24b1a95854b8c";
|
|
111
|
+
pub(crate) const MEDIA_CHANNEL_ERROR: &str = "_5074ccd3d62b20984013a86b";
|
|
112
|
+
pub(crate) const MEDIA_SEED_OFFER_ERROR: &str = "_53089dcf29654deafd766592";
|
|
113
|
+
pub(crate) const MEDIA_SEED_GATHER_ERROR: &str = "_c781a8c6e10f1962d6344856";
|
|
114
114
|
|
|
115
115
|
/// Recognition recovers the network information probe's output names from the probe itself.
|
|
116
116
|
#[cfg(test)]
|
|
117
117
|
pub(crate) const NETWORK_INFORMATION_OUTPUTS: [&str; 6] = [
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
pub(crate) const PARENT_INFO_REFERRER: &str = "_31a6173d1692e77e5a1005d5";
|
|
127
|
-
pub(crate) const PARENT_INFO_MISSING: &str = "_10450802c4fb954516e0c07b";
|
|
128
|
-
pub(crate) const PARENT_INFO_REASONS: &str = "_cd7d13df270697c8781d261c";
|
|
129
|
-
pub(crate) const PARENT_INFO_VISIBILITY: &str = "_4172551fe148377bcda1f7b5";
|
|
130
|
-
/// The output the embedding page's `pad` property is copied to.
|
|
131
|
-
pub(crate) const PARENT_INFO_PAD: &str = "_e5caf599351485e860642415";
|
|
132
|
-
/// Pairs of output fields and parent-info properties copied directly.
|
|
133
|
-
pub(crate) const PARENT_INFO_DIRECT: [(&str, &str); 16] = [
|
|
134
|
-
("_6e1dc8b6953acf52c04a8602", "vDuh"),
|
|
135
|
-
("_4f08666db7270b9f907f663c", "vDie"),
|
|
136
|
-
("_c8cb367a7b94d575149530e3", "xp"),
|
|
137
|
-
("_5ef82acb130f4537ed9aac35", "wp"),
|
|
138
|
-
("_62193c48d482daf2700a995c", "pfp"),
|
|
139
|
-
("_1c113a764991c259adfcf85b", "sL"),
|
|
140
|
-
("_3da484dbed1006c654fac96e", "ssL"),
|
|
141
|
-
("_c74be140015d9b0e3d256c48", "mL"),
|
|
142
|
-
("_d6f250eb3d24cd44d78bab61", "t"),
|
|
143
|
-
("_1d5d7b99f35d507b3a08a437", "tL"),
|
|
144
|
-
("_af146df9ca80117c88f514dd", "lH"),
|
|
145
|
-
("_cf3a9d328d85b9c7f2ae9457", "sR"),
|
|
146
|
-
("_4c7024270fd2a920c7ce5503", "ii"),
|
|
147
|
-
("_e4689550ed6807ca8acfeff4", "ffp"),
|
|
148
|
-
("_fd302ee89388067a1cfa51d9", "pac"),
|
|
149
|
-
(PARENT_INFO_PAD, "pad"),
|
|
150
|
-
];
|
|
151
|
-
/// Pairs of output fields and parent-info properties copied with an empty-string fallback for
|
|
152
|
-
/// falsy values.
|
|
153
|
-
pub(crate) const PARENT_INFO_FALLBACK: [(&str, &str); 4] = [
|
|
154
|
-
("_3bce4851046c22ddb9da2a5b", "vDmt"),
|
|
155
|
-
("_70346a8995cdbf5b1cd02bc7", "vDhp"),
|
|
156
|
-
("_d9c1b344a652122a42aa8fdf", "vDmd"),
|
|
157
|
-
("_1b4e766af5a14e457b0a4459", "vDa"),
|
|
118
|
+
"_916465939c983b0e34932f10",
|
|
119
|
+
"_ee17ddb325bc2672e4632345",
|
|
120
|
+
"_089f27b0144047a027148655",
|
|
121
|
+
"_120472427ce39965f7989ab9",
|
|
122
|
+
"_7fa3fbe4ce55c442d8ce5ffb",
|
|
123
|
+
"_a19915adb31d352013e44e49",
|
|
158
124
|
];
|
|
159
125
|
|
|
160
|
-
pub(crate) const PRIVATE_TOKEN_ELAPSED: &str = "
|
|
161
|
-
pub(crate) const PRIVATE_TOKEN_ERROR: &str = "
|
|
162
|
-
pub(crate) const PRIVATE_TOKEN_TOKEN: &str = "
|
|
163
|
-
pub(crate) const PRIVATE_TOKEN_TIMESTAMP: &str = "
|
|
126
|
+
pub(crate) const PRIVATE_TOKEN_ELAPSED: &str = "_c2752bbd593e00cd0a557236";
|
|
127
|
+
pub(crate) const PRIVATE_TOKEN_ERROR: &str = "_788b80e93e6f07f8df3a191f";
|
|
128
|
+
pub(crate) const PRIVATE_TOKEN_TOKEN: &str = "_ce8d4c2947640b9eeab9edf5";
|
|
129
|
+
pub(crate) const PRIVATE_TOKEN_TIMESTAMP: &str = "_b9520771bad17798d15b6a4d";
|
|
164
130
|
/// The error the probe reports when its worker reaches its deadline.
|
|
165
|
-
pub(crate) const PRIVATE_TOKEN_TIMEOUT_ERROR: &str = "
|
|
131
|
+
pub(crate) const PRIVATE_TOKEN_TIMEOUT_ERROR: &str = "_5f147af36bc5c883dfb4a8f0";
|
|
166
132
|
/// The flag every reply of the probe's worker sets.
|
|
167
|
-
pub(crate) const PRIVATE_TOKEN_WORKER_REPLIED: &str = "
|
|
133
|
+
pub(crate) const PRIVATE_TOKEN_WORKER_REPLIED: &str = "_bd7744733cde9138e62e7c05";
|
|
168
134
|
/// The reply field holding the worker fetch error.
|
|
169
|
-
pub(crate) const PRIVATE_TOKEN_WORKER_ERROR: &str = "
|
|
135
|
+
pub(crate) const PRIVATE_TOKEN_WORKER_ERROR: &str = "_755032ac06c14e942209534c";
|
|
170
136
|
|
|
171
|
-
pub(crate) const WORKER_FETCH_STATUS: &str = "
|
|
172
|
-
pub(crate) const WORKER_FETCH_TOKEN: &str = "
|
|
137
|
+
pub(crate) const WORKER_FETCH_STATUS: &str = "_34ede69a56e30699295d3fe7";
|
|
138
|
+
pub(crate) const WORKER_FETCH_TOKEN: &str = "_04b7567131213446f02e16b1";
|
|
173
139
|
|
|
174
|
-
pub(crate) const WORKER_NAVIGATOR_INDICATOR: &str = "
|
|
175
|
-
pub(crate) const WORKER_NAVIGATOR_RESULT: &str = "
|
|
140
|
+
pub(crate) const WORKER_NAVIGATOR_INDICATOR: &str = "_4151217be1606ceeefdfdccb";
|
|
141
|
+
pub(crate) const WORKER_NAVIGATOR_RESULT: &str = "_bc44d64454a4d30a2e2a50ea";
|
|
176
142
|
|
|
177
143
|
#[cfg(test)]
|
|
178
144
|
mod tests {
|
|
@@ -229,10 +195,6 @@ mod tests {
|
|
|
229
195
|
(Kind::Media, MEDIA_CHANNEL_ERROR),
|
|
230
196
|
(Kind::Media, MEDIA_SEED_OFFER_ERROR),
|
|
231
197
|
(Kind::Media, MEDIA_SEED_GATHER_ERROR),
|
|
232
|
-
(Kind::ParentInfo, PARENT_INFO_REFERRER),
|
|
233
|
-
(Kind::ParentInfo, PARENT_INFO_MISSING),
|
|
234
|
-
(Kind::ParentInfo, PARENT_INFO_REASONS),
|
|
235
|
-
(Kind::ParentInfo, PARENT_INFO_VISIBILITY),
|
|
236
198
|
(Kind::PrivateToken, PLATFORM_OPTION),
|
|
237
199
|
(Kind::PrivateToken, SHARED_RESULT),
|
|
238
200
|
(Kind::PrivateToken, PRIVATE_TOKEN_ELAPSED),
|
|
@@ -251,8 +213,6 @@ mod tests {
|
|
|
251
213
|
(Kind::WorkerNavigator, WORKER_NAVIGATOR_RESULT),
|
|
252
214
|
];
|
|
253
215
|
names.extend(NETWORK_INFORMATION_OUTPUTS.map(|name| (Kind::NetworkInformation, name)));
|
|
254
|
-
let copied = PARENT_INFO_DIRECT.into_iter().chain(PARENT_INFO_FALLBACK);
|
|
255
|
-
names.extend(copied.map(|(name, _)| (Kind::ParentInfo, name)));
|
|
256
216
|
for (kind, name) in names {
|
|
257
217
|
for &reference in kind.references() {
|
|
258
218
|
assert!(
|
|
@@ -164,8 +164,6 @@ families! {
|
|
|
164
164
|
worker_fetch, "worker_fetch", Reference, Computed, [4];
|
|
165
165
|
Image { fields: image::Fields } =>
|
|
166
166
|
image, "image", Reference, Computed, [33];
|
|
167
|
-
ParentInfo {} =>
|
|
168
|
-
parent_info, "parent_info", Reference, Computed, [7];
|
|
169
167
|
DateParsingOffsets(dates::Fields) =>
|
|
170
168
|
dates, "date_parsing_offsets", Reference, Computed, [21];
|
|
171
169
|
// The payload publishes the error-message length beside the record.
|
|
@@ -189,6 +187,9 @@ families! {
|
|
|
189
187
|
// Rebuilt from the session's own script. The reference build's stack probe is probe 28.
|
|
190
188
|
Stack { fields: stack::Fields } =>
|
|
191
189
|
stack, "stack", Structural, Computed, [28];
|
|
190
|
+
// Its outputs carry no reference names: it reads the embedding page's signals by index.
|
|
191
|
+
ParentInfo { fields: parent_info::Fields } =>
|
|
192
|
+
parent_info, "parent_info", Structural, Computed, [7];
|
|
192
193
|
HostReachability { fields: host_reachability::Fields } =>
|
|
193
194
|
host_reachability, "host_reachability", Structural, Computed, [];
|
|
194
195
|
WebSocketEcho { fields: websocket_echo::Fields } =>
|
|
@@ -366,7 +367,7 @@ impl Operation {
|
|
|
366
367
|
observed.benchmark.as_ref(),
|
|
367
368
|
"benchmark measurements",
|
|
368
369
|
)?)),
|
|
369
|
-
Self::ParentInfo {} => Ok(
|
|
370
|
+
Self::ParentInfo { fields } => Ok(fields.collect(measured(
|
|
370
371
|
observed.page_signals.as_ref(),
|
|
371
372
|
"the embedding page's signals",
|
|
372
373
|
)?)),
|
|
@@ -300,7 +300,7 @@ mod tests {
|
|
|
300
300
|
window.pushTrace(value);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
|
-
window.vlJM8 = function(p) { return new M(p)
|
|
303
|
+
window.vlJM8 = function(p) { return run(new M(p), 0, 1, []); };
|
|
304
304
|
function start() { window.vlJM8("initial", window); }
|
|
305
305
|
function ready() { window.replaceTrace("fresh-root"); start(); }
|
|
306
306
|
function response(body) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
use std::collections::btree_map::Entry;
|
|
5
5
|
use std::collections::{BTreeMap, VecDeque};
|
|
6
|
+
use std::iter;
|
|
6
7
|
use std::ops::ControlFlow;
|
|
7
8
|
|
|
8
9
|
use super::{Listing, Path};
|
|
@@ -22,16 +23,24 @@ impl<K: Ord + Clone, V: PartialEq + Clone> Facts for BTreeMap<K, V> {
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
/// Sets `key` to `value`, or forgets it when `value` is unknown.
|
|
27
|
+
pub(crate) fn assign<K: Ord, V>(facts: &mut BTreeMap<K, V>, key: K, value: Option<V>) {
|
|
28
|
+
match value {
|
|
29
|
+
Some(value) => facts.insert(key, value),
|
|
30
|
+
None => facts.remove(&key),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
/// Computes entry facts for instructions reachable from `entries`. `transfer` updates a copy of
|
|
26
35
|
/// facts for one instruction path and reports whether it can run, or stops the analysis. Facts
|
|
27
36
|
/// propagate through the exit only if the path can run.
|
|
28
37
|
///
|
|
29
38
|
/// Only recorded exits propagate facts, so function entries and hidden branch targets need
|
|
30
39
|
/// explicit entries. Reaching a position without an instruction ends that path.
|
|
31
|
-
pub(crate) fn forward<F: Facts, B>(
|
|
32
|
-
listing: &Listing,
|
|
40
|
+
pub(crate) fn forward<'listing, F: Facts, B>(
|
|
41
|
+
listing: &'listing Listing,
|
|
33
42
|
entries: impl IntoIterator<Item = (u32, F)>,
|
|
34
|
-
mut transfer: impl FnMut(u32, &Path, &mut F) -> ControlFlow<B, bool>,
|
|
43
|
+
mut transfer: impl FnMut(u32, &'listing Path, &mut F) -> ControlFlow<B, bool>,
|
|
35
44
|
) -> ControlFlow<B, BTreeMap<u32, F>> {
|
|
36
45
|
let mut incoming = BTreeMap::new();
|
|
37
46
|
let mut pending = VecDeque::new();
|
|
@@ -42,9 +51,9 @@ pub(crate) fn forward<F: Facts, B>(
|
|
|
42
51
|
let Some(instruction) = listing.instructions.get(&pc) else {
|
|
43
52
|
continue;
|
|
44
53
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
// The last path takes the entry facts rather than a copy.
|
|
55
|
+
let entries = iter::repeat_n(incoming[&pc].clone(), instruction.paths.len());
|
|
56
|
+
for (path, mut facts) in iter::zip(&instruction.paths, entries) {
|
|
48
57
|
match transfer(pc, path, &mut facts) {
|
|
49
58
|
ControlFlow::Break(stop) => return ControlFlow::Break(stop),
|
|
50
59
|
ControlFlow::Continue(false) => continue,
|
|
@@ -21,7 +21,7 @@ use super::interpret::Way;
|
|
|
21
21
|
use super::machine::{Loaded, Machine};
|
|
22
22
|
use super::output::{Constant, Effect, Exit, Hidden, Instruction, Listing, Path, Position, Term};
|
|
23
23
|
use super::value::Value;
|
|
24
|
-
use super::{HashMap, convert, dataflow, packed_names};
|
|
24
|
+
use super::{HashMap, convert, dataflow, encoded_strings, packed_names};
|
|
25
25
|
use crate::{candidates, profiling};
|
|
26
26
|
|
|
27
27
|
impl Machine<'_> {
|
|
@@ -70,6 +70,7 @@ impl Machine<'_> {
|
|
|
70
70
|
listing.failures.sort_unstable_by_key(|failure| failure.pc);
|
|
71
71
|
fuse_method_calls(&mut listing);
|
|
72
72
|
packed_names::fold(&mut listing);
|
|
73
|
+
encoded_strings::fold(&mut listing);
|
|
73
74
|
profiling::report("VM");
|
|
74
75
|
Ok(listing)
|
|
75
76
|
}
|