[JAEGER] Merge from tracemonkey.
authorDavid Mandelin <dmandelin@mozilla.com>
Wed, 18 Aug 2010 11:03:53 -0700
changeset 53452 9c85862fffbdbf4a077a32faaa9f2aa175d9b41a
parent 53451 c74a3e0705bf94089da7c99da12f1f4303fa6d87 (current diff)
parent 51107 54602ead54172f0e79c7fd04894869aa5d1ff4ce (diff)
child 53454 c3409f0012586f2abf64d1bbf68c4e86735736d6
push idunknown
push userunknown
push dateunknown
milestone2.0b4pre
[JAEGER] Merge from tracemonkey.
js/src/Makefile.in
js/src/assembler/wtf/Platform.h
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -381,19 +381,16 @@ CPPSRCS += 	Assertions.cpp \
                 pcre_exec.cpp \
                 pcre_tables.cpp \
                 pcre_xclass.cpp \
                 pcre_ucp_searchfuncs.cpp \
 		$(NONE)
 
 ifeq (86, $(findstring 86,$(TARGET_CPU)))
 ifeq (x86_64, $(TARGET_CPU))
-ifeq ($(OS_ARCH),WINNT)
-ASFILES +=	TrampolineMasmX64.asm
-endif
 #CPPSRCS		+= only_on_x86_64.cpp
 else
 #CPPSRCS		+= only_on_x86.cpp
 endif
 endif
 ifeq (arm, $(TARGET_CPU))
 #CPPSRCS		+= only_on_arm.cpp
 endif
@@ -870,38 +867,43 @@ update-nanojit:
 	(cd $(srcdir) && hg commit --message="Update nanojit-import-rev stamp." nanojit-import-rev)
 
 .PHONY: update-nanojit
 endif
 
 ###############################################
 # BEGIN kludges for the Nitro assembler
 #
-## FIXME figure out where INCLUDES is being reset, and move this
-## backwards to that point.  Ideally, merge with the rest of the
-## Nitro assembler stuff, far above.
-ifdef ENABLE_METHODJIT
-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
+
+ifdef ENABLE_METHODJIT
 # Build a standalone test program that exercises the assembler
 # sources a bit.
 TESTMAIN_OBJS = \
 		Assertions.$(OBJ_SUFFIX) \
 		ExecutableAllocatorPosix.$(OBJ_SUFFIX) \
 		ExecutableAllocatorWin.$(OBJ_SUFFIX) \
 		ExecutableAllocator.$(OBJ_SUFFIX) \
 		ARMAssembler.$(OBJ_SUFFIX) \
 		MacroAssemblerARM.$(OBJ_SUFFIX) \
 		TestMain.$(OBJ_SUFFIX) \
 		jsutil.$(OBJ_SUFFIX) \
 		jslog2.$(OBJ_SUFFIX)
 TestMain$(HOST_BIN_SUFFIX): $(TESTMAIN_OBJS)
 	$(CXX) -o TestMain$(HOST_BIN_SUFFIX) $(TESTMAIN_OBJS)
 endif
+
 #
 # END kludges for the Nitro assembler
 ###############################################
 
--- a/js/src/assembler/wtf/Platform.h
+++ b/js/src/assembler/wtf/Platform.h
@@ -889,29 +889,29 @@ on MinGW. See https://bugs.webkit.org/sh
 #else
     #define WTF_USE_INTERPRETER 1
 #endif
 
 /* Yet Another Regex Runtime. */
 #if !defined(ENABLE_YARR_JIT)
 
 /* YARR supports ARM, 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_ARM_TRADITIONAL \
- || WTF_CPU_X86
+ || WTF_CPU_X86) && !WTF_PLATFORM_ANDROID
 #define ENABLE_YARR_JIT 1
 #else
 #define ENABLE_YARR_JIT 0
 #endif
 
 #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
    security but currectly comes at a significant performance cost. */
 #if WTF_PLATFORM_IPHONE
 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
 #else
 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
--- a/js/src/yarr/yarr/RegexJIT.cpp
+++ b/js/src/yarr/yarr/RegexJIT.cpp
@@ -20,24 +20,24 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 #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 {
 
 class JSGlobalData;
 
 class RegexGenerator : private MacroAssembler {
     friend void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
--- a/js/src/yarr/yarr/RegexJIT.h
+++ b/js/src/yarr/yarr/RegexJIT.h
@@ -21,16 +21,18 @@
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 #ifndef RegexJIT_h
 #define RegexJIT_h
 
+#if ENABLE_ASSEMBLER
+
 #include "assembler/assembler/MacroAssembler.h"
 #include "assembler/assembler/MacroAssemblerCodeRef.h"
 #include "assembler/jit/ExecutableAllocator.h"
 #include "RegexPattern.h"
 #include "yarr/jswtfbridge.h"
 
 #include "yarr/pcre/pcre.h"
 struct JSRegExp; // temporary, remove when fallback is removed.
@@ -87,9 +89,11 @@ inline int executeRegex(JSContext *cx, R
     if (JSRegExp* fallback = jitObject.getFallback())
         return (jsRegExpExecute(cx, fallback, input, length, start, output, outputArraySize) < 0 ? -1 : output[0]);
 
     return jitObject.execute(input, start, length, output);
 }
 
 } } // namespace JSC::Yarr
 
+#endif /* ENABLE_ASSEMBLER */
+
 #endif // RegexJIT_h