diff --git a/common.gypi b/common.gypi index b4a3010d2ff..d0380616db6 100644 --- a/common.gypi +++ b/common.gypi @@ -44,7 +44,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.11', + 'v8_embedder_string': '-node.12', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/torque/implementation-visitor.cc b/deps/v8/src/torque/implementation-visitor.cc index 08caa5038e4..4ddcd25d3ee 100644 --- a/deps/v8/src/torque/implementation-visitor.cc +++ b/deps/v8/src/torque/implementation-visitor.cc @@ -4023,6 +4023,11 @@ class ClassFieldOffsetGenerator : public FieldOffsetsGenerator { std::string parent_name = use_templates ? "P" : parent->name(); if (type->IsLayoutDefinedInCpp()) { + if (parent) { + if (std::optional packed_size = parent->size().SingleValue()) { + return std::to_string(*packed_size); + } + } return "sizeof(" + parent_name + ")"; } @@ -4111,7 +4116,8 @@ void CppClassGenerator::GenerateCppObjectLayoutDefinitionAsserts() { << "::" << f.name_and_type.name << " in C++ do not match\");\n"; } if (!type_->IsAbstract() && type_->HasStaticSize()) { - impl_ << " static_assert(kSize == sizeof(" + name_ + "));\n"; + impl_ << " static_assert(kSize <= sizeof(" + name_ + ") && sizeof(" + + name_ + ") < kSize + alignof(" + name_ + "));\n"; } impl_ << "};\n\n";