Skip to content

Commit b2d2ce2

Browse files
Connor ClarkV8 LUCI CQ
authored andcommitted
Change isolate trace field from number to string
`IsolateId()` is a uint64_t, which cannot convert to JS without precision loss. Beyond that, the way v8 serializes large uint64_t values seems to differ from how blink does, which results in the same isolate presenting as different values. That made it impossible to properly correlate these events for the same isolate. See associated bug for more. Bug: 447654178 Change-Id: I070a2a5532be63a6c77f237d8c96307970058132 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6991617 Reviewed-by: Michael Lippautz <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Connor Clark <[email protected]> Reviewed-by: Yang Guo <[email protected]> Cr-Commit-Position: refs/heads/main@{#102832}
1 parent b52621b commit b2d2ce2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/objects/script.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void Script::TraceScriptRundown() {
189189
auto value = v8::tracing::TracedValue::Create();
190190
value->SetInteger("scriptId", this->id());
191191
value->SetInteger("executionContextId", contextId);
192-
value->SetUnsignedInteger("isolate", isolate->debug()->IsolateId());
192+
value->SetString("isolate", std::to_string(isolate->debug()->IsolateId()));
193193
value->SetBoolean("isModule", this->origin_options().IsModule());
194194
value->SetBoolean("hasSourceUrl", this->HasSourceURLComment());
195195
if (this->HasValidSource()) {
@@ -231,7 +231,7 @@ void Script::TraceScriptRundownSources() {
231231
const int32_t kSplitMaxLength = 1000000; // 1mb
232232
if (source_length > kSourceMaxLength) {
233233
auto value = v8::tracing::TracedValue::Create();
234-
value->SetUnsignedInteger("isolate", isolate->debug()->IsolateId());
234+
value->SetString("isolate", std::to_string(isolate->debug()->IsolateId()));
235235
value->SetInteger("scriptId", script_id);
236236
value->SetInteger("length", source_length);
237237
value->SetInteger("limit", kSourceMaxLength);
@@ -240,7 +240,7 @@ void Script::TraceScriptRundownSources() {
240240
"TooLargeScriptCatchup", "data", std::move(value));
241241
} else if (source_length <= kSplitMaxLength) {
242242
auto value = v8::tracing::TracedValue::Create();
243-
value->SetUnsignedInteger("isolate", isolate->debug()->IsolateId());
243+
value->SetString("isolate", std::to_string(isolate->debug()->IsolateId()));
244244
value->SetInteger("scriptId", script_id);
245245
value->SetInteger("length", source_length);
246246
value->SetString("sourceText", source->ToCString().get());
@@ -256,8 +256,8 @@ void Script::TraceScriptRundownSources() {
256256
auto split_trace_value = v8::tracing::TracedValue::Create();
257257
split_trace_value->SetInteger("splitIndex", i);
258258
split_trace_value->SetInteger("splitCount", split_count);
259-
split_trace_value->SetUnsignedInteger("isolate",
260-
isolate->debug()->IsolateId());
259+
split_trace_value->SetString(
260+
"isolate", std::to_string(isolate->debug()->IsolateId()));
261261
split_trace_value->SetInteger("scriptId", script_id);
262262
split_trace_value->SetString(
263263
"sourceText", std::string(source_ptr.get() + begin, end - begin));

0 commit comments

Comments
 (0)