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 35
35
36
36
# Reset this number to 0 on major V8 upgrades.
37
37
# Increment by one for each non-official patch applied to deps/v8.
38
- 'v8_embedder_string' : '-node.13 ' ,
38
+ 'v8_embedder_string' : '-node.14 ' ,
39
39
40
40
##### V8 defaults for Node.js #####
41
41
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 @@ -9530,7 +9530,12 @@ class V8_EXPORT V8 {
9530
9530
* Initializes V8. This function needs to be called before the first Isolate
9531
9531
* is created. It always returns true.
9532
9532
*/
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
+ }
9534
9539
9535
9540
/* *
9536
9541
* Allows the host application to provide a callback which can be used
@@ -9664,6 +9669,17 @@ class V8_EXPORT V8 {
9664
9669
private:
9665
9670
V8 ();
9666
9671
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
+
9667
9683
static internal::Address* GlobalizeReference (internal::Isolate* isolate,
9668
9684
internal::Address* handle);
9669
9685
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) {
5652
5652
5653
5653
void v8::V8::ShutdownPlatform () { i::V8::ShutdownPlatform (); }
5654
5654
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
+
5656
5674
i::V8::Initialize ();
5657
5675
return true ;
5658
5676
}
You can’t perform that action at this time.
0 commit comments