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 65729132b233dc5801f142f05a00253ac951e66a..e717a0b76513401daee6910502ea580485a20612 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
@@ -125,6 +125,9 @@
         'obj_dir%': '<(PRODUCT_DIR)/obj.target',
         'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
       }],
+      ['target_arch == "arm64" or target_arch == "x64"', {
+        'v8_enable_pointer_compression': 1,
+      }],
       ['target_arch in "ppc64 s390x"', {
         'v8_enable_backtrace': 1,
       }],
