From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 10 Dec 2019 15:02:21 -0800
Subject: enable 31 bit smis on 64bit arch and ptr compression

This aligns with the defaults set on the Chromium build. Without this, native
node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work.

diff --git a/common.gypi b/common.gypi
index 4b6a965f65b9ad711507e4dd7ade4d54d52277cc..9e4064b263819756f17fb712a54bd6f828c5be35 100644
--- a/common.gypi
+++ b/common.gypi
@@ -64,7 +64,7 @@
     # options but default values are required here as this file is also used by
     # node-gyp to build addons.
     'v8_enable_pointer_compression%': 0,
-    'v8_enable_31bit_smis_on_64bit_arch%': 0,
+    'v8_enable_31bit_smis_on_64bit_arch%': 1,
 
     # Disable V8 untrusted code mitigations.
     # See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
@@ -130,6 +130,9 @@
         'v8_enable_pointer_compression': 0,
         'v8_enable_31bit_smis_on_64bit_arch': 0,
       }],
+      ['target_arch == "arm64" or target_arch == "x64"', {
+        'v8_enable_pointer_compression': 1,
+      }],
       ['target_arch in "ppc64 s390x"', {
         'v8_enable_backtrace': 1,
       }],
