community/js185: v8 fix

This commit is contained in:
Kevin Mihelich 2019-01-07 01:31:34 +00:00
parent 9c3799fb2d
commit 9eed43b648
2 changed files with 3 additions and 91 deletions

View file

@ -4,7 +4,7 @@
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix mozilla stupidity
# - patch to fix mozilla stupidity
# - two patches for AArch64
# - patch for AArch64
pkgname=js185
pkgver=1.0.0
@ -22,8 +22,7 @@ source=("https://ftp.mozilla.org/pub/mozilla.org/js/${pkgname}-${pkgver}.tar.gz"
'allow-to-build-against-system-libffi.patch'
'apache-couchdb-mozjs-tag.patch'
ihatemozilla.patch no-neon.patch
Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch
mozjs185-tag.patch)
Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch)
sha256sums=('5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687'
'7d252ea688f3011360c3a370820e1a00c85ae785cdad37c6655d0d5ef996fb76'
'b738dc60b6f9c4697aede30ca09a87ac0d5895fe5da6c9f277295531cbe8c215'
@ -32,8 +31,7 @@ sha256sums=('5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687'
'669b2e87f962ef554ab8e7940d1dbf4e0e437b96ed3001a3b9ef124492a686d0'
'40d3f2778ff111bf75c736018a25c5d5cf02585a1981430d18dd2ec030414771'
'99bc474f881950c3d65b09d7a912115cc209d7fbfb4223a819b75d393bd49586'
'2f3fdaa47825835d3b54453c0cfb201f15aee2d12631a244106243d2ff5594e5'
'90ce234d5223e143cd94f2d2730dd9ec6d96f9fdeee7c4f6754ad4732f202fef')
'2f3fdaa47825835d3b54453c0cfb201f15aee2d12631a244106243d2ff5594e5')
prepare() {
find . -name config.sub -exec chmod +w {} \; -exec cp /usr/share/libtool/build-aux/config.sub {} \;
@ -52,7 +50,6 @@ find . -name config.guess -exec chmod +w {} \; -exec cp /usr/share/libtool/build
patch -p1 -i ../no-neon.patch
if [[ $CARCH == "aarch64" ]]; then
patch -p1 -i ../Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch
patch -p1 -i ../mozjs185-tag.patch
fi
}

View file

@ -1,85 +0,0 @@
diff -urN js-1.8.5.orig/js/src/jsval.h js-1.8.5/js/src/jsval.h
--- js-1.8.5.orig/js/src/jsval.h 2016-04-08 08:44:39.417713832 +0000
+++ js-1.8.5/js/src/jsval.h 2016-04-11 06:26:40.807919594 +0000
@@ -66,7 +66,7 @@
#endif
#if JS_BITS_PER_WORD == 64
-# define JSVAL_TAG_SHIFT 47
+# define JSVAL_TAG_SHIFT 48
#endif
/*
@@ -135,7 +135,8 @@
/* Remember to propagate changes to the C defines below. */
JS_ENUM_HEADER(JSValueTag, uint32)
{
- JSVAL_TAG_MAX_DOUBLE = 0x1FFF0,
+ JSVAL_TAG_DUMMY = 0xFFFFFFFF, /* Make sure the enums cannot fit 16-bits. */
+ JSVAL_TAG_MAX_DOUBLE = 0xFFF8,
JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,
JSVAL_TAG_UNDEFINED = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,
JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,
@@ -196,7 +197,7 @@
#elif JS_BITS_PER_WORD == 64
typedef uint32 JSValueTag;
-#define JSVAL_TAG_MAX_DOUBLE ((uint32)(0x1FFF0))
+#define JSVAL_TAG_MAX_DOUBLE ((uint32)(0xFFF8))
#define JSVAL_TAG_INT32 (uint32)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)
#define JSVAL_TAG_UNDEFINED (uint32)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)
#define JSVAL_TAG_STRING (uint32)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)
@@ -236,8 +237,8 @@
#elif JS_BITS_PER_WORD == 64
-#define JSVAL_PAYLOAD_MASK 0x00007FFFFFFFFFFFLL
-#define JSVAL_TAG_MASK 0xFFFF800000000000LL
+#define JSVAL_PAYLOAD_MASK 0x0000FFFFFFFFFFFFLL
+#define JSVAL_TAG_MASK 0xFFFF000000000000LL
#define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))
#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)
@@ -297,8 +298,8 @@
#if (!defined(_WIN64) && defined(__cplusplus))
/* MSVC does not pack these correctly :-( */
struct {
- uint64 payload47 : 47;
- JSValueTag tag : 17;
+ uint64 payload48 : 48;
+ JSValueTag tag : 16;
} debugView;
#endif
struct {
@@ -339,8 +340,8 @@
{
uint64 asBits;
struct {
- JSValueTag tag : 17;
- uint64 payload47 : 47;
+ JSValueTag tag : 16;
+ uint64 payload48 : 48;
} debugView;
struct {
union {
diff -urN js-1.8.5.orig/js/src/jsvalue.h js-1.8.5/js/src/jsvalue.h
--- js-1.8.5.orig/js/src/jsvalue.h 2016-04-08 08:44:39.417713832 +0000
+++ js-1.8.5/js/src/jsvalue.h 2016-04-11 06:10:21.219479884 +0000
@@ -255,7 +255,7 @@
{
uint64 lbits = lhs.asBits, rbits = rhs.asBits;
return (lbits <= JSVAL_TAG_MAX_DOUBLE && rbits <= JSVAL_TAG_MAX_DOUBLE) ||
- (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);
+ (((lbits ^ rbits) & 0xFFFF000000000000LL) == 0);
}
static JS_ALWAYS_INLINE jsval_layout
@@ -277,7 +277,7 @@
static JS_ALWAYS_INLINE JSValueType
JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)
{
- uint64 type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;
+ uint64 type = (l.asBits >> JSVAL_TAG_SHIFT) & 0x7;
JS_ASSERT(type > JSVAL_TYPE_DOUBLE);
return (JSValueType)type;
}