File tree Expand file tree Collapse file tree 4 files changed +41
-3
lines changed Expand file tree Collapse file tree 4 files changed +41
-3
lines changed Original file line number Diff line number Diff line change 3636
3737 # Reset this number to 0 on major V8 upgrades.
3838 # Increment by one for each non-official patch applied to deps/v8.
39- 'v8_embedder_string' : '-node.13 ' ,
39+ 'v8_embedder_string' : '-node.14 ' ,
4040
4141 ##### V8 defaults for Node.js #####
4242
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ const int kApiTaggedSize = kApiInt32Size;
106106const int kApiTaggedSize = kApiSystemPointerSize ;
107107#endif
108108
109+ constexpr bool PointerCompressionIsEnabled () {
110+ return kApiTaggedSize != kApiSystemPointerSize ;
111+ }
112+
109113#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
110114using PlatformSmiTagging = SmiTagging<kApiInt32Size >;
111115#else
Original file line number Diff line number Diff line change @@ -9598,7 +9598,12 @@ class V8_EXPORT V8 {
95989598 * Initializes V8. This function needs to be called before the first Isolate
95999599 * is created. It always returns true.
96009600 */
9601- static bool Initialize ();
9601+ V8_INLINE static bool Initialize () {
9602+ const int kBuildConfiguration =
9603+ (internal::PointerCompressionIsEnabled () ? kPointerCompression : 0 ) |
9604+ (internal::SmiValuesAre31Bits () ? k31BitSmis : 0 );
9605+ return Initialize (kBuildConfiguration );
9606+ }
96029607
96039608 /* *
96049609 * Allows the host application to provide a callback which can be used
@@ -9732,6 +9737,17 @@ class V8_EXPORT V8 {
97329737 private:
97339738 V8 ();
97349739
9740+ enum BuildConfigurationFeatures {
9741+ kPointerCompression = 1 << 0 ,
9742+ k31BitSmis = 1 << 1 ,
9743+ };
9744+
9745+ /* *
9746+ * Checks that the embedder build configuration is compatible with
9747+ * the V8 binary and if so initializes V8.
9748+ */
9749+ static bool Initialize (int build_config);
9750+
97359751 static internal::Address* GlobalizeReference (internal::Isolate* isolate,
97369752 internal::Address* handle);
97379753 static internal::Address* GlobalizeTracedReference (internal::Isolate* isolate,
Original file line number Diff line number Diff line change @@ -5721,7 +5721,25 @@ void v8::V8::InitializePlatform(Platform* platform) {
57215721
57225722void v8::V8::ShutdownPlatform () { i::V8::ShutdownPlatform (); }
57235723
5724- bool v8::V8::Initialize () {
5724+ bool v8::V8::Initialize (const int build_config) {
5725+ const bool kEmbedderPointerCompression =
5726+ (build_config & kPointerCompression ) != 0 ;
5727+ if (kEmbedderPointerCompression != COMPRESS_POINTERS_BOOL) {
5728+ FATAL (
5729+ " Embedder-vs-V8 build configuration mismatch. On embedder side "
5730+ " pointer compression is %s while on V8 side it's %s." ,
5731+ kEmbedderPointerCompression ? " ENABLED" : " DISABLED" ,
5732+ COMPRESS_POINTERS_BOOL ? " ENABLED" : " DISABLED" );
5733+ }
5734+
5735+ const int kEmbedderSmiValueSize = (build_config & k31BitSmis) ? 31 : 32 ;
5736+ if (kEmbedderSmiValueSize != internal::kSmiValueSize ) {
5737+ FATAL (
5738+ " Embedder-vs-V8 build configuration mismatch. On embedder side "
5739+ " Smi value size is %d while on V8 side it's %d." ,
5740+ kEmbedderSmiValueSize , internal::kSmiValueSize );
5741+ }
5742+
57255743 i::V8::Initialize ();
57265744 return true ;
57275745}
You can’t perform that action at this time.
0 commit comments