File tree 4 files changed +41
-3
lines changed
4 files changed +41
-3
lines changed Original file line number Diff line number Diff line change 36
36
37
37
# Reset this number to 0 on major V8 upgrades.
38
38
# Increment by one for each non-official patch applied to deps/v8.
39
- 'v8_embedder_string' : '-node.13 ' ,
39
+ 'v8_embedder_string' : '-node.14 ' ,
40
40
41
41
##### V8 defaults for Node.js #####
42
42
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ const int kApiTaggedSize = kApiInt32Size;
106
106
const int kApiTaggedSize = kApiSystemPointerSize ;
107
107
#endif
108
108
109
+ constexpr bool PointerCompressionIsEnabled () {
110
+ return kApiTaggedSize != kApiSystemPointerSize ;
111
+ }
112
+
109
113
#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
110
114
using PlatformSmiTagging = SmiTagging<kApiInt32Size >;
111
115
#else
Original file line number Diff line number Diff line change @@ -9598,7 +9598,12 @@ class V8_EXPORT V8 {
9598
9598
* Initializes V8. This function needs to be called before the first Isolate
9599
9599
* is created. It always returns true.
9600
9600
*/
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
+ }
9602
9607
9603
9608
/* *
9604
9609
* Allows the host application to provide a callback which can be used
@@ -9732,6 +9737,17 @@ class V8_EXPORT V8 {
9732
9737
private:
9733
9738
V8 ();
9734
9739
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
+
9735
9751
static internal::Address* GlobalizeReference (internal::Isolate* isolate,
9736
9752
internal::Address* handle);
9737
9753
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) {
5721
5721
5722
5722
void v8::V8::ShutdownPlatform () { i::V8::ShutdownPlatform (); }
5723
5723
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
+
5725
5743
i::V8::Initialize ();
5726
5744
return true ;
5727
5745
}
You can’t perform that action at this time.
0 commit comments