Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
7,071 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,72 @@ | ||
From 5017afb14474ef104719aaf56992f7c86475c42e Mon Sep 17 00:00:00 2001 | ||
From: Colin Walters <walters@verbum.org> | ||
Date: Mon, 17 Mar 2014 13:48:01 -0400 | ||
Subject: [PATCH] Move JS_BYTES_PER_WORD out of config.h | ||
|
||
Instead define it in terms of the already extant GNU C extension | ||
__SIZEOF_POINTER__. This avoids multiarch conflicts when 32 and 64 | ||
bit packages of js are co-installed. | ||
--- | ||
js/src/configure.in | 9 --------- | ||
js/src/js-config.h.in | 1 - | ||
js/src/jstypes.h | 12 ++++++++++++ | ||
3 files changed, 12 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/js/src/configure.in b/js/src/configure.in | ||
index 0bf9b75..daf53d2 100644 | ||
--- a/js/src/configure.in | ||
+++ b/js/src/configure.in | ||
@@ -3134,15 +3134,6 @@ else | ||
[int long 'long long' short]) | ||
fi | ||
|
||
-MOZ_SIZE_OF_TYPE(JS_BYTES_PER_WORD, void*, 4 8) | ||
-if test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "4"; then | ||
- AC_DEFINE(JS_BITS_PER_WORD_LOG2, 5) | ||
-elif test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "8"; then | ||
- AC_DEFINE(JS_BITS_PER_WORD_LOG2, 6) | ||
-else | ||
- AC_MSG_ERROR([Unexpected JS_BYTES_PER_WORD]) | ||
-fi | ||
- | ||
MOZ_ALIGN_OF_TYPE(JS_ALIGN_OF_POINTER, void*, 2 4 8 16) | ||
MOZ_SIZE_OF_TYPE(JS_BYTES_PER_DOUBLE, double, 6 8 10 12 14) | ||
|
||
diff --git a/js/src/js-config.h.in b/js/src/js-config.h.in | ||
index e3a5f74..f30d5c3 100644 | ||
--- a/js/src/js-config.h.in | ||
+++ b/js/src/js-config.h.in | ||
@@ -81,7 +81,6 @@ | ||
#undef JS_INT32_TYPE | ||
#undef JS_INT64_TYPE | ||
#undef JS_INTPTR_TYPE | ||
-#undef JS_BYTES_PER_WORD | ||
|
||
/* Some mozilla code uses JS-friend APIs that depend on JS_TRACER and | ||
JS_METHODJIT being correct. */ | ||
diff --git a/js/src/jstypes.h b/js/src/jstypes.h | ||
index c2103d8..84d402e 100644 | ||
--- a/js/src/jstypes.h | ||
+++ b/js/src/jstypes.h | ||
@@ -56,6 +56,18 @@ | ||
|
||
#include <stddef.h> | ||
#include "js-config.h" | ||
+#ifndef JS_BYTES_PER_WORD | ||
+#define JS_BYTES_PER_WORD __SIZEOF_POINTER__ | ||
+#endif | ||
+#ifndef JS_BITS_PER_WORD_LOG2 | ||
+#if JS_BYTES_PER_WORD == 8 | ||
+#define JS_BITS_PER_WORD_LOG2 6 | ||
+#elif JS_BYTES_PER_WORD == 4 | ||
+#define JS_BITS_PER_WORD_LOG2 5 | ||
+#else | ||
+#error Unhandled JS_BYTES_PER_WORD | ||
+#endif | ||
+#endif | ||
|
||
/*********************************************************************** | ||
** MACROS: JS_EXTERN_API | ||
-- | ||
1.8.3.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,13 @@ | ||
--- js-1.8.5/js/src/configure.in 2011-03-31 22:08:36.000000000 +0300 | ||
+++ js-1.8.5/js/src/configure.in~ 2012-11-10 17:59:02.222497367 +0200 | ||
@@ -5615,8 +5615,8 @@ esac | ||
|
||
if test -z "$SKIP_LIBRARY_CHECKS" -a -z "$NO_EDITLINE"; then | ||
if test -n "$JS_WANT_READLINE"; then | ||
- AC_CHECK_LIB(readline, readline, | ||
- EDITLINE_LIBS="-lreadline", | ||
+ AC_CHECK_LIB(edit, readline, | ||
+ EDITLINE_LIBS="$(pkg-config --libs libedit)", | ||
AC_MSG_ERROR([No system readline library found.])) | ||
else | ||
dnl By default, we use editline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,99 @@ | ||
diff -up js-1.8.5/js/src/jsval.h.tag js-1.8.5/js/src/jsval.h | ||
--- js-1.8.5/js/src/jsval.h.tag 2017-03-10 16:27:06.000000000 +0100 | ||
+++ js-1.8.5/js/src/jsval.h 2017-03-10 16:30:39.000000000 +0100 | ||
@@ -66,7 +66,7 @@ JS_BEGIN_EXTERN_C | ||
#endif | ||
|
||
#if JS_BITS_PER_WORD == 64 | ||
-# define JSVAL_TAG_SHIFT 47 | ||
+# define JSVAL_TAG_SHIFT 48 | ||
#endif | ||
|
||
/* | ||
@@ -135,7 +135,8 @@ JS_STATIC_ASSERT(sizeof(JSValueTag) == 4 | ||
/* 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 @@ typedef uint32 JSValueTag; | ||
#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 @@ typedef uint64 JSValueShiftedTag; | ||
|
||
#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 @@ typedef union jsval_layout | ||
#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 @@ typedef union jsval_layout | ||
{ | ||
uint64 asBits; | ||
struct { | ||
- JSValueTag tag : 17; | ||
- uint64 payload47 : 47; | ||
+ JSValueTag tag : 16; | ||
+ uint64 payload48 : 48; | ||
} debugView; | ||
struct { | ||
uint32 padding; | ||
diff -up js-1.8.5/js/src/jsvalue.h.tag js-1.8.5/js/src/jsvalue.h | ||
--- js-1.8.5/js/src/jsvalue.h.tag 2017-03-10 16:27:06.000000000 +0100 | ||
+++ js-1.8.5/js/src/jsvalue.h 2017-03-10 16:27:06.000000000 +0100 | ||
@@ -255,7 +255,7 @@ JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, j | ||
{ | ||
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 @@ JSVAL_TO_PRIVATE_UINT32_IMPL(jsval_layou | ||
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; | ||
} | ||
diff -up js-1.8.5/js/src/methodjit/MethodJIT.cpp.tag js-1.8.5/js/src/methodjit/MethodJIT.cpp | ||
--- js-1.8.5/js/src/methodjit/MethodJIT.cpp.tag 2011-03-31 21:08:36.000000000 +0200 | ||
+++ js-1.8.5/js/src/methodjit/MethodJIT.cpp 2017-03-10 16:27:06.000000000 +0100 | ||
@@ -186,8 +186,8 @@ JS_STATIC_ASSERT(sizeof(VMFrame) % 16 == | ||
JS_STATIC_ASSERT(offsetof(VMFrame, savedRBX) == 0x58); | ||
JS_STATIC_ASSERT(offsetof(VMFrame, regs.fp) == 0x38); | ||
|
||
-JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF800000000000LL); | ||
-JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x00007FFFFFFFFFFFLL); | ||
+JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF000000000000LL); | ||
+JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x0000FFFFFFFFFFFFLL); | ||
|
||
asm volatile ( | ||
".text\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,37 @@ | ||
diff -Naur js-1.8.5.orig/js/src/assembler/wtf/Platform.h js-1.8.5/js/src/assembler/wtf/Platform.h | ||
--- js-1.8.5.orig/js/src/assembler/wtf/Platform.h | ||
+++ js-1.8.5/js/src/assembler/wtf/Platform.h | ||
@@ -129,16 +129,22 @@ | ||
|| defined(__POWERPC__) \ | ||
|| defined(_M_PPC) \ | ||
|| defined(__PPC) | ||
+#if !defined(__ppc64__) && !defined(__PPC64__) | ||
#define WTF_CPU_PPC 1 | ||
+#endif | ||
+#if !defined(__LITTLE_ENDIAN__) | ||
#define WTF_CPU_BIG_ENDIAN 1 | ||
#endif | ||
+#endif | ||
|
||
/* CPU(PPC64) - PowerPC 64-bit */ | ||
#if defined(__ppc64__) \ | ||
|| defined(__PPC64__) | ||
#define WTF_CPU_PPC64 1 | ||
+#if !defined(__LITTLE_ENDIAN__) | ||
#define WTF_CPU_BIG_ENDIAN 1 | ||
#endif | ||
+#endif | ||
|
||
/* CPU(SH4) - SuperH SH-4 */ | ||
#if defined(__SH4__) | ||
diff -Naur js-1.8.5.orig/js/src/configure.in js-1.8.5/js/src/configure.in | ||
--- js-1.8.5.orig/js/src/configure.in | ||
+++ js-1.8.5/js/src/configure.in | ||
@@ -1498,7 +1498,7 @@ | ||
CPU_ARCH=x86 | ||
;; | ||
|
||
-powerpc64 | ppc64) | ||
+powerpc64 | ppc64 | powerpc64le | ppc64le) | ||
CPU_ARCH=ppc64 | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,29 @@ | ||
From: Mike Hommey <mh+mozilla@glandium.org> | ||
Date: Mon, 21 Mar 2011 18:31:12 +0100 | ||
Subject: Bug 589744 - Fallback to perf measurement stub when perf_event_open | ||
syscall isn't supported. r=ted | ||
|
||
--- | ||
js/src/configure.in | 11 ++++++++++- | ||
1 files changed, 10 insertions(+), 1 deletions(-) | ||
|
||
--- a/js/src/configure.in | ||
+++ b/js/src/configure.in | ||
@@ -3477,7 +3477,16 @@ case $target in | ||
esac | ||
|
||
dnl Performance measurement headers. | ||
-AC_CHECK_HEADER(linux/perf_event.h, HAVE_LINUX_PERF_EVENT_H=1) | ||
+AC_CHECK_HEADER(linux/perf_event.h, | ||
+ [AC_CACHE_CHECK(for perf_event_open system call,ac_cv_perf_event_open, | ||
+ [AC_TRY_COMPILE([#include <sys/syscall.h>],[return sizeof(__NR_perf_event_open);], | ||
+ ac_cv_perf_event_open=yes, | ||
+ ac_cv_perf_event_open=no)])]) | ||
+if test "$ac_cv_perf_event_open" = "yes"; then | ||
+ HAVE_LINUX_PERF_EVENT_H=1 | ||
+else | ||
+ HAVE_LINUX_PERF_EVENT_H= | ||
+fi | ||
AC_SUBST(HAVE_LINUX_PERF_EVENT_H) | ||
|
||
dnl Checks for libraries. |
Oops, something went wrong.