summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorLars T Hansen <lhansen@mozilla.com>2019-07-20 15:43:01 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-07-20 15:43:01 +0200
commit7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9 (patch)
tree02865106951fc182ebf3c7d9f130e3dadb428e55 /js
parentb7807cd00b4930639c8d536887a0b54d61c793ee (diff)
downloadUXP-7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9.tar
UXP-7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9.tar.gz
UXP-7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9.tar.lz
UXP-7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9.tar.xz
UXP-7e6342a01158d689cb8cbfcb7ffb34f4aa2817c9.zip
Define JumpImmediateRange on ARM64.
There are comments in the code suggesting that we've made plans at some point to handle very far jumps via patching + indirect jumps, but all of those comments are TODO/FIXME. Absent such a strategy, the furthest jump is 2^27-1 bytes, and we need to define JumpImmediateRange to reflect that.
Diffstat (limited to 'js')
-rw-r--r--js/src/jit/arm64/Architecture-arm64.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/src/jit/arm64/Architecture-arm64.h b/js/src/jit/arm64/Architecture-arm64.h
index e74340f13..bee212db7 100644
--- a/js/src/jit/arm64/Architecture-arm64.h
+++ b/js/src/jit/arm64/Architecture-arm64.h
@@ -299,10 +299,12 @@ static const uint32_t ION_FRAME_SLACK_SIZE = 24;
static const uint32_t ShadowStackSpace = 0;
-// TODO:
-// This constant needs to be updated to account for whatever near/far branching
-// strategy is used by ARM64.
-static const uint32_t JumpImmediateRange = UINT32_MAX;
+// When our only strategy for far jumps is to encode the offset directly, and
+// not insert any jump islands during assembly for even further jumps, then the
+// architecture restricts us to -2^27 .. 2^27-4, to fit into a signed 28-bit
+// value. We further reduce this range to allow the far-jump inserting code to
+// have some breathing room.
+static const uint32_t JumpImmediateRange = ((1 << 27) - (20 * 1024 * 1024));
static const uint32_t ABIStackAlignment = 16;
static const uint32_t CodeAlignment = 16;