From 29541032246bf1b0ca74fbddd00d4bcfce3c32d0 Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Sat, 14 Aug 2010 16:46:37 -0700 Subject: [PATCH] [Bug 587183] TM merge broke android in Nitro. r=sayrer. --- js/src/Makefile.in | 12 +++++++++--- js/src/assembler/wtf/Platform.h | 6 +++--- js/src/yarr/yarr/RegexJIT.cpp | 4 ++-- js/src/yarr/yarr/RegexJIT.h | 4 ++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/js/src/Makefile.in b/js/src/Makefile.in index c72097dd5b..1daf59e71f 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -831,12 +831,18 @@ endif # BEGIN kludges for the Nitro assembler # -INCLUDES += -I$(srcdir)/assembler -I$(srcdir)/yarr -# # Needed to "configure" it correctly. Unfortunately these # flags wind up being applied to all code in js/src, not just # the code in js/src/assembler. -CXXFLAGS += -DENABLE_ASSEMBLER=1 -DUSE_SYSTEM_MALLOC=1 -DENABLE_JIT=1 +CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 + +ifeq (android,$(TARGET_VENDOR)) +CXXFLAGS += -DWTF_PLATFORM_ANDROID=1 +else +CXXFLAGS += -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 +endif + +INCLUDES += -I$(srcdir)/assembler -I$(srcdir)/yarr # # END kludges for the Nitro assembler diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h index e19ccc4d4a..fedb841549 100644 --- a/js/src/assembler/wtf/Platform.h +++ b/js/src/assembler/wtf/Platform.h @@ -874,10 +874,10 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #if !defined(ENABLE_YARR_JIT) /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */ -#if WTF_CPU_X86 \ +#if (WTF_CPU_X86 \ || WTF_CPU_X86_64 \ || WTF_CPU_ARM_THUMB2 \ - || WTF_CPU_X86 + || WTF_CPU_X86) && !WTF_PLATFORM_ANDROID #define ENABLE_YARR_JIT 1 #else #define ENABLE_YARR_JIT 0 @@ -885,7 +885,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #endif /* !defined(ENABLE_YARR_JIT) */ -#if ENABLE_JIT || ENABLE_YARR_JIT +#if (ENABLE_JIT || ENABLE_YARR_JIT) && !WTF_PLATFORM_ANDROID #define ENABLE_ASSEMBLER 1 #endif /* Setting this flag prevents the assembler from using RWX memory; this may improve diff --git a/js/src/yarr/yarr/RegexJIT.cpp b/js/src/yarr/yarr/RegexJIT.cpp index 7160991e82..c7e36f1607 100644 --- a/js/src/yarr/yarr/RegexJIT.cpp +++ b/js/src/yarr/yarr/RegexJIT.cpp @@ -25,14 +25,14 @@ #include "RegexJIT.h" +#if ENABLE_ASSEMBLER + #include "assembler/assembler/LinkBuffer.h" #include "assembler/assembler/MacroAssembler.h" #include "RegexCompiler.h" #include "yarr/pcre/pcre.h" // temporary, remove when fallback is removed. -#if ENABLE_YARR_JIT - using namespace WTF; namespace JSC { namespace Yarr { diff --git a/js/src/yarr/yarr/RegexJIT.h b/js/src/yarr/yarr/RegexJIT.h index 775d92d1d7..be8aa571ad 100644 --- a/js/src/yarr/yarr/RegexJIT.h +++ b/js/src/yarr/yarr/RegexJIT.h @@ -26,6 +26,8 @@ #ifndef RegexJIT_h #define RegexJIT_h +#if ENABLE_ASSEMBLER + #include "assembler/assembler/MacroAssembler.h" #include "assembler/assembler/MacroAssemblerCodeRef.h" #include "assembler/jit/ExecutableAllocator.h" @@ -92,4 +94,6 @@ inline int executeRegex(JSContext *cx, RegexCodeBlock& jitObject, const UChar* i } } // namespace JSC::Yarr +#endif /* ENABLE_ASSEMBLER */ + #endif // RegexJIT_h -- 2.11.4.GIT