Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick 22bee2c92123 #39943

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.21',
'v8_embedder_string': '-node.22',

##### V8 defaults for Node.js #####

Expand Down
17 changes: 17 additions & 0 deletions deps/v8/src/snapshot/serializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,23 @@ void Serializer::ResolvePendingForwardReference(int forward_reference_id) {
}
}

ExternalReferenceEncoder::Value Serializer::EncodeExternalReference(
Address addr) {
Maybe<ExternalReferenceEncoder::Value> result =
external_reference_encoder_.TryEncode(addr);
if (result.IsNothing()) {
#ifdef DEBUG
PrintStack(std::cerr);
#endif
void* addr_ptr = reinterpret_cast<void*>(addr);
v8::base::OS::PrintError("Unknown external reference %p.\n", addr_ptr);
v8::base::OS::PrintError("%s\n",
ExternalReferenceTable::ResolveSymbol(addr_ptr));
v8::base::OS::Abort();
}
return result.FromJust();
}

void Serializer::RegisterObjectIsPending(Handle<HeapObject> obj) {
if (*obj == ReadOnlyRoots(isolate()).not_mapped_symbol()) return;

Expand Down
5 changes: 2 additions & 3 deletions deps/v8/src/snapshot/serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ class Serializer : public SerializerDeserializer {
// Returns true if the given heap object is a bytecode handler code object.
bool ObjectIsBytecodeHandler(Handle<HeapObject> obj) const;

ExternalReferenceEncoder::Value EncodeExternalReference(Address addr) {
return external_reference_encoder_.Encode(addr);
}
ExternalReferenceEncoder::Value EncodeExternalReference(Address addr);

Maybe<ExternalReferenceEncoder::Value> TryEncodeExternalReference(
Address addr) {
return external_reference_encoder_.TryEncode(addr);
Expand Down