diff --git a/common.gypi b/common.gypi index 04303c7de6acfa..073d89fda640dd 100644 --- a/common.gypi +++ b/common.gypi @@ -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 ##### diff --git a/deps/v8/src/snapshot/serializer.cc b/deps/v8/src/snapshot/serializer.cc index 7f7551316c17e9..5f738d69a88ec4 100644 --- a/deps/v8/src/snapshot/serializer.cc +++ b/deps/v8/src/snapshot/serializer.cc @@ -318,6 +318,23 @@ void Serializer::ResolvePendingForwardReference(int forward_reference_id) { } } +ExternalReferenceEncoder::Value Serializer::EncodeExternalReference( + Address addr) { + Maybe result = + external_reference_encoder_.TryEncode(addr); + if (result.IsNothing()) { +#ifdef DEBUG + PrintStack(std::cerr); +#endif + void* addr_ptr = reinterpret_cast(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 obj) { if (*obj == ReadOnlyRoots(isolate()).not_mapped_symbol()) return; diff --git a/deps/v8/src/snapshot/serializer.h b/deps/v8/src/snapshot/serializer.h index a1b17e4fd56d4f..c096cf9038a0d5 100644 --- a/deps/v8/src/snapshot/serializer.h +++ b/deps/v8/src/snapshot/serializer.h @@ -244,9 +244,8 @@ class Serializer : public SerializerDeserializer { // Returns true if the given heap object is a bytecode handler code object. bool ObjectIsBytecodeHandler(Handle obj) const; - ExternalReferenceEncoder::Value EncodeExternalReference(Address addr) { - return external_reference_encoder_.Encode(addr); - } + ExternalReferenceEncoder::Value EncodeExternalReference(Address addr); + Maybe TryEncodeExternalReference( Address addr) { return external_reference_encoder_.TryEncode(addr);