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 3535
3636 # Reset this number to 0 on major V8 upgrades.
3737 # Increment by one for each non-official patch applied to deps/v8.
38- 'v8_embedder_string' : '-node.13 ' ,
38+ 'v8_embedder_string' : '-node.14 ' ,
3939
4040 ##### V8 defaults for Node.js #####
4141
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 @@ -9530,7 +9530,12 @@ class V8_EXPORT V8 {
95309530 * Initializes V8. This function needs to be called before the first Isolate
95319531 * is created. It always returns true.
95329532 */
9533- static bool Initialize ();
9533+ V8_INLINE static bool Initialize () {
9534+ const int kBuildConfiguration =
9535+ (internal::PointerCompressionIsEnabled () ? kPointerCompression : 0 ) |
9536+ (internal::SmiValuesAre31Bits () ? k31BitSmis : 0 );
9537+ return Initialize (kBuildConfiguration );
9538+ }
95349539
95359540 /* *
95369541 * Allows the host application to provide a callback which can be used
@@ -9664,6 +9669,17 @@ class V8_EXPORT V8 {
96649669 private:
96659670 V8 ();
96669671
9672+ enum BuildConfigurationFeatures {
9673+ kPointerCompression = 1 << 0 ,
9674+ k31BitSmis = 1 << 1 ,
9675+ };
9676+
9677+ /* *
9678+ * Checks that the embedder build configuration is compatible with
9679+ * the V8 binary and if so initializes V8.
9680+ */
9681+ static bool Initialize (int build_config);
9682+
96679683 static internal::Address* GlobalizeReference (internal::Isolate* isolate,
96689684 internal::Address* handle);
96699685 static internal::Address* GlobalizeTracedReference (internal::Isolate* isolate,
Original file line number Diff line number Diff line change @@ -5652,7 +5652,25 @@ void v8::V8::InitializePlatform(Platform* platform) {
56525652
56535653void v8::V8::ShutdownPlatform () { i::V8::ShutdownPlatform (); }
56545654
5655- bool v8::V8::Initialize () {
5655+ bool v8::V8::Initialize (const int build_config) {
5656+ const bool kEmbedderPointerCompression =
5657+ (build_config & kPointerCompression ) != 0 ;
5658+ if (kEmbedderPointerCompression != COMPRESS_POINTERS_BOOL) {
5659+ FATAL (
5660+ " Embedder-vs-V8 build configuration mismatch. On embedder side "
5661+ " pointer compression is %s while on V8 side it's %s." ,
5662+ kEmbedderPointerCompression ? " ENABLED" : " DISABLED" ,
5663+ COMPRESS_POINTERS_BOOL ? " ENABLED" : " DISABLED" );
5664+ }
5665+
5666+ const int kEmbedderSmiValueSize = (build_config & k31BitSmis) ? 31 : 32 ;
5667+ if (kEmbedderSmiValueSize != internal::kSmiValueSize ) {
5668+ FATAL (
5669+ " Embedder-vs-V8 build configuration mismatch. On embedder side "
5670+ " Smi value size is %d while on V8 side it's %d." ,
5671+ kEmbedderSmiValueSize , internal::kSmiValueSize );
5672+ }
5673+
56565674 i::V8::Initialize ();
56575675 return true ;
56585676}
You can’t perform that action at this time.
0 commit comments