Commit 5e1f856d authored by Rob Paveza's avatar Rob Paveza Committed by V8 LUCI CQ

Add support for source hashing in stack traces.

This change adds support for computing SHA-256 hashes in the stack
output of errors by adding a function to the prototype of the
`CallSite` object, passed to `Error.prepareStackTrace`. Additionally,
it updates the `hash` property from `Debugger.scriptParsed` and
`Debugger.scriptFailedToParse` to be SHA-256 instead of the
proprietary hash it is today.

It is intended to be an advancement in indexing source maps to
support improved tooling, especially for post-hoc or in-production
diagnostics scenarios.

The explainer can be found here:
https://docs.google.com/document/d/13hNeeLC2Ve_FVieNndZUUUP15x2O4ltvjnGWwOsMlrU/edit?usp=sharing

Change-Id: Ifbbed4b22c8256e74e6d79974d2dd1e444143eda
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3229957Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Auto-Submit: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80320}
parent 4776aee6
......@@ -3451,12 +3451,14 @@ v8_header_set("v8_internal_headers") {
"src/utils/bit-vector.h",
"src/utils/boxed-float.h",
"src/utils/detachable-vector.h",
"src/utils/hex-format.h",
"src/utils/identity-map.h",
"src/utils/locked-queue-inl.h",
"src/utils/locked-queue.h",
"src/utils/memcopy.h",
"src/utils/ostreams.h",
"src/utils/scoped-list.h",
"src/utils/sha-256.h",
"src/utils/utils-inl.h",
"src/utils/utils.h",
"src/utils/version.h",
......@@ -4001,6 +4003,8 @@ v8_compiler_sources = [
"src/compiler/value-numbering-reducer.cc",
"src/compiler/verifier.cc",
"src/compiler/zone-stats.cc",
"src/utils/hex-format.cc",
"src/utils/sha-256.cc",
]
if (v8_enable_webassembly) {
......
......@@ -559,7 +559,7 @@ domain Debugger
integer endColumn
# Specifies script creation context.
Runtime.ExecutionContextId executionContextId
# Content hash of the script.
# Content hash of the script, SHA-256.
string hash
# Embedder-specific auxiliary data.
optional object executionContextAuxData
......@@ -598,7 +598,7 @@ domain Debugger
integer endColumn
# Specifies script creation context.
Runtime.ExecutionContextId executionContextId
# Content hash of the script.
# Content hash of the script, SHA-256.
string hash
# Embedder-specific auxiliary data.
optional object executionContextAuxData
......
......@@ -111,6 +111,12 @@ BUILTIN(CallSitePrototypeGetPromiseIndex) {
return Smi::FromInt(CallSiteInfo::GetSourcePosition(frame));
}
BUILTIN(CallSitePrototypeGetScriptHash) {
HandleScope scope(isolate);
CHECK_CALLSITE(frame, "getScriptHash");
return *CallSiteInfo::GetScriptHash(frame);
}
BUILTIN(CallSitePrototypeGetScriptNameOrSourceURL) {
HandleScope scope(isolate);
CHECK_CALLSITE(frame, "getScriptNameOrSourceUrl");
......
......@@ -452,6 +452,7 @@ namespace internal {
CPP(CallSitePrototypeGetMethodName) \
CPP(CallSitePrototypeGetPosition) \
CPP(CallSitePrototypeGetPromiseIndex) \
CPP(CallSitePrototypeGetScriptHash) \
CPP(CallSitePrototypeGetScriptNameOrSourceURL) \
CPP(CallSitePrototypeGetThis) \
CPP(CallSitePrototypeGetTypeName) \
......
......@@ -477,6 +477,15 @@ MaybeLocal<String> Script::SourceMappingURL() const {
return Utils::ToLocal(i::Handle<i::String>::cast(value));
}
MaybeLocal<String> Script::GetSha256Hash() const {
i::Handle<i::Script> script = Utils::OpenHandle(this);
i::Isolate* isolate = script->GetIsolate();
i::HandleScope handle_scope(isolate);
i::Handle<i::String> value =
script->GetScriptHash(/* forceForInspector: */ true);
return Utils::ToLocal(handle_scope.CloseAndEscape(value));
}
Maybe<int> Script::ContextId() const {
i::Handle<i::Script> script = Utils::OpenHandle(this);
i::Object value = script->context_data();
......
......@@ -208,6 +208,7 @@ class V8_EXPORT_PRIVATE Script {
MaybeLocal<String> Name() const;
MaybeLocal<String> SourceURL() const;
MaybeLocal<String> SourceMappingURL() const;
MaybeLocal<String> GetSha256Hash() const;
Maybe<int> ContextId() const;
Local<ScriptSource> Source() const;
bool IsModule() const;
......
......@@ -291,6 +291,7 @@ Handle<Script> FactoryBase<Impl>::NewScriptWithId(
SKIP_WRITE_BARRIER);
raw.set_flags(0);
raw.set_host_defined_options(roots.empty_fixed_array(), SKIP_WRITE_BARRIER);
raw.set_source_hash(roots.undefined_value(), SKIP_WRITE_BARRIER);
#ifdef V8_SCRIPTORMODULE_LEGACY_LIFETIME
raw.set_script_or_modules(roots.empty_array_list());
#endif
......
......@@ -1415,6 +1415,7 @@ Handle<Script> Factory::CloneScript(Handle<Script> script) {
new_script.set_eval_from_position(old_script.eval_from_position());
new_script.set_flags(old_script.flags());
new_script.set_host_defined_options(old_script.host_defined_options());
new_script.set_source_hash(*undefined_value(), SKIP_WRITE_BARRIER);
#ifdef V8_SCRIPTORMODULE_LEGACY_LIFETIME
new_script.set_script_or_modules(*list);
#endif
......
......@@ -4373,6 +4373,7 @@ void Genesis::InitializeCallSiteBuiltins() {
{"getPromiseIndex", Builtin::kCallSitePrototypeGetPromiseIndex},
{"getScriptNameOrSourceURL",
Builtin::kCallSitePrototypeGetScriptNameOrSourceURL},
{"getScriptHash", Builtin::kCallSitePrototypeGetScriptHash},
{"getThis", Builtin::kCallSitePrototypeGetThis},
{"getTypeName", Builtin::kCallSitePrototypeGetTypeName},
{"isAsync", Builtin::kCallSitePrototypeIsAsync},
......
......@@ -20,6 +20,7 @@ include_rules = [
"+src/debug/interface-types.h",
"+src/base/vector.h",
"+src/base/enum-set.h",
"+src/utils/sha-256.h",
"+third_party/inspector_protocol/crdtp",
"+../../third_party/inspector_protocol/crdtp",
]
......@@ -10,6 +10,7 @@
#include "src/inspector/string-util.h"
#include "src/inspector/v8-debugger-agent-impl.h"
#include "src/inspector/v8-inspector-impl.h"
#include "src/utils/sha-256.h"
namespace v8_inspector {
......@@ -17,73 +18,23 @@ namespace {
const char kGlobalDebuggerScriptHandleLabel[] = "DevTools debugger";
// Hash algorithm for substrings is described in "Über die Komplexität der
// Multiplikation in
// eingeschränkten Branchingprogrammmodellen" by Woelfe.
// http://opendatastructures.org/versions/edition-0.1d/ods-java/node33.html#SECTION00832000000000000000
String16 calculateHash(v8::Isolate* isolate, v8::Local<v8::String> source) {
static uint64_t prime[] = {0x3FB75161, 0xAB1F4E4F, 0x82675BC5, 0xCD924D35,
0x81ABE279};
static uint64_t random[] = {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476,
0xC3D2E1F0};
static uint32_t randomOdd[] = {0xB4663807, 0xCC322BF5, 0xD4F91BBD, 0xA7BEA11D,
0x8F462907};
uint64_t hashes[] = {0, 0, 0, 0, 0};
uint64_t zi[] = {1, 1, 1, 1, 1};
const size_t hashesSize = arraysize(hashes);
size_t current = 0;
std::unique_ptr<UChar[]> buffer(new UChar[source->Length()]);
int written = source->Write(
isolate, reinterpret_cast<uint16_t*>(buffer.get()), 0, source->Length());
const uint32_t* data = nullptr;
const uint8_t* data = nullptr;
size_t sizeInBytes = sizeof(UChar) * written;
data = reinterpret_cast<const uint32_t*>(buffer.get());
for (size_t i = 0; i < sizeInBytes / 4; ++i) {
uint32_t d = v8::base::ReadUnalignedValue<uint32_t>(
reinterpret_cast<v8::internal::Address>(data + i));
#if V8_TARGET_LITTLE_ENDIAN
uint32_t v = d;
#else
uint32_t v = (d << 16) | (d >> 16);
#endif
uint64_t xi = v * randomOdd[current] & 0x7FFFFFFF;
hashes[current] = (hashes[current] + zi[current] * xi) % prime[current];
zi[current] = (zi[current] * random[current]) % prime[current];
current = current == hashesSize - 1 ? 0 : current + 1;
}
if (sizeInBytes % 4) {
uint32_t v = 0;
const uint8_t* data_8b = reinterpret_cast<const uint8_t*>(data);
for (size_t i = sizeInBytes - sizeInBytes % 4; i < sizeInBytes; ++i) {
v <<= 8;
#if V8_TARGET_LITTLE_ENDIAN
v |= data_8b[i];
#else
if (i % 2) {
v |= data_8b[i - 1];
} else {
v |= data_8b[i + 1];
}
#endif
}
uint64_t xi = v * randomOdd[current] & 0x7FFFFFFF;
hashes[current] = (hashes[current] + zi[current] * xi) % prime[current];
zi[current] = (zi[current] * random[current]) % prime[current];
current = current == hashesSize - 1 ? 0 : current + 1;
}
data = reinterpret_cast<const uint8_t*>(buffer.get());
for (size_t i = 0; i < hashesSize; ++i)
hashes[i] = (hashes[i] + zi[i] * (prime[i] - 1)) % prime[i];
uint8_t hash[kSizeOfSha256Digest];
v8::internal::SHA256_hash(data, sizeInBytes, hash);
String16Builder hash;
for (size_t i = 0; i < hashesSize; ++i)
hash.appendUnsignedAsHex(static_cast<uint32_t>(hashes[i]));
return hash.toString();
String16Builder formatted_hash;
for (size_t i = 0; i < kSizeOfSha256Digest; i++)
formatted_hash.appendUnsignedAsHex(static_cast<uint8_t>(hash[i]));
return formatted_hash.toString();
}
class ActualScript : public V8DebuggerScript {
......@@ -318,6 +269,11 @@ class ActualScript : public V8DebuggerScript {
m_script.AnnotateStrongRetainer(kGlobalDebuggerScriptHandleLabel);
m_scriptSource.Reset(m_isolate, script->Source());
m_scriptSource.AnnotateStrongRetainer(kGlobalDebuggerScriptHandleLabel);
bool hasHash = script->GetSha256Hash().ToLocal(&tmp) && tmp->Length() > 0;
if (hasHash) {
m_hash = toProtocolString(m_isolate, tmp);
}
}
void MakeWeak() override {
......
......@@ -198,6 +198,19 @@ Object CallSiteInfo::GetScriptSourceMappingURL() const {
return ReadOnlyRoots(GetIsolate()).null_value();
}
// static
Handle<String> CallSiteInfo::GetScriptHash(Handle<CallSiteInfo> info) {
Handle<Script> script;
Isolate* isolate = info->GetIsolate();
if (!GetScript(isolate, info).ToHandle(&script)) {
return isolate->factory()->empty_string();
}
if (script->HasValidSource()) {
return script->GetScriptHash(/*forceForInspector:*/ false);
}
return isolate->factory()->empty_string();
}
namespace {
MaybeHandle<String> FormatEvalOrigin(Isolate* isolate, Handle<Script> script) {
......
......@@ -73,6 +73,7 @@ class CallSiteInfo : public TorqueGeneratedCallSiteInfo<CallSiteInfo, Struct> {
Handle<CallSiteInfo> info);
static Handle<String> GetFunctionDebugName(Handle<CallSiteInfo> info);
static Handle<Object> GetMethodName(Handle<CallSiteInfo> info);
static Handle<String> GetScriptHash(Handle<CallSiteInfo> info);
static Handle<Object> GetTypeName(Handle<CallSiteInfo> info);
#if V8_ENABLE_WEBASSEMBLY
......
......@@ -123,7 +123,9 @@
#include "src/strings/string-stream.h"
#include "src/strings/unicode-decoder.h"
#include "src/strings/unicode-inl.h"
#include "src/utils/hex-format.h"
#include "src/utils/ostreams.h"
#include "src/utils/sha-256.h"
#include "src/utils/utils-inl.h"
#include "src/zone/zone.h"
......@@ -5042,6 +5044,47 @@ Object Script::GetNameOrSourceURL() {
return name();
}
Handle<String> Script::GetScriptHash(bool forceForInspector) {
auto isolate = GetIsolate();
if (origin_options().IsOpaque() && !forceForInspector) {
return isolate->factory()->empty_string();
}
Object maybe_source_hash = source_hash();
if (maybe_source_hash.IsString()) {
Handle<String> precomputed(String::cast(maybe_source_hash), isolate);
if (precomputed->length() > 0) {
return precomputed;
}
}
Handle<Object> src(source(), isolate);
if (!src->IsString()) {
return isolate->factory()->empty_string();
}
Handle<String> src_text = Handle<String>::cast(src);
char formatted_hash[kSizeOfFormattedSha256Digest];
// std::unique_ptr<UChar[]> buffer(new UChar[src->Length()]);
// int written = src->Write(isolate,
// reinterpret_cast<uint16_t*>(buffer.get()), 0, source->Length()); size_t
// writtenSizeInBytes = sizeof(UChar) * written;
std::unique_ptr<char[]> string_val = src_text->ToCString();
size_t len = strlen(string_val.get());
uint8_t hash[kSizeOfSha256Digest];
SHA256_hash(string_val.get(), len, hash);
FormatBytesToHex(formatted_hash, kSizeOfFormattedSha256Digest, hash,
kSizeOfSha256Digest);
formatted_hash[kSizeOfSha256Digest * 2] = '\0';
Handle<String> result =
isolate->factory()->NewStringFromAsciiChecked(formatted_hash);
set_source_hash(*result);
return result;
}
template <typename IsolateT>
MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo(
Handle<Script> script, IsolateT* isolate,
......
......@@ -157,6 +157,7 @@ class Script : public TorqueGeneratedScript<Script, Struct> {
inline bool IsMaybeUnfinalized(Isolate* isolate) const;
Object GetNameOrSourceURL();
Handle<String> GetScriptHash(bool forceForInspector);
// Retrieve source position from where eval was called.
static int GetEvalPosition(Isolate* isolate, Handle<Script> script);
......
......@@ -64,4 +64,8 @@ extern class Script extends Struct {
// Used to make sure we are backwards compatible with node to gaurantee
// the same lifetime for ScriptOrModule as the Script they originated.
@if(V8_SCRIPTORMODULE_LEGACY_LIFETIME) script_or_modules: ArrayList;
// [source_hash]: Calculated once per file if the source text is available,
// represents the SHA-256 of the content
source_hash: String|Undefined;
}
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/utils/hex-format.h"
#include <stddef.h>
#include <stdint.h>
namespace v8 {
namespace internal {
void FormatBytesToHex(char* formatted, size_t size_of_formatted,
const uint8_t* val, size_t size_of_val) {
// Prevent overflow by ensuring that the value can't exceed
// 0x20000000 in length, which would be 0x40000000 when formatted
CHECK_LT(size_of_val, 0x20000000);
CHECK(size_of_formatted >= (size_of_val * 2));
for (size_t index = 0; index < size_of_val; index++) {
size_t dest_index = index << 1;
snprintf(&formatted[dest_index], size_of_formatted - dest_index, "%02x", val[index]);
}
}
} // namespace internal
} // namespace v8
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_UTILS_HEX_FORMAT_H_
#define V8_UTILS_HEX_FORMAT_H_
#include <stddef.h>
#include <stdint.h>
#include "src/base/logging.h"
namespace v8 {
namespace internal {
// Takes a byte array in `val` and formats into a hex-based character array
// contained within `formatted`. `formatted` should be a valid buffer which is
// at least 2x the size of `size_of_val`. Additionally, `size_of_val` should be
// less than 0x20000000. If either of these invariants is violated, a CHECK will
// occur.
void FormatBytesToHex(char* formatted, size_t size_of_formatted,
const uint8_t* val, size_t size_of_val);
} // namespace internal
} // namespace v8
#endif // V8_UTILS_HEX_FORMAT_H_
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copyright 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
//
// Optimized for minimal code size.
//
// This code originates from the Omaha installer for Windows but is
// reduced in complexity. Changes made are outlined in the header file.
#include "src/utils/sha-256.h"
#include <stdint.h>
#include <string.h>
#define ror(value, bits) (((value) >> (bits)) | ((value) << (32 - (bits))))
#define shr(value, bits) ((value) >> (bits))
namespace v8 {
namespace internal {
static const uint32_t K[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2};
static void SHA256_Transform(LITE_SHA256_CTX* ctx) {
uint32_t W[64];
uint32_t A, B, C, D, E, F, G, H;
uint8_t* p = ctx->buf;
int t;
for (t = 0; t < 16; ++t) {
uint32_t tmp = (uint32_t)*p++ << 24;
tmp |= (uint32_t)*p++ << 16;
tmp |= (uint32_t)*p++ << 8;
tmp |= (uint32_t)*p++;
W[t] = tmp;
}
for (; t < 64; t++) {
uint32_t s0 = ror(W[t - 15], 7) ^ ror(W[t - 15], 18) ^ shr(W[t - 15], 3);
uint32_t s1 = ror(W[t - 2], 17) ^ ror(W[t - 2], 19) ^ shr(W[t - 2], 10);
W[t] = W[t - 16] + s0 + W[t - 7] + s1;
}
A = ctx->state[0];
B = ctx->state[1];
C = ctx->state[2];
D = ctx->state[3];
E = ctx->state[4];
F = ctx->state[5];
G = ctx->state[6];
H = ctx->state[7];
for (t = 0; t < 64; t++) {
uint32_t s0 = ror(A, 2) ^ ror(A, 13) ^ ror(A, 22);
uint32_t maj = (A & B) ^ (A & C) ^ (B & C);
uint32_t t2 = s0 + maj;
uint32_t s1 = ror(E, 6) ^ ror(E, 11) ^ ror(E, 25);
uint32_t ch = (E & F) ^ ((~E) & G);
uint32_t t1 = H + s1 + ch + K[t] + W[t];
H = G;
G = F;
F = E;
E = D + t1;
D = C;
C = B;
B = A;
A = t1 + t2;
}
ctx->state[0] += A;
ctx->state[1] += B;
ctx->state[2] += C;
ctx->state[3] += D;
ctx->state[4] += E;
ctx->state[5] += F;
ctx->state[6] += G;
ctx->state[7] += H;
}
static const HASH_VTAB SHA256_VTAB = {
SHA256_init, SHA256_update, SHA256_final, SHA256_hash, kSizeOfSha256Digest,
};
void SHA256_init(LITE_SHA256_CTX* ctx) {
ctx->f = &SHA256_VTAB;
ctx->state[0] = 0x6a09e667;
ctx->state[1] = 0xbb67ae85;
ctx->state[2] = 0x3c6ef372;
ctx->state[3] = 0xa54ff53a;
ctx->state[4] = 0x510e527f;
ctx->state[5] = 0x9b05688c;
ctx->state[6] = 0x1f83d9ab;
ctx->state[7] = 0x5be0cd19;
ctx->count = 0;
}
void SHA256_update(LITE_SHA256_CTX* ctx, const void* data, size_t len) {
int i = static_cast<int>(ctx->count & 63);
const uint8_t* p = (const uint8_t*)data;
ctx->count += len;
while (len--) {
ctx->buf[i++] = *p++;
if (i == 64) {
SHA256_Transform(ctx);
i = 0;
}
}
}
const uint8_t* SHA256_final(LITE_SHA256_CTX* ctx) {
uint8_t* p = ctx->buf;
uint64_t cnt = LITE_LShiftU64(ctx->count, 3);
int i;
const uint8_t completion[] { 0x80, 0 };
SHA256_update(ctx, &completion[0], 1);
while ((ctx->count & 63) != 56) {
SHA256_update(ctx, &completion[1], 1);
}
for (i = 0; i < 8; ++i) {
uint8_t tmp = (uint8_t)LITE_RShiftU64(cnt, 56);
cnt = LITE_LShiftU64(cnt, 8);
SHA256_update(ctx, &tmp, 1);
}
for (i = 0; i < 8; i++) {
uint32_t tmp = ctx->state[i];
*p++ = (uint8_t)(tmp >> 24);
*p++ = (uint8_t)(tmp >> 16);
*p++ = (uint8_t)(tmp >> 8);
*p++ = (uint8_t)(tmp >> 0);
}
return ctx->buf;
}
/* Convenience function */
const uint8_t* SHA256_hash(const void* data, size_t len, uint8_t* digest) {
LITE_SHA256_CTX ctx;
SHA256_init(&ctx);
SHA256_update(&ctx, data, len);
memcpy(digest, SHA256_final(&ctx), kSizeOfSha256Digest);
return digest;
}
} // namespace internal
} // namespace v8
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copyright 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
//
// This code originates from the Omaha installer for Windows:
// https://github.com/google/omaha
// The following changes were made:
// - Combined the hash-internal.h and sha256.h headers together to form
// this one.
// - Eliminated conditional definitions related to LITE_EMULATED_64BIT_OPS
// - Eliminated `extern "C"` definitions as these aren't exported
// - Eliminated `SHA512_SUPPORT` as we only support SHA256
// - Eliminated generic `HASH_` definitions as unnecessary
// - Moved the hashing functions into `namespace v8::internal`
//
// This is intended simply to provide a minimal-impact SHA256 hash utility
// to support the stack trace source hash functionality.
#ifndef V8_UTILS_SHA_256_H_
#define V8_UTILS_SHA_256_H_
#include <stddef.h>
#include <stdint.h>
#define LITE_LShiftU64(a, b) ((a) << (b))
#define LITE_RShiftU64(a, b) ((a) >> (b))
const size_t kSizeOfSha256Digest = 32;
const size_t kSizeOfFormattedSha256Digest = (kSizeOfSha256Digest * 2) + 1;
namespace v8 {
namespace internal {
typedef struct HASH_VTAB {
void (*const init)(struct HASH_CTX*);
void (*const update)(struct HASH_CTX*, const void*, size_t);
const uint8_t* (*const final)(struct HASH_CTX*);
const uint8_t* (*const hash)(const void*, size_t, uint8_t*);
unsigned int size;
} HASH_VTAB;
typedef struct HASH_CTX {
const HASH_VTAB* f;
uint64_t count;
uint8_t buf[64];
uint32_t state[8]; // upto SHA2-256
} HASH_CTX;
typedef HASH_CTX LITE_SHA256_CTX;
void SHA256_init(LITE_SHA256_CTX* ctx);
void SHA256_update(LITE_SHA256_CTX* ctx, const void* data, size_t len);
const uint8_t* SHA256_final(LITE_SHA256_CTX* ctx);
// Convenience method. Returns digest address.
const uint8_t* SHA256_hash(const void* data, size_t len, uint8_t* digest);
} // namespace internal
} // namespace v8
#endif // V8_UTILS_SHA_256_H_
......@@ -9,13 +9,13 @@ Running test: testLoadedModulesOnDebuggerEnable
endLine : 3
executionContextId : <executionContextId>
hasSourceURL : false
hash : 03b276dd81b75bf832afbeccbbd273c62dad100c
hash : 2d91bcfe883a9f0a8da29373a3160d8ddc04ba4bc50f048a2cd1d80b9057ac03
isLiveEdit : false
isModule : true
length : 39
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module1.js
......@@ -31,13 +31,13 @@ Running test: testScriptEventsWhenDebuggerIsEnabled
endLine : 3
executionContextId : <executionContextId>
hasSourceURL : false
hash : 03b276dd81b75bf832afbeccbbd273c62dad100c
hash : 2d91bcfe883a9f0a8da29373a3160d8ddc04ba4bc50f048a2cd1d80b9057ac03
isLiveEdit : false
isModule : true
length : 39
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module2.js
......@@ -51,12 +51,12 @@ Running test: testScriptEventsWhenDebuggerIsEnabled
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 021647ffab1f4e4e82675bc4cd924d3481abe278
hash : d10b36aa74a59bcf4a88185837f658afaf3646eff2bb16c3928d0e9335e945d2
isModule : true
length : 1
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module-with-syntax-error-2.js
......
......@@ -2,17 +2,17 @@ getPossibleBreakpoints should not crash during lazy compilation (crbug.com/71533
{
method : Debugger.scriptFailedToParse
params : {
embedderName :
embedderName :
endColumn : 23
endLine : 2
executionContextId : <executionContextId>
hasSourceURL : true
hash : 1bce5d0c4da4d13a3ea6e6f35ea0f34705c26ba4
hash : a4d1909206d9f456110de34bdd5f8b3362a2c35e3879b1d7a76868f7e5dd04be
isModule : false
length : 56
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : test.js
......
......@@ -8,13 +8,13 @@ Check script with url:
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 033b33d191ed51ed823355d865eb871d811403e2
hash : d61d14dd9c20e4ca03a76a585bac0049f3776ef54aa90758ecc7d233639a0681
isLiveEdit : false
isModule : false
length : 16
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : prefix://url
......@@ -29,13 +29,13 @@ Check script with sourceURL comment:
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 06c136ce206c5f505f32af524e6ec71b5baa0bbb
hash : bbb04915bca73cbf949e5d836a0322915d6b7d917efe88d58591ca3e01aab524
isLiveEdit : false
isModule : false
length : 37
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : foo.js
......@@ -50,12 +50,12 @@ Check script failed to parse:
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 033b33d191ed51ed1f44cd0465eb871d811403e2
hash : 5a1b7af9d5918fe9d1507381f2ed3f9c3056c49ab5864bb9da676a6a30b3d1b2
isModule : false
length : 15
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : prefix://url
......@@ -70,12 +70,12 @@ Check script failed to parse with sourceURL comment:
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 23a2885951475580023e2a742563d78876d8f05e
hash : e6460482059772df0a321f1d9a9d54f257366f4af9b64310b272924d17e9edd0
isModule : false
length : 36
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : foo.js
......@@ -111,7 +111,7 @@ Test runtime stack trace:
}
[2] : {
columnNumber : 4
functionName :
functionName :
lineNumber : 4
scriptId : <scriptId>
url : prefix://url
......@@ -124,7 +124,7 @@ Test runtime stack trace:
}
Test debugger stack trace:
[
[0] :
[1] :
[2] :
[0] :
[1] :
[2] :
]
......@@ -2,26 +2,26 @@ Debugger.scriptParsed.stackTrace should contain only one frame
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 0
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 3fb75160ab1f4e4e82675bc4cd924d3481abe278
hash : e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
isLiveEdit : false
isModule : false
length : 0
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
stackTrace : {
callFrames : [
[0] : {
columnNumber : 17
functionName :
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
url :
}
]
parentId : {
......@@ -30,6 +30,6 @@ Debugger.scriptParsed.stackTrace should contain only one frame
}
startColumn : 0
startLine : 0
url :
url :
}
}
......@@ -3,18 +3,18 @@ Runtime.evaluate with valid expression
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 29
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 088d339a1527053d718d72a610f9700c32e64eef
hash : 9f02f72adbd66ce9b25542198a9ae4244c0e4a7cb4c9e6de7eae8e5bcdec89e1
isLiveEdit : false
isModule : false
length : 29
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : evaluate.js
......@@ -24,17 +24,17 @@ Runtime.evaluate with syntax error
{
method : Debugger.scriptFailedToParse
params : {
embedderName :
embedderName :
endColumn : 39
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 37f7701801762b5e2198ec5dca86af5775b39421
hash : b9f2efcf5fc6c3698684af19785120e50faacceb498f330d2d9aa58f55ab3fdb
isModule : false
length : 39
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : evaluate-syntax-error.js
......@@ -44,41 +44,41 @@ Runtime.callFunctionOn with valid functionDeclaration
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 18
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 1169ab358eba9e1a28fa39e19f578ced708a8404
hash : 5692cb5b347ea5186169fa1d9b40a614b4e013edd0bc8e5dfbabd297f94c1061
isLiveEdit : false
isModule : false
length : 18
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url :
url :
}
}
Runtime.callFunctionOn with syntax error
{
method : Debugger.scriptFailedToParse
params : {
embedderName :
embedderName :
endColumn : 3
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 238d40d96f7b2e1582675bc4cd924d3481abe278
hash : 4da27f5b363e9008d496aa9ac0b8be840fa300e28687f8eaa2e36bab085a3cc9
isModule : false
length : 3
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url :
url :
}
}
Runtime.compileScript with valid expression
......@@ -90,13 +90,13 @@ Runtime.compileScript with valid expression
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 337f40d9a52d67b682675bc4cd924d3481abe278
hash : 5b8d2b991d2c1f5bf78beb557d17e6650086a267e5ffd4bb6f8aaa942c570f5d
isLiveEdit : false
isModule : false
length : 4
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : compile-script.js
......@@ -111,12 +111,12 @@ Runtime.compileScript with syntax error
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 021647ffab1f4e4e82675bc4cd924d3481abe278
hash : d10b36aa74a59bcf4a88185837f658afaf3646eff2bb16c3928d0e9335e945d2
isModule : false
length : 1
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : compile-script-syntax-error.js
......@@ -127,38 +127,38 @@ Runtime.evaluate compiled script with stack trace
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 8
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 0435812a3176b201645f85bac0ce254781abe278
hash : a909749d912d72764320d9a0fc19ab5d0c271c3ad9b3926ef2f4fb17cd4e0caa
isLiveEdit : false
isModule : false
length : 8
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url :
url :
}
}
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 39
endLine : 4
executionContextId : <executionContextId>
hasSourceURL : true
hash : 1fe25013058a11e86a218cbdab72a4511253d317
hash : 6a42c4687a3966fa12f1bd6e8ef1ccf839a72d02a06cd130ea78734c1a13ffc5
isLiveEdit : false
isModule : false
length : 86
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
stackTrace : {
callFrames : [
[0] : {
......@@ -178,18 +178,18 @@ Runtime.evaluate compiled script with stack trace
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 4
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 337f40d9a52d67b682675bc4cd924d3481abe278
hash : 5b8d2b991d2c1f5bf78beb557d17e6650086a267e5ffd4bb6f8aaa942c570f5d
isLiveEdit : false
isModule : false
length : 4
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
stackTrace : {
callFrames : [
[0] : {
......@@ -203,45 +203,45 @@ Runtime.evaluate compiled script with stack trace
}
startColumn : 0
startLine : 0
url :
url :
}
}
Runtime.evaluate compile script error with stack trace
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 12
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 04ea8c553176b201645f85ba59eab978523fb6e1
hash : ea5b2bcb1e34045bcabc71bf027c9701e519dc72cc4d6f4a53987eec3d103ad5
isLiveEdit : false
isModule : false
length : 12
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url :
url :
}
}
{
method : Debugger.scriptParsed
params : {
embedderName :
embedderName :
endColumn : 48
endLine : 4
executionContextId : <executionContextId>
hasSourceURL : true
hash : 0178c875a610447615aeda1073937cd62e4f0919
hash : 230feafbe3db3066a3abcc75fbe9a821bc52e92056bfdff0f42fd567156e0516
isLiveEdit : false
isModule : false
length : 98
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
stackTrace : {
callFrames : [
[0] : {
......@@ -261,17 +261,17 @@ Runtime.evaluate compile script error with stack trace
{
method : Debugger.scriptFailedToParse
params : {
embedderName :
embedderName :
endColumn : 3
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 337f40d93ac843c682675bc4cd924d3481abe278
hash : 436a9b2e7c2aeaccc4bcb04d2c9c033a67cfcf5a8f3d0a0ab54d8b264e69b0b7
isModule : false
length : 3
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
stackTrace : {
callFrames : [
[0] : {
......@@ -285,6 +285,6 @@ Runtime.evaluate compile script error with stack trace
}
startColumn : 0
startLine : 0
url :
url :
}
}
......@@ -5,13 +5,13 @@ Tests scripts hasing
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 28e2d6c1ab1f4e4e82675bc4cd924d3481abe278
hash : 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b
isLiveEdit : false
isModule : false
length : 1
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : foo1.js
......@@ -22,13 +22,13 @@ Tests scripts hasing
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 3dce1fbe923a7e1582675bc4cd924d3481abe278
hash : 79bf08685d3138f9b109c3546780f056bc954fd69377b84a2cf23622e464897b
isLiveEdit : false
isModule : false
length : 3
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : foo2.js
......@@ -39,13 +39,13 @@ Tests scripts hasing
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 2a3f94401c23c4d8336963ce4656dae27a95edb4
hash : 31d50490dca67797f1cac5a75c26eb866d60aa7d688e4393b3d07e4868d3d36d
isLiveEdit : false
isModule : false
length : 8106
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : foo3.js
......
......@@ -7,13 +7,13 @@ Checks basic ES6 modules support.
endLine : 5
executionContextId : <executionContextId>
hasSourceURL : false
hash : 395a588e3dc4c9155d342cb169bcd60d5b96c1a1
hash : 691860c2718c7dc1093d2933a3a71fe62c25948d592f2cadeee30f2f130c0a00
isLiveEdit : false
isModule : true
length : 83
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module1
......@@ -27,13 +27,13 @@ Checks basic ES6 modules support.
endLine : 5
executionContextId : <executionContextId>
hasSourceURL : false
hash : 15448dfe629fbe4306eae7194754692706c6d6ba
hash : 406cbebea0b200671431320fca58b34225270aa55c47756656a50ef999b24825
isLiveEdit : false
isModule : true
length : 84
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module2
......@@ -47,13 +47,13 @@ Checks basic ES6 modules support.
endLine : 11
executionContextId : <executionContextId>
hasSourceURL : false
hash : 2e8186096446efdc472a6e0559ea22216a664cb5
hash : d719e141b8fa8c07426816ce46ddf65ed0474667b2588300d3e9ec491017e989
isLiveEdit : false
isModule : true
length : 286
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module3
......@@ -85,7 +85,7 @@ console.log(239)
lineNumber : 0
scriptId : <scriptId>
}
functionName :
functionName :
location : {
columnNumber : 0
lineNumber : 9
......@@ -124,7 +124,7 @@ console.log(239)
this : {
type : undefined
}
url :
url :
}
]
hitBreakpoints : [
......@@ -210,12 +210,12 @@ console.log(239)
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 021647ffab1f4e4e82675bc4cd924d3481abe278
hash : d10b36aa74a59bcf4a88185837f658afaf3646eff2bb16c3928d0e9335e945d2
isModule : true
length : 1
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
sourceMapURL :
startColumn : 0
startLine : 0
url : module4
......
......@@ -501,67 +501,67 @@ KNOWN_OBJECTS = {
("read_only_space", 0x0368d): "EmptyFunctionScopeInfo",
("read_only_space", 0x036b1): "NativeScopeInfo",
("read_only_space", 0x036c9): "HashSeed",
("old_space", 0x04215): "ArgumentsIteratorAccessor",
("old_space", 0x04259): "ArrayLengthAccessor",
("old_space", 0x0429d): "BoundFunctionLengthAccessor",
("old_space", 0x042e1): "BoundFunctionNameAccessor",
("old_space", 0x04325): "ErrorStackAccessor",
("old_space", 0x04369): "FunctionArgumentsAccessor",
("old_space", 0x043ad): "FunctionCallerAccessor",
("old_space", 0x043f1): "FunctionNameAccessor",
("old_space", 0x04435): "FunctionLengthAccessor",
("old_space", 0x04479): "FunctionPrototypeAccessor",
("old_space", 0x044bd): "StringLengthAccessor",
("old_space", 0x04501): "WrappedFunctionLengthAccessor",
("old_space", 0x04545): "WrappedFunctionNameAccessor",
("old_space", 0x04589): "InvalidPrototypeValidityCell",
("old_space", 0x04591): "EmptyScript",
("old_space", 0x045d1): "ManyClosuresCell",
("old_space", 0x045dd): "ArrayConstructorProtector",
("old_space", 0x045f1): "NoElementsProtector",
("old_space", 0x04605): "MegaDOMProtector",
("old_space", 0x04619): "IsConcatSpreadableProtector",
("old_space", 0x0462d): "ArraySpeciesProtector",
("old_space", 0x04641): "TypedArraySpeciesProtector",
("old_space", 0x04655): "PromiseSpeciesProtector",
("old_space", 0x04669): "RegExpSpeciesProtector",
("old_space", 0x0467d): "StringLengthProtector",
("old_space", 0x04691): "ArrayIteratorProtector",
("old_space", 0x046a5): "ArrayBufferDetachingProtector",
("old_space", 0x046b9): "PromiseHookProtector",
("old_space", 0x046cd): "PromiseResolveProtector",
("old_space", 0x046e1): "MapIteratorProtector",
("old_space", 0x046f5): "PromiseThenProtector",
("old_space", 0x04709): "SetIteratorProtector",
("old_space", 0x0471d): "StringIteratorProtector",
("old_space", 0x04731): "SingleCharacterStringCache",
("old_space", 0x04b39): "StringSplitCache",
("old_space", 0x04f41): "RegExpMultipleCache",
("old_space", 0x05349): "BuiltinsConstantsTable",
("old_space", 0x0577d): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x057a1): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x057c5): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x057e9): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x0580d): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x05831): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x05855): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x05879): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x0589d): "AsyncIteratorValueUnwrapSharedFun",
("old_space", 0x058c1): "PromiseAllResolveElementSharedFun",
("old_space", 0x058e5): "PromiseAllSettledResolveElementSharedFun",
("old_space", 0x05909): "PromiseAllSettledRejectElementSharedFun",
("old_space", 0x0592d): "PromiseAnyRejectElementSharedFun",
("old_space", 0x05951): "PromiseCapabilityDefaultRejectSharedFun",
("old_space", 0x05975): "PromiseCapabilityDefaultResolveSharedFun",
("old_space", 0x05999): "PromiseCatchFinallySharedFun",
("old_space", 0x059bd): "PromiseGetCapabilitiesExecutorSharedFun",
("old_space", 0x059e1): "PromiseThenFinallySharedFun",
("old_space", 0x05a05): "PromiseThrowerFinallySharedFun",
("old_space", 0x05a29): "PromiseValueThunkFinallySharedFun",
("old_space", 0x05a4d): "ProxyRevokeSharedFun",
("old_space", 0x05a71): "ShadowRealmImportValueFulfilledSFI",
("old_space", 0x05a95): "SourceTextModuleExecuteAsyncModuleFulfilledSFI",
("old_space", 0x05ab9): "SourceTextModuleExecuteAsyncModuleRejectedSFI",
("old_space", 0x04231): "ArgumentsIteratorAccessor",
("old_space", 0x04275): "ArrayLengthAccessor",
("old_space", 0x042b9): "BoundFunctionLengthAccessor",
("old_space", 0x042fd): "BoundFunctionNameAccessor",
("old_space", 0x04341): "ErrorStackAccessor",
("old_space", 0x04385): "FunctionArgumentsAccessor",
("old_space", 0x043c9): "FunctionCallerAccessor",
("old_space", 0x0440d): "FunctionNameAccessor",
("old_space", 0x04451): "FunctionLengthAccessor",
("old_space", 0x04495): "FunctionPrototypeAccessor",
("old_space", 0x044d9): "StringLengthAccessor",
("old_space", 0x0451d): "WrappedFunctionLengthAccessor",
("old_space", 0x04561): "WrappedFunctionNameAccessor",
("old_space", 0x045a5): "InvalidPrototypeValidityCell",
("old_space", 0x045ad): "EmptyScript",
("old_space", 0x045f1): "ManyClosuresCell",
("old_space", 0x045fd): "ArrayConstructorProtector",
("old_space", 0x04611): "NoElementsProtector",
("old_space", 0x04625): "MegaDOMProtector",
("old_space", 0x04639): "IsConcatSpreadableProtector",
("old_space", 0x0464d): "ArraySpeciesProtector",
("old_space", 0x04661): "TypedArraySpeciesProtector",
("old_space", 0x04675): "PromiseSpeciesProtector",
("old_space", 0x04689): "RegExpSpeciesProtector",
("old_space", 0x0469d): "StringLengthProtector",
("old_space", 0x046b1): "ArrayIteratorProtector",
("old_space", 0x046c5): "ArrayBufferDetachingProtector",
("old_space", 0x046d9): "PromiseHookProtector",
("old_space", 0x046ed): "PromiseResolveProtector",
("old_space", 0x04701): "MapIteratorProtector",
("old_space", 0x04715): "PromiseThenProtector",
("old_space", 0x04729): "SetIteratorProtector",
("old_space", 0x0473d): "StringIteratorProtector",
("old_space", 0x04751): "SingleCharacterStringCache",
("old_space", 0x04b59): "StringSplitCache",
("old_space", 0x04f61): "RegExpMultipleCache",
("old_space", 0x05369): "BuiltinsConstantsTable",
("old_space", 0x0579d): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x057c1): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x057e5): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x05809): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x0582d): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x05851): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x05875): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x05899): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x058bd): "AsyncIteratorValueUnwrapSharedFun",
("old_space", 0x058e1): "PromiseAllResolveElementSharedFun",
("old_space", 0x05905): "PromiseAllSettledResolveElementSharedFun",
("old_space", 0x05929): "PromiseAllSettledRejectElementSharedFun",
("old_space", 0x0594d): "PromiseAnyRejectElementSharedFun",
("old_space", 0x05971): "PromiseCapabilityDefaultRejectSharedFun",
("old_space", 0x05995): "PromiseCapabilityDefaultResolveSharedFun",
("old_space", 0x059b9): "PromiseCatchFinallySharedFun",
("old_space", 0x059dd): "PromiseGetCapabilitiesExecutorSharedFun",
("old_space", 0x05a01): "PromiseThenFinallySharedFun",
("old_space", 0x05a25): "PromiseThrowerFinallySharedFun",
("old_space", 0x05a49): "PromiseValueThunkFinallySharedFun",
("old_space", 0x05a6d): "ProxyRevokeSharedFun",
("old_space", 0x05a91): "ShadowRealmImportValueFulfilledSFI",
("old_space", 0x05ab5): "SourceTextModuleExecuteAsyncModuleFulfilledSFI",
("old_space", 0x05ad9): "SourceTextModuleExecuteAsyncModuleRejectedSFI",
}
# Lower 32 bits of first page addresses for various heap spaces.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment