Merge from tracemonkey.
authorDavid Anderson <danderson@mozilla.com>
Wed, 25 May 2011 23:23:45 -0700
changeset 104816 92842c9de360a56fc2001bd37789a52f7ae4f444
parent 104815 3e098050470c6038b35ff6359b6bd3b8d3b5fe8e (current diff)
parent 70624 7e7cf9bc4cc8df1af1fe159281fc9730194bfdb1 (diff)
child 104817 13fc895fc73a0681c67bf58138db128b606e7b9d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
milestone6.0a1
Merge from tracemonkey.
js/src/Makefile.in
js/src/yarr/Makefile
js/src/yarr/jswtfbridge.h
js/src/yarr/pcre/AUTHORS
js/src/yarr/pcre/COPYING
js/src/yarr/pcre/chartables.c
js/src/yarr/pcre/dftables
js/src/yarr/pcre/pcre.h
js/src/yarr/pcre/pcre.pri
js/src/yarr/pcre/pcre_compile.cpp
js/src/yarr/pcre/pcre_exec.cpp
js/src/yarr/pcre/pcre_internal.h
js/src/yarr/pcre/pcre_tables.cpp
js/src/yarr/pcre/pcre_ucp_searchfuncs.cpp
js/src/yarr/pcre/pcre_xclass.cpp
js/src/yarr/pcre/ucpinternal.h
js/src/yarr/pcre/ucptable.cpp
js/src/yarr/wtf/ASCIICType.h
js/src/yarr/yarr/RegExpJitTables.h
js/src/yarr/yarr/RegexCommon.h
js/src/yarr/yarr/RegexCompiler.cpp
js/src/yarr/yarr/RegexCompiler.h
js/src/yarr/yarr/RegexJIT.cpp
js/src/yarr/yarr/RegexJIT.h
js/src/yarr/yarr/RegexParser.h
js/src/yarr/yarr/RegexPattern.h
--- a/js/jsd/idl/jsdIDebuggerService.idl
+++ b/js/jsd/idl/jsdIDebuggerService.idl
@@ -537,17 +537,17 @@ interface jsdIContextEnumerator : nsISup
      * currently in use.
      */
     void enumerateContext(in jsdIContext executionContext);
 };
 
 /**
  * Set jsdIDebuggerService::scriptHook to an instance of one of these.
  */
-[scriptable, uuid(bb722893-0f63-45c5-b547-7a0947c7b6b6)]
+[scriptable, uuid(d030d1a2-a58a-4f19-b9e3-96da4e2cdd09)]
 interface jsdIScriptHook : nsISupports
 {
     /**
      * Called when scripts are created.
      */
     void onScriptCreated(in jsdIScript script);
     /**
      * Called when the JavaScript engine destroys a script. The jsdIScript
@@ -806,17 +806,17 @@ interface jsdIContext : jsdIEphemeral
 
 /**
  * Stack frame objects. These are only valid inside the jsdIExecutionHook which
  * gave it to you. After you return from that handler the bottom frame, and any
  * frame you found attached through it, are invalidated via the jsdIEphemeral
  * interface. Once a jsdIStackFrame has been invalidated all method and
  * property accesses will throw a NS_ERROR_NOT_AVAILABLE exception.
  */
-[scriptable, uuid(0633ca73-105e-4e8e-bcc5-13405d61754a)]
+[scriptable, uuid(7c95422c-7579-4a6f-8ef7-e5b391552ee5)]
 interface jsdIStackFrame : jsdIEphemeral
 {
     /** Internal use only. */
     [noscript] readonly attribute JSDContext        JSDContext;
     /** Internal use only. */
     [noscript] readonly attribute JSDThreadState    JSDThreadState;
     /** Internal use only. */
     [noscript] readonly attribute JSDStackFrameInfo JSDStackFrameInfo;
@@ -879,17 +879,17 @@ interface jsdIStackFrame : jsdIEphemeral
                  in unsigned long line, out jsdIValue result);
     
 };
 
 /**
  * Script object. In JavaScript engine terms, there's a single script for each
  * function, and one for the top level script.
  */
-[scriptable, uuid(e7935220-7def-4c8e-832f-fbc948a97490)]
+[scriptable, uuid(721724e0-7716-4bf4-b48f-92b78d056141)]
 interface jsdIScript : jsdIEphemeral
 {
     /** Internal use only. */
     [noscript] readonly attribute JSDContext JSDContext;
     /** Internal use only. */
     [noscript] readonly attribute JSDScript  JSDScript;
     
     /**
@@ -1025,16 +1025,27 @@ interface jsdIScript : jsdIEphemeral
      */
     unsigned long lineToPc(in unsigned long line, in unsigned long pcmap);
     /**
      * Determine is a particular line is executable, like checking that
      * lineToPc == pcToLine, except in one call.
      * The |pcmap| argument specifies which pc to source line map to use.
      */
     boolean isLineExecutable(in unsigned long line, in unsigned long pcmap);
+
+    /**
+     * Return a list of all executable lines in a script.
+     * |pcmap| specifies which pc to source line map to use.
+     * |startLine| and |maxLines| may be used to retrieve a chunk at a time.
+     */
+    void getExecutableLines(in unsigned long pcmap,
+                            in unsigned long startLine, in unsigned long maxLines,
+                            [optional] out unsigned long count,
+                            [array, size_is(count), retval] out unsigned long executableLines);
+ 
     /**
      * Set a breakpoint at a PC in this script.
      */
     void setBreakpoint(in unsigned long pc);
     /**
      * Clear a breakpoint at a PC in this script.
      */
     void clearBreakpoint(in unsigned long pc);
@@ -1049,17 +1060,17 @@ interface jsdIScript : jsdIEphemeral
 };
 
 /**
  * Value objects. Represents typeless JavaScript values (jsval in SpiderMonkey
  * terminology.)  These are valid until the debugger is turned off. Holding a
  * jsdIValue adds a root for the underlying JavaScript value, so don't keep it
  * if you don't need to.
  */
-[scriptable, uuid(fd1311f7-096c-44a3-847b-9d478c8176c3)]
+[scriptable, uuid(861c4d37-e115-4a52-9f76-273cb6b21c3b)]
 interface jsdIValue : jsdIEphemeral
 {
     /** Internal use only. */
     [noscript] readonly attribute JSDContext JSDContext;
     /** Internal use only. */
     [noscript] readonly attribute JSDValue   JSDValue;
 
     /**
--- a/js/jsd/jsd.h
+++ b/js/jsd/jsd.h
@@ -476,16 +476,21 @@ extern JSBool
 jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata);
 
 extern jsuword
 jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line);
 
 extern uintN
 jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc);
 
+extern JSBool
+jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
+               uintN startLine, uintN maxLines,
+               uintN* count, uintN** lines, jsuword** pcs);
+
 extern void
 jsd_NewScriptHookProc(
                 JSContext   *cx,
                 const char  *filename,      /* URL this script loads from */
                 uintN       lineno,         /* line where this script starts */
                 JSScript    *script,
                 JSFunction  *fun,
                 void*       callerdata);
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -576,16 +576,54 @@ jsd_GetClosestLine(JSDContext* jsdc, JSD
         line = newline;
     }
 #endif
 
     return line;    
 }
 
 JSBool
+jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
+               uintN startLine, uintN maxLines,
+               uintN* count, uintN** retLines, jsuword** retPCs)
+{
+    JSCrossCompartmentCall *call;
+    uintN first = jsdscript->lineBase;
+    uintN last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1;
+    JSBool ok;
+    uintN *lines;
+    jsbytecode **pcs;
+    uintN i;
+
+    if (last < startLine)
+        return JS_TRUE;
+
+    call = JS_EnterCrossCompartmentCallScript(jsdc->dumbContext, jsdscript->script);
+    if (!call)
+        return JS_FALSE;
+
+    ok = JS_GetLinePCs(jsdc->dumbContext, jsdscript->script,
+                       startLine, maxLines,
+                       count, retLines, &pcs);
+
+    if (ok) {
+        if (retPCs) {
+            for (i = 0; i < *count; ++i) {
+                (*retPCs)[i] = (*pcs)[i];
+            }
+        }
+
+        JS_free(jsdc->dumbContext, pcs);
+    }
+
+    JS_LeaveCrossCompartmentCall(call);
+    return ok;
+}
+
+JSBool
 jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata)
 {
     JSD_LOCK();
     jsdc->scriptHook = hook;
     jsdc->scriptHookData = callerdata;
     JSD_UNLOCK();
     return JS_TRUE;
 }
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -1537,16 +1537,68 @@ jsdScript::EnableSingleStepInterrupts(PR
     /* Must have set interrupt hook before enabling */
     if (enable && !jsdService::GetService()->CheckInterruptHook())
         return NS_ERROR_NOT_INITIALIZED;
 
     return (JSD_EnableSingleStepInterrupts(mCx, mScript, enable) ? NS_OK : NS_ERROR_FAILURE);
 }
 
 NS_IMETHODIMP
+jsdScript::GetExecutableLines(PRUint32 aPcmap, PRUint32 aStartLine, PRUint32 aMaxLines,
+                              PRUint32* aCount, PRUint32** aExecutableLines)
+{
+    ASSERT_VALID_EPHEMERAL;
+    if (aPcmap == PCMAP_SOURCETEXT) {
+        jsuword start = JSD_GetClosestPC(mCx, mScript, 0);
+        uintN lastLine = JSD_GetScriptBaseLineNumber(mCx, mScript)
+                       + JSD_GetScriptLineExtent(mCx, mScript) - 1;
+        jsuword end = JSD_GetClosestPC(mCx, mScript, lastLine + 1);
+
+        *aExecutableLines = static_cast<PRUint32*>(NS_Alloc((end - start + 1) * sizeof(PRUint32)));
+        if (!JSD_GetLinePCs(mCx, mScript, aStartLine, aMaxLines, aCount, aExecutableLines, NULL))
+            return NS_ERROR_OUT_OF_MEMORY;
+        
+        return NS_OK;
+    }
+
+    if (aPcmap == PCMAP_PRETTYPRINT) {
+        if (!mPPLineMap) {
+            if (!CreatePPLineMap())
+                return NS_ERROR_OUT_OF_MEMORY;
+        }
+
+        nsTArray<PRUint32> lines;
+        PRUint32 i;
+
+        for (i = 0; i < mPCMapSize; ++i) {
+            if (mPPLineMap[i].line >= aStartLine)
+                break;
+        }
+
+        for (; i < mPCMapSize && lines.Length() < aMaxLines; ++i) {
+            lines.AppendElement(mPPLineMap[i].line);
+        }
+
+        if (aCount)
+            *aCount = lines.Length();
+
+        *aExecutableLines = static_cast<PRUint32*>(NS_Alloc(lines.Length() * sizeof(PRUint32)));
+        if (!*aExecutableLines)
+            return NS_ERROR_OUT_OF_MEMORY;
+
+        for (i = 0; i < lines.Length(); ++i)
+            (*aExecutableLines)[i] = lines[i];
+
+        return NS_OK;
+    }
+
+    return NS_ERROR_INVALID_ARG;
+}
+
+NS_IMETHODIMP
 jsdScript::IsLineExecutable(PRUint32 aLine, PRUint32 aPcmap, PRBool *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     if (aPcmap == PCMAP_SOURCETEXT) {    
         jsuword pc = JSD_GetClosestPC (mCx, mScript, aLine);
         *_rval = (aLine == JSD_GetClosestLine (mCx, mScript, pc));
     } else if (aPcmap == PCMAP_PRETTYPRINT) {
         if (!mPPLineMap && !CreatePPLineMap())
--- a/js/jsd/jsdebug.c
+++ b/js/jsd/jsdebug.c
@@ -351,16 +351,26 @@ JSD_GetClosestPC(JSDContext* jsdc, JSDSc
 JSD_PUBLIC_API(uintN)
 JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetClosestLine(jsdc, jsdscript, pc);
 }
 
+JSD_PUBLIC_API(JSBool)
+JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
+               uintN startLine, uintN maxLines,
+               uintN* count, uintN** lines, jsuword** pcs)
+{
+    JSD_ASSERT_VALID_CONTEXT(jsdc);
+    JSD_ASSERT_VALID_SCRIPT(jsdscript);
+    return jsd_GetLinePCs(jsdc, jsdscript, startLine, maxLines, count, lines, pcs);
+}
+
 JSD_PUBLIC_API(void)
 JSD_ScriptCreated(JSDContext* jsdc,
                   JSContext   *cx,
                   const char  *filename,    /* URL this script loads from */
                   uintN       lineno,       /* line where this script starts */
                   JSScript    *script,
                   JSFunction  *fun)
 {
--- a/js/jsd/jsdebug.h
+++ b/js/jsd/jsdebug.h
@@ -491,16 +491,27 @@ JSD_GetClosestPC(JSDContext* jsdc, JSDSc
 /*
 * Get the source line number for a given 'Program Counter' location.
 * Returns 0 if no source line information is appropriate (or available) for
 * the given pc.
 */
 extern JSD_PUBLIC_API(uintN)
 JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc);
 
+/*
+ * Get a list of lines and the corresponding earliest PC for each (see
+ * JSD_GetClosestPC). Lines with no PCs associated will not be returned. NULL
+ * may be passed for either lines or pcs to avoid filling anything in for that
+ * argument.
+ */
+extern JSD_PUBLIC_API(JSBool)
+JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
+               uintN startLine, uintN maxLines,
+               uintN* count, uintN** lines, jsuword** pcs);
+
 /* these are only used in cases where scripts are created outside of JS*/
 
 /*
 * Direct call to notify JSD that a script has been created.
 * Embeddings that use the normal jsapi script functions need not call this.
 * Any embedding that follows the (discouraged!) practice of contructing script
 * structures manually should call this function to inform JSD. (older ssjs
 * systems do this).
--- a/js/jsd/test/Makefile.in
+++ b/js/jsd/test/Makefile.in
@@ -44,12 +44,13 @@ relativesrcdir  = js/jsd/test
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = jsdebug
 
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = 	test_bug507448.html bug507448.js \
 		test_bug617870-callhooks.html test-bug617870-callhooks.js jsd-test.js \
+		test_bug638178-execlines.html test-bug638178-execlines.js \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/js/jsd/test/test-bug638178-execlines.js
@@ -0,0 +1,95 @@
+netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+var jsdIScript = Components.interfaces.jsdIScript;
+
+function f1() {
+    var x;
+}
+
+function f2() {
+
+
+    var x; var y; x = 1;
+}
+
+function f3() {
+
+
+    var x;
+
+    var y; var y2; y = 1;
+    var z;
+
+}
+
+var jsdIFilter = Components.interfaces.jsdIFilter;
+
+function testJSD(jsd) {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    ok(jsd.isOn, "JSD needs to be running for this test.");
+
+    jsd.functionHook = ({
+        onCall: function(frame, type) {
+            //console.log("Got " + type);
+            console.log("Got " + frame.script.fileName);
+        }
+    });
+
+    console.log("Triggering functions");
+    f1();
+    f2();
+    f3();
+    console.log("Done with functions");
+
+    var linemap = {};
+    var firsts = {};
+    var rests = {};
+    var startlines = {};
+    jsd.enumerateScripts({
+        enumerateScript: function(script) {
+            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+            if (/execlines\.js$/.test(script.fileName)) {
+                console.log("script: " + script.fileName + " " + script.functionName);
+                var execLines = script.getExecutableLines(jsdIScript.PCMAP_SOURCETEXT, 0, 10000);
+                console.log(execLines.toSource());
+                linemap[script.functionName] = execLines;
+                startlines[script.functionName] = script.baseLineNumber;
+
+                execLines = script.getExecutableLines(jsdIScript.PCMAP_SOURCETEXT, 0, 1);
+                firsts[script.functionName] = execLines;
+                execLines = script.getExecutableLines(jsdIScript.PCMAP_SOURCETEXT, execLines[0]+1, 10000);
+                rests[script.functionName] = execLines;
+            }
+        }
+    });
+
+    var checklines = function (funcname, linemap, rellines) {
+        var base = startlines[funcname];
+        var b = [];
+        for (var i = 0; i < rellines.length; ++i) {
+            b[i] = rellines[i] + base;
+        }
+        is(linemap[funcname].toSource(), b.toSource(), funcname + " lines");
+    };
+
+    checklines('f1', linemap, [ 1 ]);
+    checklines('f2', linemap, [ 3 ]);
+    checklines('f3', linemap, [ 3, 5, 6 ]);
+
+    checklines('f1', firsts, [ 1 ]);
+    checklines('f1', rests, []);
+    checklines('f3', firsts, [ 3 ]);
+    checklines('f3', rests, [ 5, 6 ]);
+
+    jsd.functionHook = null;
+
+    if (!jsdOnAtStart) {
+        // turn JSD off if it wasn't on when this test started
+        jsd.off();
+        ok(!jsd.isOn, "JSD shouldn't be running at the end of this test.");
+    }
+
+    SimpleTest.finish();
+}
+
+testJSD(jsd);
new file mode 100644
--- /dev/null
+++ b/js/jsd/test/test_bug638178-execlines.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <!-- The bug number is pulled from the test URL -->
+  <title>JSD Test for Bug AUTOFILLED</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="jsd-test.js"></script>
+  <script type="application/javascript">
+var BUG = 638178;
+var TEST_SCRIPT = "test-bug638178-execlines.js";
+document.getElementsByTagName("title")[0].innerHTML = "JSD Test for Bug " + BUG;
+
+netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+SimpleTest.waitForExplicitFinish();
+
+function runTest() {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    console.log("start of runTest, loading script");
+    loadScript(TEST_SCRIPT, document.getElementById("test"));
+    console.log("end of runTest");
+}
+
+function setupTest() {
+    var buglink = document.getElementById("buglink");
+    buglink.href = "https://bugzilla.mozilla.org/show_bug.cgi?id=" + BUG;
+    buglink.innerHTML = "Mozilla Bug " + BUG;
+}
+  </script>
+</head>
+<body onLoad='setupTest(); setupJSD();'>
+
+<a id="buglink" target="_blank"></a>
+<p id="display"></p>
+
+<div id="content" style="display: none">
+  <pre id='test'>
+  </pre>
+</div>
+
+<div id='test-output'>
+</div>
+
+</body>
+</html>
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -426,57 +426,57 @@ CPPSRCS += 	checks.cc \
 #
 # END enclude sources for V8 dtoa
 #############################################
 
 ifeq (,$(filter arm% sparc %86 x86_64,$(TARGET_CPU)))
 
 VPATH +=	$(srcdir)/assembler \
 		$(srcdir)/assembler/wtf \
-		$(srcdir)/yarr/pcre \
+		$(srcdir)/yarr\
 		$(NULL)
 
-CPPSRCS += 	pcre_compile.cpp \
-                pcre_exec.cpp \
-                pcre_tables.cpp \
-                pcre_xclass.cpp \
-                pcre_ucp_searchfuncs.cpp \
+CPPSRCS += \
+		Assertions.cpp \
+		OSAllocatorPosix.cpp \
+		OSAllocatorWin.cpp \
+		PageBlock.cpp \
+		YarrInterpreter.cpp \
+		YarrPattern.cpp \
+		YarrSyntaxChecker.cpp \
 		$(NULL)
 else
 
 ###############################################
 # BEGIN include sources for the Nitro assembler
 #
 VPATH += 	$(srcdir)/assembler \
 		$(srcdir)/assembler/wtf \
 		$(srcdir)/assembler/jit \
 		$(srcdir)/assembler/assembler \
 		$(srcdir)/methodjit \
 		$(srcdir)/yarr \
-		$(srcdir)/yarr/yarr \
-		$(srcdir)/yarr/pcre \
-		$(srcdir)/yarr/wtf \
 		$(NONE)
 
 CPPSRCS += 	Assertions.cpp \
 		ExecutableAllocatorPosix.cpp \
 		ExecutableAllocatorWin.cpp \
 		ExecutableAllocatorOS2.cpp \
 		ExecutableAllocator.cpp \
 		ARMAssembler.cpp \
-                Logging.cpp \
+        Logging.cpp \
 		MacroAssemblerARM.cpp \
 		MacroAssemblerX86Common.cpp \
-		RegexCompiler.cpp \
-		RegexJIT.cpp \
-		pcre_compile.cpp \
-                pcre_exec.cpp \
-                pcre_tables.cpp \
-                pcre_xclass.cpp \
-                pcre_ucp_searchfuncs.cpp \
+		OSAllocatorPosix.cpp \
+		OSAllocatorWin.cpp \
+		PageBlock.cpp \
+		YarrInterpreter.cpp \
+		YarrJIT.cpp \
+		YarrPattern.cpp \
+		YarrSyntaxChecker.cpp \
 		$(NONE)
 
 ifeq (86, $(findstring 86,$(TARGET_CPU)))
 ifeq (x86_64, $(TARGET_CPU))
 #CPPSRCS		+= only_on_x86_64.cpp
 else
 #CPPSRCS		+= only_on_x86.cpp
 endif
@@ -659,17 +659,17 @@ check-malloc-function-usage: $(filter-ou
 		"in Makefile.in" "cx->calloc_ or rt->calloc_" $^
 	$(srcdir)/config/check_source_count.py "\bjs_realloc\b" 0 \
 		"in Makefile.in" "cx->realloc_ or rt->realloc_" $^
 	$(srcdir)/config/check_source_count.py "\bjs_free\b" 0 \
 		"in Makefile.in" "cx->free_" $^
 
 	# We desire these numbers to go down, not up. See "User guide to memory
 	# management within SpiderMonkey" in jsutil.h.
-	$(srcdir)/config/check_source_count.py OffTheBooks:: 52 \
+	$(srcdir)/config/check_source_count.py OffTheBooks:: 54 \
 		"in Makefile.in" "{cx,rt}->{new_,new_array,malloc_,calloc_,realloc_}" $^
 	# This should go to zero, if possible.
 	$(srcdir)/config/check_source_count.py UnwantedForeground:: 34 \
 		"in Makefile.in" "{cx,rt}->{free_,delete_,array_delete}" $^
 
 ifneq ($(OS_ARCH),WINNT) # FIXME: this should be made work on Windows too.
 check:: check-malloc-function-usage
 endif
--- a/js/src/assembler/assembler/ARMAssembler.h
+++ b/js/src/assembler/assembler/ARMAssembler.h
@@ -842,17 +842,17 @@ namespace JSC {
             emitInst(static_cast<ARMWord>(cc) | BX, 0, 0, RM(rm));
 #else
             mov_r(ARMRegisters::pc, RM(rm), cc);
 #endif
         }
 
         JmpSrc blx(int rm, Condition cc = AL)
         {
-#if WTF_ARM_ARCH_AT_LEAST(5)
+#if WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5
             int s = m_buffer.uncheckedSize();
             js::JaegerSpew(
                     js::JSpew_Insns,
                     IPFX    "blx%-12s %s\n", MAYBE_PAD, nameCC(cc), nameGpReg(rm));
             emitInst(static_cast<ARMWord>(cc) | BLX, 0, 0, RM(rm));
 #else
             ASSERT(rm != 14);
             ensureSpace(2 * sizeof(ARMWord), 0);
@@ -975,17 +975,17 @@ namespace JSC {
         void* executableAllocAndCopy(ExecutableAllocator* allocator, ExecutablePool **poolp);
         void executableCopy(void* buffer);
         void fixUpOffsets(void* buffer);
 
         // Patching helpers
 
         static ARMWord* getLdrImmAddress(ARMWord* insn)
         {
-#if WTF_ARM_ARCH_AT_LEAST(5)
+#if WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5
             // Check for call
             if ((*insn & 0x0f7f0000) != 0x051f0000) {
                 // Must be BLX
                 ASSERT((*insn & 0x012fff30) == 0x012fff30);
                 insn--;
             }
 #endif
             // Must be an ldr ..., [pc +/- imm]
--- a/js/src/assembler/assembler/AbstractMacroAssembler.h
+++ b/js/src/assembler/assembler/AbstractMacroAssembler.h
@@ -161,52 +161,59 @@ public:
         explicit AbsoluteAddress(void* ptr)
             : m_ptr(ptr)
         {
         }
 
         void* m_ptr;
     };
 
-    // ImmPtr:
+    // TrustedImmPtr:
     //
     // A pointer sized immediate operand to an instruction - this is wrapped
     // in a class requiring explicit construction in order to differentiate
     // from pointers used as absolute addresses to memory operations
-    struct ImmPtr {
-        explicit ImmPtr(const void* value)
+    struct TrustedImmPtr {
+        explicit TrustedImmPtr(const void* value)
             : m_value(value)
         {
         }
 
         intptr_t asIntptr()
         {
             return reinterpret_cast<intptr_t>(m_value);
         }
 
         const void* m_value;
     };
 
-    // Imm32:
+    struct ImmPtr : public TrustedImmPtr {
+        explicit ImmPtr(const void* value)
+            : TrustedImmPtr(value)
+        {
+        }
+    };
+ 
+    // TrustedImm32:
     //
     // A 32bit immediate operand to an instruction - this is wrapped in a
     // class requiring explicit construction in order to prevent RegisterIDs
     // (which are implemented as an enum) from accidentally being passed as
     // immediate values.
-    struct Imm32 {
-        explicit Imm32(int32_t value)
+    struct TrustedImm32 {
+        explicit TrustedImm32(int32_t value)
             : m_value(value)
 #if WTF_CPU_ARM || WTF_CPU_MIPS
             , m_isPointer(false)
 #endif
         {
         }
 
 #if !WTF_CPU_X86_64
-        explicit Imm32(ImmPtr ptr)
+        explicit TrustedImm32(TrustedImmPtr ptr)
             : m_value(ptr.asIntptr())
 #if WTF_CPU_ARM || WTF_CPU_MIPS
             , m_isPointer(true)
 #endif
         {
         }
 #endif
 
@@ -218,16 +225,30 @@ public:
         // To avoid this problem, always generate pointers (and thus Imm32s constructed
         // from ImmPtrs) with a code sequence that is able  to represent  any pointer
         // value - don't use a more compact form in these cases.
         // Same for MIPS.
         bool m_isPointer;
 #endif
     };
 
+
+    struct Imm32 : public TrustedImm32 {
+        explicit Imm32(int32_t value)
+            : TrustedImm32(value)
+        {
+        }
+#if !WTF_CPU_X86_64
+        explicit Imm32(TrustedImmPtr ptr)
+            : TrustedImm32(ptr)
+        {
+        }
+#endif
+    };
+
     struct ImmDouble {
         union {
             struct {
 #if WTF_CPU_BIG_ENDIAN || WTF_CPU_MIDDLE_ENDIAN
                 uint32 msb, lsb;
 #else
                 uint32 lsb, msb;
 #endif
@@ -236,17 +257,16 @@ public:
             double d;
         } u;
 
         explicit ImmDouble(double d) {
             u.d = d;
         }
     };
 
-
     // Section 2: MacroAssembler code buffer handles
     //
     // The following types are used to reference items in the code buffer
     // during JIT code generation.  For example, the type Jump is used to
     // track the location of a jump instruction so that it may later be
     // linked to a label marking its destination.
 
 
@@ -268,17 +288,17 @@ public:
 
         Label(AbstractMacroAssembler<AssemblerType>* masm)
             : m_label(masm->m_assembler.label())
         {
         }
         
         bool isUsed() const { return m_label.isUsed(); }
         void used() { m_label.used(); }
-        bool isValid() const { return m_label.isValid(); }
+        bool isSet() const { return m_label.isValid(); }
     private:
         JmpDst m_label;
     };
 
     // DataLabelPtr:
     //
     // A DataLabelPtr is used to refer to a location in the code containing a pointer to be
     // patched after the code has been generated.
@@ -291,16 +311,18 @@ public:
         {
         }
 
         DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm)
             : m_label(masm->m_assembler.label())
         {
         }
         
+        bool isSet() const { return m_label.isValid(); }
+
     private:
         JmpDst m_label;
     };
 
     // DataLabel32:
     //
     // A DataLabel32 is used to refer to a location in the code containing a
     // 32-bit constant to be patched after the code has been generated.
@@ -406,16 +428,30 @@ public:
     // A JumpList is a set of Jump objects.
     // All jumps in the set will be linked to the same destination.
     class JumpList {
         friend class LinkBuffer;
 
     public:
         typedef js::Vector<Jump, 16 ,js::SystemAllocPolicy > JumpVector;
 
+        JumpList() {}
+
+        JumpList(const JumpList &other)
+        {
+            m_jumps.append(other.m_jumps);
+        }
+
+        JumpList &operator=(const JumpList &other)
+        {
+            m_jumps.clear();
+            m_jumps.append(other.m_jumps);
+            return *this;
+        }
+
         void link(AbstractMacroAssembler<AssemblerType>* masm)
         {
             size_t size = m_jumps.length();
             for (size_t i = 0; i < size; ++i)
                 m_jumps[i].link(masm);
             m_jumps.clear();
         }
         
@@ -427,27 +463,32 @@ public:
             m_jumps.clear();
         }
         
         void append(Jump jump)
         {
             m_jumps.append(jump);
         }
         
-        void append(JumpList& other)
+        void append(const JumpList& other)
         {
             m_jumps.append(other.m_jumps.begin(), other.m_jumps.length());
         }
 
+        void clear()
+        {
+            m_jumps.clear();
+        }
+
         bool empty()
         {
             return !m_jumps.length();
         }
         
-        const JumpVector& jumps() { return m_jumps; }
+        const JumpVector& jumps() const { return m_jumps; }
 
     private:
         JumpVector m_jumps;
     };
 
 
     // Section 3: Misc admin methods
 
--- a/js/src/assembler/assembler/MacroAssembler.h
+++ b/js/src/assembler/assembler/MacroAssembler.h
@@ -90,39 +90,39 @@ public:
         loadPtr(Address(stackPointerRegister, (index * sizeof(void*))), dest);
     }
 
     void poke(RegisterID src, int index = 0)
     {
         storePtr(src, Address(stackPointerRegister, (index * sizeof(void*))));
     }
 
-    void poke(Imm32 value, int index = 0)
+    void poke(TrustedImm32 value, int index = 0)
     {
         store32(value, Address(stackPointerRegister, (index * sizeof(void*))));
     }
 
-    void poke(ImmPtr imm, int index = 0)
+    void poke(TrustedImmPtr imm, int index = 0)
     {
         storePtr(imm, Address(stackPointerRegister, (index * sizeof(void*))));
     }
 
 
     // Backwards banches, these are currently all implemented using existing forwards branch mechanisms.
     void branchPtr(Condition cond, RegisterID op1, ImmPtr imm, Label target)
     {
         branchPtr(cond, op1, imm).linkTo(target, this);
     }
 
     void branch32(Condition cond, RegisterID op1, RegisterID op2, Label target)
     {
         branch32(cond, op1, op2).linkTo(target, this);
     }
 
-    void branch32(Condition cond, RegisterID op1, Imm32 imm, Label target)
+    void branch32(Condition cond, RegisterID op1, TrustedImm32 imm, Label target)
     {
         branch32(cond, op1, imm).linkTo(target, this);
     }
 
     void branch32(Condition cond, RegisterID left, Address right, Label target)
     {
         branch32(cond, left, right).linkTo(target, this);
     }
@@ -172,31 +172,21 @@ public:
         add32(imm, src, dest);
     }
 
     void andPtr(RegisterID src, RegisterID dest)
     {
         and32(src, dest);
     }
 
-    void andPtr(Address address, RegisterID srcDest)
-    {
-        and32(address, srcDest);
-    }
-
     void andPtr(Imm32 imm, RegisterID srcDest)
     {
         and32(imm, srcDest);
     }
 
-    void andPtr(ImmPtr ptr, RegisterID srcDest)
-    {
-        and32(Imm32(ptr), srcDest);
-    }
-
     void notPtr(RegisterID srcDest)
     {
         not32(srcDest);
     }
 
     void orPtr(RegisterID src, RegisterID dest)
     {
         or32(src, dest);
@@ -207,21 +197,16 @@ public:
         or32(Imm32(imm), dest);
     }
 
     void orPtr(Imm32 imm, RegisterID dest)
     {
         or32(imm, dest);
     }
 
-    void orPtr(Address address, RegisterID srcDest)
-    {
-        or32(address, srcDest);
-    }
-
     void subPtr(RegisterID src, RegisterID dest)
     {
         sub32(src, dest);
     }
     
     void subPtr(Imm32 imm, RegisterID dest)
     {
         sub32(imm, dest);
@@ -273,37 +258,32 @@ public:
         set32(cond, left, right, dest);
     }
 
     void storePtr(RegisterID src, ImplicitAddress address)
     {
         store32(src, address);
     }
 
-    void storePtr(RegisterID src, BaseIndex address)
-    {
-        store32(src, address);
-    }
-
     void storePtr(RegisterID src, void* address)
     {
         store32(src, address);
     }
 
-    void storePtr(ImmPtr imm, ImplicitAddress address)
+    void storePtr(TrustedImmPtr imm, ImplicitAddress address)
     {
         store32(Imm32(imm), address);
     }
 
-    void storePtr(ImmPtr imm, BaseIndex address)
+    void storePtr(TrustedImmPtr imm, BaseIndex address)
     {
         store32(Imm32(imm), address);
     }
 
-    void storePtr(ImmPtr imm, void* address)
+    void storePtr(TrustedImmPtr imm, void* address)
     {
         store32(Imm32(imm), address);
     }
 
     DataLabel32 storePtrWithAddressOffsetPatch(RegisterID src, Address address)
     {
         return store32WithAddressOffsetPatch(src, address);
     }
--- a/js/src/assembler/assembler/MacroAssemblerARM.cpp
+++ b/js/src/assembler/assembler/MacroAssemblerARM.cpp
@@ -29,17 +29,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "assembler/wtf/Platform.h"
 
 #if ENABLE_ASSEMBLER && WTF_CPU_ARM_TRADITIONAL
 
 #include "MacroAssemblerARM.h"
 
-#if WTF_PLATFORM_LINUX || WTF_PLATFORM_ANDROID
+#if WTF_OS_LINUX || WTF_OS_ANDROID
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <elf.h>
 
 // lame check for kernel version
 // see bug 586550
--- a/js/src/assembler/assembler/MacroAssemblerARM.h
+++ b/js/src/assembler/assembler/MacroAssemblerARM.h
@@ -86,24 +86,24 @@ public:
     static const Scale ScalePtr = TimesFour;
     static const unsigned int TotalRegisters = 16;
 
     void add32(RegisterID src, RegisterID dest)
     {
         m_assembler.adds_r(dest, dest, src);
     }
 
-    void add32(Imm32 imm, Address address)
+    void add32(TrustedImm32 imm, Address address)
     {
         load32(address, ARMRegisters::S1);
         add32(imm, ARMRegisters::S1);
         store32(ARMRegisters::S1, address);
     }
 
-    void add32(Imm32 imm, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.adds_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
     void add32(Address src, RegisterID dest)
     {
         load32(src, ARMRegisters::S1);
         add32(ARMRegisters::S1, dest);
@@ -168,17 +168,17 @@ public:
         m_assembler.mvns_r(dest, dest);
     }
 
     void or32(RegisterID src, RegisterID dest)
     {
         m_assembler.orrs_r(dest, dest, src);
     }
 
-    void or32(Imm32 imm, RegisterID dest)
+    void or32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.orrs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
     void rshift32(RegisterID shift_amount, RegisterID dest)
     {
         ARMWord w = ARMAssembler::getOp2(0x1f);
         ASSERT(w != ARMAssembler::INVALID_IMM);
@@ -206,22 +206,22 @@ public:
         m_assembler.movs_r(dest, m_assembler.lsr(dest, imm.m_value & 0x1f));
     }
 
     void sub32(RegisterID src, RegisterID dest)
     {
         m_assembler.subs_r(dest, dest, src);
     }
 
-    void sub32(Imm32 imm, RegisterID dest)
+    void sub32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.subs_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
-    void sub32(Imm32 imm, Address address)
+    void sub32(TrustedImm32 imm, Address address)
     {
         load32(address, ARMRegisters::S1);
         sub32(imm, ARMRegisters::S1);
         store32(ARMRegisters::S1, address);
     }
 
     void sub32(Address src, RegisterID dest)
     {
@@ -235,17 +235,17 @@ public:
         or32(ARMRegisters::S1, dest);
     }
 
     void xor32(RegisterID src, RegisterID dest)
     {
         m_assembler.eors_r(dest, dest, src);
     }
 
-    void xor32(Imm32 imm, RegisterID dest)
+    void xor32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.eors_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
     void xor32(Address src, RegisterID dest)
     {
         load32(src, ARMRegisters::S1);
         m_assembler.eors_r(dest, dest, ARMRegisters::S1);
@@ -375,41 +375,41 @@ public:
         m_assembler.dataTransfer32(false, src, address.base, address.offset);
     }
 
     void store32(RegisterID src, BaseIndex address)
     {
         m_assembler.baseIndexTransfer32(false, src, address.base, address.index, static_cast<int>(address.scale), address.offset);
     }
 
-    void store32(Imm32 imm, BaseIndex address)
+    void store32(TrustedImm32 imm, BaseIndex address)
     {
         if (imm.m_isPointer)
             m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
         else
             move(imm, ARMRegisters::S1);
         store32(ARMRegisters::S1, address);
     }
 
-    void store32(Imm32 imm, ImplicitAddress address)
+    void store32(TrustedImm32 imm, ImplicitAddress address)
     {
         if (imm.m_isPointer)
             m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
         else
             move(imm, ARMRegisters::S1);
         store32(ARMRegisters::S1, address);
     }
 
     void store32(RegisterID src, void* address)
     {
         m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
         m_assembler.dtr_u(false, src, ARMRegisters::S0, 0);
     }
 
-    void store32(Imm32 imm, void* address)
+    void store32(TrustedImm32 imm, void* address)
     {
         m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address));
         if (imm.m_isPointer)
             m_assembler.ldr_un_imm(ARMRegisters::S1, imm.m_value);
         else
             m_assembler.moveImm(imm.m_value, ARMRegisters::S1);
         m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
     }
@@ -431,30 +431,30 @@ public:
     }
 
     void push(Imm32 imm)
     {
         move(imm, ARMRegisters::S0);
         push(ARMRegisters::S0);
     }
 
-    void move(Imm32 imm, RegisterID dest)
+    void move(TrustedImm32 imm, RegisterID dest)
     {
         if (imm.m_isPointer)
             m_assembler.ldr_un_imm(dest, imm.m_value);
         else
             m_assembler.moveImm(imm.m_value, dest);
     }
 
     void move(RegisterID src, RegisterID dest)
     {
         m_assembler.mov_r(dest, src);
     }
 
-    void move(ImmPtr imm, RegisterID dest)
+    void move(TrustedImmPtr imm, RegisterID dest)
     {
         move(Imm32(imm), dest);
     }
 
     void swap(RegisterID reg1, RegisterID reg2)
     {
         m_assembler.mov_r(ARMRegisters::S0, reg1);
         m_assembler.mov_r(reg1, reg2);
@@ -480,46 +480,46 @@ public:
     }
 
     Jump branch32(Condition cond, RegisterID left, RegisterID right, int useConstantPool = 0)
     {
         m_assembler.cmp_r(left, right);
         return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
     }
 
-    Jump branch32(Condition cond, RegisterID left, Imm32 right, int useConstantPool = 0)
+    Jump branch32(Condition cond, RegisterID left, TrustedImm32 right, int useConstantPool = 0)
     {
         ASSERT(left != ARMRegisters::S0);
         if (right.m_isPointer) {
             m_assembler.ldr_un_imm(ARMRegisters::S0, right.m_value);
             m_assembler.cmp_r(left, ARMRegisters::S0);
         } else
             m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
         return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
     }
 
     // Like branch32, but emit a consistently-structured sequence such that the
     // number of instructions emitted is constant, regardless of the argument
     // values. For ARM, this is identical to branch32WithPatch, except that it
     // does not generate a DataLabel32.
-    Jump branch32FixedLength(Condition cond, RegisterID left, Imm32 right)
+    Jump branch32FixedLength(Condition cond, RegisterID left, TrustedImm32 right)
     {
         m_assembler.ldr_un_imm(ARMRegisters::S1, right.m_value);
         return branch32(cond, left, ARMRegisters::S1, true);
     }
 
     // As branch32_force32, but allow the value ('right') to be patched.
-    Jump branch32WithPatch(Condition cond, RegisterID left, Imm32 right, DataLabel32 &dataLabel)
+    Jump branch32WithPatch(Condition cond, RegisterID left, TrustedImm32 right, DataLabel32 &dataLabel)
     {
         ASSERT(left != ARMRegisters::S1);
         dataLabel = moveWithPatch(right, ARMRegisters::S1);
         return branch32(cond, left, ARMRegisters::S1, true);
     }
 
-    Jump branch32WithPatch(Condition cond, Address left, Imm32 right, DataLabel32 &dataLabel)
+    Jump branch32WithPatch(Condition cond, Address left, TrustedImm32 right, DataLabel32 &dataLabel)
     {
         ASSERT(left.base != ARMRegisters::S1);
         load32(left, ARMRegisters::S1);
         dataLabel = moveWithPatch(right, ARMRegisters::S0);
         return branch32(cond, ARMRegisters::S1, ARMRegisters::S0, true);
     }
 
     Jump branch32(Condition cond, RegisterID left, Address right)
@@ -529,29 +529,29 @@ public:
     }
 
     Jump branch32(Condition cond, Address left, RegisterID right)
     {
         load32(left, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
-    Jump branch32(Condition cond, Address left, Imm32 right)
+    Jump branch32(Condition cond, Address left, TrustedImm32 right)
     {
         load32(left, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
-    Jump branch32(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         load32(left, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
-    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         load32WithUnalignedHalfWords(left, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
     Jump branch16(Condition cond, BaseIndex left, RegisterID right)
     {
         (void)(cond);
@@ -823,17 +823,17 @@ public:
     }
 
     void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
     {
         // ARM doesn't have byte registers
         setTest32(cond, address, mask, dest);
     }
 
-    void add32(Imm32 imm, RegisterID src, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
     {
         m_assembler.add_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
     void lea(Address address, RegisterID dest)
     {
         m_assembler.add_r(dest, address.base, m_assembler.getImm(address.offset, ARMRegisters::S0));
     }
@@ -845,26 +845,26 @@ public:
         if (address.scale != 0)
             lshift32(Imm32(address.scale), ARMRegisters::S1);
         if (address.offset)
             add32(Imm32(address.offset), ARMRegisters::S1);
         add32(address.base, ARMRegisters::S1);
         move(ARMRegisters::S1, dest);
     }
 
-    void add32(Imm32 imm, AbsoluteAddress address)
+    void add32(TrustedImm32 imm, AbsoluteAddress address)
     {
         m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
         m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0);
         add32(imm, ARMRegisters::S1);
         m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
         m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
     }
 
-    void sub32(Imm32 imm, AbsoluteAddress address)
+    void sub32(TrustedImm32 imm, AbsoluteAddress address)
     {
         m_assembler.ldr_un_imm(ARMRegisters::S1, reinterpret_cast<ARMWord>(address.m_ptr));
         m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0);
         sub32(imm, ARMRegisters::S1);
         m_assembler.ldr_un_imm(ARMRegisters::S0, reinterpret_cast<ARMWord>(address.m_ptr));
         m_assembler.dtr_u(false, ARMRegisters::S1, ARMRegisters::S0, 0);
     }
 
@@ -875,17 +875,17 @@ public:
     }
 
     Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
     {
         load32(left.m_ptr, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
-    Jump branch32(Condition cond, AbsoluteAddress left, Imm32 right)
+    Jump branch32(Condition cond, AbsoluteAddress left, TrustedImm32 right)
     {
         load32(left.m_ptr, ARMRegisters::S1);
         return branch32(cond, ARMRegisters::S1, right);
     }
 
     Call call()
     {
 #if WTF_ARM_ARCH_VERSION >= 5
@@ -903,24 +903,24 @@ public:
         return Call::fromTailJump(jump());
     }
 
     Call makeTailRecursiveCall(Jump oldJump)
     {
         return Call::fromTailJump(oldJump);
     }
 
-    DataLabelPtr moveWithPatch(ImmPtr initialValue, RegisterID dest)
+    DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
     {
         DataLabelPtr dataLabel(this);
         m_assembler.ldr_un_imm(dest, reinterpret_cast<ARMWord>(initialValue.m_value));
         return dataLabel;
     }
 
-    DataLabel32 moveWithPatch(Imm32 initialValue, RegisterID dest)
+    DataLabel32 moveWithPatch(TrustedImm32 initialValue, RegisterID dest)
     {
         DataLabel32 dataLabel(this);
         m_assembler.ldr_un_imm(dest, initialValue.m_value);
         return dataLabel;
     }
 
     Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
@@ -932,17 +932,17 @@ public:
     Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         load32(left, ARMRegisters::S1);
         dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S0);
         Jump jump = branch32(cond, ARMRegisters::S0, ARMRegisters::S1, true);
         return jump;
     }
 
-    DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+    DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
     {
         DataLabelPtr dataLabel = moveWithPatch(initialValue, ARMRegisters::S1);
         store32(ARMRegisters::S1, address);
         return dataLabel;
     }
 
     DataLabelPtr storePtrWithPatch(ImplicitAddress address)
     {
--- a/js/src/assembler/assembler/MacroAssemblerARMv7.h
+++ b/js/src/assembler/assembler/MacroAssemblerARMv7.h
@@ -47,17 +47,17 @@ class MacroAssemblerARMv7 : public Abstr
     static const ARMRegisters::RegisterID dataTempRegister = ARMRegisters::ip;
     static const RegisterID addressTempRegister = ARMRegisters::r3;
     static const FPRegisterID fpTempRegister = ARMRegisters::d7;
     static const unsigned int TotalRegisters = 16;
 
     struct ArmAddress {
         enum AddressType {
             HasOffset,
-            HasIndex,
+            HasIndex
         } type;
         RegisterID base;
         union {
             int32_t offset;
             struct {
                 RegisterID index;
                 Scale scale;
             };
@@ -108,17 +108,17 @@ public:
         DoubleLessThan = ARMv7Assembler::ConditionLO,
         DoubleLessThanOrEqual = ARMv7Assembler::ConditionLS,
         // If either operand is NaN, these conditions always evaluate to true.
         DoubleEqualOrUnordered = ARMv7Assembler::ConditionVS, // Not the right flag! check for this & handle differently.
         DoubleNotEqualOrUnordered = ARMv7Assembler::ConditionNE,
         DoubleGreaterThanOrUnordered = ARMv7Assembler::ConditionHI,
         DoubleGreaterThanOrEqualOrUnordered = ARMv7Assembler::ConditionHS,
         DoubleLessThanOrUnordered = ARMv7Assembler::ConditionLT,
-        DoubleLessThanOrEqualOrUnordered = ARMv7Assembler::ConditionLE,
+        DoubleLessThanOrEqualOrUnordered = ARMv7Assembler::ConditionLE
     };
 
     static const RegisterID stackPointerRegister = ARMRegisters::sp;
     static const RegisterID linkRegister = ARMRegisters::lr;
 
     // Integer arithmetic operations:
     //
     // Operations are typically two operand - operation(source, srcDst)
@@ -126,33 +126,33 @@ public:
     // may often be a memory location (explictly described using an Address
     // object).
 
     void add32(RegisterID src, RegisterID dest)
     {
         m_assembler.add(dest, dest, src);
     }
 
-    void add32(Imm32 imm, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID dest)
     {
         add32(imm, dest, dest);
     }
 
-    void add32(Imm32 imm, RegisterID src, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
     {
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.add(dest, src, armImm);
         else {
             move(imm, dataTempRegister);
             m_assembler.add(dest, src, dataTempRegister);
         }
     }
 
-    void add32(Imm32 imm, Address address)
+    void add32(TrustedImm32 imm, Address address)
     {
         load32(address, dataTempRegister);
 
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.add(dataTempRegister, dataTempRegister, armImm);
         else {
             // Hrrrm, since dataTempRegister holds the data loaded,
@@ -165,17 +165,17 @@ public:
     }
 
     void add32(Address src, RegisterID dest)
     {
         load32(src, dataTempRegister);
         add32(dataTempRegister, dest);
     }
 
-    void add32(Imm32 imm, AbsoluteAddress address)
+    void add32(TrustedImm32 imm, AbsoluteAddress address)
     {
         load32(address.m_ptr, dataTempRegister);
 
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.add(dataTempRegister, dataTempRegister, armImm);
         else {
             // Hrrrm, since dataTempRegister holds the data loaded,
@@ -234,17 +234,17 @@ public:
         m_assembler.mvn(srcDest, srcDest);
     }
 
     void or32(RegisterID src, RegisterID dest)
     {
         m_assembler.orr(dest, dest, src);
     }
 
-    void or32(Imm32 imm, RegisterID dest)
+    void or32(TrustedImm32 imm, RegisterID dest)
     {
         ARMThumbImmediate armImm = ARMThumbImmediate::makeEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.orr(dest, dest, armImm);
         else {
             move(imm, dataTempRegister);
             m_assembler.orr(dest, dest, dataTempRegister);
         }
@@ -280,28 +280,28 @@ public:
         m_assembler.lsr(dest, dest, imm.m_value & 0x1f);
     }
 
     void sub32(RegisterID src, RegisterID dest)
     {
         m_assembler.sub(dest, dest, src);
     }
 
-    void sub32(Imm32 imm, RegisterID dest)
+    void sub32(TrustedImm32 imm, RegisterID dest)
     {
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.sub(dest, dest, armImm);
         else {
             move(imm, dataTempRegister);
             m_assembler.sub(dest, dest, dataTempRegister);
         }
     }
 
-    void sub32(Imm32 imm, Address address)
+    void sub32(TrustedImm32 imm, Address address)
     {
         load32(address, dataTempRegister);
 
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.sub(dataTempRegister, dataTempRegister, armImm);
         else {
             // Hrrrm, since dataTempRegister holds the data loaded,
@@ -314,17 +314,17 @@ public:
     }
 
     void sub32(Address src, RegisterID dest)
     {
         load32(src, dataTempRegister);
         sub32(dataTempRegister, dest);
     }
 
-    void sub32(Imm32 imm, AbsoluteAddress address)
+    void sub32(TrustedImm32 imm, AbsoluteAddress address)
     {
         load32(address.m_ptr, dataTempRegister);
 
         ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.sub(dataTempRegister, dataTempRegister, armImm);
         else {
             // Hrrrm, since dataTempRegister holds the data loaded,
@@ -336,17 +336,17 @@ public:
         store32(dataTempRegister, address.m_ptr);
     }
 
     void xor32(RegisterID src, RegisterID dest)
     {
         m_assembler.eor(dest, dest, src);
     }
 
-    void xor32(Imm32 imm, RegisterID dest)
+    void xor32(TrustedImm32 imm, RegisterID dest)
     {
         ARMThumbImmediate armImm = ARMThumbImmediate::makeEncodedImm(imm.m_value);
         if (armImm.isValid())
             m_assembler.eor(dest, dest, armImm);
         else {
             move(imm, dataTempRegister);
             m_assembler.eor(dest, dest, dataTempRegister);
         }
@@ -481,29 +481,29 @@ public:
         store32(src, setupArmAddress(address));
     }
 
     void store32(RegisterID src, BaseIndex address)
     {
         store32(src, setupArmAddress(address));
     }
 
-    void store32(Imm32 imm, ImplicitAddress address)
+    void store32(TrustedImm32 imm, ImplicitAddress address)
     {
         move(imm, dataTempRegister);
         store32(dataTempRegister, setupArmAddress(address));
     }
 
     void store32(RegisterID src, void* address)
     {
         move(ImmPtr(address), addressTempRegister);
         m_assembler.str(src, addressTempRegister, ARMThumbImmediate::makeUInt16(0));
     }
 
-    void store32(Imm32 imm, void* address)
+    void store32(TrustedImm32 imm, void* address)
     {
         move(imm, dataTempRegister);
         store32(dataTempRegister, address);
     }
 
 
     // Floating-point operations:
 
@@ -662,17 +662,17 @@ public:
         move(imm, dataTempRegister);
         push(dataTempRegister);
     }
 
     // Register move operations:
     //
     // Move values in registers.
 
-    void move(Imm32 imm, RegisterID dest)
+    void move(TrustedImm32 imm, RegisterID dest)
     {
         uint32_t value = imm.m_value;
 
         if (imm.m_isPointer)
             moveFixedWidthEncoding(imm, dest);
         else {
             ARMThumbImmediate armImm = ARMThumbImmediate::makeEncodedImm(value);
 
@@ -688,17 +688,17 @@ public:
         }
     }
 
     void move(RegisterID src, RegisterID dest)
     {
         m_assembler.mov(dest, src);
     }
 
-    void move(ImmPtr imm, RegisterID dest)
+    void move(TrustedImmPtr imm, RegisterID dest)
     {
         move(Imm32(imm), dest);
     }
 
     void swap(RegisterID reg1, RegisterID reg2)
     {
         move(reg1, dataTempRegister);
         move(reg2, reg1);
@@ -775,17 +775,17 @@ private:
 
 public:
     Jump branch32(Condition cond, RegisterID left, RegisterID right)
     {
         m_assembler.cmp(left, right);
         return Jump(makeBranch(cond));
     }
 
-    Jump branch32(Condition cond, RegisterID left, Imm32 right)
+    Jump branch32(Condition cond, RegisterID left, TrustedImm32 right)
     {
         compare32(left, right);
         return Jump(makeBranch(cond));
     }
 
     Jump branch32(Condition cond, RegisterID left, Address right)
     {
         load32(right, dataTempRegister);
@@ -793,44 +793,44 @@ public:
     }
 
     Jump branch32(Condition cond, Address left, RegisterID right)
     {
         load32(left, dataTempRegister);
         return branch32(cond, dataTempRegister, right);
     }
 
-    Jump branch32(Condition cond, Address left, Imm32 right)
+    Jump branch32(Condition cond, Address left, TrustedImm32 right)
     {
         // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
         load32(left, addressTempRegister);
         return branch32(cond, addressTempRegister, right);
     }
 
-    Jump branch32(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
         load32(left, addressTempRegister);
         return branch32(cond, addressTempRegister, right);
     }
 
-    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
         load32WithUnalignedHalfWords(left, addressTempRegister);
         return branch32(cond, addressTempRegister, right);
     }
 
     Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
     {
         load32(left.m_ptr, dataTempRegister);
         return branch32(cond, dataTempRegister, right);
     }
 
-    Jump branch32(Condition cond, AbsoluteAddress left, Imm32 right)
+    Jump branch32(Condition cond, AbsoluteAddress left, TrustedImm32 right)
     {
         // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
         load32(left.m_ptr, addressTempRegister);
         return branch32(cond, addressTempRegister, right);
     }
 
     Jump branch16(Condition cond, BaseIndex left, RegisterID right)
     {
@@ -1060,23 +1060,23 @@ public:
     {
         load8(address, dataTempRegister);
         test32(dataTempRegister, mask);
         m_assembler.it(armV7Condition(cond), false);
         m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(1));
         m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
     }
 
-    DataLabel32 moveWithPatch(Imm32 imm, RegisterID dst)
+    DataLabel32 moveWithPatch(TrustedImm32 imm, RegisterID dst)
     {
         moveFixedWidthEncoding(imm, dst);
         return DataLabel32(this);
     }
 
-    DataLabelPtr moveWithPatch(ImmPtr imm, RegisterID dst)
+    DataLabelPtr moveWithPatch(TrustedImmPtr imm, RegisterID dst)
     {
         moveFixedWidthEncoding(Imm32(imm), dst);
         return DataLabelPtr(this);
     }
 
     Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         dataLabel = moveWithPatch(initialRightValue, dataTempRegister);
@@ -1085,17 +1085,17 @@ public:
 
     Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         load32(left, addressTempRegister);
         dataLabel = moveWithPatch(initialRightValue, dataTempRegister);
         return branch32(cond, addressTempRegister, dataTempRegister);
     }
 
-    DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+    DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
     {
         DataLabelPtr label = moveWithPatch(initialValue, dataTempRegister);
         store32(dataTempRegister, address);
         return label;
     }
     DataLabelPtr storePtrWithPatch(ImplicitAddress address) { return storePtrWithPatch(ImmPtr(0), address); }
 
 
@@ -1174,17 +1174,17 @@ protected:
         else {
             move(Imm32(address.offset), addressTempRegister);
             m_assembler.add(addressTempRegister, addressTempRegister, address.base);
         }
 
         return addressTempRegister;
     }
 
-    void moveFixedWidthEncoding(Imm32 imm, RegisterID dst)
+    void moveFixedWidthEncoding(TrustedImm32 imm, RegisterID dst)
     {
         uint32_t value = imm.m_value;
         m_assembler.movT3(dst, ARMThumbImmediate::makeUInt16(value & 0xffff));
         m_assembler.movt(dst, ARMThumbImmediate::makeUInt16(value >> 16));
     }
 
     ARMv7Assembler::Condition armV7Condition(Condition cond)
     {
--- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h
+++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h
@@ -175,27 +175,42 @@ private:
 // MacroAssemblerCodeRef:
 //
 // A reference to a section of JIT generated code.  A CodeRef consists of a
 // pointer to the code, and a ref pointer to the pool from within which it
 // was allocated.
 class MacroAssemblerCodeRef {
 public:
     MacroAssemblerCodeRef()
-        : m_size(0)
+        : m_executablePool(NULL),
+          m_size(0)
     {
     }
 
     MacroAssemblerCodeRef(void* code, ExecutablePool* executablePool, size_t size)
         : m_code(code)
         , m_executablePool(executablePool)
         , m_size(size)
     {
     }
 
+    // Release the code memory in this code ref.
+    void release()
+    {
+        if (!m_executablePool)
+            return;
+
+#if defined DEBUG && (defined WTF_CPU_X86 || defined WTF_CPU_X86_64) 
+        void *addr = m_code.executableAddress();
+        memset(addr, 0xcc, m_size);
+#endif
+        m_executablePool->release();
+        m_executablePool = NULL;
+    }
+
     MacroAssemblerCodePtr m_code;
     ExecutablePool* m_executablePool;
     size_t m_size;
 };
 
 } // namespace JSC
 
 #endif // ENABLE(ASSEMBLER)
--- a/js/src/assembler/assembler/MacroAssemblerSparc.h
+++ b/js/src/assembler/assembler/MacroAssemblerSparc.h
@@ -92,24 +92,24 @@ namespace JSC {
         static const Scale ScalePtr = TimesFour;
         static const unsigned int TotalRegisters = 32;
 
         void add32(RegisterID src, RegisterID dest)
         {
             m_assembler.addcc_r(dest, src, dest);
         }
 
-        void add32(Imm32 imm, Address address)
+        void add32(TrustedImm32 imm, Address address)
         {
             load32(address, SparcRegisters::g2);
             add32(imm, SparcRegisters::g2);
             store32(SparcRegisters::g2, address);
         }
 
-        void add32(Imm32 imm, RegisterID dest)
+        void add32(TrustedImm32 imm, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.addcc_imm(dest, imm.m_value, dest);
             else {
                 m_assembler.move_nocheck(imm.m_value, SparcRegisters::g3);
                 m_assembler.addcc_r(dest, SparcRegisters::g3, dest);
             }
         }
@@ -121,17 +121,17 @@ namespace JSC {
         }
 
         void and32(Address src, RegisterID dest)
         {
             load32(src, SparcRegisters::g2);
             m_assembler.andcc_r(dest, SparcRegisters::g2, dest);
         }
 
-        void add32(Imm32 imm, RegisterID src, RegisterID dest)
+        void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.addcc_imm(src, imm.m_value, dest);
             else {
                 m_assembler.move_nocheck(imm.m_value, SparcRegisters::g3);
                 m_assembler.addcc_r(src, SparcRegisters::g3, dest);
             }
         }
@@ -189,17 +189,17 @@ namespace JSC {
             m_assembler.xnorcc_r(dest, SparcRegisters::g0, dest);
         }
 
         void or32(RegisterID src, RegisterID dest)
         {
             m_assembler.orcc_r(dest, src, dest);
         }
 
-        void or32(Imm32 imm, RegisterID dest)
+        void or32(TrustedImm32 imm, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.orcc_imm(dest, imm.m_value, dest);
             else {
                 m_assembler.move_nocheck(imm.m_value, SparcRegisters::g3);
                 m_assembler.or_r(SparcRegisters::g3, dest, dest);
             }
         }
@@ -235,27 +235,27 @@ namespace JSC {
             m_assembler.srl_imm(dest, imm.m_value, dest);
         }
 
         void sub32(RegisterID src, RegisterID dest)
         {
             m_assembler.subcc_r(dest, src, dest);
         }
 
-        void sub32(Imm32 imm, RegisterID dest)
+        void sub32(TrustedImm32 imm, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.subcc_imm(dest, imm.m_value, dest);
             else {
                 m_assembler.move_nocheck(imm.m_value, SparcRegisters::g3);
                 m_assembler.subcc_r(dest, SparcRegisters::g3, dest);
             }
         }
 
-        void sub32(Imm32 imm, Address address)
+        void sub32(TrustedImm32 imm, Address address)
         {
             load32(address, SparcRegisters::g2);
             sub32(imm, SparcRegisters::g2);
             store32(SparcRegisters::g2, address);
         }
 
         void sub32(Address src, RegisterID dest)
         {
@@ -263,17 +263,17 @@ namespace JSC {
             sub32(SparcRegisters::g2, dest);
         }
 
         void xor32(RegisterID src, RegisterID dest)
         {
             m_assembler.xorcc_r(src, dest, dest);
         }
 
-        void xor32(Imm32 imm, RegisterID dest)
+        void xor32(TrustedImm32 imm, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.xorcc_imm(dest, imm.m_value, dest);
             else {
                 m_assembler.move_nocheck(imm.m_value, SparcRegisters::g3);
                 m_assembler.xorcc_r(dest, SparcRegisters::g3, dest);
             }
         }
@@ -543,37 +543,37 @@ namespace JSC {
 
         void store32(RegisterID src, BaseIndex address)
         {
             m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
             add32(Imm32(address.offset), SparcRegisters::g2);
             m_assembler.stw_r(src, address.base, SparcRegisters::g2);
         }
 
-        void store32(Imm32 imm, BaseIndex address)
+        void store32(TrustedImm32 imm, BaseIndex address)
         {
             m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
             add32(Imm32(address.offset), SparcRegisters::g2);
             move(imm, SparcRegisters::g3);
             m_assembler.stw_r(SparcRegisters::g3, SparcRegisters::g2, address.base);
         }
 
-        void store32(Imm32 imm, ImplicitAddress address)
+        void store32(TrustedImm32 imm, ImplicitAddress address)
         {
             m_assembler.move_nocheck(imm.m_value, SparcRegisters::g2);
             store32(SparcRegisters::g2, address);
         }
 
         void store32(RegisterID src, void* address)
         {
             m_assembler.move_nocheck((int)address, SparcRegisters::g3);
             m_assembler.stw_r(src, SparcRegisters::g0, SparcRegisters::g3);
         }
 
-        void store32(Imm32 imm, void* address)
+        void store32(TrustedImm32 imm, void* address)
         {
             move(imm, SparcRegisters::g2);
             store32(SparcRegisters::g2, address);
         }
 
         void pop(RegisterID dest)
         {
             m_assembler.lduw_imm(SparcRegisters::sp, 0x68, dest);
@@ -593,30 +593,30 @@ namespace JSC {
         }
 
         void push(Imm32 imm)
         {
             move(imm, SparcRegisters::g2);
             push(SparcRegisters::g2);
         }
 
-        void move(Imm32 imm, RegisterID dest)
+        void move(TrustedImm32 imm, RegisterID dest)
         {
             if (m_assembler.isimm13(imm.m_value))
                 m_assembler.or_imm(SparcRegisters::g0, imm.m_value, dest);
             else
                 m_assembler.move_nocheck(imm.m_value, dest);
         }
 
         void move(RegisterID src, RegisterID dest)
         {
             m_assembler.or_r(src, SparcRegisters::g0, dest);
         }
 
-        void move(ImmPtr imm, RegisterID dest)
+        void move(TrustedImmPtr imm, RegisterID dest)
         {
             move(Imm32(imm), dest);
         }
 
         void swap(RegisterID reg1, RegisterID reg2)
         {
             m_assembler.or_r(reg1, SparcRegisters::g0, SparcRegisters::g3);
             m_assembler.or_r(reg2, SparcRegisters::g0, reg1);
@@ -636,45 +636,45 @@ namespace JSC {
         }
 
         Jump branch8(Condition cond, Address left, Imm32 right)
         {
             load8(left, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
-        Jump branch32_force32(Condition cond, RegisterID left, Imm32 right)
+        Jump branch32_force32(Condition cond, RegisterID left, TrustedImm32 right)
         {
             m_assembler.move_nocheck(right.m_value, SparcRegisters::g3);
             m_assembler.subcc_r(left, SparcRegisters::g3, SparcRegisters::g0);
             return Jump(m_assembler.branch(SparcCondition(cond)));
         }
 
-        Jump branch32FixedLength(Condition cond, RegisterID left, Imm32 right)
+        Jump branch32FixedLength(Condition cond, RegisterID left, TrustedImm32 right)
         {
             m_assembler.move_nocheck(right.m_value, SparcRegisters::g2);
             return branch32(cond, left, SparcRegisters::g2);
         }
 
-        Jump branch32WithPatch(Condition cond, RegisterID left, Imm32 right, DataLabel32 &dataLabel)
+        Jump branch32WithPatch(Condition cond, RegisterID left, TrustedImm32 right, DataLabel32 &dataLabel)
         {
             // Always use move_nocheck, since the value is to be patched.
             dataLabel = DataLabel32(this);
             m_assembler.move_nocheck(right.m_value, SparcRegisters::g3);
             m_assembler.subcc_r(left, SparcRegisters::g3, SparcRegisters::g0);
             return Jump(m_assembler.branch(SparcCondition(cond)));
         }
 
         Jump branch32(Condition cond, RegisterID left, RegisterID right)
         {
             m_assembler.subcc_r(left, right, SparcRegisters::g0);
             return Jump(m_assembler.branch(SparcCondition(cond)));
         }
 
-        Jump branch32(Condition cond, RegisterID left, Imm32 right)
+        Jump branch32(Condition cond, RegisterID left, TrustedImm32 right)
         {
             if (m_assembler.isimm13(right.m_value))
                 m_assembler.subcc_imm(left, right.m_value, SparcRegisters::g0);
             else {
                 m_assembler.move_nocheck(right.m_value, SparcRegisters::g3);
                 m_assembler.subcc_r(left, SparcRegisters::g3, SparcRegisters::g0);
             }
             return Jump(m_assembler.branch(SparcCondition(cond)));
@@ -687,30 +687,30 @@ namespace JSC {
         }
 
         Jump branch32(Condition cond, Address left, RegisterID right)
         {
             load32(left, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
-        Jump branch32(Condition cond, Address left, Imm32 right)
+        Jump branch32(Condition cond, Address left, TrustedImm32 right)
         {
             load32(left, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
-        Jump branch32(Condition cond, BaseIndex left, Imm32 right)
+        Jump branch32(Condition cond, BaseIndex left, TrustedImm32 right)
         {
 
             load32(left, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
-        Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+        Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, TrustedImm32 right)
         {
             load32WithUnalignedHalfWords(left, SparcRegisters::g4);
             return branch32(cond, SparcRegisters::g4, right);
         }
 
         Jump branch16(Condition cond, BaseIndex left, RegisterID right)
         {
             (void)(cond);
@@ -1047,17 +1047,17 @@ namespace JSC {
 
         void add32(Imm32 imm, AbsoluteAddress address)
         {
             load32(address.m_ptr, SparcRegisters::g2);
             add32(imm, SparcRegisters::g2);
             store32(SparcRegisters::g2, address.m_ptr);
         }
 
-        void sub32(Imm32 imm, AbsoluteAddress address)
+        void sub32(TrustedImm32 imm, AbsoluteAddress address)
         {
             load32(address.m_ptr, SparcRegisters::g2);
             sub32(imm, SparcRegisters::g2);
             store32(SparcRegisters::g2, address.m_ptr);
         }
 
         void load32(void* address, RegisterID dest)
         {
@@ -1066,17 +1066,17 @@ namespace JSC {
         }
 
         Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
         {
             load32(left.m_ptr, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
-        Jump branch32(Condition cond, AbsoluteAddress left, Imm32 right)
+        Jump branch32(Condition cond, AbsoluteAddress left, TrustedImm32 right)
         {
             load32(left.m_ptr, SparcRegisters::g2);
             return branch32(cond, SparcRegisters::g2, right);
         }
 
         Call call()
         {
             m_assembler.rdpc(SparcRegisters::g2);
@@ -1094,25 +1094,25 @@ namespace JSC {
             return Call::fromTailJump(jump());
         }
 
         Call makeTailRecursiveCall(Jump oldJump)
         {
             return Call::fromTailJump(oldJump);
         }
 
-        DataLabelPtr moveWithPatch(ImmPtr initialValue, RegisterID dest)
+        DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
         {
             DataLabelPtr dataLabel(this);
             Imm32 imm = Imm32(initialValue);
             m_assembler.move_nocheck(imm.m_value, dest);
             return dataLabel;
         }
 
-        DataLabel32 moveWithPatch(Imm32 initialValue, RegisterID dest)
+        DataLabel32 moveWithPatch(TrustedImm32 initialValue, RegisterID dest)
         {
             DataLabel32 dataLabel(this);
             m_assembler.move_nocheck(initialValue.m_value, dest);
             return dataLabel;
         }
 
         Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
         {
@@ -1124,17 +1124,17 @@ namespace JSC {
         Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
         {
             load32(left, SparcRegisters::g2);
             dataLabel = moveWithPatch(initialRightValue, SparcRegisters::g3);
             Jump jump = branch32(cond, SparcRegisters::g3, SparcRegisters::g2);
             return jump;
         }
 
-        DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+        DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
         {
             DataLabelPtr dataLabel = moveWithPatch(initialValue, SparcRegisters::g2);
             store32(SparcRegisters::g2, address);
             return dataLabel;
         }
 
         DataLabelPtr storePtrWithPatch(ImplicitAddress address)
         {
--- a/js/src/assembler/assembler/MacroAssemblerX86.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86.h
@@ -55,17 +55,17 @@ public:
     using MacroAssemblerX86Common::load32;
     using MacroAssemblerX86Common::store32;
     using MacroAssemblerX86Common::branch32;
     using MacroAssemblerX86Common::call;
     using MacroAssemblerX86Common::loadDouble;
     using MacroAssemblerX86Common::storeDouble;
     using MacroAssemblerX86Common::convertInt32ToDouble;
 
-    void add32(Imm32 imm, RegisterID src, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
     {
         m_assembler.leal_mr(imm.m_value, src, dest);
     }
 
     void lea(Address address, RegisterID dest)
     {
         m_assembler.leal_mr(address.offset, address.base, dest);
     }
@@ -85,22 +85,22 @@ public:
         m_assembler.adcl_im(imm.m_value, address.m_ptr);
     }
     
     void and32(Imm32 imm, AbsoluteAddress address)
     {
         m_assembler.andl_im(imm.m_value, address.m_ptr);
     }
     
-    void or32(Imm32 imm, AbsoluteAddress address)
+    void or32(TrustedImm32 imm, AbsoluteAddress address)
     {
         m_assembler.orl_im(imm.m_value, address.m_ptr);
     }
 
-    void sub32(Imm32 imm, AbsoluteAddress address)
+    void sub32(TrustedImm32 imm, AbsoluteAddress address)
     {
         m_assembler.subl_im(imm.m_value, address.m_ptr);
     }
 
     void load32(void* address, RegisterID dest)
     {
         m_assembler.movl_mr(address, dest);
     }
@@ -143,33 +143,33 @@ public:
         convertInt32ToDouble(srcDest, dest);
 
         // dest is now a double with the int range.
         // correct the double value by adding (0x80000000).
         move(ImmPtr(&NegativeOne), srcDest);
         addDouble(Address(srcDest), dest);
     }
 
-    void store32(Imm32 imm, void* address)
+    void store32(TrustedImm32 imm, void* address)
     {
         m_assembler.movl_i32m(imm.m_value, address);
     }
 
     void store32(RegisterID src, void* address)
     {
         m_assembler.movl_rm(src, address);
     }
 
     Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
     {
         m_assembler.cmpl_rm(right, left.m_ptr);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32(Condition cond, AbsoluteAddress left, Imm32 right)
+    Jump branch32(Condition cond, AbsoluteAddress left, TrustedImm32 right)
     {
         m_assembler.cmpl_im(right.m_value, left.m_ptr);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
     Call call()
     {
         return Call(m_assembler.call(), Call::Linkable);
@@ -181,17 +181,17 @@ public:
     }
 
     Call makeTailRecursiveCall(Jump oldJump)
     {
         return Call::fromTailJump(oldJump);
     }
 
 
-    DataLabelPtr moveWithPatch(ImmPtr initialValue, RegisterID dest)
+    DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
     {
         m_assembler.movl_i32r(initialValue.asIntptr(), dest);
         return DataLabelPtr(this);
     }
 
     Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         m_assembler.cmpl_ir_force32(initialRightValue.asIntptr(), left);
@@ -201,17 +201,17 @@ public:
 
     Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         m_assembler.cmpl_im_force32(initialRightValue.asIntptr(), left.offset, left.base);
         dataLabel = DataLabelPtr(this);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+    DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
     {
         m_assembler.movl_i32m(initialValue.asIntptr(), address.offset, address.base);
         return DataLabelPtr(this);
     }
 
     Label loadPtrWithPatchToLEA(Address address, RegisterID dest)
     {
         Label label(this);
--- a/js/src/assembler/assembler/MacroAssemblerX86Common.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h
@@ -111,22 +111,22 @@ public:
     // may often be a memory location (explictly described using an Address
     // object).
 
     void add32(RegisterID src, RegisterID dest)
     {
         m_assembler.addl_rr(src, dest);
     }
 
-    void add32(Imm32 imm, Address address)
+    void add32(TrustedImm32 imm, Address address)
     {
         m_assembler.addl_im(imm.m_value, address.offset, address.base);
     }
 
-    void add32(Imm32 imm, RegisterID dest)
+    void add32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.addl_ir(imm.m_value, dest);
     }
     
     void add32(Address src, RegisterID dest)
     {
         m_assembler.addl_mr(src.offset, src.base, dest);
     }
@@ -229,32 +229,32 @@ public:
         m_assembler.notl_m(srcDest.offset, srcDest.base);
     }
     
     void or32(RegisterID src, RegisterID dest)
     {
         m_assembler.orl_rr(src, dest);
     }
 
-    void or32(Imm32 imm, RegisterID dest)
+    void or32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.orl_ir(imm.m_value, dest);
     }
 
     void or32(RegisterID src, Address dest)
     {
         m_assembler.orl_rm(src, dest.offset, dest.base);
     }
 
     void or32(Address src, RegisterID dest)
     {
         m_assembler.orl_mr(src.offset, src.base, dest);
     }
 
-    void or32(Imm32 imm, Address address)
+    void or32(TrustedImm32 imm, Address address)
     {
         m_assembler.orl_im(imm.m_value, address.offset, address.base);
     }
 
     void rshift32(RegisterID shift_amount, RegisterID dest)
     {
         // On x86 we can only shift by ecx; if asked to shift by another register we'll
         // need rejig the shift amount into ecx first, and restore the registers afterwards.
@@ -308,22 +308,22 @@ public:
         m_assembler.shrl_i8r(imm.m_value, dest);
     }
 
     void sub32(RegisterID src, RegisterID dest)
     {
         m_assembler.subl_rr(src, dest);
     }
     
-    void sub32(Imm32 imm, RegisterID dest)
+    void sub32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.subl_ir(imm.m_value, dest);
     }
     
-    void sub32(Imm32 imm, Address address)
+    void sub32(TrustedImm32 imm, Address address)
     {
         m_assembler.subl_im(imm.m_value, address.offset, address.base);
     }
 
     void sub32(Address src, RegisterID dest)
     {
         m_assembler.subl_mr(src.offset, src.base, dest);
     }
@@ -334,22 +334,22 @@ public:
     }
 
 
     void xor32(RegisterID src, RegisterID dest)
     {
         m_assembler.xorl_rr(src, dest);
     }
 
-    void xor32(Imm32 imm, Address dest)
+    void xor32(TrustedImm32 imm, Address dest)
     {
         m_assembler.xorl_im(imm.m_value, dest.offset, dest.base);
     }
 
-    void xor32(Imm32 imm, RegisterID dest)
+    void xor32(TrustedImm32 imm, RegisterID dest)
     {
         m_assembler.xorl_ir(imm.m_value, dest);
     }
 
     void xor32(RegisterID src, Address dest)
     {
         m_assembler.xorl_rm(src, dest.offset, dest.base);
     }
@@ -463,32 +463,32 @@ public:
         m_assembler.movl_rm(src, address.offset, address.base);
     }
 
     void store32(RegisterID src, BaseIndex address)
     {
         m_assembler.movl_rm(src, address.offset, address.base, address.index, address.scale);
     }
 
-    void store32(Imm32 imm, BaseIndex address)
+    void store32(TrustedImm32 imm, BaseIndex address)
     {
         m_assembler.movl_i32m(imm.m_value, address.offset, address.base, address.index, address.scale);
     }
 
     void store16(Imm32 imm, BaseIndex address)
     {
         m_assembler.movw_i16m(imm.m_value, address.offset, address.base, address.index, address.scale);
     }
 
     void store8(Imm32 imm, BaseIndex address)
     {
         m_assembler.movb_i8m(imm.m_value, address.offset, address.base, address.index, address.scale);
     }
 
-    void store32(Imm32 imm, ImplicitAddress address)
+    void store32(TrustedImm32 imm, ImplicitAddress address)
     {
         m_assembler.movl_i32m(imm.m_value, address.offset, address.base);
     }
 
     void store16(Imm32 imm, ImplicitAddress address)
     {
         m_assembler.movw_i16m(imm.m_value, address.offset, address.base);
     }
@@ -743,17 +743,17 @@ public:
         m_assembler.push_i32(imm.m_value);
     }
 
 
     // Register move operations:
     //
     // Move values in registers.
 
-    void move(Imm32 imm, RegisterID dest)
+    void move(TrustedImm32 imm, RegisterID dest)
     {
         // Note: on 64-bit the Imm32 value is zero extended into the register, it
         // may be useful to have a separate version that sign extends the value?
         if (!imm.m_value)
             m_assembler.xorl_rr(dest, dest);
         else
             m_assembler.movl_i32r(imm.m_value, dest);
     }
@@ -762,17 +762,17 @@ public:
     void move(RegisterID src, RegisterID dest)
     {
         // Note: on 64-bit this is is a full register move; perhaps it would be
         // useful to have separate move32 & movePtr, with move32 zero extending?
         if (src != dest)
             m_assembler.movq_rr(src, dest);
     }
 
-    void move(ImmPtr imm, RegisterID dest)
+    void move(TrustedImmPtr imm, RegisterID dest)
     {
         m_assembler.movq_i64r(imm.asIntptr(), dest);
     }
 
     void swap(RegisterID reg1, RegisterID reg2)
     {
         // XCHG is extremely slow. Don't use XCHG.
         if (reg1 != reg2) {
@@ -793,17 +793,17 @@ public:
     }
 #else
     void move(RegisterID src, RegisterID dest)
     {
         if (src != dest)
             m_assembler.movl_rr(src, dest);
     }
 
-    void move(ImmPtr imm, RegisterID dest)
+    void move(TrustedImmPtr imm, RegisterID dest)
     {
         m_assembler.movl_i32r(imm.asIntptr(), dest);
     }
 
     void swap(RegisterID reg1, RegisterID reg2)
     {
         if (reg1 != reg2)
             m_assembler.xchgl_rr(reg1, reg2);
@@ -847,44 +847,44 @@ public:
     }
 
     Jump branch32(Condition cond, RegisterID left, RegisterID right)
     {
         m_assembler.cmpl_rr(right, left);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32(Condition cond, RegisterID left, Imm32 right)
+    Jump branch32(Condition cond, RegisterID left, TrustedImm32 right)
     {
         if (((cond == Equal) || (cond == NotEqual)) && !right.m_value)
             m_assembler.testl_rr(left, left);
         else
             m_assembler.cmpl_ir(right.m_value, left);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
     
     // Branch based on a 32-bit comparison, forcing the size of the
     // immediate operand to 32 bits in the native code stream to ensure that
     // the length of code emitted by this instruction is consistent.
-    Jump branch32FixedLength(Condition cond, RegisterID left, Imm32 right)
+    Jump branch32FixedLength(Condition cond, RegisterID left, TrustedImm32 right)
     {
         m_assembler.cmpl_ir_force32(right.m_value, left);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
     // Branch and record a label after the comparison.
-    Jump branch32WithPatch(Condition cond, RegisterID left, Imm32 right, DataLabel32 &dataLabel)
+    Jump branch32WithPatch(Condition cond, RegisterID left, TrustedImm32 right, DataLabel32 &dataLabel)
     {
         // Always use cmpl, since the value is to be patched.
         m_assembler.cmpl_ir_force32(right.m_value, left);
         dataLabel = DataLabel32(this);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32WithPatch(Condition cond, Address left, Imm32 right, DataLabel32 &dataLabel)
+    Jump branch32WithPatch(Condition cond, Address left, TrustedImm32 right, DataLabel32 &dataLabel)
     {
         m_assembler.cmpl_im_force32(right.m_value, left.offset, left.base);
         dataLabel = DataLabel32(this);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
     Jump branch32(Condition cond, RegisterID left, Address right)
     {
@@ -893,29 +893,29 @@ public:
     }
     
     Jump branch32(Condition cond, Address left, RegisterID right)
     {
         m_assembler.cmpl_rm(right, left.offset, left.base);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32(Condition cond, Address left, Imm32 right)
+    Jump branch32(Condition cond, Address left, TrustedImm32 right)
     {
         m_assembler.cmpl_im(right.m_value, left.offset, left.base);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         m_assembler.cmpl_im(right.m_value, left.offset, left.base, left.index, left.scale);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, TrustedImm32 right)
     {
         return branch32(cond, left, right);
     }
 
     Jump branch16(Condition cond, BaseIndex left, RegisterID right)
     {
         m_assembler.cmpw_rm(right, left.offset, left.base, left.index, left.scale);
         return Jump(m_assembler.jCC(x86Condition(cond)));
@@ -1364,30 +1364,30 @@ private:
             s_sseCheckState = HasSSE2;
         else if (flags_edx & SSEFeatureBit)
             s_sseCheckState = HasSSE;
         else
             s_sseCheckState = NoSSE;
     }
 
 #if WTF_CPU_X86
-#if WTF_PLATFORM_MAC
+#if WTF_OS_MAC_OS_X
 
     // All X86 Macs are guaranteed to support at least SSE2
     static bool isSSEPresent()
     {
         return true;
     }
 
     static bool isSSE2Present()
     {
         return true;
     }
 
-#else // PLATFORM(MAC)
+#else // OS(MAC_OS_X)
 
     static bool isSSEPresent()
     {
         if (s_sseCheckState == NotCheckedSSE) {
             setSSECheckState();
         }
         // Only check once.
         ASSERT(s_sseCheckState != NotCheckedSSE);
--- a/js/src/assembler/assembler/MacroAssemblerX86_64.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86_64.h
@@ -55,35 +55,35 @@ public:
     using MacroAssemblerX86Common::sub32;
     using MacroAssemblerX86Common::load32;
     using MacroAssemblerX86Common::store32;
     using MacroAssemblerX86Common::call;
     using MacroAssemblerX86Common::loadDouble;
     using MacroAssemblerX86Common::storeDouble;
     using MacroAssemblerX86Common::convertInt32ToDouble;
 
-    void add32(Imm32 imm, AbsoluteAddress address)
+    void add32(TrustedImm32 imm, AbsoluteAddress address)
     {
         move(ImmPtr(address.m_ptr), scratchRegister);
         add32(imm, Address(scratchRegister));
     }
     
     void and32(Imm32 imm, AbsoluteAddress address)
     {
         move(ImmPtr(address.m_ptr), scratchRegister);
         and32(imm, Address(scratchRegister));
     }
     
-    void or32(Imm32 imm, AbsoluteAddress address)
+    void or32(TrustedImm32 imm, AbsoluteAddress address)
     {
         move(ImmPtr(address.m_ptr), scratchRegister);
         or32(imm, Address(scratchRegister));
     }
 
-    void sub32(Imm32 imm, AbsoluteAddress address)
+    void sub32(TrustedImm32 imm, AbsoluteAddress address)
     {
         move(ImmPtr(address.m_ptr), scratchRegister);
         sub32(imm, Address(scratchRegister));
     }
 
     void load32(void* address, RegisterID dest)
     {
         if (dest == X86Registers::eax)
@@ -109,17 +109,17 @@ public:
 
     void convertUInt32ToDouble(RegisterID srcDest, FPRegisterID dest)
     {
         zeroExtend32ToPtr(srcDest, srcDest);
         zeroDouble(dest); // break dependency chains
         m_assembler.cvtsq2sd_rr(srcDest, dest);
     }
 
-    void store32(Imm32 imm, void* address)
+    void store32(TrustedImm32 imm, void* address)
     {
         move(X86Registers::eax, scratchRegister);
         move(imm, X86Registers::eax);
         m_assembler.movl_EAXm(address);
         move(scratchRegister, X86Registers::eax);
     }
 
     Call call()
@@ -306,17 +306,17 @@ public:
         return DataLabel32(this);
     }
 
     void storePtr(RegisterID src, ImplicitAddress address)
     {
         m_assembler.movq_rm(src, address.offset, address.base);
     }
 
-    void storePtr(ImmPtr imm, BaseIndex address)
+    void storePtr(TrustedImmPtr imm, BaseIndex address)
     {
         intptr_t value = intptr_t(imm.m_value);
 
         // 32-bit immediates in 64-bit stores will be zero-extended, so check
         // if the value can fit in such a store.
         if (value >= 0 && value < intptr_t(0x7FFFFFFF)) {
             m_assembler.movq_i32m(int32_t(value), address.offset, address.base, address.index,
                                   address.scale);
@@ -336,17 +336,17 @@ public:
         if (src == X86Registers::eax)
             m_assembler.movq_EAXm(address);
         else {
             move(ImmPtr(address), scratchRegister);
             storePtr(src, ImplicitAddress(scratchRegister));
         }
     }
 
-    void storePtr(ImmPtr imm, ImplicitAddress address)
+    void storePtr(TrustedImmPtr imm, ImplicitAddress address)
     {
         intptr_t value = intptr_t(imm.m_value);
 
         // 32-bit immediates in 64-bit stores will be zero-extended, so check
         // if the value can fit in such a store.
         if (value >= 0 && value < intptr_t(0x7FFFFFFF)) {
             m_assembler.movq_i32m(int32_t(value), address.offset, address.base);
         } else {
@@ -482,17 +482,17 @@ public:
 
     Jump branchSubPtr(Condition cond, Imm32 imm, RegisterID dest)
     {
         ASSERT((cond == Overflow) || (cond == Zero) || (cond == NonZero));
         subPtr(imm, dest);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
-    DataLabelPtr moveWithPatch(ImmPtr initialValue, RegisterID dest)
+    DataLabelPtr moveWithPatch(TrustedImmPtr initialValue, RegisterID dest)
     {
         m_assembler.movq_i64r(initialValue.asIntptr(), dest);
         return DataLabelPtr(this);
     }
 
     Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         dataLabel = moveWithPatch(initialRightValue, scratchRegister);
@@ -500,17 +500,17 @@ public:
     }
 
     Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
     {
         dataLabel = moveWithPatch(initialRightValue, scratchRegister);
         return branchPtr(cond, left, scratchRegister);
     }
 
-    DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+    DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
     {
         DataLabelPtr label = moveWithPatch(initialValue, scratchRegister);
         storePtr(scratchRegister, address);
         return label;
     }
 
     using MacroAssemblerX86Common::branchTest8;
     Jump branchTest8(Condition cond, ExtendedAddress address, Imm32 mask = Imm32(-1))
--- a/js/src/assembler/jit/ExecutableAllocator.h
+++ b/js/src/assembler/jit/ExecutableAllocator.h
@@ -47,26 +47,26 @@ static void sync_instruction_memory(cadd
         p += 32;
     }
 }
 #else
 extern  "C" void sync_instruction_memory(caddr_t v, u_int len);
 #endif
 #endif
 
-#if WTF_PLATFORM_IPHONE
+#if WTF_OS_IOS
 #include <libkern/OSCacheControl.h>
 #include <sys/mman.h>
 #endif
 
-#if WTF_PLATFORM_SYMBIAN
+#if WTF_OS_SYMBIAN
 #include <e32std.h>
 #endif
 
-#if WTF_CPU_MIPS && WTF_PLATFORM_LINUX
+#if WTF_CPU_MIPS && WTF_OS_LINUX
 #include <sys/cachectl.h>
 #endif
 
 #if ENABLE_ASSEMBLER_WX_EXCLUSIVE
 #define PROTECTION_FLAGS_RW (PROT_READ | PROT_WRITE)
 #define PROTECTION_FLAGS_RX (PROT_READ | PROT_EXEC)
 #define INITIAL_PROTECTION_FLAGS PROTECTION_FLAGS_RX
 #else
@@ -85,17 +85,17 @@ namespace JSC {
   class ExecutablePool {
 
     JS_DECLARE_ALLOCATION_FRIENDS_FOR_PRIVATE_CONSTRUCTOR;
     friend class ExecutableAllocator;
 private:
     struct Allocation {
         char* pages;
         size_t size;
-#if WTF_PLATFORM_SYMBIAN
+#if WTF_OS_SYMBIAN
         RChunk* chunk;
 #endif
     };
 
     ExecutableAllocator* m_allocator;
     char* m_freePtr;
     char* m_end;
     Allocation m_allocation;
@@ -264,16 +264,17 @@ private:
         if (!pool) {
             systemRelease(a);
             return NULL;
         }
         m_pools.put(pool);
         return pool;
     }
 
+public:
     ExecutablePool* poolForSize(size_t n)
     {
 #ifndef DEBUG_STRESS_JSC_ALLOCATOR
         // Try to fit in an existing small allocator.  Use the pool with the
         // least available space that is big enough (best-fit).  This is the
         // best strategy because (a) it maximizes the chance of the next
         // allocation fitting in a small pool, and (b) it minimizes the
         // potential waste when a small pool is next abandoned.
@@ -322,17 +323,16 @@ private:
                 pool->addRef();
             }
         }
 
    	    // Pass ownership to the caller.
         return pool;
     }
 
-public:
 #if ENABLE_ASSEMBLER_WX_EXCLUSIVE
     static void makeWritable(void* start, size_t size)
     {
         reprotectRegion(start, size, Writable);
     }
 
     static void makeExecutable(void* start, size_t size)
     {
@@ -369,46 +369,46 @@ public:
 #else
         intptr_t end = reinterpret_cast<intptr_t>(code) + size;
         __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
 #endif
 #else
         _flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
 #endif
     }
-#elif WTF_CPU_ARM_THUMB2 && WTF_PLATFORM_IPHONE
+#elif WTF_CPU_ARM_THUMB2 && WTF_OS_IOS
     static void cacheFlush(void* code, size_t size)
     {
         sys_dcache_flush(code, size);
         sys_icache_invalidate(code, size);
     }
-#elif WTF_CPU_ARM_THUMB2 && WTF_PLATFORM_LINUX
+#elif WTF_CPU_ARM_THUMB2 && WTF_IOS
     static void cacheFlush(void* code, size_t size)
     {
         asm volatile (
             "push    {r7}\n"
             "mov     r0, %0\n"
             "mov     r1, %1\n"
             "movw    r7, #0x2\n"
             "movt    r7, #0xf\n"
             "movs    r2, #0x0\n"
             "svc     0x0\n"
             "pop     {r7}\n"
             :
             : "r" (code), "r" (reinterpret_cast<char*>(code) + size)
             : "r0", "r1", "r2");
     }
-#elif WTF_PLATFORM_SYMBIAN
+#elif WTF_OS_SYMBIAN
     static void cacheFlush(void* code, size_t size)
     {
         User::IMB_Range(code, static_cast<char*>(code) + size);
     }
-#elif WTF_CPU_ARM_TRADITIONAL && WTF_PLATFORM_LINUX && WTF_COMPILER_RVCT
+#elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
     static __asm void cacheFlush(void* code, size_t size);
-#elif WTF_CPU_ARM_TRADITIONAL && (WTF_PLATFORM_LINUX || WTF_PLATFORM_ANDROID) && WTF_COMPILER_GCC
+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC
     static void cacheFlush(void* code, size_t size)
     {
         asm volatile (
             "push    {r7}\n"
             "mov     r0, %0\n"
             "mov     r1, %1\n"
             "mov     r7, #0xf0000\n"
             "add     r7, r7, #0x2\n"
--- a/js/src/assembler/jit/ExecutableAllocatorOS2.cpp
+++ b/js/src/assembler/jit/ExecutableAllocatorOS2.cpp
@@ -21,17 +21,17 @@
  * 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 "ExecutableAllocator.h"
 
-#if ENABLE_ASSEMBLER && WTF_PLATFORM_OS2
+#if ENABLE_ASSEMBLER && WTF_OS_OS2
 
 #define INCL_DOS
 #include <os2.h>
 
 namespace JSC {
 
 size_t ExecutableAllocator::determinePageSize()
 {
--- a/js/src/assembler/jit/ExecutableAllocatorPosix.cpp
+++ b/js/src/assembler/jit/ExecutableAllocatorPosix.cpp
@@ -20,17 +20,17 @@
  * 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 "ExecutableAllocator.h"
 
-#if ENABLE_ASSEMBLER && WTF_PLATFORM_UNIX && !WTF_PLATFORM_SYMBIAN
+#if ENABLE_ASSEMBLER && WTF_OS_UNIX && !WTF_OS_SYMBIAN
 
 #include <sys/mman.h>
 #include <unistd.h>
 #include <wtf/VMTags.h>
 
 namespace JSC {
 
 size_t ExecutableAllocator::determinePageSize()
@@ -69,17 +69,17 @@ void ExecutableAllocator::reprotectRegio
     // Round size up
     size += (pageSize - 1);
     size &= ~(pageSize - 1);
 
     mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);
 }
 #endif
 
-#if WTF_CPU_ARM_TRADITIONAL && WTF_PLATFORM_LINUX && WTF_COMPILER_RVCT
+#if WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
 __asm void ExecutableAllocator::cacheFlush(void* code, size_t size)
 {
     ARM
     push {r7}
     add r1, r1, r0
     mov r7, #0xf0000
     add r7, r7, #0x2
     mov r2, #0x0
--- a/js/src/assembler/jit/ExecutableAllocatorSymbian.cpp
+++ b/js/src/assembler/jit/ExecutableAllocatorSymbian.cpp
@@ -17,17 +17,17 @@
  *  Boston, MA  02110-1301  USA
  *
  */
 
 #include "config.h"
 
 #include "ExecutableAllocator.h"
 
-#if ENABLE_ASSEMBLER && WTF_PLATFORM_SYMBIAN
+#if ENABLE_ASSEMBLER && WTF_OS_SYMBIAN
 
 #include <e32hal.h>
 #include <e32std.h>
 
 // Set the page size to 256 Kb to compensate for moving memory model limitation
 const size_t MOVING_MEM_PAGE_SIZE = 256 * 1024; 
 
 namespace JSC {
--- a/js/src/assembler/jit/ExecutableAllocatorWin.cpp
+++ b/js/src/assembler/jit/ExecutableAllocatorWin.cpp
@@ -21,17 +21,17 @@
  * 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 "ExecutableAllocator.h"
 
-#if ENABLE_ASSEMBLER && WTF_PLATFORM_WIN_OS
+#if ENABLE_ASSEMBLER && WTF_OS_WINDOWS
 
 #include "jswin.h"
 
 namespace JSC {
 
 size_t ExecutableAllocator::determinePageSize()
 {
     SYSTEM_INFO system_info;
--- a/js/src/assembler/wtf/Platform.h
+++ b/js/src/assembler/wtf/Platform.h
@@ -1,11 +1,12 @@
 /*
  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
  * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
@@ -22,544 +23,705 @@
  * 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 WTF_Platform_h
 #define WTF_Platform_h
 
-/* Either XX(YY) --> WTF_XX_YY  or  XX(YY) --> XX_YY, depending on XX
-
-   PLATFORM(YY) --> WTF_PLATFORM_YY
-   COMPILER(YY) --> WTF_COMPILER_YY
-   CPU(YY)      --> WTF_CPU_YY
-   OS(YY)       --> WTF_OS_YY
-   USE(YY)      --> WTF_USE_YY
-
-   HAVE(YY)     --> HAVE_YY
-   ENABLE(YY)   --> ENABLE_YY
-*/
-
 /* ==== PLATFORM handles OS, operating environment, graphics API, and
    CPU. This macro will be phased out in favor of platform adaptation
    macros, policy decision macros, and top-level port definitions. ==== */
-//#define PLATFORM(WTF_FEATURE) (defined(WTF_PLATFORM_##WTF_FEATURE)  && WTF_PLATFORM_##WTF_FEATURE)
+#define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE  && WTF_PLATFORM_##WTF_FEATURE)
 
 
 /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */
 
 /* COMPILER() - the compiler being used to build the project */
-//#define COMPILER(WTF_FEATURE) (defined(WTF_COMPILER_##WTF_FEATURE)  && WTF_COMPILER_##WTF_FEATURE)
+#define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE  && WTF_COMPILER_##WTF_FEATURE)
 /* CPU() - the target CPU architecture */
-//#define CPU(WTF_FEATURE) (defined(WTF_CPU_##WTF_FEATURE)  && WTF_CPU_##WTF_FEATURE)
+#define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE  && WTF_CPU_##WTF_FEATURE)
 /* HAVE() - specific system features (headers, functions or similar) that are present or not */
-//#define HAVE(WTF_FEATURE) (defined(HAVE_##WTF_FEATURE)  && HAVE_##WTF_FEATURE)
+#define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE  && HAVE_##WTF_FEATURE)
 /* OS() - underlying operating system; only to be used for mandated low-level services like 
    virtual memory, not to choose a GUI toolkit */
-//#define OS(WTF_FEATURE) (defined(WTF_OS_##WTF_FEATURE)  && WTF_OS_##WTF_FEATURE)
+#define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE  && WTF_OS_##WTF_FEATURE)
 
 
 /* ==== Policy decision macros: these define policy choices for a particular port. ==== */
 
 /* USE() - use a particular third-party library or optional OS service */
-//#define USE(WTF_FEATURE) (defined(WTF_USE_##WTF_FEATURE)  && WTF_USE_##WTF_FEATURE)
+#define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE  && WTF_USE_##WTF_FEATURE)
 /* ENABLE() - turn on a specific feature of WebKit */
-//#define ENABLE(WTF_FEATURE) (defined(ENABLE_##WTF_FEATURE)  && ENABLE_##WTF_FEATURE)
+#define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE  && ENABLE_##WTF_FEATURE)
 
 
 
 /* ==== COMPILER() - the compiler being used to build the project ==== */
 
-/* COMPILER(MSVC) Microsoft Visual C++ */
-/* COMPILER(MSVC7) Microsoft Visual C++ v7 or lower*/
+/* WTF_COMPILER_MSVC Microsoft Visual C++ */
+/* WTF_COMPILER_MSVC7_OR_LOWER Microsoft Visual C++ 2003 or lower*/
+/* WTF_COMPILER_MSVC9_OR_LOWER Microsoft Visual C++ 2008 or lower*/
 #if defined(_MSC_VER)
 #define WTF_COMPILER_MSVC 1
 #if _MSC_VER < 1400
-#define WTF_COMPILER_MSVC7 1
+#define WTF_COMPILER_MSVC7_OR_LOWER 1
+#elif _MSC_VER < 1600
+#define WTF_COMPILER_MSVC9_OR_LOWER 1
 #endif
 #endif
 
-/* COMPILER(RVCT)  - ARM RealView Compilation Tools */
+/* WTF_COMPILER_RVCT  - ARM RealView Compilation Tools */
+/* WTF_COMPILER_RVCT4_OR_GREATER - ARM RealView Compilation Tools 4.0 or greater */
 #if defined(__CC_ARM) || defined(__ARMCC__)
 #define WTF_COMPILER_RVCT 1
+#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) (__ARMCC_VERSION >= (major * 100000 + minor * 10000 + patch * 1000 + build))
+#else
+/* Define this for !RVCT compilers, just so we can write things like RVCT_VERSION_AT_LEAST(3, 0, 0, 0). */
+#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) 0
 #endif
 
-/* COMPILER(GCC) - GNU Compiler Collection */
+/* WTF_COMPILER_GCC - GNU Compiler Collection */
 /* --gnu option of the RVCT compiler also defines __GNUC__ */
 #if defined(__GNUC__) && !WTF_COMPILER_RVCT
 #define WTF_COMPILER_GCC 1
 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-#endif
-
-/* COMPILER(MINGW) - MinGW GCC */
-#if defined(MINGW) || defined(__MINGW32__)
-#define WTF_COMPILER_MINGW 1
+#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
+#else
+/* Define this for !GCC compilers, just so we can write things like GCC_VERSION_AT_LEAST(4, 1, 0). */
+#define GCC_VERSION_AT_LEAST(major, minor, patch) 0
 #endif
 
-/* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */
+/* WTF_COMPILER_MINGW - MinGW GCC */
+/* WTF_COMPILER_MINGW64 - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */
+#if defined(__MINGW32__)
+#define WTF_COMPILER_MINGW 1
+#include <_mingw.h> /* private MinGW header */
+    #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */
+        #define WTF_COMPILER_MINGW64 1
+    #endif /* __MINGW64_VERSION_MAJOR */
+#endif /* __MINGW32__ */
+
+/* WTF_COMPILER_WINSCW - CodeWarrior for Symbian emulator */
 #if defined(__WINSCW__)
 #define WTF_COMPILER_WINSCW 1
+/* cross-compiling, it is not really windows */
+#undef WIN32
+#undef _WIN32
 #endif
 
-/* COMPILER(SUNPRO) - Sun Studio for Solaris */
-#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#define WTF_COMPILER_SUNPRO 1
+/* WTF_COMPILER_INTEL - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
 #endif
 
+/* WTF_COMPILER_SUNCC */
+#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
+#define WTF_COMPILER_SUNCC 1
+#endif
 
 /* ==== CPU() - the target CPU architecture ==== */
 
-/* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */
+/* This also defines WTF_CPU_BIG_ENDIAN or WTF_CPU_MIDDLE_ENDIAN or neither, as appropriate. */
 
-
-/* CPU(ALPHA) - DEC Alpha */
+/* WTF_CPU_ALPHA - DEC Alpha */
 #if defined(__alpha__)
 #define WTF_CPU_ALPHA 1
 #endif
 
-/* CPU(IA64) - Itanium / IA-64 */
+/* WTF_CPU_IA64 - Itanium / IA-64 */
 #if defined(__ia64__)
 #define WTF_CPU_IA64 1
+/* 32-bit mode on Itanium */
+#if !defined(__LP64__)
+#define WTF_CPU_IA64_32 1
+#endif
 #endif
 
-/* CPU(PPC) - PowerPC 32-bit */
+/* WTF_CPU_MIPS - MIPS 32-bit */
+/* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now.  */
+#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \
+    && defined(_ABIO32)
+#define WTF_CPU_MIPS 1
+#if defined(__MIPSEB__)
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
+#define WTF_MIPS_PIC (defined __PIC__)
+#define WTF_MIPS_ARCH __mips
+#define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v)
+#define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v)
+#define WTF_MIPS_ARCH_REV __mips_isa_rev
+#define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v)
+#define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float)
+#define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64)
+/* MIPS requires allocators to use aligned memory */
+#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
+#endif /* MIPS */
+
+/* WTF_CPU_PPC - PowerPC 32-bit */
 #if   defined(__ppc__)     \
-   || defined(__PPC__)     \
-   || defined(__powerpc__) \
-   || defined(__powerpc)   \
-   || defined(__POWERPC__) \
-   || defined(_M_PPC)      \
-   || defined(__PPC)
+    || defined(__PPC__)     \
+    || defined(__powerpc__) \
+    || defined(__powerpc)   \
+    || defined(__POWERPC__) \
+    || defined(_M_PPC)      \
+    || defined(__PPC)
 #define WTF_CPU_PPC 1
 #define WTF_CPU_BIG_ENDIAN 1
 #endif
 
-/* CPU(PPC64) - PowerPC 64-bit */
+/* WTF_CPU_PPC64 - PowerPC 64-bit */
 #if   defined(__ppc64__) \
-   || defined(__PPC64__)
+    || defined(__PPC64__)
 #define WTF_CPU_PPC64 1
 #define WTF_CPU_BIG_ENDIAN 1
 #endif
 
-/* CPU(SH4) - SuperH SH-4 */
+/* WTF_CPU_SH4 - SuperH SH-4 */
 #if defined(__SH4__)
 #define WTF_CPU_SH4 1
 #endif
 
-/* CPU(SPARC32) - SPARC 32-bit */
+/* WTF_CPU_SPARC32 - SPARC 32-bit */
 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8)
 #define WTF_CPU_SPARC32 1
 #define WTF_CPU_BIG_ENDIAN 1
 #endif
 
-/* CPU(SPARC64) - SPARC 64-bit */
+/* WTF_CPU_SPARC64 - SPARC 64-bit */
 #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9)
 #define WTF_CPU_SPARC64 1
 #define WTF_CPU_BIG_ENDIAN 1
 #endif
 
-/* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */
+/* WTF_CPU_SPARC - any SPARC, true for WTF_CPU_SPARC32 and WTF_CPU_SPARC64 */
 #if WTF_CPU_SPARC32 || WTF_CPU_SPARC64
 #define WTF_CPU_SPARC 1
 #endif
 
-/* CPU(X86) - i386 / x86 32-bit */
+/* WTF_CPU_S390X - S390 64-bit */
+#if defined(__s390x__)
+#define WTF_CPU_S390X 1
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
+
+/* WTF_CPU_S390 - S390 32-bit */
+#if defined(__s390__)
+#define WTF_CPU_S390 1
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
+
+/* WTF_CPU_X86 - i386 / x86 32-bit */
 #if   defined(__i386__) \
-   || defined(i386)     \
-   || defined(_M_IX86)  \
-   || defined(_X86_)    \
-   || defined(__THW_INTEL)
+    || defined(i386)     \
+    || defined(_M_IX86)  \
+    || defined(_X86_)    \
+    || defined(__THW_INTEL)
 #define WTF_CPU_X86 1
 #endif
 
-/* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
+/* WTF_CPU_X86_64 - AMD64 / Intel64 / x86_64 64-bit */
 #if   defined(__x86_64__) \
-   || defined(_M_X64)
+    || defined(_M_X64)
 #define WTF_CPU_X86_64 1
 #endif
 
-/* CPU(ARM) - ARM, any version*/
+/* WTF_CPU_ARM - ARM, any version*/
 #if   defined(arm) \
-   || defined(__arm__)
+    || defined(__arm__) \
+    || defined(ARM) \
+    || defined(_ARM_)
 #define WTF_CPU_ARM 1
 
-#if defined(__ARMEB__)
+#if defined(__ARMEB__) || (WTF_COMPILER_RVCT && defined(__BIG_ENDIAN))
 #define WTF_CPU_BIG_ENDIAN 1
 
 #elif !defined(__ARM_EABI__) \
-   && !defined(__EABI__) \
-   && !defined(__VFP_FP__) \
-   && !defined(ANDROID)
+    && !defined(__EABI__) \
+    && !defined(__VFP_FP__) \
+    && !defined(_WIN32_WCE) \
+    && !defined(ANDROID)
 #define WTF_CPU_MIDDLE_ENDIAN 1
 
 #endif
 
-#define WTF_ARM_ARCH_AT_LEAST(N) (WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= N)
+#define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N)
 
 /* Set WTF_ARM_ARCH_VERSION */
 #if   defined(__ARM_ARCH_4__) \
-   || defined(__ARM_ARCH_4T__) \
-   || defined(__MARM_ARMV4__) \
-   || defined(_ARMV4I_)
+    || defined(__ARM_ARCH_4T__) \
+    || defined(__MARM_ARMV4__) \
+    || defined(_ARMV4I_)
 #define WTF_ARM_ARCH_VERSION 4
 
 #elif defined(__ARM_ARCH_5__) \
-   || defined(__ARM_ARCH_5T__) \
-   || defined(__ARM_ARCH_5E__) \
-   || defined(__ARM_ARCH_5TE__) \
-   || defined(__ARM_ARCH_5TEJ__) \
-   || defined(__MARM_ARMV5__)
+    || defined(__ARM_ARCH_5T__) \
+    || defined(__MARM_ARMV5__)
 #define WTF_ARM_ARCH_VERSION 5
 
+#elif defined(__ARM_ARCH_5E__) \
+    || defined(__ARM_ARCH_5TE__) \
+    || defined(__ARM_ARCH_5TEJ__)
+#define WTF_ARM_ARCH_VERSION 5
+/*ARMv5TE requires allocators to use aligned memory*/
+#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
+
 #elif defined(__ARM_ARCH_6__) \
-   || defined(__ARM_ARCH_6J__) \
-   || defined(__ARM_ARCH_6K__) \
-   || defined(__ARM_ARCH_6Z__) \
-   || defined(__ARM_ARCH_6ZK__) \
-   || defined(__ARM_ARCH_6T2__) \
-   || defined(__ARMV6__)
+    || defined(__ARM_ARCH_6J__) \
+    || defined(__ARM_ARCH_6K__) \
+    || defined(__ARM_ARCH_6Z__) \
+    || defined(__ARM_ARCH_6ZK__) \
+    || defined(__ARM_ARCH_6T2__) \
+    || defined(__ARMV6__)
 #define WTF_ARM_ARCH_VERSION 6
 
 #elif defined(__ARM_ARCH_7A__) \
-   || defined(__ARM_ARCH_7R__)
+    || defined(__ARM_ARCH_7R__)
 #define WTF_ARM_ARCH_VERSION 7
 
 /* RVCT sets _TARGET_ARCH_ARM */
 #elif defined(__TARGET_ARCH_ARM)
 #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM
 
+#if defined(__TARGET_ARCH_5E) \
+    || defined(__TARGET_ARCH_5TE) \
+    || defined(__TARGET_ARCH_5TEJ)
+/*ARMv5TE requires allocators to use aligned memory*/
+#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
+#endif
+
 #else
 #define WTF_ARM_ARCH_VERSION 0
 
 #endif
 
 /* Set WTF_THUMB_ARCH_VERSION */
 #if   defined(__ARM_ARCH_4T__)
 #define WTF_THUMB_ARCH_VERSION 1
 
 #elif defined(__ARM_ARCH_5T__) \
-   || defined(__ARM_ARCH_5TE__) \
-   || defined(__ARM_ARCH_5TEJ__)
+    || defined(__ARM_ARCH_5TE__) \
+    || defined(__ARM_ARCH_5TEJ__)
 #define WTF_THUMB_ARCH_VERSION 2
 
 #elif defined(__ARM_ARCH_6J__) \
-   || defined(__ARM_ARCH_6K__) \
-   || defined(__ARM_ARCH_6Z__) \
-   || defined(__ARM_ARCH_6ZK__) \
-   || defined(__ARM_ARCH_6M__)
+    || defined(__ARM_ARCH_6K__) \
+    || defined(__ARM_ARCH_6Z__) \
+    || defined(__ARM_ARCH_6ZK__) \
+    || defined(__ARM_ARCH_6M__)
 #define WTF_THUMB_ARCH_VERSION 3
 
 #elif defined(__ARM_ARCH_6T2__) \
-   || defined(__ARM_ARCH_7__) \
-   || defined(__ARM_ARCH_7A__) \
-   || defined(__ARM_ARCH_7R__) \
-   || defined(__ARM_ARCH_7M__)
+    || defined(__ARM_ARCH_7__) \
+    || defined(__ARM_ARCH_7A__) \
+    || defined(__ARM_ARCH_7R__) \
+    || defined(__ARM_ARCH_7M__)
 #define WTF_THUMB_ARCH_VERSION 4
 
 /* RVCT sets __TARGET_ARCH_THUMB */
 #elif defined(__TARGET_ARCH_THUMB)
 #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB
 
 #else
 #define WTF_THUMB_ARCH_VERSION 0
 #endif
 
 
-/* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */
+/* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */
 /* On ARMv5 and below the natural alignment is required. 
    And there are some other differences for v5 or earlier. */
-#if !defined(ARMV5_OR_LOWER) /* && !CPU_ARM_ARCH_AT_LEAST(6) */
+#if !defined(ARMV5_OR_LOWER) && WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 6
 #define WTF_CPU_ARMV5_OR_LOWER 1
 #endif
 
 
-/* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */
-/* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
+/* WTF_CPU_ARM_TRADITIONAL - Thumb2 is not available, only traditional ARM (v4 or greater) */
+/* WTF_CPU_ARM_THUMB2 - Thumb2 instruction set is available */
 /* Only one of these will be defined. */
 #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
 #  if defined(thumb2) || defined(__thumb2__) \
-  || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
+    || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
 #    define WTF_CPU_ARM_TRADITIONAL 1
 #    define WTF_CPU_ARM_THUMB2 0
-#  elif WTF_ARM_ARCH_AT_LEAST(4)
+#  elif WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 4
 #    define WTF_CPU_ARM_TRADITIONAL 1
 #    define WTF_CPU_ARM_THUMB2 0
 #  else
 #    error "Not supported ARM architecture"
 #  endif
 #elif WTF_CPU_ARM_TRADITIONAL && WTF_CPU_ARM_THUMB2 /* Sanity Check */
 #  error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms"
-#endif // !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
+#endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */
+
+#if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON)
+#define WTF_CPU_ARM_NEON 1
+#endif
 
 #endif /* ARM */
 
-
+#if WTF_CPU_ARM || WTF_CPU_MIPS
+#define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
+#endif
 
-/* Operating systems - low-level dependencies */
+/* ==== OS() - underlying operating system; only to be used for mandated low-level services like 
+   virtual memory, not to choose a GUI toolkit ==== */
 
-/* PLATFORM(DARWIN) */
-/* Operating system level dependencies for Mac OS X / Darwin that should */
-/* be used regardless of operating environment */
+/* WTF_OS_ANDROID - Android */
+#ifdef ANDROID
+#define WTF_OS_ANDROID 1
+#endif
+
+/* WTF_OS_AIX - AIX */
+#ifdef _AIX
+#define WTF_OS_AIX 1
+#endif
+
+/* WTF_OS_DARWIN - Any Darwin-based OS, including Mac OS X and iPhone OS */
 #ifdef __APPLE__
-#define WTF_PLATFORM_DARWIN 1
+#define WTF_OS_DARWIN 1
+
+/* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */
 #include <AvailabilityMacros.h>
 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
 #define BUILDING_ON_TIGER 1
 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
 #define BUILDING_ON_LEOPARD 1
 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
 #define BUILDING_ON_SNOW_LEOPARD 1
 #endif
 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
 #define TARGETING_TIGER 1
 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
 #define TARGETING_LEOPARD 1
 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
 #define TARGETING_SNOW_LEOPARD 1
 #endif
 #include <TargetConditionals.h>
+
 #endif
 
-/* PLATFORM(WIN_OS) */
-/* Operating system level dependencies for Windows that should be used */
-/* regardless of operating environment */
-#if defined(WIN32) || defined(_WIN32)
-#define WTF_PLATFORM_WIN_OS 1
+/* WTF_OS_IOS - iOS */
+/* WTF_OS_MAC_OS_X - Mac OS X (not including iOS) */
+#if WTF_OS_DARWIN && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED)  \
+    || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)                   \
+    || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR))
+#define WTF_OS_IOS 1
+#elif WTF_OS_DARWIN && defined(TARGET_OS_MAC) && TARGET_OS_MAC
+#define WTF_OS_MAC_OS_X 1
 #endif
 
-/* PLATFORM(LINUX) */
-/* Operating system level dependencies for Linux-like systems that */
-/* should be used regardless of operating environment */
-#ifdef __linux__
-#define WTF_PLATFORM_LINUX 1
+/* WTF_OS_FREEBSD - FreeBSD */
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#define WTF_OS_FREEBSD 1
 #endif
 
-/* PLATFORM(FREEBSD) */
-/* Operating system level dependencies for FreeBSD-like systems that */
-/* should be used regardless of operating environment */
-#ifdef __FreeBSD__
-#define WTF_PLATFORM_FREEBSD 1
+/* WTF_OS_HAIKU - Haiku */
+#ifdef __HAIKU__
+#define WTF_OS_HAIKU 1
 #endif
 
-/* PLATFORM(OPENBSD) */
-/* Operating system level dependencies for OpenBSD systems that */
-/* should be used regardless of operating environment */
-#ifdef __OpenBSD__
-#define WTF_PLATFORM_OPENBSD 1
+/* WTF_OS_LINUX - Linux */
+#ifdef __linux__
+#define WTF_OS_LINUX 1
 #endif
 
-/* PLATFORM(SOLARIS) */
-/* Operating system level dependencies for Solaris that should be used */
-/* regardless of operating environment */
-#if defined(sun) || defined(__sun)
-#define WTF_PLATFORM_SOLARIS 1
+/* WTF_OS_NETBSD - NetBSD */
+#if defined(__NetBSD__)
+#define WTF_OS_NETBSD 1
+#endif
+
+/* WTF_OS_OPENBSD - OpenBSD */
+#ifdef __OpenBSD__
+#define WTF_OS_OPENBSD 1
 #endif
 
-/* PLATFORM(OS2) */
-/* Operating system level dependencies for OS/2 that should be used */
-/* regardless of operating environment */
-#if defined(OS2) || defined(__OS2__)
-#define WTF_PLATFORM_OS2 1
+/* WTF_OS_QNX - QNX */
+#if defined(__QNXNTO__)
+#define WTF_OS_QNX 1
 #endif
 
-#if defined (__SYMBIAN32__)
-/* we are cross-compiling, it is not really windows */
-#undef WTF_PLATFORM_WIN_OS
-#undef WTF_PLATFORM_WIN
-#define WTF_PLATFORM_SYMBIAN 1
+/* WTF_OS_SOLARIS - Solaris */
+#if defined(sun) || defined(__sun)
+#define WTF_OS_SOLARIS 1
 #endif
 
+/* WTF_OS_WINCE - Windows CE; note that for this platform WTF_OS_WINDOWS is also defined */
+#if defined(_WIN32_WCE)
+#define WTF_OS_WINCE 1
+#endif
 
-/* PLATFORM(NETBSD) */
-/* Operating system level dependencies for NetBSD that should be used */
-/* regardless of operating environment */
-#if defined(__NetBSD__)
-#define WTF_PLATFORM_NETBSD 1
+/* WTF_OS_WINDOWS - Any version of Windows */
+#if defined(WIN32) || defined(_WIN32)
+#define WTF_OS_WINDOWS 1
 #endif
 
-/* PLATFORM(QNX) */
-/* Operating system level dependencies for QNX that should be used */
-/* regardless of operating environment */
-#if defined(__QNXNTO__)
-#define WTF_PLATFORM_QNX 1
+/* WTF_OS_SYMBIAN - Symbian */
+#if defined (__SYMBIAN32__)
+#define WTF_OS_SYMBIAN 1
 #endif
 
-/* PLATFORM(UNIX) */
-/* Operating system level dependencies for Unix-like systems that */
-/* should be used regardless of operating environment */
-#if   WTF_PLATFORM_DARWIN     \
-   || WTF_PLATFORM_FREEBSD    \
-   || WTF_PLATFORM_SYMBIAN    \
-   || WTF_PLATFORM_NETBSD     \
-   || defined(unix)        \
-   || defined(__unix)      \
-   || defined(__unix__)    \
-   || defined(_AIX)        \
-   || defined(__HAIKU__)   \
-   || defined(__QNXNTO__)  \
-   || defined(ANDROID)
-#define WTF_PLATFORM_UNIX 1
+/* WTF_OS_UNIX - Any Unix-like system */
+#if   WTF_OS_AIX              \
+    || WTF_OS_ANDROID          \
+    || WTF_OS_DARWIN           \
+    || WTF_OS_FREEBSD          \
+    || WTF_OS_HAIKU            \
+    || WTF_OS_LINUX            \
+    || WTF_OS_NETBSD           \
+    || WTF_OS_OPENBSD          \
+    || WTF_OS_QNX              \
+    || WTF_OS_SOLARIS          \
+    || WTF_OS_SYMBIAN          \
+    || defined(unix)        \
+    || defined(__unix)      \
+    || defined(__unix__)
+#define WTF_OS_UNIX 1
 #endif
 
 /* Operating environments */
 
-/* PLATFORM(CHROMIUM) */
-/* PLATFORM(QT) */
-/* PLATFORM(WX) */
-/* PLATFORM(GTK) */
-/* PLATFORM(HAIKU) */
-/* PLATFORM(MAC) */
-/* PLATFORM(WIN) */
+/* FIXME: these are all mixes of OS, operating environment and policy choices. */
+/* WTF_PLATFORM_CHROMIUM */
+/* WTF_PLATFORM_QT */
+/* WTF_PLATFORM_WX */
+/* WTF_PLATFORM_GTK */
+/* WTF_PLATFORM_HAIKU */
+/* WTF_PLATFORM_MAC */
+/* WTF_PLATFORM_WIN */
 #if defined(BUILDING_CHROMIUM__)
 #define WTF_PLATFORM_CHROMIUM 1
 #elif defined(BUILDING_QT__)
 #define WTF_PLATFORM_QT 1
 #elif defined(BUILDING_WX__)
 #define WTF_PLATFORM_WX 1
 #elif defined(BUILDING_GTK__)
 #define WTF_PLATFORM_GTK 1
 #elif defined(BUILDING_HAIKU__)
 #define WTF_PLATFORM_HAIKU 1
-#elif WTF_PLATFORM_DARWIN
+#elif defined(BUILDING_BREWMP__)
+#define WTF_PLATFORM_BREWMP 1
+#if defined(AEE_SIMULATOR)
+#define WTF_PLATFORM_BREWMP_SIMULATOR 1
+#else
+#define WTF_PLATFORM_BREWMP_SIMULATOR 0
+#endif
+#undef WTF_OS_WINDOWS
+#undef WTF_PLATFORM_WIN
+#elif WTF_OS_DARWIN
 #define WTF_PLATFORM_MAC 1
-#elif WTF_PLATFORM_WIN_OS
+#elif WTF_OS_WINDOWS
 #define WTF_PLATFORM_WIN 1
 #endif
 
-/* PLATFORM(IPHONE) */
+/* WTF_PLATFORM_IOS */
+/* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */
 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
-#define WTF_PLATFORM_IPHONE 1
+#define WTF_PLATFORM_IOS 1
 #endif
 
-/* PLATFORM(IPHONE_SIMULATOR) */
+/* WTF_PLATFORM_IOS_SIMULATOR */
 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
-#define WTF_PLATFORM_IPHONE 1
-#define WTF_PLATFORM_IPHONE_SIMULATOR 1
+#define WTF_PLATFORM_IOS 1
+#define WTF_PLATFORM_IOS_SIMULATOR 1
 #else
-#define WTF_PLATFORM_IPHONE_SIMULATOR 0
+#define WTF_PLATFORM_IOS_SIMULATOR 0
 #endif
 
-#if !defined(WTF_PLATFORM_IPHONE)
-#define WTF_PLATFORM_IPHONE 0
+#if !defined(WTF_PLATFORM_IOS)
+#define WTF_PLATFORM_IOS 0
 #endif
 
-/* PLATFORM(ANDROID) */
+/* WTF_PLATFORM_ANDROID */
+/* FIXME: this is sometimes used as an OS() switch, and other times to drive
+   policy choices */
 #if defined(ANDROID)
 #define WTF_PLATFORM_ANDROID 1
 #endif
 
 /* Graphics engines */
 
-/* PLATFORM(CG) and PLATFORM(CI) */
-#if WTF_PLATFORM_MAC || WTF_PLATFORM_IPHONE
-#define WTF_PLATFORM_CG 1
+/* WTF_USE_CG and WTF_PLATFORM_CI */
+#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS
+#define WTF_USE_CG 1
 #endif
-#if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
-#define WTF_PLATFORM_CI 1
+#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS || (WTF_PLATFORM_WIN && WTF_USE_CG)
+#define WTF_USE_CA 1
 #endif
 
-/* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
+/* WTF_USE_SKIA for Win/Linux, CG for Mac */
 #if WTF_PLATFORM_CHROMIUM
-#if WTF_PLATFORM_DARWIN
-#define WTF_PLATFORM_CG 1
-#define WTF_PLATFORM_CI 1
+#if WTF_OS_DARWIN
+#define WTF_USE_CG 1
 #define WTF_USE_ATSUI 1
 #define WTF_USE_CORE_TEXT 1
+#define WTF_USE_ICCJPEG 1
 #else
-#define WTF_PLATFORM_SKIA 1
+#define WTF_USE_SKIA 1
+#define WTF_USE_CHROMIUM_NET 1
 #endif
 #endif
 
+#if WTF_PLATFORM_BREWMP
+#define WTF_USE_SKIA 1
+#endif
+
 #if WTF_PLATFORM_GTK
-#define WTF_PLATFORM_CAIRO 1
+#define WTF_USE_CAIRO 1
 #endif
 
 
-#if (WTF_PLATFORM_IPHONE || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_OS2 || (WTF_PLATFORM_QT && WTF_PLATFORM_DARWIN && !ENABLE_SINGLE_THREADED)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
+#if WTF_OS_WINCE
+#include <ce_time.h>
+#define WTF_USE_MERSENNE_TWISTER_19937 1
+#endif
+
+#if WTF_PLATFORM_QT && WTF_OS_UNIX && !WTF_OS_SYMBIAN && !WTF_OS_DARWIN
+#define WTF_USE_PTHREAD_BASED_QT 1
+#endif
+
+#if (WTF_PLATFORM_GTK || WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || (WTF_PLATFORM_QT && (WTF_OS_DARWIN || WTF_USE_PTHREAD_BASED_QT) && !ENABLE_SINGLE_THREADED)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
 #define ENABLE_JSC_MULTIPLE_THREADS 1
 #endif
 
+#if ENABLE_JSC_MULTIPLE_THREADS
+#define ENABLE_WTF_MULTIPLE_THREADS 1
+#endif
+
 /* On Windows, use QueryPerformanceCounter by default */
-#if WTF_PLATFORM_WIN_OS
+#if WTF_OS_WINDOWS
 #define WTF_USE_QUERY_PERFORMANCE_COUNTER  1
 #endif
 
+#if WTF_OS_WINCE && !WTF_PLATFORM_QT
+#define NOMINMAX       /* Windows min and max conflict with standard macros */
+#define NOSHLWAPI      /* shlwapi.h not available on WinCe */
+
+/* MSDN documentation says these functions are provided with uspce.lib.  But we cannot find this file. */
+#define __usp10__      /* disable "usp10.h" */
+
+#define _INC_ASSERT    /* disable "assert.h" */
+#define assert(x)
+
+#endif  /* WTF_OS_WINCE && !WTF_PLATFORM_QT */
+
 #if WTF_PLATFORM_QT
 #define WTF_USE_QT4_UNICODE 1
+#elif WTF_OS_WINCE
+#define WTF_USE_WINCE_UNICODE 1
+#elif WTF_PLATFORM_BREWMP
+#define WTF_USE_BREWMP_UNICODE 1
 #elif WTF_PLATFORM_GTK
 /* The GTK+ Unicode backend is configurable */
 #else
 #define WTF_USE_ICU_UNICODE 1
 #endif
 
-#if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
-#define WTF_PLATFORM_CF 1
-#define WTF_USE_PTHREADS 1
-#define HAVE_PTHREAD_RWLOCK 1
+#if WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && WTF_CPU_X86_64
 #define WTF_USE_PLUGIN_HOST_PROCESS 1
 #endif
-#if !defined(ENABLE_MAC_JAVA_BRIDGE)
-#define ENABLE_MAC_JAVA_BRIDGE 1
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#define ENABLE_GESTURE_EVENTS 1
+#define ENABLE_RUBBER_BANDING 1
+#define WTF_USE_WK_SCROLLBAR_PAINTER 1
+#endif
+#if !defined(ENABLE_JAVA_BRIDGE)
+#define ENABLE_JAVA_BRIDGE 1
 #endif
 #if !defined(ENABLE_DASHBOARD_SUPPORT)
 #define ENABLE_DASHBOARD_SUPPORT 1
 #endif
+#define WTF_USE_CF 1
+#define WTF_USE_PTHREADS 1
+#define HAVE_PTHREAD_RWLOCK 1
 #define HAVE_READLINE 1
 #define HAVE_RUNLOOP_TIMER 1
-#endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */
+#define ENABLE_FULLSCREEN_API 1
+#define ENABLE_SMOOTH_SCROLLING 1
+#define ENABLE_WEB_ARCHIVE 1
+#endif /* WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS */
 
-#if WTF_PLATFORM_CHROMIUM && WTF_PLATFORM_DARWIN
-#define WTF_PLATFORM_CF 1
+#if WTF_PLATFORM_CHROMIUM && WTF_OS_DARWIN
+#define WTF_USE_CF 1
 #define WTF_USE_PTHREADS 1
 #define HAVE_PTHREAD_RWLOCK 1
 #endif
 
-#if WTF_PLATFORM_QT && WTF_PLATFORM_DARWIN
-#define WTF_PLATFORM_CF 1
+#if WTF_PLATFORM_BREWMP
+#define ENABLE_SINGLE_THREADED 1
+#endif
+
+#if WTF_PLATFORM_QT && WTF_OS_DARWIN
+#define WTF_USE_CF 1
 #endif
 
-#if WTF_PLATFORM_IPHONE
+#if WTF_OS_DARWIN && !defined(BUILDING_ON_TIGER) && !WTF_PLATFORM_GTK && !WTF_PLATFORM_QT
+#define ENABLE_PURGEABLE_MEMORY 1
+#endif
+
+#if WTF_PLATFORM_IOS
 #define ENABLE_CONTEXT_MENUS 0
 #define ENABLE_DRAG_SUPPORT 0
+#define ENABLE_DATA_TRANSFER_ITEMS 0
 #define ENABLE_FTPDIR 1
 #define ENABLE_GEOLOCATION 1
 #define ENABLE_ICONDATABASE 0
 #define ENABLE_INSPECTOR 0
-#define ENABLE_MAC_JAVA_BRIDGE 0
+#define ENABLE_JAVA_BRIDGE 0
 #define ENABLE_NETSCAPE_PLUGIN_API 0
 #define ENABLE_ORIENTATION_EVENTS 1
 #define ENABLE_REPAINT_THROTTLING 1
 #define HAVE_READLINE 1
-#define WTF_PLATFORM_CF 1
+#define WTF_USE_CF 1
 #define WTF_USE_PTHREADS 1
 #define HAVE_PTHREAD_RWLOCK 1
+#define ENABLE_WEB_ARCHIVE 1
 #endif
 
 #if WTF_PLATFORM_ANDROID
 #define WTF_USE_PTHREADS 1
-#define WTF_PLATFORM_SGL 1
 #define USE_SYSTEM_MALLOC 1
-#define ENABLE_MAC_JAVA_BRIDGE 1
+#define ENABLE_JAVA_BRIDGE 1
 #define LOG_DISABLED 1
-// Prevents Webkit from drawing the caret in textfields and textareas
-// This prevents unnecessary invals.
+/* Prevents Webkit from drawing the caret in textfields and textareas
+   This prevents unnecessary invals. */
 #define ENABLE_TEXT_CARET 1
 #define ENABLE_JAVASCRIPT_DEBUGGER 0
 #endif
 
-#if WTF_PLATFORM_WIN
-#define WTF_USE_WININET 1
+#if WTF_PLATFORM_WIN && !WTF_OS_WINCE
+#define WTF_USE_CF 1
+#define WTF_USE_PTHREADS 0
+#endif
+
+#if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !defined(WIN_CAIRO)
+#define WTF_USE_CFNETWORK 1
+#endif
+
+#if WTF_USE_CFNETWORK || WTF_PLATFORM_MAC
+#define WTF_USE_CFURLCACHE 1
+#define WTF_USE_CFURLSTORAGESESSIONS 1
+#endif
+
+#if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !WTF_PLATFORM_QT
+#define ENABLE_WEB_ARCHIVE 1
 #endif
 
 #if WTF_PLATFORM_WX
 #define ENABLE_ASSEMBLER 1
-#if WTF_PLATFORM_DARWIN
-#define WTF_PLATFORM_CF 1
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 0
+#if WTF_OS_DARWIN
+#define WTF_USE_CF 1
+#ifndef BUILDING_ON_TIGER
+#define WTF_USE_CORE_TEXT 1
+#define ENABLE_WEB_ARCHIVE 1
+#else
+#define WTF_USE_ATSUI 1
+#endif
 #endif
 #endif
 
 #if WTF_PLATFORM_GTK
 #if HAVE_PTHREAD_H
 #define WTF_USE_PTHREADS 1
 #define HAVE_PTHREAD_RWLOCK 1
 #endif
@@ -569,122 +731,152 @@
 #define HAVE_POSIX_MEMALIGN 1
 #define WTF_USE_CURL 1
 #define WTF_USE_PTHREADS 1
 #define HAVE_PTHREAD_RWLOCK 1
 #define USE_SYSTEM_MALLOC 1
 #define ENABLE_NETSCAPE_PLUGIN_API 0
 #endif
 
+#if WTF_PLATFORM_BREWMP
+#define USE_SYSTEM_MALLOC 1
+#endif
+
+#if WTF_PLATFORM_BREWMP_SIMULATOR
+#define ENABLE_JIT 0
+#endif
+
 #if !defined(HAVE_ACCESSIBILITY)
-#if WTF_PLATFORM_IPHONE || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM
+#if WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM
 #define HAVE_ACCESSIBILITY 1
 #endif
 #endif /* !defined(HAVE_ACCESSIBILITY) */
 
-#if WTF_PLATFORM_UNIX && !WTF_PLATFORM_SYMBIAN
+#if WTF_OS_UNIX && !WTF_OS_SYMBIAN
 #define HAVE_SIGNAL_H 1
 #endif
 
-#if !WTF_PLATFORM_WIN_OS && !WTF_PLATFORM_SOLARIS && !WTF_PLATFORM_QNX \
-    && !WTF_PLATFORM_SYMBIAN && !WTF_PLATFORM_HAIKU && !WTF_COMPILER_RVCT \
-    && !WTF_PLATFORM_ANDROID && !WTF_PLATFORM_OS2
+#if !defined(HAVE_STRNSTR)
+#if WTF_OS_DARWIN || WTF_OS_FREEBSD
+#define HAVE_STRNSTR 1
+#endif
+#endif
+
+#if !WTF_OS_WINDOWS && !WTF_OS_SOLARIS && !WTF_OS_QNX \
+    && !WTF_OS_SYMBIAN && !WTF_OS_HAIKU && !WTF_OS_RVCT \
+    && !WTF_OS_ANDROID && !WTF_PLATFORM_BREWMP
 #define HAVE_TM_GMTOFF 1
 #define HAVE_TM_ZONE 1
 #define HAVE_TIMEGM 1
-#endif     
+#endif
 
-#if WTF_PLATFORM_DARWIN
+#if WTF_OS_DARWIN
 
 #define HAVE_ERRNO_H 1
 #define HAVE_LANGINFO_H 1
 #define HAVE_MMAP 1
 #define HAVE_MERGESORT 1
 #define HAVE_SBRK 1
 #define HAVE_STRINGS_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_TIME_H 1
 #define HAVE_SYS_TIMEB_H 1
+#define WTF_USE_ACCELERATE 1
 
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !WTF_PLATFORM_IPHONE && !WTF_PLATFORM_QT
+#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
+
+#define HAVE_DISPATCH_H 1
+#define HAVE_HOSTED_CORE_ANIMATION 1
+
+#if !WTF_PLATFORM_IOS
 #define HAVE_MADV_FREE_REUSE 1
 #define HAVE_MADV_FREE 1
 #define HAVE_PTHREAD_SETNAME_NP 1
 #endif
 
-#if WTF_PLATFORM_IPHONE
+#endif
+
+#if WTF_PLATFORM_IOS
 #define HAVE_MADV_FREE 1
 #endif
 
-#elif WTF_PLATFORM_WIN_OS
+#elif WTF_OS_WINDOWS
 
+#if WTF_OS_WINCE
+#define HAVE_ERRNO_H 0
+#else
 #define HAVE_SYS_TIMEB_H 1
+#define HAVE_ALIGNED_MALLOC 1
+#define HAVE_ISDEBUGGERPRESENT 1
+#endif
 #define HAVE_VIRTUALALLOC 1
 
-#elif WTF_PLATFORM_SYMBIAN
+#elif WTF_OS_SYMBIAN
 
 #define HAVE_ERRNO_H 1
 #define HAVE_MMAP 0
 #define HAVE_SBRK 1
 
 #define HAVE_SYS_TIME_H 1
 #define HAVE_STRINGS_H 1
 
 #if !WTF_COMPILER_RVCT
 #define HAVE_SYS_PARAM_H 1
 #endif
 
-#elif WTF_PLATFORM_QNX
+#elif WTF_PLATFORM_BREWMP
+
+#define HAVE_ERRNO_H 1
+
+#elif WTF_OS_QNX
 
 #define HAVE_ERRNO_H 1
 #define HAVE_MMAP 1
 #define HAVE_SBRK 1
 #define HAVE_STRINGS_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_TIME_H 1
 
-#elif WTF_PLATFORM_ANDROID
+#elif WTF_OS_ANDROID
 
 #define HAVE_ERRNO_H 1
 #define HAVE_LANGINFO_H 0
 #define HAVE_MMAP 1
 #define HAVE_SBRK 1
 #define HAVE_STRINGS_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_TIME_H 1
 
-#elif WTF_PLATFORM_OS2
-
-#define HAVE_MMAP 1
-#define ENABLE_ASSEMBLER 1
-#define HAVE_ERRNO_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TIMEB_H 1
-
 #else
 
 /* FIXME: is this actually used or do other platforms generate their own config.h? */
 
 #define HAVE_ERRNO_H 1
 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
-#if !WTF_PLATFORM_HAIKU
+#if !WTF_OS_HAIKU
 #define HAVE_LANGINFO_H 1
 #endif
 #define HAVE_MMAP 1
 #define HAVE_SBRK 1
 #define HAVE_STRINGS_H 1
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_TIME_H 1
 
 #endif
 
 /* ENABLE macro defaults */
 
+#if WTF_PLATFORM_QT
+/* We must not customize the global operator new and delete for the Qt port. */
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 0
+#if !WTF_OS_UNIX || WTF_OS_SYMBIAN
+#define USE_SYSTEM_MALLOC 1
+#endif
+#endif
+
 /* fastMalloc match validation allows for runtime verification that
    new is matched by delete, fastMalloc is matched by fastFree, etc. */
 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
 #endif
 
 #if !defined(ENABLE_ICONDATABASE)
 #define ENABLE_ICONDATABASE 1
@@ -705,238 +897,322 @@
 #if !defined(ENABLE_CONTEXT_MENUS)
 #define ENABLE_CONTEXT_MENUS 1
 #endif
 
 #if !defined(ENABLE_DRAG_SUPPORT)
 #define ENABLE_DRAG_SUPPORT 1
 #endif
 
+#if !defined(ENABLE_DATA_TRANSFER_ITEMS)
+#define ENABLE_DATA_TRANSFER_ITEMS 0
+#endif
+
 #if !defined(ENABLE_DASHBOARD_SUPPORT)
 #define ENABLE_DASHBOARD_SUPPORT 0
 #endif
 
 #if !defined(ENABLE_INSPECTOR)
 #define ENABLE_INSPECTOR 1
 #endif
 
-#if !defined(ENABLE_MAC_JAVA_BRIDGE)
-#define ENABLE_MAC_JAVA_BRIDGE 0
+#if !defined(ENABLE_JAVA_BRIDGE)
+#define ENABLE_JAVA_BRIDGE 0
 #endif
 
 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
 #define ENABLE_NETSCAPE_PLUGIN_API 1
 #endif
 
+#if !defined(ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE)
+#define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0
+#endif
+
+#if !defined(ENABLE_PURGEABLE_MEMORY)
+#define ENABLE_PURGEABLE_MEMORY 0
+#endif
+
 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
 #define WTF_USE_PLUGIN_HOST_PROCESS 0
 #endif
 
 #if !defined(ENABLE_ORIENTATION_EVENTS)
 #define ENABLE_ORIENTATION_EVENTS 0
 #endif
 
 #if !defined(ENABLE_OPCODE_STATS)
 #define ENABLE_OPCODE_STATS 0
 #endif
 
+#if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 1
+#endif
+
+#define ENABLE_DEBUG_WITH_BREAKPOINT 0
 #define ENABLE_SAMPLING_COUNTERS 0
 #define ENABLE_SAMPLING_FLAGS 0
 #define ENABLE_OPCODE_SAMPLING 0
 #define ENABLE_CODEBLOCK_SAMPLING 0
 #if ENABLE_CODEBLOCK_SAMPLING && !ENABLE_OPCODE_SAMPLING
 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
 #endif
 #if ENABLE_OPCODE_SAMPLING || ENABLE_SAMPLING_FLAGS
 #define ENABLE_SAMPLING_THREAD 1
 #endif
 
 #if !defined(ENABLE_GEOLOCATION)
 #define ENABLE_GEOLOCATION 0
 #endif
 
+#if !defined(ENABLE_GESTURE_RECOGNIZER)
+#define ENABLE_GESTURE_RECOGNIZER 0
+#endif
+
 #if !defined(ENABLE_NOTIFICATIONS)
 #define ENABLE_NOTIFICATIONS 0
 #endif
 
+#if WTF_PLATFORM_IOS
+#define ENABLE_TEXT_CARET 0
+#endif
+
 #if !defined(ENABLE_TEXT_CARET)
 #define ENABLE_TEXT_CARET 1
 #endif
 
 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
 #endif
 
-#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
-#if (WTF_CPU_X86_64 && (WTF_PLATFORM_UNIX || WTF_PLATFORM_WIN_OS)) || WTF_CPU_IA64 || WTF_CPU_ALPHA
+#if !defined(ENABLE_FULLSCREEN_API)
+#define ENABLE_FULLSCREEN_API 0
+#endif
+
+#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64)
+#if (WTF_CPU_X86_64 && (WTF_OS_UNIX || WTF_OS_WINDOWS)) \
+    || (WTF_CPU_IA64 && !WTF_CPU_IA64_32) \
+    || WTF_CPU_ALPHA \
+    || WTF_CPU_SPARC64 \
+    || WTF_CPU_S390X \
+    || WTF_CPU_PPC64
 #define WTF_USE_JSVALUE64 1
-#elif WTF_CPU_ARM || WTF_CPU_PPC64
-#define WTF_USE_JSVALUE32 1
-#elif WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW
-/* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
-on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
-#define WTF_USE_JSVALUE32 1
 #else
 #define WTF_USE_JSVALUE32_64 1
 #endif
-#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
+#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */
 
 #if !defined(ENABLE_REPAINT_THROTTLING)
 #define ENABLE_REPAINT_THROTTLING 0
 #endif
 
-#if !defined(ENABLE_JIT)
+/* Disable the JIT on versions of GCC prior to 4.1 */
+#if !defined(ENABLE_JIT) && WTF_COMPILER_GCC && !GCC_VERSION_AT_LEAST(4, 1, 0)
+#define ENABLE_JIT 0
+#endif
+
+/* JIT is not implemented for 64 bit on MSVC */
+#if !defined(ENABLE_JIT) && WTF_COMPILER_MSVC && WTF_CPU_X86_64
+#define ENABLE_JIT 0
+#endif
 
-/* The JIT is tested & working on x86_64 Mac */
-#if WTF_CPU_X86_64 && WTF_PLATFORM_MAC
-    #define ENABLE_JIT 1
-/* The JIT is tested & working on x86 Mac */
-#elif WTF_CPU_X86 && WTF_PLATFORM_MAC
-    #define ENABLE_JIT 1
-    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
-#elif WTF_CPU_ARM_THUMB2 && WTF_PLATFORM_IPHONE
-    #define ENABLE_JIT 1
-/* The JIT is tested & working on x86 OS/2 */
-#elif WTF_CPU_X86 && WTF_PLATFORM_OS2
-    #define ENABLE_JIT 1
-/* The JIT is tested & working on x86 Windows */
-#elif WTF_CPU_X86 && WTF_PLATFORM_WIN
-    #define ENABLE_JIT 1
-#elif WTF_CPU_SPARC
-    #define ENABLE_JIT 1
+/* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */
+#if !defined(ENABLE_JIT) \
+    && (WTF_CPU_X86 || WTF_CPU_X86_64 || WTF_CPU_ARM || WTF_CPU_MIPS) \
+    && (WTF_OS_DARWIN || !WTF_COMPILER_GCC || GCC_VERSION_AT_LEAST(4, 1, 0)) \
+    && !WTF_OS_WINCE
+#define ENABLE_JIT 1
+#endif
+
+/* Currently only implemented for JSVALUE64, only tested on WTF_PLATFORM_MAC */
+#if ENABLE_JIT && WTF_USE_JSVALUE64 && WTF_PLATFORM_MAC
+#define ENABLE_DFG_JIT 1
+/* Enabled with restrictions to circumvent known performance regressions. */
+#define ENABLE_DFG_JIT_RESTRICTIONS 1
 #endif
 
-#if WTF_PLATFORM_QT
-#if WTF_CPU_X86_64 && WTF_PLATFORM_DARWIN
-    #define ENABLE_JIT 1
-#elif WTF_CPU_X86 && WTF_PLATFORM_DARWIN
-    #define ENABLE_JIT 1
-    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
-#elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW && GCC_VERSION >= 40100
-    #define ENABLE_JIT 1
-    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
-#elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MSVC
-    #define ENABLE_JIT 1
-    #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
-#elif WTF_CPU_X86 && WTF_PLATFORM_LINUX && GCC_VERSION >= 40100
-    #define ENABLE_JIT 1
-    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
-#elif WTF_CPU_ARM_TRADITIONAL && WTF_PLATFORM_LINUX
-    #define ENABLE_JIT 1
+/* Ensure that either the JIT or the interpreter has been enabled. */
+#if !defined(ENABLE_INTERPRETER) && !ENABLE_JIT
+#define ENABLE_INTERPRETER 1
+#endif
+#if !(ENABLE_JIT || ENABLE_INTERPRETER)
+#error You have to have at least one execution model enabled to build JSC
+#endif
+
+#if WTF_CPU_SH4 && WTF_PLATFORM_QT
+#define ENABLE_JIT 1
+#define ENABLE_YARR 1
+#define ENABLE_YARR_JIT 1
+#define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
+#define ENABLE_ASSEMBLER 1
 #endif
-#endif /* PLATFORM(QT) */
 
-#endif /* !defined(ENABLE_JIT) */
-
+/* Configure the JIT */
 #if ENABLE_JIT
-#ifndef ENABLE_JIT_OPTIMIZE_CALL
-#define ENABLE_JIT_OPTIMIZE_CALL 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
-#define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
-#define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
-#endif
-#ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
-#define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
-#endif
+    #if WTF_CPU_ARM
+    #if !defined(ENABLE_JIT_USE_SOFT_MODULO) && WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5
+    #define ENABLE_JIT_USE_SOFT_MODULO 1
+    #endif
+    #endif
+
+    #ifndef ENABLE_JIT_OPTIMIZE_CALL
+    #define ENABLE_JIT_OPTIMIZE_CALL 1
+    #endif
+    #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
+    #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
+    #endif
+    #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
+    #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
+    #endif
+    #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
+    #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
+    #endif
 #endif
 
 #if WTF_CPU_X86 && WTF_COMPILER_MSVC
 #define JSC_HOST_CALL __fastcall
 #elif WTF_CPU_X86 && WTF_COMPILER_GCC
 #define JSC_HOST_CALL __attribute__ ((fastcall))
 #else
 #define JSC_HOST_CALL
 #endif
 
-#if WTF_COMPILER_GCC && !ENABLE_JIT
+/* Configure the interpreter */
+#if WTF_COMPILER_GCC || (RVCT_VERSION_AT_LEAST(4, 0, 0, 0) && defined(__GNUC__))
 #define HAVE_COMPUTED_GOTO 1
 #endif
-
-#if ENABLE_JIT && defined(COVERAGE)
-    #define WTF_USE_INTERPRETER 0
-#else
-    #define WTF_USE_INTERPRETER 1
+#if HAVE_COMPUTED_GOTO && ENABLE_INTERPRETER
+#define ENABLE_COMPUTED_GOTO_INTERPRETER 1
 #endif
 
-/* Yet Another Regex Runtime. */
-#if !defined(ENABLE_YARR_JIT)
+/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc.  Results dumped at exit */
+#define ENABLE_REGEXP_TRACING 0
 
-/* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
-#if (WTF_CPU_X86 \
- || WTF_CPU_X86_64 \
- || WTF_CPU_SPARC \
- || WTF_CPU_ARM_TRADITIONAL \
- || WTF_CPU_ARM_THUMB2 \
- || WTF_CPU_X86)
+/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
+#if WTF_PLATFORM_CHROMIUM
+#define ENABLE_YARR_JIT 0
+
+#elif ENABLE_JIT && !defined(ENABLE_YARR_JIT)
 #define ENABLE_YARR_JIT 1
-#else
-#define ENABLE_YARR_JIT 0
+
+/* Setting this flag compares JIT results with interpreter results. */
+#define ENABLE_YARR_JIT_DEBUG 0
 #endif
 
-#endif /* !defined(ENABLE_YARR_JIT) */
-
-#if (ENABLE_JIT || ENABLE_YARR_JIT)
+#if ENABLE_JIT || ENABLE_YARR_JIT
 #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
+#if WTF_PLATFORM_IOS
 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
-#else
-#define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
 #endif
 
-#if !defined(ENABLE_PAN_SCROLLING) && WTF_PLATFORM_WIN_OS
+/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
+   On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
+#if ENABLE_ASSEMBLER
+#if WTF_CPU_X86_64
+#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
+#else
+#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
+#endif
+#endif
+
+#if !defined(ENABLE_PAN_SCROLLING) && WTF_OS_WINDOWS
 #define ENABLE_PAN_SCROLLING 1
 #endif
 
-/* Use the QXmlStreamReader implementation for XMLTokenizer */
+#if !defined(ENABLE_SMOOTH_SCROLLING)
+#define ENABLE_SMOOTH_SCROLLING 0
+#endif
+
+#if !defined(ENABLE_WEB_ARCHIVE)
+#define ENABLE_WEB_ARCHIVE 0
+#endif
+
+/* Use the QXmlStreamReader implementation for XMLDocumentParser */
 /* Use the QXmlQuery implementation for XSLTProcessor */
 #if WTF_PLATFORM_QT
 #define WTF_USE_QXMLSTREAM 1
 #define WTF_USE_QXMLQUERY 1
 #endif
 
-#if !WTF_PLATFORM_QT
-#define WTF_USE_FONT_FAST_PATH 1
-#endif
-
-/* Accelerated compositing */
 #if WTF_PLATFORM_MAC
-#if !defined(BUILDING_ON_TIGER)
-#define WTF_USE_ACCELERATED_COMPOSITING 1
+/* Complex text framework */
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#define WTF_USE_ATSUI 0
+#define WTF_USE_CORE_TEXT 1
+#else
+#define WTF_USE_ATSUI 1
+#define WTF_USE_CORE_TEXT 0
 #endif
 #endif
 
-#if WTF_PLATFORM_IPHONE
+/* Accelerated compositing */
+#if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER)) || WTF_PLATFORM_IOS || WTF_PLATFORM_QT || (WTF_PLATFORM_WIN && !WTF_OS_WINCE &&!defined(WIN_CAIRO))
 #define WTF_USE_ACCELERATED_COMPOSITING 1
 #endif
 
-/* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
-   with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
-   off in one place. */
-//#if WTF_PLATFORM_WIN
-//#include "QuartzCorePresent.h"
-//#if QUARTZCORE_PRESENT
-//#define WTF_USE_ACCELERATED_COMPOSITING 1
-//#define ENABLE_3D_RENDERING 1
-//#endif
-//#endif
+#if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || WTF_PLATFORM_IOS
+#define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
+#endif
+
+#if WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#define WTF_USE_AVFOUNDATION 1
+#endif
 
 #if WTF_COMPILER_GCC
 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
 #else
 #define WARN_UNUSED_RETURN
 #endif
 
-#if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_PLATFORM_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK))
+#if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_OS_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK))
 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
 #endif
 
 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
 
 #define ENABLE_JSC_ZOMBIES 0
 
+/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
+#if WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_QT
+#define WTF_USE_PLATFORM_STRATEGIES 1
+#endif
+
+#if WTF_PLATFORM_WIN
+#define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1
+#endif
+
+/* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location.
+   Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy.
+   pre-emptive permission policy is enabled by default for all client-based implementations. */
+#if ENABLE_CLIENT_BASED_GEOLOCATION
+#define WTF_USE_PREEMPT_GEOLOCATION_PERMISSION 1
+#endif
+
+#if WTF_CPU_ARM_THUMB2
+#define ENABLE_BRANCH_COMPACTION 1
+#endif
+
+#if !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
+#define ENABLE_THREADING_OPENMP 1
+#endif
+
+#if !defined(ENABLE_PARALLEL_JOBS) && !ENABLE_SINGLE_THREADED && (ENABLE_THREADING_GENERIC || ENABLE_THREADING_LIBDISPATCH || ENABLE_THREADING_OPENMP)
+#define ENABLE_PARALLEL_JOBS 1
+#endif
+
+#if ENABLE_GLIB_SUPPORT
+#include "GTypedefs.h"
+#endif
+
+/* FIXME: This define won't be needed once #27551 is fully landed. However, 
+   since most ports try to support sub-project independence, adding new headers
+   to WTF causes many ports to break, and so this way we can address the build
+   breakages one port at a time. */
+#define WTF_USE_EXPORT_MACROS 0
+
+#if WTF_PLATFORM_QT || WTF_PLATFORM_GTK
+#define WTF_USE_UNIX_DOMAIN_SOCKETS 1
+#endif
+
 #endif /* WTF_Platform_h */
--- a/js/src/jit-test/tests/basic/bug632964-regexp.js
+++ b/js/src/jit-test/tests/basic/bug632964-regexp.js
@@ -1,17 +1,14 @@
-// |jit-test| error: InternalError: regular expression too complex
-
 var sText = "s";
 
 for (var i = 0; i < 250000; ++i)
     sText += 'a\n';
 
 sText += 'e';
 
 var start = new Date();
 var match = sText.match(/s(\s|.)*?e/gi);
 //var match = sText.match(/s([\s\S]*?)e/gi);
 //var match = sText.match(/s(?:[\s\S]*?)e/gi);
 var end = new Date();
-print(end - start);
 
 assertEq(match.length, 1);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBitopWithConstan.js
@@ -0,0 +1,741 @@
+function test1 (x) {
+    assertEq(x | -1, -1);
+    assertEq(-1 | x, -1);
+    assertEq(x & -1, 1);
+    assertEq(-1 & x, 1);
+    assertEq(x ^ -1, -2);
+    assertEq(-1 ^ x, -2);
+    assertEq(x >> -1, 0);
+    assertEq(-1 >> x, -1);
+    assertEq(x >>> -1, 0);
+    assertEq(-1 >>> x, 2147483647);
+    assertEq(x << -1, -2147483648);
+    assertEq(-1 << x, -2);
+    assertEq(x | 1, 1);
+    assertEq(1 | x, 1);
+    assertEq(x & 1, 1);
+    assertEq(1 & x, 1);
+    assertEq(x ^ 1, 0);
+    assertEq(1 ^ x, 0);
+    assertEq(x >> 1, 0);
+    assertEq(1 >> x, 0);
+    assertEq(x >>> 1, 0);
+    assertEq(1 >>> x, 0);
+    assertEq(x << 1, 2);
+    assertEq(1 << x, 2);
+    assertEq(x | 0, 1);
+    assertEq(0 | x, 1);
+    assertEq(x & 0, 0);
+    assertEq(0 & x, 0);
+    assertEq(x ^ 0, 1);
+    assertEq(0 ^ x, 1);
+    assertEq(x >> 0, 1);
+    assertEq(0 >> x, 0);
+    assertEq(x >>> 0, 1);
+    assertEq(0 >>> x, 0);
+    assertEq(x << 0, 1);
+    assertEq(0 << x, 0);
+    assertEq(x | 0xffffffff, -1);
+    assertEq(0xffffffff | x, -1);
+    assertEq(x & 0xffffffff, 1);
+    assertEq(0xffffffff & x, 1);
+    assertEq(x ^ 0xffffffff, -2);
+    assertEq(0xffffffff ^ x, -2);
+    assertEq(x >> 0xffffffff, 0);
+    assertEq(0xffffffff >> x, -1);
+    assertEq(x >>> 0xffffffff, 0);
+    assertEq(0xffffffff >>> x, 2147483647);
+    assertEq(x << 0xffffffff, -2147483648);
+    assertEq(0xffffffff << x, -2);
+    assertEq(x | "10.6", 11);
+    assertEq("10.6" | x, 11);
+    assertEq(x & "10.6", 0);
+    assertEq("10.6" & x, 0);
+    assertEq(x ^ "10.6", 11);
+    assertEq("10.6" ^ x, 11);
+    assertEq(x >> "10.6", 0);
+    assertEq("10.6" >> x, 5);
+    assertEq(x >>> "10.6", 0);
+    assertEq("10.6" >>> x, 5);
+    assertEq(x << "10.6", 1024);
+    assertEq("10.6" << x, 20);
+    assertEq(x | 2147483648, -2147483647);
+    assertEq(2147483648 | x, -2147483647);
+    assertEq(x & 2147483648, 0);
+    assertEq(2147483648 & x, 0);
+    assertEq(x ^ 2147483648, -2147483647);
+    assertEq(2147483648 ^ x, -2147483647);
+    assertEq(x >> 2147483648, 1);
+    assertEq(2147483648 >> x, -1073741824);
+    assertEq(x >>> 2147483648, 1);
+    assertEq(2147483648 >>> x, 1073741824);
+    assertEq(x << 2147483648, 1);
+    assertEq(2147483648 << x, 0);
+    assertEq(x | 4294967296, 1);
+    assertEq(4294967296 | x, 1);
+    assertEq(x & 4294967296, 0);
+    assertEq(4294967296 & x, 0);
+    assertEq(x ^ 4294967296, 1);
+    assertEq(4294967296 ^ x, 1);
+    assertEq(x >> 4294967296, 1);
+    assertEq(4294967296 >> x, 0);
+    assertEq(x >>> 4294967296, 1);
+    assertEq(4294967296 >>> x, 0);
+    assertEq(x << 4294967296, 1);
+    assertEq(4294967296 << x, 0);
+    assertEq(x | undefined, 1);
+    assertEq(undefined | x, 1);
+    assertEq(x & undefined, 0);
+    assertEq(undefined & x, 0);
+    assertEq(x ^ undefined, 1);
+    assertEq(undefined ^ x, 1);
+    assertEq(x >> undefined, 1);
+    assertEq(undefined >> x, 0);
+    assertEq(x >>> undefined, 1);
+    assertEq(undefined >>> x, 0);
+    assertEq(x << undefined, 1);
+    assertEq(undefined << x, 0);
+    assertEq(x | null, 1);
+    assertEq(null | x, 1);
+    assertEq(x & null, 0);
+    assertEq(null & x, 0);
+    assertEq(x ^ null, 1);
+    assertEq(null ^ x, 1);
+    assertEq(x >> null, 1);
+    assertEq(null >> x, 0);
+    assertEq(x >>> null, 1);
+    assertEq(null >>> x, 0);
+    assertEq(x << null, 1);
+    assertEq(null << x, 0);
+    assertEq(x | false, 1);
+    assertEq(false | x, 1);
+    assertEq(x & false, 0);
+    assertEq(false & x, 0);
+    assertEq(x ^ false, 1);
+    assertEq(false ^ x, 1);
+    assertEq(x >> false, 1);
+    assertEq(false >> x, 0);
+    assertEq(x >>> false, 1);
+    assertEq(false >>> x, 0);
+    assertEq(x << false, 1);
+    assertEq(false << x, 0);
+    assertEq(x | true, 1);
+    assertEq(true | x, 1);
+    assertEq(x & true, 1);
+    assertEq(true & x, 1);
+    assertEq(x ^ true, 0);
+    assertEq(true ^ x, 0);
+    assertEq(x >> true, 0);
+    assertEq(true >> x, 0);
+    assertEq(x >>> true, 0);
+    assertEq(true >>> x, 0);
+    assertEq(x << true, 2);
+    assertEq(true << x, 2);
+    assertEq(x | -1.5, -1);
+    assertEq(-1.5 | x, -1);
+    assertEq(x & -1.5, 1);
+    assertEq(-1.5 & x, 1);
+    assertEq(x ^ -1.5, -2);
+    assertEq(-1.5 ^ x, -2);
+    assertEq(x >> -1.5, 0);
+    assertEq(-1.5 >> x, -1);
+    assertEq(x >>> -1.5, 0);
+    assertEq(-1.5 >>> x, 2147483647);
+    assertEq(x << -1.5, -2147483648);
+    assertEq(-1.5 << x, -2);
+}
+test1(1)
+
+function test2 (x) {
+    assertEq(x | -1, -1);
+    assertEq(-1 | x, -1);
+    assertEq(x & -1, 0);
+    assertEq(-1 & x, 0);
+    assertEq(x ^ -1, -1);
+    assertEq(-1 ^ x, -1);
+    assertEq(x >> -1, 0);
+    assertEq(-1 >> x, -1);
+    assertEq(x >>> -1, 0);
+    assertEq(-1 >>> x, 4294967295);
+    assertEq(x << -1, 0);
+    assertEq(-1 << x, -1);
+    assertEq(x | 1, 1);
+    assertEq(1 | x, 1);
+    assertEq(x & 1, 0);
+    assertEq(1 & x, 0);
+    assertEq(x ^ 1, 1);
+    assertEq(1 ^ x, 1);
+    assertEq(x >> 1, 0);
+    assertEq(1 >> x, 1);
+    assertEq(x >>> 1, 0);
+    assertEq(1 >>> x, 1);
+    assertEq(x << 1, 0);
+    assertEq(1 << x, 1);
+    assertEq(x | 0, 0);
+    assertEq(0 | x, 0);
+    assertEq(x & 0, 0);
+    assertEq(0 & x, 0);
+    assertEq(x ^ 0, 0);
+    assertEq(0 ^ x, 0);
+    assertEq(x >> 0, 0);
+    assertEq(0 >> x, 0);
+    assertEq(x >>> 0, 0);
+    assertEq(0 >>> x, 0);
+    assertEq(x << 0, 0);
+    assertEq(0 << x, 0);
+    assertEq(x | 0xffffffff, -1);
+    assertEq(0xffffffff | x, -1);
+    assertEq(x & 0xffffffff, 0);
+    assertEq(0xffffffff & x, 0);
+    assertEq(x ^ 0xffffffff, -1);
+    assertEq(0xffffffff ^ x, -1);
+    assertEq(x >> 0xffffffff, 0);
+    assertEq(0xffffffff >> x, -1);
+    assertEq(x >>> 0xffffffff, 0);
+    assertEq(0xffffffff >>> x, 4294967295);
+    assertEq(x << 0xffffffff, 0);
+    assertEq(0xffffffff << x, -1);
+    assertEq(x | "10.6", 10);
+    assertEq("10.6" | x, 10);
+    assertEq(x & "10.6", 0);
+    assertEq("10.6" & x, 0);
+    assertEq(x ^ "10.6", 10);
+    assertEq("10.6" ^ x, 10);
+    assertEq(x >> "10.6", 0);
+    assertEq("10.6" >> x, 10);
+    assertEq(x >>> "10.6", 0);
+    assertEq("10.6" >>> x, 10);
+    assertEq(x << "10.6", 0);
+    assertEq("10.6" << x, 10);
+    assertEq(x | 2147483648, -2147483648);
+    assertEq(2147483648 | x, -2147483648);
+    assertEq(x & 2147483648, 0);
+    assertEq(2147483648 & x, 0);
+    assertEq(x ^ 2147483648, -2147483648);
+    assertEq(2147483648 ^ x, -2147483648);
+    assertEq(x >> 2147483648, 0);
+    assertEq(2147483648 >> x, -2147483648);
+    assertEq(x >>> 2147483648, 0);
+    assertEq(2147483648 >>> x, 2147483648);
+    assertEq(x << 2147483648, 0);
+    assertEq(2147483648 << x, -2147483648);
+    assertEq(x | 4294967296, 0);
+    assertEq(4294967296 | x, 0);
+    assertEq(x & 4294967296, 0);
+    assertEq(4294967296 & x, 0);
+    assertEq(x ^ 4294967296, 0);
+    assertEq(4294967296 ^ x, 0);
+    assertEq(x >> 4294967296, 0);
+    assertEq(4294967296 >> x, 0);
+    assertEq(x >>> 4294967296, 0);
+    assertEq(4294967296 >>> x, 0);
+    assertEq(x << 4294967296, 0);
+    assertEq(4294967296 << x, 0);
+    assertEq(x | undefined, 0);
+    assertEq(undefined | x, 0);
+    assertEq(x & undefined, 0);
+    assertEq(undefined & x, 0);
+    assertEq(x ^ undefined, 0);
+    assertEq(undefined ^ x, 0);
+    assertEq(x >> undefined, 0);
+    assertEq(undefined >> x, 0);
+    assertEq(x >>> undefined, 0);
+    assertEq(undefined >>> x, 0);
+    assertEq(x << undefined, 0);
+    assertEq(undefined << x, 0);
+    assertEq(x | null, 0);
+    assertEq(null | x, 0);
+    assertEq(x & null, 0);
+    assertEq(null & x, 0);
+    assertEq(x ^ null, 0);
+    assertEq(null ^ x, 0);
+    assertEq(x >> null, 0);
+    assertEq(null >> x, 0);
+    assertEq(x >>> null, 0);
+    assertEq(null >>> x, 0);
+    assertEq(x << null, 0);
+    assertEq(null << x, 0);
+    assertEq(x | false, 0);
+    assertEq(false | x, 0);
+    assertEq(x & false, 0);
+    assertEq(false & x, 0);
+    assertEq(x ^ false, 0);
+    assertEq(false ^ x, 0);
+    assertEq(x >> false, 0);
+    assertEq(false >> x, 0);
+    assertEq(x >>> false, 0);
+    assertEq(false >>> x, 0);
+    assertEq(x << false, 0);
+    assertEq(false << x, 0);
+    assertEq(x | true, 1);
+    assertEq(true | x, 1);
+    assertEq(x & true, 0);
+    assertEq(true & x, 0);
+    assertEq(x ^ true, 1);
+    assertEq(true ^ x, 1);
+    assertEq(x >> true, 0);
+    assertEq(true >> x, 1);
+    assertEq(x >>> true, 0);
+    assertEq(true >>> x, 1);
+    assertEq(x << true, 0);
+    assertEq(true << x, 1);
+    assertEq(x | -1.5, -1);
+    assertEq(-1.5 | x, -1);
+    assertEq(x & -1.5, 0);
+    assertEq(-1.5 & x, 0);
+    assertEq(x ^ -1.5, -1);
+    assertEq(-1.5 ^ x, -1);
+    assertEq(x >> -1.5, 0);
+    assertEq(-1.5 >> x, -1);
+    assertEq(x >>> -1.5, 0);
+    assertEq(-1.5 >>> x, 4294967295);
+    assertEq(x << -1.5, 0);
+    assertEq(-1.5 << x, -1);
+}
+test2(0)
+
+function test3 (x) {
+    assertEq(x | -1, -1);
+    assertEq(-1 | x, -1);
+    assertEq(x & -1, -1);
+    assertEq(-1 & x, -1);
+    assertEq(x ^ -1, 0);
+    assertEq(-1 ^ x, 0);
+    assertEq(x >> -1, -1);
+    assertEq(-1 >> x, -1);
+    assertEq(x >>> -1, 1);
+    assertEq(-1 >>> x, 1);
+    assertEq(x << -1, -2147483648);
+    assertEq(-1 << x, -2147483648);
+    assertEq(x | 1, -1);
+    assertEq(1 | x, -1);
+    assertEq(x & 1, 1);
+    assertEq(1 & x, 1);
+    assertEq(x ^ 1, -2);
+    assertEq(1 ^ x, -2);
+    assertEq(x >> 1, -1);
+    assertEq(1 >> x, 0);
+    assertEq(x >>> 1, 2147483647);
+    assertEq(1 >>> x, 0);
+    assertEq(x << 1, -2);
+    assertEq(1 << x, -2147483648);
+    assertEq(x | 0, -1);
+    assertEq(0 | x, -1);
+    assertEq(x & 0, 0);
+    assertEq(0 & x, 0);
+    assertEq(x ^ 0, -1);
+    assertEq(0 ^ x, -1);
+    assertEq(x >> 0, -1);
+    assertEq(0 >> x, 0);
+    assertEq(x >>> 0, 4294967295);
+    assertEq(0 >>> x, 0);
+    assertEq(x << 0, -1);
+    assertEq(0 << x, 0);
+    assertEq(x | 0xffffffff, -1);
+    assertEq(0xffffffff | x, -1);
+    assertEq(x & 0xffffffff, -1);
+    assertEq(0xffffffff & x, -1);
+    assertEq(x ^ 0xffffffff, 0);
+    assertEq(0xffffffff ^ x, 0);
+    assertEq(x >> 0xffffffff, -1);
+    assertEq(0xffffffff >> x, -1);
+    assertEq(x >>> 0xffffffff, 1);
+    assertEq(0xffffffff >>> x, 1);
+    assertEq(x << 0xffffffff, -2147483648);
+    assertEq(0xffffffff << x, -2147483648);
+    assertEq(x | "10.6", -1);
+    assertEq("10.6" | x, -1);
+    assertEq(x & "10.6", 10);
+    assertEq("10.6" & x, 10);
+    assertEq(x ^ "10.6", -11);
+    assertEq("10.6" ^ x, -11);
+    assertEq(x >> "10.6", -1);
+    assertEq("10.6" >> x, 0);
+    assertEq(x >>> "10.6", 4194303);
+    assertEq("10.6" >>> x, 0);
+    assertEq(x << "10.6", -1024);
+    assertEq("10.6" << x, 0);
+    assertEq(x | 2147483648, -1);
+    assertEq(2147483648 | x, -1);
+    assertEq(x & 2147483648, -2147483648);
+    assertEq(2147483648 & x, -2147483648);
+    assertEq(x ^ 2147483648, 2147483647);
+    assertEq(2147483648 ^ x, 2147483647);
+    assertEq(x >> 2147483648, -1);
+    assertEq(2147483648 >> x, -1);
+    assertEq(x >>> 2147483648, 4294967295);
+    assertEq(2147483648 >>> x, 1);
+    assertEq(x << 2147483648, -1);
+    assertEq(2147483648 << x, 0);
+    assertEq(x | 4294967296, -1);
+    assertEq(4294967296 | x, -1);
+    assertEq(x & 4294967296, 0);
+    assertEq(4294967296 & x, 0);
+    assertEq(x ^ 4294967296, -1);
+    assertEq(4294967296 ^ x, -1);
+    assertEq(x >> 4294967296, -1);
+    assertEq(4294967296 >> x, 0);
+    assertEq(x >>> 4294967296, 4294967295);
+    assertEq(4294967296 >>> x, 0);
+    assertEq(x << 4294967296, -1);
+    assertEq(4294967296 << x, 0);
+    assertEq(x | undefined, -1);
+    assertEq(undefined | x, -1);
+    assertEq(x & undefined, 0);
+    assertEq(undefined & x, 0);
+    assertEq(x ^ undefined, -1);
+    assertEq(undefined ^ x, -1);
+    assertEq(x >> undefined, -1);
+    assertEq(undefined >> x, 0);
+    assertEq(x >>> undefined, 4294967295);
+    assertEq(undefined >>> x, 0);
+    assertEq(x << undefined, -1);
+    assertEq(undefined << x, 0);
+    assertEq(x | null, -1);
+    assertEq(null | x, -1);
+    assertEq(x & null, 0);
+    assertEq(null & x, 0);
+    assertEq(x ^ null, -1);
+    assertEq(null ^ x, -1);
+    assertEq(x >> null, -1);
+    assertEq(null >> x, 0);
+    assertEq(x >>> null, 4294967295);
+    assertEq(null >>> x, 0);
+    assertEq(x << null, -1);
+    assertEq(null << x, 0);
+    assertEq(x | false, -1);
+    assertEq(false | x, -1);
+    assertEq(x & false, 0);
+    assertEq(false & x, 0);
+    assertEq(x ^ false, -1);
+    assertEq(false ^ x, -1);
+    assertEq(x >> false, -1);
+    assertEq(false >> x, 0);
+    assertEq(x >>> false, 4294967295);
+    assertEq(false >>> x, 0);
+    assertEq(x << false, -1);
+    assertEq(false << x, 0);
+    assertEq(x | true, -1);
+    assertEq(true | x, -1);
+    assertEq(x & true, 1);
+    assertEq(true & x, 1);
+    assertEq(x ^ true, -2);
+    assertEq(true ^ x, -2);
+    assertEq(x >> true, -1);
+    assertEq(true >> x, 0);
+    assertEq(x >>> true, 2147483647);
+    assertEq(true >>> x, 0);
+    assertEq(x << true, -2);
+    assertEq(true << x, -2147483648);
+    assertEq(x | -1.5, -1);
+    assertEq(-1.5 | x, -1);
+    assertEq(x & -1.5, -1);
+    assertEq(-1.5 & x, -1);
+    assertEq(x ^ -1.5, 0);
+    assertEq(-1.5 ^ x, 0);
+    assertEq(x >> -1.5, -1);
+    assertEq(-1.5 >> x, -1);
+    assertEq(x >>> -1.5, 1);
+    assertEq(-1.5 >>> x, 1);
+    assertEq(x << -1.5, -2147483648);
+    assertEq(-1.5 << x, -2147483648);
+}
+test3(-1)
+
+function test4 (x) {
+    assertEq(x | -1, -1);
+    assertEq(-1 | x, -1);
+    assertEq(x & -1, -2147483648);
+    assertEq(-1 & x, -2147483648);
+    assertEq(x ^ -1, 2147483647);
+    assertEq(-1 ^ x, 2147483647);
+    assertEq(x >> -1, -1);
+    assertEq(-1 >> x, -1);
+    assertEq(x >>> -1, 1);
+    assertEq(-1 >>> x, 4294967295);
+    assertEq(x << -1, 0);
+    assertEq(-1 << x, -1);
+    assertEq(x | 1, -2147483647);
+    assertEq(1 | x, -2147483647);
+    assertEq(x & 1, 0);
+    assertEq(1 & x, 0);
+    assertEq(x ^ 1, -2147483647);
+    assertEq(1 ^ x, -2147483647);
+    assertEq(x >> 1, -1073741824);
+    assertEq(1 >> x, 1);
+    assertEq(x >>> 1, 1073741824);
+    assertEq(1 >>> x, 1);
+    assertEq(x << 1, 0);
+    assertEq(1 << x, 1);
+    assertEq(x | 0, -2147483648);
+    assertEq(0 | x, -2147483648);
+    assertEq(x & 0, 0);
+    assertEq(0 & x, 0);
+    assertEq(x ^ 0, -2147483648);
+    assertEq(0 ^ x, -2147483648);
+    assertEq(x >> 0, -2147483648);
+    assertEq(0 >> x, 0);
+    assertEq(x >>> 0, 2147483648);
+    assertEq(0 >>> x, 0);
+    assertEq(x << 0, -2147483648);
+    assertEq(0 << x, 0);
+    assertEq(x | 0xffffffff, -1);
+    assertEq(0xffffffff | x, -1);
+    assertEq(x & 0xffffffff, -2147483648);
+    assertEq(0xffffffff & x, -2147483648);
+    assertEq(x ^ 0xffffffff, 2147483647);
+    assertEq(0xffffffff ^ x, 2147483647);
+    assertEq(x >> 0xffffffff, -1);
+    assertEq(0xffffffff >> x, -1);
+    assertEq(x >>> 0xffffffff, 1);
+    assertEq(0xffffffff >>> x, 4294967295);
+    assertEq(x << 0xffffffff, 0);
+    assertEq(0xffffffff << x, -1);
+    assertEq(x | "10.6", -2147483638);
+    assertEq("10.6" | x, -2147483638);
+    assertEq(x & "10.6", 0);
+    assertEq("10.6" & x, 0);
+    assertEq(x ^ "10.6", -2147483638);
+    assertEq("10.6" ^ x, -2147483638);
+    assertEq(x >> "10.6", -2097152);
+    assertEq("10.6" >> x, 10);
+    assertEq(x >>> "10.6", 2097152);
+    assertEq("10.6" >>> x, 10);
+    assertEq(x << "10.6", 0);
+    assertEq("10.6" << x, 10);
+    assertEq(x | 2147483648, -2147483648);
+    assertEq(2147483648 | x, -2147483648);
+    assertEq(x & 2147483648, -2147483648);
+    assertEq(2147483648 & x, -2147483648);
+    assertEq(x ^ 2147483648, 0);
+    assertEq(2147483648 ^ x, 0);
+    assertEq(x >> 2147483648, -2147483648);
+    assertEq(2147483648 >> x, -2147483648);
+    assertEq(x >>> 2147483648, 2147483648);
+    assertEq(2147483648 >>> x, 2147483648);
+    assertEq(x << 2147483648, -2147483648);
+    assertEq(2147483648 << x, -2147483648);
+    assertEq(x | 4294967296, -2147483648);
+    assertEq(4294967296 | x, -2147483648);
+    assertEq(x & 4294967296, 0);
+    assertEq(4294967296 & x, 0);
+    assertEq(x ^ 4294967296, -2147483648);
+    assertEq(4294967296 ^ x, -2147483648);
+    assertEq(x >> 4294967296, -2147483648);
+    assertEq(4294967296 >> x, 0);
+    assertEq(x >>> 4294967296, 2147483648);
+    assertEq(4294967296 >>> x, 0);
+    assertEq(x << 4294967296, -2147483648);
+    assertEq(4294967296 << x, 0);
+    assertEq(x | undefined, -2147483648);
+    assertEq(undefined | x, -2147483648);
+    assertEq(x & undefined, 0);
+    assertEq(undefined & x, 0);
+    assertEq(x ^ undefined, -2147483648);
+    assertEq(undefined ^ x, -2147483648);
+    assertEq(x >> undefined, -2147483648);
+    assertEq(undefined >> x, 0);
+    assertEq(x >>> undefined, 2147483648);
+    assertEq(undefined >>> x, 0);
+    assertEq(x << undefined, -2147483648);
+    assertEq(undefined << x, 0);
+    assertEq(x | null, -2147483648);
+    assertEq(null | x, -2147483648);
+    assertEq(x & null, 0);
+    assertEq(null & x, 0);
+    assertEq(x ^ null, -2147483648);
+    assertEq(null ^ x, -2147483648);
+    assertEq(x >> null, -2147483648);
+    assertEq(null >> x, 0);
+    assertEq(x >>> null, 2147483648);
+    assertEq(null >>> x, 0);
+    assertEq(x << null, -2147483648);
+    assertEq(null << x, 0);
+    assertEq(x | false, -2147483648);
+    assertEq(false | x, -2147483648);
+    assertEq(x & false, 0);
+    assertEq(false & x, 0);
+    assertEq(x ^ false, -2147483648);
+    assertEq(false ^ x, -2147483648);
+    assertEq(x >> false, -2147483648);
+    assertEq(false >> x, 0);
+    assertEq(x >>> false, 2147483648);
+    assertEq(false >>> x, 0);
+    assertEq(x << false, -2147483648);
+    assertEq(false << x, 0);
+    assertEq(x | true, -2147483647);
+    assertEq(true | x, -2147483647);
+    assertEq(x & true, 0);
+    assertEq(true & x, 0);
+    assertEq(x ^ true, -2147483647);
+    assertEq(true ^ x, -2147483647);
+    assertEq(x >> true, -1073741824);
+    assertEq(true >> x, 1);
+    assertEq(x >>> true, 1073741824);
+    assertEq(true >>> x, 1);
+    assertEq(x << true, 0);
+    assertEq(true << x, 1);
+    assertEq(x | -1.5, -1);
+    assertEq(-1.5 | x, -1);
+    assertEq(x & -1.5, -2147483648);
+    assertEq(-1.5 & x, -2147483648);
+    assertEq(x ^ -1.5, 2147483647);
+    assertEq(-1.5 ^ x, 2147483647);
+    assertEq(x >> -1.5, -1);
+    assertEq(-1.5 >> x, -1);
+    assertEq(x >>> -1.5, 1);
+    assertEq(-1.5 >>> x, 4294967295);
+    assertEq(x << -1.5, 0);
+    assertEq(-1.5 << x, -1);
+}
+test4(2147483648)
+
+function test5 (x) {
+    assertEq(x | -1, -1);
+    assertEq(-1 | x, -1);
+    assertEq(x & -1, -2147483648);
+    assertEq(-1 & x, -2147483648);
+    assertEq(x ^ -1, 2147483647);
+    assertEq(-1 ^ x, 2147483647);
+    assertEq(x >> -1, -1);
+    assertEq(-1 >> x, -1);
+    assertEq(x >>> -1, 1);
+    assertEq(-1 >>> x, 4294967295);
+    assertEq(x << -1, 0);
+    assertEq(-1 << x, -1);
+    assertEq(x | 1, -2147483647);
+    assertEq(1 | x, -2147483647);
+    assertEq(x & 1, 0);
+    assertEq(1 & x, 0);
+    assertEq(x ^ 1, -2147483647);
+    assertEq(1 ^ x, -2147483647);
+    assertEq(x >> 1, -1073741824);
+    assertEq(1 >> x, 1);
+    assertEq(x >>> 1, 1073741824);
+    assertEq(1 >>> x, 1);
+    assertEq(x << 1, 0);
+    assertEq(1 << x, 1);
+    assertEq(x | 0, -2147483648);
+    assertEq(0 | x, -2147483648);
+    assertEq(x & 0, 0);
+    assertEq(0 & x, 0);
+    assertEq(x ^ 0, -2147483648);
+    assertEq(0 ^ x, -2147483648);
+    assertEq(x >> 0, -2147483648);
+    assertEq(0 >> x, 0);
+    assertEq(x >>> 0, 2147483648);
+    assertEq(0 >>> x, 0);
+    assertEq(x << 0, -2147483648);
+    assertEq(0 << x, 0);
+    assertEq(x | 0xffffffff, -1);
+    assertEq(0xffffffff | x, -1);
+    assertEq(x & 0xffffffff, -2147483648);
+    assertEq(0xffffffff & x, -2147483648);
+    assertEq(x ^ 0xffffffff, 2147483647);
+    assertEq(0xffffffff ^ x, 2147483647);
+    assertEq(x >> 0xffffffff, -1);
+    assertEq(0xffffffff >> x, -1);
+    assertEq(x >>> 0xffffffff, 1);
+    assertEq(0xffffffff >>> x, 4294967295);
+    assertEq(x << 0xffffffff, 0);
+    assertEq(0xffffffff << x, -1);
+    assertEq(x | "10.6", -2147483638);
+    assertEq("10.6" | x, -2147483638);
+    assertEq(x & "10.6", 0);
+    assertEq("10.6" & x, 0);
+    assertEq(x ^ "10.6", -2147483638);
+    assertEq("10.6" ^ x, -2147483638);
+    assertEq(x >> "10.6", -2097152);
+    assertEq("10.6" >> x, 10);
+    assertEq(x >>> "10.6", 2097152);
+    assertEq("10.6" >>> x, 10);
+    assertEq(x << "10.6", 0);
+    assertEq("10.6" << x, 10);
+    assertEq(x | 2147483648, -2147483648);
+    assertEq(2147483648 | x, -2147483648);
+    assertEq(x & 2147483648, -2147483648);
+    assertEq(2147483648 & x, -2147483648);
+    assertEq(x ^ 2147483648, 0);
+    assertEq(2147483648 ^ x, 0);
+    assertEq(x >> 2147483648, -2147483648);
+    assertEq(2147483648 >> x, -2147483648);
+    assertEq(x >>> 2147483648, 2147483648);
+    assertEq(2147483648 >>> x, 2147483648);
+    assertEq(x << 2147483648, -2147483648);
+    assertEq(2147483648 << x, -2147483648);
+    assertEq(x | 4294967296, -2147483648);
+    assertEq(4294967296 | x, -2147483648);
+    assertEq(x & 4294967296, 0);
+    assertEq(4294967296 & x, 0);
+    assertEq(x ^ 4294967296, -2147483648);
+    assertEq(4294967296 ^ x, -2147483648);
+    assertEq(x >> 4294967296, -2147483648);
+    assertEq(4294967296 >> x, 0);
+    assertEq(x >>> 4294967296, 2147483648);
+    assertEq(4294967296 >>> x, 0);
+    assertEq(x << 4294967296, -2147483648);
+    assertEq(4294967296 << x, 0);
+    assertEq(x | undefined, -2147483648);
+    assertEq(undefined | x, -2147483648);
+    assertEq(x & undefined, 0);
+    assertEq(undefined & x, 0);
+    assertEq(x ^ undefined, -2147483648);
+    assertEq(undefined ^ x, -2147483648);
+    assertEq(x >> undefined, -2147483648);
+    assertEq(undefined >> x, 0);
+    assertEq(x >>> undefined, 2147483648);
+    assertEq(undefined >>> x, 0);
+    assertEq(x << undefined, -2147483648);
+    assertEq(undefined << x, 0);
+    assertEq(x | null, -2147483648);
+    assertEq(null | x, -2147483648);
+    assertEq(x & null, 0);
+    assertEq(null & x, 0);
+    assertEq(x ^ null, -2147483648);
+    assertEq(null ^ x, -2147483648);
+    assertEq(x >> null, -2147483648);
+    assertEq(null >> x, 0);
+    assertEq(x >>> null, 2147483648);
+    assertEq(null >>> x, 0);
+    assertEq(x << null, -2147483648);
+    assertEq(null << x, 0);
+    assertEq(x | false, -2147483648);
+    assertEq(false | x, -2147483648);
+    assertEq(x & false, 0);
+    assertEq(false & x, 0);
+    assertEq(x ^ false, -2147483648);
+    assertEq(false ^ x, -2147483648);
+    assertEq(x >> false, -2147483648);
+    assertEq(false >> x, 0);
+    assertEq(x >>> false, 2147483648);
+    assertEq(false >>> x, 0);
+    assertEq(x << false, -2147483648);
+    assertEq(false << x, 0);
+    assertEq(x | true, -2147483647);
+    assertEq(true | x, -2147483647);
+    assertEq(x & true, 0);
+    assertEq(true & x, 0);
+    assertEq(x ^ true, -2147483647);
+    assertEq(true ^ x, -2147483647);
+    assertEq(x >> true, -1073741824);
+    assertEq(true >> x, 1);
+    assertEq(x >>> true, 1073741824);
+    assertEq(true >>> x, 1);
+    assertEq(x << true, 0);
+    assertEq(true << x, 1);
+    assertEq(x | -1.5, -1);
+    assertEq(-1.5 | x, -1);
+    assertEq(x & -1.5, -2147483648);
+    assertEq(-1.5 & x, -2147483648);
+    assertEq(x ^ -1.5, 2147483647);
+    assertEq(-1.5 ^ x, 2147483647);
+    assertEq(x >> -1.5, -1);
+    assertEq(-1.5 >> x, -1);
+    assertEq(x >>> -1.5, 1);
+    assertEq(-1.5 >>> x, 4294967295);
+    assertEq(x << -1.5, 0);
+    assertEq(-1.5 << x, -1);
+}
+test5(-2147483648)
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/bug658968.js
@@ -0,0 +1,13 @@
+function f(){
+    var tarr = [];
+    var elemArray = [
+        {name: "C0", checked: true},
+        {name: "C1", checked: false},
+    ];
+    for (var i = 0; i < elemArray.length; i++) {
+        var element = elemArray[i];
+        tarr[i] = (element.checked == true) ? 1 : 2;
+    }
+    assertEq(tarr.join(""), "12");
+}
+f();
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -816,17 +816,17 @@ js_ReportOutOfMemory(JSContext *cx)
         JSDebugErrorHook hook = cx->debugHooks->debugErrorHook;
         if (hook &&
             !hook(cx, msg, &report, cx->debugHooks->debugErrorHookData)) {
             onError = NULL;
         }
     }
 
     if (onError) {
-        AutoScopedAssign<bool> ss(&cx->runtime->inOOMReport, true);
+        AutoAtomicIncrement incr(&cx->runtime->inOOMReport);
         onError(cx, msg, &report);
     }
 }
 
 void
 js_ReportOutOfScriptQuota(JSContext *maybecx)
 {
     if (maybecx)
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -705,17 +705,17 @@ struct JSRuntime {
     size_t               mjitDataSize;
 #endif
 
     /*
      * To ensure that cx->malloc does not cause a GC, we set this flag during
      * OOM reporting (in js_ReportOutOfMemory). If a GC is requested while
      * reporting the OOM, we ignore it.
      */
-    bool                 inOOMReport;
+    int32               inOOMReport;
 
 #if defined(MOZ_GCTIMER) || defined(JSGC_TESTPILOT)
     struct GCData {
         /*
          * Timestamp of the first GCTimer -- application runtime is determined
          * relative to this value.
          */
         uint64      firstEnter;
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -43,16 +43,17 @@
 #include "jsgc.h"
 #include "jsgcmark.h"
 #include "jsiter.h"
 #include "jsproxy.h"
 #include "jsscope.h"
 #include "jstracer.h"
 #include "jswrapper.h"
 #include "assembler/wtf/Platform.h"
+#include "yarr/BumpPointerAllocator.h"
 #include "methodjit/MethodJIT.h"
 #include "methodjit/PolyIC.h"
 #include "methodjit/MonoIC.h"
 
 #include "jsgcinlines.h"
 #include "jsscopeinlines.h"
 
 #if ENABLE_YARR_JIT
@@ -69,29 +70,29 @@ JSCompartment::JSCompartment(JSRuntime *
     gcTriggerBytes(0),
     gcLastBytes(0),
     hold(false),
     data(NULL),
     active(false),
 #ifdef JS_METHODJIT
     jaegerCompartment(NULL),
 #endif
+#if ENABLE_YARR_JIT
+    regExpAllocator(NULL),
+#endif
     propertyTree(thisForCtor()),
     emptyArgumentsShape(NULL),
     emptyBlockShape(NULL),
     emptyCallShape(NULL),
     emptyDeclEnvShape(NULL),
     emptyEnumeratorShape(NULL),
     emptyWithShape(NULL),
     initialRegExpShape(NULL),
     initialStringShape(NULL),
     debugMode(rt->debugMode),
-#if ENABLE_YARR_JIT
-    regExpAllocator(NULL),
-#endif
     mathCache(NULL)
 {
     JS_INIT_CLIST(&scripts);
 
     PodArrayZero(scriptsToGC);
 }
 
 JSCompartment::~JSCompartment()
@@ -130,32 +131,30 @@ JSCompartment::init()
     }
 #endif
 
 #ifdef JS_TRACER
     if (!traceMonitor.init(rt))
         return false;
 #endif
 
-#if ENABLE_YARR_JIT
-    regExpAllocator = rt->new_<JSC::ExecutableAllocator>();
+    regExpAllocator = rt->new_<WTF::BumpPointerAllocator>();
     if (!regExpAllocator)
         return false;
-#endif
 
     if (!backEdgeTable.init())
         return false;
 
 #ifdef JS_METHODJIT
-    if (!(jaegerCompartment = rt->new_<mjit::JaegerCompartment>()))
+    jaegerCompartment = rt->new_<mjit::JaegerCompartment>();
+    if (!jaegerCompartment || !jaegerCompartment->Initialize())
         return false;
-    return jaegerCompartment->Initialize();
-#else
+#endif
+        
     return true;
-#endif
 }
 
 #ifdef JS_METHODJIT
 size_t
 JSCompartment::getMjitCodeSize() const
 {
     return jaegerCompartment->execAlloc()->getCodeSize();
 }
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -49,21 +49,18 @@
 #include "jsclist.h"
 #include "jsxml.h"
 
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4251) /* Silence warning about JS_FRIEND_API and data members. */
 #endif
 
-namespace JSC {
-
-class ExecutableAllocator;
-
-}
+namespace JSC { class ExecutableAllocator; }
+namespace WTF { class BumpPointerAllocator; }
 
 namespace js {
 
 /* Holds the number of recording attemps for an address. */
 typedef HashMap<jsbytecode*,
                 size_t,
                 DefaultHasher<jsbytecode*>,
                 SystemAllocPolicy> RecordAttemptMap;
@@ -415,16 +412,17 @@ struct JS_FRIEND_API(JSCompartment) {
     /*
      * This function is here so that xpconnect/src/xpcjsruntime.cpp doesn't
      * need to see the declaration of JaegerCompartment, which would require
      * #including MethodJIT.h into xpconnect/src/xpcjsruntime.cpp, which is
      * difficult due to reasons explained in bug 483677.
      */
     size_t getMjitCodeSize() const;
 #endif
+    WTF::BumpPointerAllocator    *regExpAllocator;
 
     /*
      * Shared scope property tree, and arena-pool for allocating its nodes.
      */
     js::PropertyTree             propertyTree;
 
 #ifdef DEBUG
     /* Property metering. */
@@ -461,18 +459,16 @@ struct JS_FRIEND_API(JSCompartment) {
      * non-configurable, they will always map to fixed slots.
      */
     const js::Shape              *initialRegExpShape;
     const js::Shape              *initialStringShape;
 
     bool                         debugMode;  // true iff debug mode on
     JSCList                      scripts;    // scripts in this compartment
 
-    JSC::ExecutableAllocator     *regExpAllocator;
-
     js::NativeIterCache          nativeIterCache;
 
     typedef js::Maybe<js::ToSourceCache> LazyToSourceCache;
     LazyToSourceCache            toSourceCache;
 
     JSCompartment(JSRuntime *rt);
     ~JSCompartment();
 
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -1294,16 +1294,69 @@ JS_LineNumberToPC(JSContext *cx, JSScrip
 }
 
 JS_PUBLIC_API(jsbytecode *)
 JS_EndPC(JSContext *cx, JSScript *script)
 {
     return script->code + script->length;
 }
 
+JS_PUBLIC_API(JSBool)
+JS_GetLinePCs(JSContext *cx, JSScript *script,
+              uintN startLine, uintN maxLines,
+              uintN* count, uintN** retLines, jsbytecode*** retPCs)
+{
+    uintN* lines;
+    jsbytecode** pcs;
+    size_t len = (script->length > maxLines ? maxLines : script->length);
+    lines = (uintN*) cx->malloc_(len * sizeof(uintN));
+    if (!lines)
+        return JS_FALSE;
+
+    pcs = (jsbytecode**) cx->malloc_(len * sizeof(jsbytecode*));
+    if (!pcs) {
+        cx->free_(lines);
+        return JS_FALSE;
+    }
+
+    uintN lineno = script->lineno;
+    uintN offset = 0;
+    uintN i = 0;
+    for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
+        offset += SN_DELTA(sn);
+        JSSrcNoteType type = (JSSrcNoteType) SN_TYPE(sn);
+        if (type == SRC_SETLINE || type == SRC_NEWLINE) {
+            if (type == SRC_SETLINE)
+                lineno = (uintN) js_GetSrcNoteOffset(sn, 0);
+            else
+                lineno++;
+
+            if (lineno >= startLine) {
+                lines[i] = lineno;
+                pcs[i] = script->code + offset;
+                if (++i >= maxLines)
+                    break;
+            }
+        }
+    }
+
+    *count = i;
+    if (retLines)
+        *retLines = lines;
+    else
+        cx->free_(lines);
+
+    if (retPCs)
+        *retPCs = pcs;
+    else
+        cx->free_(pcs);
+
+    return JS_TRUE;
+}
+
 JS_PUBLIC_API(uintN)
 JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun)
 {
     return fun->nargs;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun)
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -102,19 +102,19 @@ JS_SetRuntimeDebugMode(JSRuntime *rt, JS
  * enable debug mode while frames are live.
  */
 
 /* Get current state of debugging mode. */
 extern JS_PUBLIC_API(JSBool)
 JS_GetDebugMode(JSContext *cx);
 
 /*
- * Turn on/off debugging mode for a single compartment. This must be
- * called from the main thread and the compartment must be associated
- * with the main thread.
+ * Turn on/off debugging mode for a single compartment. This should only be
+ * used when no code from this compartment is running or on the stack in any
+ * thread.
  */
 JS_FRIEND_API(JSBool)
 JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);
 
 /*
  * Turn on/off debugging mode for a context's compartment.
  */
 JS_FRIEND_API(JSBool)
@@ -212,16 +212,21 @@ extern JS_PUBLIC_API(uintN)
 JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
 
 extern JS_PUBLIC_API(jsbytecode *)
 JS_LineNumberToPC(JSContext *cx, JSScript *script, uintN lineno);
 
 extern JS_PUBLIC_API(jsbytecode *)
 JS_EndPC(JSContext *cx, JSScript *script);
 
+extern JS_PUBLIC_API(JSBool)
+JS_GetLinePCs(JSContext *cx, JSScript *script,
+              uintN startLine, uintN maxLines,
+              uintN* count, uintN** lines, jsbytecode*** pcs);
+
 extern JS_PUBLIC_API(uintN)
 JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);
 
 extern JS_PUBLIC_API(JSBool)
 JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
 
 /*
  * N.B. The mark is in the context temp pool and thus the caller must take care
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2217,17 +2217,17 @@ SweepCompartments(JSContext *cx, JSGCInv
     while (read < end) {
         JSCompartment *compartment = *read++;
 
         if (!compartment->hold &&
             (compartment->arenaListsAreEmpty() || gckind == GC_LAST_CONTEXT))
         {
             JS_ASSERT(compartment->freeLists.isEmpty());
             if (callback)
-                (void) callback(cx, compartment, JSCOMPARTMENT_DESTROY);
+                JS_ALWAYS_TRUE(callback(cx, compartment, JSCOMPARTMENT_DESTROY));
             if (compartment->principals)
                 JSPRINCIPALS_DROP(cx, compartment->principals);
             cx->delete_(compartment);
             continue;
         }
         *write++ = compartment;
     }
     rt->compartments.resize(write - rt->compartments.begin());
@@ -2618,19 +2618,16 @@ AutoGCSession::~AutoGCSession()
  * GC, repeatedly if necessary, until we think we have not created any new
  * garbage and no other threads are demanding more GC. We disable inlining
  * to ensure that the bottom of the stack with possible GC roots recorded in
  * js_GC excludes any pointers we use during the marking implementation.
  */
 static JS_NEVER_INLINE void
 GCCycle(JSContext *cx, JSCompartment *comp, JSGCInvocationKind gckind  GCTIMER_PARAM)
 {
-    if (JS_ON_TRACE(cx))
-        return;
-
     JSRuntime *rt = cx->runtime;
 
     /*
      * Recursive GC is no-op and a call from another thread waits the started
      * GC cycle to finish.
      */
     if (rt->gcMarkAndSweep) {
 #ifdef JS_THREADSAFE
@@ -2641,16 +2638,27 @@ GCCycle(JSContext *cx, JSCompartment *co
         }
 #endif
         return;
     }
 
     AutoGCSession gcsession(cx);
 
     /*
+     * Don't GC if any thread is reporting an OOM. We check the flag after we
+     * have set up the GC session and know that the thread that reported OOM
+     * is either the current thread or waits for the GC to complete on this
+     * thread.
+     */
+    if (rt->inOOMReport) {
+        JS_ASSERT(gckind != GC_LAST_CONTEXT);
+        return;
+    }
+
+    /*
      * We should not be depending on cx->compartment in the GC, so set it to
      * NULL to look for violations.
      */
     SwitchToCompartment sc(cx, (JSCompartment *)NULL);
 
     JS_ASSERT(!rt->gcCurrentCompartment);
     rt->gcCurrentCompartment = comp;
 
@@ -2692,29 +2700,30 @@ GCCycle(JSContext *cx, JSCompartment *co
         (*c)->setGCLastBytes((*c)->gcBytes);
 }
 
 void
 js_GC(JSContext *cx, JSCompartment *comp, JSGCInvocationKind gckind)
 {
     JSRuntime *rt = cx->runtime;
 
-    /* Don't GC while reporting an OOM. */
-    if (rt->inOOMReport)
-        return;
-
     /*
      * Don't collect garbage if the runtime isn't up, and cx is not the last
      * context in the runtime.  The last context must force a GC, and nothing
      * should suppress that final collection or there may be shutdown leaks,
      * or runtime bloat until the next context is created.
      */
     if (rt->state != JSRTS_UP && gckind != GC_LAST_CONTEXT)
         return;
 
+    if (JS_ON_TRACE(cx)) {
+        JS_ASSERT(gckind != GC_LAST_CONTEXT);
+        return;
+    }
+
     RecordNativeStackTopForGC(cx);
 
     GCTIMER_BEGIN(rt, comp);
 
     do {
         /*
          * Let the API user decide to defer a GC if it wants to (unless this
          * is the last context).  Invoke the callback regardless. Sample the
@@ -2747,58 +2756,16 @@ js_GC(JSContext *cx, JSCompartment *comp
     } while (gckind == GC_LAST_CONTEXT && rt->gcPoke);
 #ifdef JS_GCMETER
     js_DumpGCStats(cx->runtime, stderr);
 #endif
     GCTIMER_END(gckind == GC_LAST_CONTEXT);
 }
 
 namespace js {
-namespace gc {
-
-JSCompartment *
-NewCompartment(JSContext *cx, JSPrincipals *principals)
-{
-    JSRuntime *rt = cx->runtime;
-    JSCompartment *compartment = cx->new_<JSCompartment>(rt);
-    if (!compartment || !compartment->init()) {
-        Foreground::delete_(compartment);
-        JS_ReportOutOfMemory(cx);
-        return NULL;
-    }
-
-    if (principals) {
-        compartment->principals = principals;
-        JSPRINCIPALS_HOLD(cx, principals);
-    }
-
-    compartment->setGCLastBytes(8192);
-
-    {
-        AutoLockGC lock(rt);
-
-        if (!rt->compartments.append(compartment)) {
-            AutoUnlockGC unlock(rt);
-            Foreground::delete_(compartment);
-            JS_ReportOutOfMemory(cx);
-            return NULL;
-        }
-    }
-
-    JSCompartmentCallback callback = rt->compartmentCallback;
-    if (callback && !callback(cx, compartment, JSCOMPARTMENT_NEW)) {
-        AutoLockGC lock(rt);
-        rt->compartments.popBack();
-        Foreground::delete_(compartment);
-        return NULL;
-    }
-    return compartment;
-}
-
-} /* namespace gc */
 
 class AutoCopyFreeListToArenas {
     JSRuntime *rt;
 
   public:
     AutoCopyFreeListToArenas(JSRuntime *rt)
       : rt(rt) {
         for (JSCompartment **c = rt->compartments.begin(); c != rt->compartments.end(); ++c)
@@ -2946,9 +2913,35 @@ IterateCells(JSContext *cx, JSCompartmen
     if (comp) {
         IterateCompartmentCells(cx, comp, traceKindMask, data, callback);
     } else {
         for (JSCompartment **c = rt->compartments.begin(); c != rt->compartments.end(); ++c)
             IterateCompartmentCells(cx, *c, traceKindMask, data, callback);
     }
 }
 
+namespace gc {
+
+JSCompartment *
+NewCompartment(JSContext *cx, JSPrincipals *principals)
+{
+    JSRuntime *rt = cx->runtime;
+    JSCompartment *compartment = cx->new_<JSCompartment>(rt);
+    if (compartment && compartment->init()) {
+        if (principals) {
+            compartment->principals = principals;
+            JSPRINCIPALS_HOLD(cx, principals);
+        }
+
+        compartment->setGCLastBytes(8192);
+
+        AutoLockGC lock(rt);
+        if (rt->compartments.append(compartment))
+            return compartment;
+    }
+    Foreground::delete_(compartment);
+    JS_ReportOutOfMemory(cx);
+    return NULL;
+}
+
+} /* namespace gc */
+
 } /* namespace js */
--- a/js/src/jslock.h
+++ b/js/src/jslock.h
@@ -213,25 +213,47 @@ js_CompareAndSwap(jsword *w, jsword ov, 
     return (*w == ov) ? *w = nv, JS_TRUE : JS_FALSE;
 }
 
 #define JS_ATOMIC_SET_MASK(w, mask) (*(w) |= (mask))
 #define JS_ATOMIC_CLEAR_MASK(w, mask) (*(w) &= ~(mask))
 
 #endif
 
+#ifdef __cplusplus
+
+namespace js {
+
 #ifdef JS_THREADSAFE
-namespace js {
 class AutoLock {
   private:
     JSLock *lock;
 
   public:
     AutoLock(JSLock *lock) : lock(lock) { JS_ACQUIRE_LOCK(lock); }
     ~AutoLock() { JS_RELEASE_LOCK(lock); }
 };
-}  /* namespace js */
 # define JS_AUTO_LOCK_GUARD(name, l) AutoLock name((l));
 #else
 # define JS_AUTO_LOCK_GUARD(name, l)
 #endif
 
+class AutoAtomicIncrement {
+    int32 *p;
+    JS_DECL_USE_GUARD_OBJECT_NOTIFIER
+
+  public:
+    AutoAtomicIncrement(int32 *p JS_GUARD_OBJECT_NOTIFIER_PARAM)
+      : p(p) {
+        JS_GUARD_OBJECT_NOTIFIER_INIT;
+        JS_ATOMIC_INCREMENT(p);
+    }
+
+    ~AutoAtomicIncrement() {
+        JS_ATOMIC_DECREMENT(p);
+    }
+};
+
+} /* namespace js */
+
+#endif
+
 #endif /* jslock_h___ */
--- a/js/src/jsprvtd.h
+++ b/js/src/jsprvtd.h
@@ -237,17 +237,17 @@ typedef void
 
 /* called just before script destruction */
 typedef void
 (* JSDestroyScriptHook)(JSContext *cx,
                         JSScript  *script,
                         void      *callerdata);
 
 typedef void
-(* JSSourceHandler)(const char *filename, uintN lineno, jschar *str,
+(* JSSourceHandler)(const char *filename, uintN lineno, const jschar *str,
                     size_t length, void **listenerTSData, void *closure);
 
 /*
  * This hook captures high level script execution and function calls (JS or
  * native).  It is used by JS_SetExecuteHook to hook top level scripts and by
  * JS_SetCallHook to hook function calls.  It will get called twice per script
  * or function call: just before execution begins and just after it finishes.
  * In both cases the 'current' frame is that of the executing code.
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -543,17 +543,16 @@ typedef JSObject *
  * Callback used by the wrap hook to ask the embedding to prepare an object
  * for wrapping in a context. This might include unwrapping other wrappers
  * or even finding a more suitable object for the new compartment.
  */
 typedef JSObject *
 (* JSPreWrapCallback)(JSContext *cx, JSObject *scope, JSObject *obj, uintN flags);
 
 typedef enum {
-    JSCOMPARTMENT_NEW, /* XXX Does it make sense to have a NEW? */
     JSCOMPARTMENT_DESTROY
 } JSCompartmentOp;
 
 typedef JSBool
 (* JSCompartmentCallback)(JSContext *cx, JSCompartment *compartment, uintN compartmentOp);
 
 /*
  * Read structured data from the reader r. This hook is used to read a value
--- a/js/src/jsregexp.cpp
+++ b/js/src/jsregexp.cpp
@@ -54,18 +54,16 @@
 #include "jsobj.h"
 #include "jsregexp.h"
 #include "jsstr.h"
 #include "jsvector.h"
 
 #include "jsobjinlines.h"
 #include "jsregexpinlines.h"
 
-#include "yarr/RegexParser.h"
-
 #ifdef JS_TRACER
 #include "jstracer.h"
 using namespace nanojit;
 #endif
 
 using namespace js;
 using namespace js::gc;
 
@@ -188,76 +186,43 @@ js_ObjectIsRegExp(JSObject *obj)
     return obj->isRegExp();
 }
 
 /*
  * js::RegExp
  */
 
 void
-RegExp::handleYarrError(JSContext *cx, int error)
+RegExp::reportYarrError(JSContext *cx, JSC::Yarr::ErrorCode error)
 {
     switch (error) {
       case JSC::Yarr::NoError:
-        JS_NOT_REACHED("Precondition violation: an error must have occurred.");
+        JS_NOT_REACHED("Called reportYarrError with value for no error");
         return;
 #define COMPILE_EMSG(__code, __msg) \
       case JSC::Yarr::__code: \
         JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, __msg); \
         return
       COMPILE_EMSG(PatternTooLarge, JSMSG_REGEXP_TOO_COMPLEX);
       COMPILE_EMSG(QuantifierOutOfOrder, JSMSG_BAD_QUANTIFIER);
       COMPILE_EMSG(QuantifierWithoutAtom, JSMSG_BAD_QUANTIFIER);
       COMPILE_EMSG(MissingParentheses, JSMSG_MISSING_PAREN);
       COMPILE_EMSG(ParenthesesUnmatched, JSMSG_UNMATCHED_RIGHT_PAREN);
       COMPILE_EMSG(ParenthesesTypeInvalid, JSMSG_BAD_QUANTIFIER); /* "(?" with bad next char */
       COMPILE_EMSG(CharacterClassUnmatched, JSMSG_BAD_CLASS_RANGE);
+      COMPILE_EMSG(CharacterClassInvalidRange, JSMSG_BAD_CLASS_RANGE);
       COMPILE_EMSG(CharacterClassOutOfOrder, JSMSG_BAD_CLASS_RANGE);
-      COMPILE_EMSG(CharacterClassRangeSingleChar, JSMSG_BAD_CLASS_RANGE);
+      COMPILE_EMSG(QuantifierTooLarge, JSMSG_BAD_QUANTIFIER);
       COMPILE_EMSG(EscapeUnterminated, JSMSG_TRAILING_SLASH);
-      COMPILE_EMSG(QuantifierTooLarge, JSMSG_BAD_QUANTIFIER);
-      COMPILE_EMSG(HitRecursionLimit, JSMSG_REGEXP_TOO_COMPLEX);
 #undef COMPILE_EMSG
       default:
-        JS_NOT_REACHED("Precondition violation: unknown Yarr error code.");
+        JS_NOT_REACHED("Unknown Yarr error code");
     }
 }
 
-void
-RegExp::handlePCREError(JSContext *cx, int error)
-{
-#define REPORT(msg_) \
-    JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, msg_); \
-    return
-    switch (error) {
-      case -2: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 0: JS_NOT_REACHED("Precondition violation: an error must have occurred.");
-      case 1: REPORT(JSMSG_TRAILING_SLASH);
-      case 2: REPORT(JSMSG_TRAILING_SLASH);
-      case 3: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 4: REPORT(JSMSG_BAD_QUANTIFIER);
-      case 5: REPORT(JSMSG_BAD_QUANTIFIER);
-      case 6: REPORT(JSMSG_BAD_CLASS_RANGE);
-      case 7: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 8: REPORT(JSMSG_BAD_CLASS_RANGE);
-      case 9: REPORT(JSMSG_BAD_QUANTIFIER);
-      case 10: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
-      case 11: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 12: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
-      case 13: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 14: REPORT(JSMSG_MISSING_PAREN);
-      case 15: REPORT(JSMSG_BAD_BACKREF);
-      case 16: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      case 17: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
-      default:
-        JS_NOT_REACHED("Precondition violation: unknown PCRE error code.");
-    }
-#undef REPORT
-}
-
 bool
 RegExp::parseFlags(JSContext *cx, JSString *flagStr, uintN *flagsOut)
 {
     size_t n = flagStr->length();
     const jschar *s = flagStr->getChars(cx);
     if (!s)
         return false;
 
@@ -924,8 +889,9 @@ js_InitRegExpClass(JSContext *cx, JSObje
         return NULL;
 
     /* Install the fully-constructed RegExp and RegExp.prototype in global. */
     if (!DefineConstructorAndPrototype(cx, global, JSProto_RegExp, ctor, proto))
         return NULL;
 
     return proto;
 }
+
--- a/js/src/jsregexpinlines.h
+++ b/js/src/jsregexpinlines.h
@@ -43,22 +43,23 @@
 #include "jscntxt.h"
 #include "jsobj.h"
 #include "jsregexp.h"
 #include "jsscope.h"
 
 #include "jsobjinlines.h"
 #include "jsstrinlines.h"
 
+#include "methodjit/MethodJIT.h"
 #include "assembler/wtf/Platform.h"
+#include "yarr/BumpPointerAllocator.h"
 
+#include "yarr/Yarr.h"
 #if ENABLE_YARR_JIT
-#include "yarr/yarr/RegexJIT.h"
-#else
-#include "yarr/pcre/pcre.h"
+#include "yarr/YarrJIT.h"
 #endif
 
 namespace js {
 
 /*
  * res = RegExp statics.
  */
 
@@ -90,52 +91,57 @@ regexp_statics_construct(JSContext *cx, 
  * main header.
  *
  * Note: refCount cannot overflow because that would require more referring
  * regexp objects than there is space for in addressable memory.
  */
 class RegExp
 {
 #if ENABLE_YARR_JIT
-    JSC::Yarr::RegexCodeBlock   compiled;
-#else
-    JSRegExp                    *compiled;
+    /* native code is valid only if codeBlock.isFallBack() == false */
+    JSC::Yarr::YarrCodeBlock    codeBlock;
 #endif
+    JSC::Yarr::BytecodePattern  *byteCode;
     JSLinearString              *source;
     size_t                      refCount;
     unsigned                    parenCount; /* Must be |unsigned| to interface with YARR. */
     uint32                      flags;
 #ifdef DEBUG
   public:
     JSCompartment               *compartment;
 
   private:
 #endif
 
     RegExp(JSLinearString *source, uint32 flags, JSCompartment *compartment)
-      : compiled(), source(source), refCount(1), parenCount(0), flags(flags)
+      :
+#if ENABLE_YARR_JIT
+        codeBlock(),
+#endif
+        byteCode(NULL), source(source), refCount(1), parenCount(0), flags(flags)
 #ifdef DEBUG
         , compartment(compartment)
 #endif
     { }
 
     JS_DECLARE_ALLOCATION_FRIENDS_FOR_PRIVATE_CONSTRUCTOR;
 
     ~RegExp() {
-#if !ENABLE_YARR_JIT
-        if (compiled)
-            jsRegExpFree(compiled);
+#if ENABLE_YARR_JIT
+        codeBlock.release();
 #endif
+        // YYY
+        if (byteCode)
+            delete byteCode;
     }
 
     bool compileHelper(JSContext *cx, JSLinearString &pattern);
     bool compile(JSContext *cx);
     static const uint32 allFlags = JSREG_FOLD | JSREG_GLOB | JSREG_MULTILINE | JSREG_STICKY;
-    void handlePCREError(JSContext *cx, int error);
-    void handleYarrError(JSContext *cx, int error);
+    void reportYarrError(JSContext *cx, JSC::Yarr::ErrorCode error);
     static inline bool initArena(JSContext *cx);
     static inline void checkMatchPairs(JSString *input, int *buf, size_t matchItemCount);
     static JSObject *createResult(JSContext *cx, JSString *input, int *buf, size_t matchItemCount);
     inline bool executeInternal(JSContext *cx, RegExpStatics *res, JSString *input,
                                 size_t *lastIndex, bool test, Value *rval);
 
   public:
     static inline bool isMetaChar(jschar c);
@@ -313,19 +319,16 @@ RegExp::createResult(JSContext *cx, JSSt
 
     return array;
 }
 
 inline bool
 RegExp::executeInternal(JSContext *cx, RegExpStatics *res, JSString *inputstr,
                         size_t *lastIndex, bool test, Value *rval)
 {
-#if !ENABLE_YARR_JIT
-    JS_ASSERT(compiled);
-#endif
     const size_t pairCount = parenCount + 1;
     const size_t bufCount = pairCount * 3; /* Should be x2, but PCRE has... needs. */
     const size_t matchItemCount = pairCount * 2;
 
     if (!initArena(cx))
         return false;
 
     AutoArenaAllocator aaa(&cx->regExpPool);
@@ -355,37 +358,30 @@ RegExp::executeInternal(JSContext *cx, R
 
     if (sticky()) {
         /* Sticky matches at the last index for the regexp object. */
         chars += *lastIndex;
         len -= *lastIndex;
         inputOffset = *lastIndex;
     }
 
+    int result;
 #if ENABLE_YARR_JIT
-    int result = JSC::Yarr::executeRegex(cx, compiled, chars, *lastIndex - inputOffset, len, buf,
-                                         bufCount);
+    if (!codeBlock.isFallBack())
+        result = JSC::Yarr::execute(codeBlock, chars, *lastIndex - inputOffset, len, buf);
+    else
+        result = JSC::Yarr::interpret(byteCode, chars, *lastIndex - inputOffset, len, buf);
 #else
-    int result = jsRegExpExecute(cx, compiled, chars, len, *lastIndex - inputOffset, buf, 
-                                 bufCount);
+    result = JSC::Yarr::interpret(byteCode, chars, *lastIndex - inputOffset, len, buf);
 #endif
     if (result == -1) {
         *rval = NullValue();
         return true;
     }
 
-    if (result < 0) {
-#if ENABLE_YARR_JIT
-        handleYarrError(cx, result);
-#else
-        handlePCREError(cx, result);
-#endif
-        return false;
-    }
-
     /* 
      * Adjust buf for the inputOffset. Use of sticky is rare and the matchItemCount is small, so
      * just do another pass.
      */
     if (JS_UNLIKELY(inputOffset)) {
         for (size_t i = 0; i < matchItemCount; ++i)
             buf[i] = buf[i] < 0 ? -1 : buf[i] + inputOffset;
     }
@@ -455,63 +451,53 @@ RegExp::createObjectNoStatics(JSContext 
     JSObject *obj = NewBuiltinClassInstance(cx, &js_RegExpClass);
     if (!obj || !obj->initRegExp(cx, re.get())) {
         re->decref(cx);
         return NULL;
     }
     return obj;
 }
 
-#ifdef ANDROID
-static bool
-YarrJITIsBroken(JSContext *cx)
+/*
+ * This function should be deleted once we can. See bug 604774.
+ */
+static inline bool
+EnableYarrJIT(JSContext *cx)
 {
-#if defined(JS_TRACER) && defined(JS_METHODJIT)
-    /* FIXME/bug 604774: dead code walking.
-     *
-     * If both JITs are disabled, assume they were disabled because
-     * we're running on a blacklisted device.
-     */
-    return !cx->traceJitEnabled && !cx->methodJitEnabled;
+#if defined ANDROID && defined(JS_TRACER) && defined(JS_METHODJIT)
+    return cx->traceJitEnabled || cx->methodJitEnabled;
 #else
-    return false;
+    return true;
 #endif
 }
-#endif  /* ANDROID */
 
 inline bool
 RegExp::compileHelper(JSContext *cx, JSLinearString &pattern)
 {
-#if ENABLE_YARR_JIT
-    bool fellBack = false;
-    int error = 0;
-    jitCompileRegex(*cx->compartment->regExpAllocator, compiled, pattern, parenCount, error, fellBack, ignoreCase(), multiline()
-#ifdef ANDROID
-                    /* Temporary gross hack to work around buggy kernels. */
-                    , YarrJITIsBroken(cx)
+    JSC::Yarr::ErrorCode yarrError;
+    JSC::Yarr::YarrPattern yarrPattern(pattern, ignoreCase(), multiline(), &yarrError);
+    if (yarrError) {
+        reportYarrError(cx, yarrError);
+        return false;
+    }
+    parenCount = yarrPattern.m_numSubpatterns;
+
+#if ENABLE_YARR_JIT && defined(JS_METHODJIT)
+    if (EnableYarrJIT(cx) && !yarrPattern.m_containsBackreferences) {
+        JSC::Yarr::JSGlobalData globalData(cx->compartment->jaegerCompartment->execAlloc());
+        JSC::Yarr::jitCompile(yarrPattern, &globalData, codeBlock);
+        if (!codeBlock.isFallBack())
+            return true;
+    }
 #endif
-);
-    if (!error)
-        return true;
-    if (fellBack)
-        handlePCREError(cx, error);
-    else
-        handleYarrError(cx, error);
-    return false;
-#else
-    int error = 0;
-    compiled = jsRegExpCompile(pattern.chars(), pattern.length(),
-                               ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase,
-                               multiline() ? JSRegExpMultiline : JSRegExpSingleLine,
-                               &parenCount, &error);
-    if (!error)
-        return true;
-    handlePCREError(cx, error);
-    return false;
-#endif
+
+    codeBlock.setFallBack(true);
+    byteCode = JSC::Yarr::byteCompile(yarrPattern, cx->compartment->regExpAllocator).get();
+
+    return true;
 }
 
 inline bool
 RegExp::compile(JSContext *cx)
 {
     /* Flatten source early for the rest of compilation. */
     if (!source->ensureLinear(cx))
         return false;
--- a/js/src/jsscan.cpp
+++ b/js/src/jsscan.cpp
@@ -174,18 +174,21 @@ TokenStream::init(const jschar *base, si
     lineno = ln;
     version = v;
     xml = VersionHasXML(v);
 
     userbuf.init(base, length);
     linebase = base;
     prevLinebase = NULL;
 
-    listener = cx->debugHooks->sourceHandler;
-    listenerData = cx->debugHooks->sourceHandlerData;
+    JSSourceHandler listener = cx->debugHooks->sourceHandler;
+    void *listenerData = cx->debugHooks->sourceHandlerData;
+
+    if (listener)
+        listener(fn, ln, base, length, &listenerTSData, listenerData);
 
     /*
      * This table holds all the token kinds that satisfy these properties:
      * - A single char long.
      * - Cannot be a prefix of any longer token (eg. '+' is excluded because
      *   '+=' is a valid token).
      * - Doesn't need tp->t_op set (eg. this excludes '~').
      *
--- a/js/src/jsscan.h
+++ b/js/src/jsscan.h
@@ -610,18 +610,16 @@ class TokenStream
     uintN               cursor;         /* index of last parsed token */
     uintN               lookahead;      /* count of lookahead tokens */
     uintN               lineno;         /* current line number */
     uintN               flags;          /* flags -- see above */
     const jschar        *linebase;      /* start of current line;  points into userbuf */
     const jschar        *prevLinebase;  /* start of previous line;  NULL if on the first line */
     TokenBuf            userbuf;        /* user input buffer */
     const char          *filename;      /* input filename or null */
-    JSSourceHandler     listener;       /* callback for source; eg debugger */
-    void                *listenerData;  /* listener 'this' data */
     void                *listenerTSData;/* listener data for this TokenStream */
     CharBuffer          tokenbuf;       /* current token string buffer */
     int8                oneCharTokens[128];  /* table of one-char tokens */
     JSPackedBool        maybeEOL[256];       /* probabilistic EOL lookup table */
     JSPackedBool        maybeStrSpecial[256];/* speeds up string scanning */
     JSVersion           version;        /* (i.e. to identify keywords) */
     bool                xml;            /* see JSOPTION_XML */
 };
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1280,17 +1280,21 @@ GlobalSlotHash(JSContext* cx, unsigned s
 }
 
 static inline int
 PCHash(jsbytecode* pc)
 {
     return int(uintptr_t(pc) & ORACLE_MASK);
 }
 
-Oracle::Oracle()
+Oracle::Oracle(VMAllocator* allocator)
+:   _stackDontDemote(*allocator),
+    _globalDontDemote(*allocator),
+    _pcDontDemote(*allocator),
+    _pcSlowZeroTest(*allocator)
 {
     /* Grow the oracle bitsets to their (fixed) size here, once. */
     _stackDontDemote.set(ORACLE_SIZE-1);
     _globalDontDemote.set(ORACLE_SIZE-1);
     clear();
 }
 
 /* Tell the oracle that a certain global variable should not be demoted. */
@@ -1359,20 +1363,20 @@ bool
 Oracle::isInstructionSlowZeroTest(jsbytecode* pc) const
 {
     return _pcSlowZeroTest.get(PCHash(pc));
 }
 
 void
 Oracle::clearDemotability()
 {
-    _stackDontDemote.reset();
-    _globalDontDemote.reset();
-    _pcDontDemote.reset();
-    _pcSlowZeroTest.reset();
+    _stackDontDemote.resetAndAlloc();
+    _globalDontDemote.resetAndAlloc();
+    _pcDontDemote.resetAndAlloc();
+    _pcSlowZeroTest.resetAndAlloc();
 }
 
 JS_REQUIRES_STACK void
 TraceRecorder::markSlotUndemotable(LinkableFragment* f, unsigned slot)
 {
     if (slot < f->nStackTypes) {
         traceMonitor->oracle->markStackSlotUndemotable(cx, slot);
         return;
@@ -7634,18 +7638,20 @@ TraceMonitor::~TraceMonitor ()
 #ifdef DEBUG
     logFragProfile();
 
     Foreground::delete_(profAlloc); /* Also frees profTab. */
     profAlloc = NULL;
 #endif
 
     Foreground::delete_(recordAttempts);
+    recordAttempts = NULL;
+
     Foreground::delete_(loopProfiles);
-    Foreground::delete_(oracle);
+    loopProfiles = NULL;
 
     PodArrayZero(vmfragments);
 
     Foreground::delete_(frameCache);
     frameCache = NULL;
 
     Foreground::delete_(codeAlloc);
     codeAlloc = NULL;
@@ -7659,16 +7665,19 @@ TraceMonitor::~TraceMonitor ()
     Foreground::delete_(tempAlloc);
     tempAlloc = NULL;
 
     Foreground::delete_(storage);
     storage = NULL;
 
     Foreground::delete_(cachedTempTypeMap);
     cachedTempTypeMap = NULL;
+
+    Foreground::delete_(oracle);
+    oracle = NULL;
 }
 
 bool
 TraceMonitor::init(JSRuntime* rt)
 {
 #define CHECK_NEW(lhs, type, args) \
     do { lhs = rt->new_<type> args; if (!lhs) return false; } while (0)
 #define CHECK_MALLOC(lhs, conversion, size) \
@@ -7676,17 +7685,16 @@ TraceMonitor::init(JSRuntime* rt)
 #define CHECK_ALLOC(lhs, rhs) \
     do { lhs = (rhs); if (!lhs) return false; } while (0)
 
 #if defined JS_JIT_SPEW
     /* no reserve needed in debug builds */
     CHECK_NEW(profAlloc, VMAllocator, (rt, (char*)NULL, 0));
     CHECK_ALLOC(profTab, new (*profAlloc) FragStatsMap(*profAlloc));
 #endif /* defined JS_JIT_SPEW */
-    CHECK_NEW(oracle, Oracle, ());
 
     CHECK_NEW(recordAttempts, RecordAttemptMap, ());
     if (!recordAttempts->init(PC_HASH_COUNT))
         return false;
 
     CHECK_NEW(loopProfiles, LoopProfileMap, ());
     if (!loopProfiles->init(PC_HASH_COUNT))
         return false;
@@ -7699,16 +7707,18 @@ TraceMonitor::init(JSRuntime* rt)
     CHECK_NEW(traceAlloc, VMAllocator, (rt, traceReserve, TraceReserveSize));
     CHECK_NEW(tempAlloc, VMAllocator, (rt, tempReserve, TempReserveSize));
     CHECK_NEW(codeAlloc, CodeAlloc, ());
     CHECK_NEW(frameCache, FrameInfoCache, (dataAlloc));
     CHECK_NEW(storage, TraceNativeStorage, ());
     CHECK_NEW(cachedTempTypeMap, TypeMap, ((Allocator*)NULL, oracle));
     verbose_only( branches = NULL; )
 
+    CHECK_NEW(oracle, Oracle, (dataAlloc));
+
     if (!tracedScripts.init())
         return false;
 
     flush();
 
     return true;
 }
 
--- a/js/src/jstracer.h
+++ b/js/src/jstracer.h
@@ -275,22 +275,22 @@ extern void FragProfiling_FragFinalizer(
  * well as slots that should not be demoted to int because we know them to
  * overflow or they result in type-unstable traces. We are using simple
  * hash tables.  Collisions lead to loss of optimization (demotable slots
  * are not demoted, etc.) but have no correctness implications.
  */
 #define ORACLE_SIZE 4096
 
 class Oracle {
-    avmplus::BitSet _stackDontDemote;
-    avmplus::BitSet _globalDontDemote;
-    avmplus::BitSet _pcDontDemote;
-    avmplus::BitSet _pcSlowZeroTest;
+    nanojit::BitSet _stackDontDemote;
+    nanojit::BitSet _globalDontDemote;
+    nanojit::BitSet _pcDontDemote;
+    nanojit::BitSet _pcSlowZeroTest;
 public:
-    Oracle();
+    Oracle(VMAllocator* allocator);
 
     JS_REQUIRES_STACK void markGlobalSlotUndemotable(JSContext* cx, unsigned slot);
     JS_REQUIRES_STACK bool isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const;
     JS_REQUIRES_STACK void markStackSlotUndemotable(JSContext* cx, unsigned slot);
     JS_REQUIRES_STACK void markStackSlotUndemotable(JSContext* cx, unsigned slot, const void* pc);
     JS_REQUIRES_STACK bool isStackSlotUndemotable(JSContext* cx, unsigned slot) const;
     JS_REQUIRES_STACK bool isStackSlotUndemotable(JSContext* cx, unsigned slot, const void* pc) const;
     void markInstructionUndemotable(jsbytecode* pc);
--- a/js/src/jsvector.h
+++ b/js/src/jsvector.h
@@ -203,22 +203,40 @@ class Vector : private AllocPolicy
     template <bool InitNewElems> inline bool growByImpl(size_t inc);
 
     /* magic constants */
 
     static const int sMaxInlineBytes = 1024;
 
     /* compute constants */
 
+    /*
+     * Consider element size to be 1 for buffer sizing if there are
+     * 0 inline elements. This allows us to compile when the definition
+     * of the element type is not visible here.
+     *
+     * Explicit specialization is only allowed at namespace scope, so
+     * in order to keep everything here, we use a dummy template
+     * parameter with partial specialization.
+     */
+    template <int M, int Dummy>
+    struct ElemSize {
+        static const size_t result = sizeof(T);
+    };
+    template <int Dummy>
+    struct ElemSize<0, Dummy> {
+        static const size_t result = 1;
+    };
+
     static const size_t sInlineCapacity =
-        tl::Min<N, sMaxInlineBytes / sizeof(T)>::result;
+        tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::result>::result;
 
     /* Calculate inline buffer size; avoid 0-sized array. */
     static const size_t sInlineBytes =
-        tl::Max<1, sInlineCapacity * sizeof(T)>::result;
+        tl::Max<1, sInlineCapacity * ElemSize<N, 0>::result>::result;
 
     /* member data */
 
     /*
      * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,
      * mBegin + mLength) hold valid constructed T objects. The range [mBegin +
      * mLength, mBegin + mCapacity) holds uninitialized memory. The range
      * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory
--- a/js/src/jsweakmap.cpp
+++ b/js/src/jsweakmap.cpp
@@ -198,17 +198,17 @@ WeakMap::set(JSContext *cx, uintN argc, 
     if (!key)
         return false;
     Value value = (argc > 1) ? vp[3] : UndefinedValue();
 
     WeakMap *table = (WeakMap *)obj->getPrivate();
     if (!table) {
         table = cx->new_<WeakMap>(cx);
         if (!table->map.init()) {
-            delete table;
+            cx->delete_(table);
             goto out_of_memory;
         }
         obj->setPrivate(table);
     }
 
     *vp = UndefinedValue();
     return table->map.put(key, value) != NULL;
 
@@ -219,17 +219,17 @@ WeakMap::set(JSContext *cx, uintN argc, 
 
 void
 WeakMap::mark(JSTracer *trc, JSObject *obj)
 {
     WeakMap *table = fromJSObject(obj);
     if (table) {
         if (IS_GC_MARKING_TRACER(trc)) {
             if (table->map.empty()) {
-                delete table;
+                trc->context->delete_(table);
                 obj->setPrivate(NULL);
                 return;
             }
             JSRuntime *rt = trc->context->runtime;
             table->next = rt->gcWeakMapList;
             rt->gcWeakMapList = obj;
         } else {
             for (js::HashMap<JSObject *, Value>::Range r = table->map.all(); !r.empty(); r.popFront()) {
@@ -292,17 +292,17 @@ WeakMap::sweep(JSContext *cx)
     rt->gcWeakMapList = NULL;
 }
 
 void
 WeakMap::finalize(JSContext *cx, JSObject *obj)
 {
     WeakMap *table = fromJSObject(obj);
     if (table)
-        delete table;
+        cx->delete_(table);
 }
 
 JSBool
 WeakMap::construct(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *obj = NewBuiltinClassInstance(cx, &WeakMap::jsclass);
     if (!obj)
         return false;
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -498,17 +498,17 @@ mjit::Compiler::finishThisUp(JITScript *
     jit->nNmapPairs = nNmapLive;
     cursor += sizeof(NativeMapEntry) * jit->nNmapPairs;
     size_t ix = 0;
     if (jit->nNmapPairs > 0) {
         for (size_t i = 0; i < script->length; i++) {
             analyze::Bytecode *opinfo = analysis->maybeCode(i);
             if (opinfo && opinfo->safePoint) {
                 Label L = jumpMap[i];
-                JS_ASSERT(L.isValid());
+                JS_ASSERT(L.isSet());
                 jitNmap[ix].bcOff = i;
                 jitNmap[ix].ncode = (uint8 *)(result + masm.distanceOf(L));
                 ix++;
             }
         }
     }
     JS_ASSERT(ix == jit->nNmapPairs);
 
@@ -620,17 +620,17 @@ mjit::Compiler::finishThisUp(JITScript *
         stubCode.patch(callICs[i].addrLabel2, &jitCallICs[i]);
     }
 
     ic::EqualityICInfo *jitEqualityICs = (ic::EqualityICInfo *)cursor;
     jit->nEqualityICs = equalityICs.length();
     cursor += sizeof(ic::EqualityICInfo) * jit->nEqualityICs;
     for (size_t i = 0; i < jit->nEqualityICs; i++) {
         uint32 offs = uint32(equalityICs[i].jumpTarget - script->code);
-        JS_ASSERT(jumpMap[offs].isValid());
+        JS_ASSERT(jumpMap[offs].isSet());
         jitEqualityICs[i].target = fullCode.locationOf(jumpMap[offs]);
         jitEqualityICs[i].stubEntry = stubCode.locationOf(equalityICs[i].stubEntry);
         jitEqualityICs[i].stubCall = stubCode.locationOf(equalityICs[i].stubCall);
         jitEqualityICs[i].stub = equalityICs[i].stub;
         jitEqualityICs[i].lvr = equalityICs[i].lvr;
         jitEqualityICs[i].rvr = equalityICs[i].rvr;
         jitEqualityICs[i].tempReg = equalityICs[i].tempReg;
         jitEqualityICs[i].cond = equalityICs[i].cond;
@@ -645,17 +645,17 @@ mjit::Compiler::finishThisUp(JITScript *
     jit->nTraceICs = traceICs.length();
     cursor += sizeof(ic::TraceICInfo) * jit->nTraceICs;
     for (size_t i = 0; i < jit->nTraceICs; i++) {
         jitTraceICs[i].initialized = traceICs[i].initialized;
         if (!traceICs[i].initialized)
             continue;
 
         uint32 offs = uint32(traceICs[i].jumpTarget - script->code);
-        JS_ASSERT(jumpMap[offs].isValid());
+        JS_ASSERT(jumpMap[offs].isSet());
         jitTraceICs[i].traceHint = fullCode.locationOf(traceICs[i].traceHint);
         jitTraceICs[i].jumpTarget = fullCode.locationOf(jumpMap[offs]);
         jitTraceICs[i].stubEntry = stubCode.locationOf(traceICs[i].stubEntry);
         jitTraceICs[i].traceData = NULL;
 #ifdef DEBUG
         jitTraceICs[i].jumpTargetPC = traceICs[i].jumpTarget;
 #endif
         jitTraceICs[i].hasSlowTraceHint = traceICs[i].slowTraceHint.isSet();
@@ -795,17 +795,17 @@ mjit::Compiler::finishThisUp(JITScript *
             fullCode.patch(patch.label, &doubleVec[i]);
     }
 
     /* Generate jump tables. */
     void **jumpVec = (void **)(doubleVec + doubleList.length());
 
     for (size_t i = 0; i < jumpTableOffsets.length(); i++) {
         uint32 offset = jumpTableOffsets[i];
-        JS_ASSERT(jumpMap[offset].isValid());
+        JS_ASSERT(jumpMap[offset].isSet());
         jumpVec[i] = (void *)(result + masm.distanceOf(jumpMap[offset]));
     }
 
     /* Patch jump table references. */
     for (size_t i = 0; i < jumpTables.length(); i++) {
         JumpTable &jumpTable = jumpTables[i];
         fullCode.patch(jumpTable.label, &jumpVec[jumpTable.offsetIndex]);
     }
@@ -2084,17 +2084,17 @@ mjit::Compiler::generateMethod()
 
 #undef END_CASE
 #undef BEGIN_CASE
 
 JSC::MacroAssembler::Label
 mjit::Compiler::labelOf(jsbytecode *pc)
 {
     uint32 offs = uint32(pc - script->code);
-    JS_ASSERT(jumpMap[offs].isValid());
+    JS_ASSERT(jumpMap[offs].isSet());
     return jumpMap[offs];
 }
 
 uint32
 mjit::Compiler::fullAtomIndex(jsbytecode *pc)
 {
     return GET_SLOTNO(pc);
 
@@ -2936,21 +2936,20 @@ mjit::Compiler::compareTwoValues(JSConte
     return false;
 }
 
 bool
 mjit::Compiler::emitStubCmpOp(BoolStub stub, jsbytecode *target, JSOp fused)
 {
     prepareStubCall(Uses(2));
     INLINE_STUBCALL(stub);
-    frame.pop();
-    frame.pop();
+    frame.popn(2);
+    frame.takeReg(Registers::ReturnReg);
 
     if (!target) {
-        frame.takeReg(Registers::ReturnReg);
         frame.pushTypedPayload(JSVAL_TYPE_BOOLEAN, Registers::ReturnReg);
         return true;
     }
 
     JS_ASSERT(fused == JSOP_IFEQ || fused == JSOP_IFNE);
     frame.syncAndForgetEverything();
     Assembler::Condition cond = (fused == JSOP_IFEQ)
                                 ? Assembler::Zero
--- a/js/src/methodjit/FastArithmetic.cpp
+++ b/js/src/methodjit/FastArithmetic.cpp
@@ -75,18 +75,23 @@ mjit::Compiler::tryBinaryConstantFold(JS
       case JSOP_DIV:
         needInt = false;
         break;
 
       case JSOP_MOD:
         needInt = (L.isInt32() && R.isInt32() &&
                    L.toInt32() >= 0 && R.toInt32() > 0);
         break;
-
+      
       case JSOP_RSH:
+      case JSOP_URSH:
+      case JSOP_LSH:
+      case JSOP_BITOR:
+      case JSOP_BITXOR:
+      case JSOP_BITAND:
         needInt = true;
         break;
 
       default:
         JS_NOT_REACHED("NYI");
         needInt = false; /* Silence compiler warning. */
         break;
     }
@@ -139,16 +144,39 @@ mjit::Compiler::tryBinaryConstantFold(JS
             dL = js_NaN;
         else
             dL = js_fmod(dL, dR);
         break;
 
       case JSOP_RSH:
         nL >>= (nR & 31);
         break;
+      
+      case JSOP_URSH:
+        uint32_t uL;
+        ValueToECMAUint32(cx, L, &uL);        
+        dL = (double)uint32(uL >> (nR & 31));
+        needInt = false;
+        break;
+      
+      case JSOP_LSH:
+        nL <<= nR;
+        break;
+        
+      case JSOP_BITOR:
+        nL |= nR;
+        break;
+    
+      case JSOP_BITXOR:
+        nL ^= nR;
+        break;
+        
+      case JSOP_BITAND:
+        nL &= nR;
+        break;
 
       default:
         JS_NOT_REACHED("NYI");
         break;
     }
 
     Value v;
     if (needInt)
@@ -1293,16 +1321,17 @@ mjit::Compiler::jsop_relational_double(J
         if (lhsNotNumber.isSet())
             stubcc.linkExitForBranch(lhsNotNumber.get());
         if (rhsNotNumber.isSet())
             stubcc.linkExitForBranch(rhsNotNumber.get());
         stubcc.leave();
         OOL_STUBCALL(stub);
 
         frame.popn(2);
+        frame.takeReg(Registers::ReturnReg);
         frame.syncAndForgetEverything();
 
         Jump j = masm.branchDouble(dblCond, fpLeft, fpRight);
 
         /*
          * The stub call has no need to rejoin since the state is synced.
          * Instead, we can just test the return value.
          */
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -326,17 +326,20 @@ mjit::Compiler::jsop_bitnot()
         stubcc.rejoin(Changes(1));
 }
 
 void
 mjit::Compiler::jsop_bitop(JSOp op)
 {
     FrameEntry *rhs = frame.peek(-1);
     FrameEntry *lhs = frame.peek(-2);
-
+    
+    if (tryBinaryConstantFold(cx, frame, op, lhs, rhs))
+        return;
+    
     VoidStub stub;
     switch (op) {
       case JSOP_BITOR:
         stub = stubs::BitOr;
         break;
       case JSOP_BITAND:
         stub = stubs::BitAnd;
         break;
@@ -348,24 +351,36 @@ mjit::Compiler::jsop_bitop(JSOp op)
         break;
       case JSOP_URSH:
         stub = stubs::Ursh;
         break;
       default:
         JS_NOT_REACHED("wat");
         return;
     }
+    
+    int32_t rhsInt = 0;
+    int32_t lhsInt = 0;
+    bool rhsConstant = false;
+    bool lhsConstant = false;
+    
+    if (rhs->isConstant() && rhs->getValue().isPrimitive()) {
+        ValueToECMAInt32(cx, rhs->getValue(), &rhsInt);
+        rhsConstant = true;
+    }
+    if (lhs->isConstant() && lhs->getValue().isPrimitive()) {
+        ValueToECMAInt32(cx, lhs->getValue(), &lhsInt);
+        lhsConstant = true;
+    }    
 
     bool lhsIntOrDouble = !(lhs->isNotType(JSVAL_TYPE_DOUBLE) && 
                             lhs->isNotType(JSVAL_TYPE_INT32));
     
     /* Fast-path double to int conversion. */
-    if (!lhs->isConstant() && rhs->isConstant() && lhsIntOrDouble &&
-        rhs->isType(JSVAL_TYPE_INT32) && rhs->getValue().toInt32() == 0 &&
-        (op == JSOP_BITOR || op == JSOP_LSH)) {
+    if (rhsConstant && rhsInt == 0 && lhsIntOrDouble  && (op == JSOP_BITOR || op == JSOP_LSH)) {
         RegisterID reg = frame.copyDataIntoReg(lhs);
         if (lhs->isType(JSVAL_TYPE_INT32)) {
             frame.popn(2);
             frame.pushTypedPayload(JSVAL_TYPE_INT32, reg);
             return;
         }
         MaybeJump isInt;
         if (!lhs->isType(JSVAL_TYPE_DOUBLE)) {
@@ -385,18 +400,19 @@ mjit::Compiler::jsop_bitop(JSOp op)
             isInt.get().linkTo(masm.label(), &masm);
         frame.popn(2);
         frame.pushTypedPayload(JSVAL_TYPE_INT32, reg);
         stubcc.rejoin(Changes(1));
         return;
     }
 
     /* We only want to handle integers here. */
-    if (rhs->isNotType(JSVAL_TYPE_INT32) || lhs->isNotType(JSVAL_TYPE_INT32) || 
-        (op == JSOP_URSH && rhs->isConstant() && rhs->getValue().toInt32() % 32 == 0)) {
+    if ((!rhsConstant && rhs->isNotType(JSVAL_TYPE_INT32)) || 
+        (!lhsConstant && lhs->isNotType(JSVAL_TYPE_INT32)) || 
+        (op == JSOP_URSH && rhsConstant && rhsInt % 32 == 0)) {
         prepareStubCall(Uses(2));
         INLINE_STUBCALL(stub);
         frame.popn(2);
         if (op == JSOP_URSH)
             frame.pushSynced();
         else
             frame.pushSyncedType(JSVAL_TYPE_INT32);
         return;
@@ -411,71 +427,42 @@ mjit::Compiler::jsop_bitop(JSOp op)
         stubNeeded = true;
     }
     if (!lhs->isTypeKnown() && !frame.haveSameBacking(lhs, rhs)) {
         Jump lhsFail = frame.testInt32(Assembler::NotEqual, lhs);
         stubcc.linkExit(lhsFail, Uses(2));
         stubNeeded = true;
     }
 
-    if (lhs->isConstant() && rhs->isConstant()) {
-        int32 L = lhs->getValue().toInt32();
-        int32 R = rhs->getValue().toInt32();
-
-        frame.popn(2);
-        switch (op) {
-          case JSOP_BITOR:
-            frame.push(Int32Value(L | R));
-            return;
-          case JSOP_BITXOR:
-            frame.push(Int32Value(L ^ R));
-            return;
-          case JSOP_BITAND:
-            frame.push(Int32Value(L & R));
-            return;
-          case JSOP_LSH:
-            frame.push(Int32Value(L << R));
-            return;
-          case JSOP_URSH: 
-          {
-            uint32 unsignedL;
-            if (ValueToECMAUint32(cx, lhs->getValue(), (uint32_t*)&unsignedL)) {
-                frame.push(NumberValue(uint32(unsignedL >> (R & 31))));
-                return;
-            }
-            break;
-          }
-          default:
-            JS_NOT_REACHED("say wat");
-        }
-    }
-
     RegisterID reg;
 
     switch (op) {
       case JSOP_BITOR:
       case JSOP_BITXOR:
       case JSOP_BITAND:
       {
         /* Commutative, and we're guaranteed both are ints. */
-        if (lhs->isConstant()) {
+        if (lhsConstant) {
             JS_ASSERT(!rhs->isConstant());
             FrameEntry *temp = rhs;
             rhs = lhs;
             lhs = temp;
+            
+            rhsInt = lhsInt;
+            rhsConstant = true;
         }
 
         reg = frame.ownRegForData(lhs);
-        if (rhs->isConstant()) {
+        if (rhsConstant) {
             if (op == JSOP_BITAND)
-                masm.and32(Imm32(rhs->getValue().toInt32()), reg);
+                masm.and32(Imm32(rhsInt), reg);
             else if (op == JSOP_BITXOR)
-                masm.xor32(Imm32(rhs->getValue().toInt32()), reg);
+                masm.xor32(Imm32(rhsInt), reg);
             else
-                masm.or32(Imm32(rhs->getValue().toInt32()), reg);
+                masm.or32(Imm32(rhsInt), reg);
         } else if (frame.shouldAvoidDataRemat(rhs)) {
             if (op == JSOP_BITAND)
                 masm.and32(masm.payloadOf(frame.addressOf(rhs)), reg);
             else if (op == JSOP_BITXOR)
                 masm.xor32(masm.payloadOf(frame.addressOf(rhs)), reg);
             else
                 masm.or32(masm.payloadOf(frame.addressOf(rhs)), reg);
         } else {
@@ -490,19 +477,19 @@ mjit::Compiler::jsop_bitop(JSOp op)
 
         break;
       }
 
       case JSOP_LSH:
       case JSOP_URSH:
       {
         /* Not commutative. */
-        if (rhs->isConstant()) {
+        if (rhsConstant) {
             RegisterID reg = frame.ownRegForData(lhs);
-            int shift = rhs->getValue().toInt32() & 0x1F;
+            int shift = rhsInt & 0x1F;
 
             if (shift) {
                 if (op == JSOP_LSH)
                     masm.lshift32(Imm32(shift), reg);
                 else
                     masm.urshift32(Imm32(shift), reg);
             }
             if (stubNeeded) {
@@ -531,19 +518,19 @@ mjit::Compiler::jsop_bitop(JSOp op)
         if (frame.haveSameBacking(lhs, rhs)) {
             // It's okay to allocReg(). If |rr| is evicted, it won't result in
             // a load, and |rr == reg| is fine since this is (x << x).
             reg = frame.allocReg();
             if (rr != reg)
                 masm.move(rr, reg);
         } else {
             frame.pinReg(rr);
-            if (lhs->isConstant()) {
+            if (lhsConstant) {
                 reg = frame.allocReg();
-                masm.move(Imm32(lhs->getValue().toInt32()), reg);
+                masm.move(Imm32(lhsInt), reg);
             } else {
                 reg = frame.copyDataIntoReg(lhs);
             }
             frame.unpinReg(rr);
         }
         
         if (op == JSOP_LSH) {
             masm.lshift32(rr, reg);
@@ -562,19 +549,18 @@ mjit::Compiler::jsop_bitop(JSOp op)
         return;
     }
 
     if (stubNeeded) {
         stubcc.leave();
         OOL_STUBCALL(stub);
     }
 
-    frame.pop();
-    frame.pop();
-
+    frame.popn(2);
+    
     if (op == JSOP_URSH)
         frame.pushNumber(reg, true);
     else
         frame.pushTypedPayload(JSVAL_TYPE_INT32, reg);
 
     if (stubNeeded)
         stubcc.rejoin(Changes(1));
 }
--- a/js/src/methodjit/MethodJIT.cpp
+++ b/js/src/methodjit/MethodJIT.cpp
@@ -841,22 +841,17 @@ JITScript::callSites() const
 template <typename T>
 static inline void Destroy(T &t)
 {
     t.~T();
 }
 
 mjit::JITScript::~JITScript()
 {
-#if defined DEBUG && (defined JS_CPU_X86 || defined JS_CPU_X64) 
-    void *addr = code.m_code.executableAddress();
-    memset(addr, 0xcc, code.m_size);
-#endif
-
-    code.m_executablePool->release();
+    code.release();
 
 #if defined JS_POLYIC
     ic::GetElementIC *getElems_ = getElems();
     ic::SetElementIC *setElems_ = setElems();
     ic::PICInfo *pics_ = pics();
     for (uint32 i = 0; i < nGetElems; i++)
         Destroy(getElems_[i]);
     for (uint32 i = 0; i < nSetElems; i++)
--- a/js/src/methodjit/TrampolineCompiler.cpp
+++ b/js/src/methodjit/TrampolineCompiler.cpp
@@ -88,17 +88,17 @@ TrampolineCompiler::release(Trampolines 
 bool
 TrampolineCompiler::compileTrampoline(Trampolines::TrampolinePtr *where,
                                       JSC::ExecutablePool **poolp, TrampolineGenerator generator)
 {
     Assembler masm;
 
     Label entry = masm.label();
     CHECK_RESULT(generator(masm));
-    JS_ASSERT(entry.isValid());
+    JS_ASSERT(entry.isSet());
 
     bool ok;
     JSC::LinkBuffer buffer(&masm, execAlloc, poolp, &ok);
     if (!ok) 
         return false;
     masm.finalize(buffer);
     uint8 *result = (uint8*)buffer.finalizeCodeAddendum().dataLocation();
     *where = JS_DATA_TO_FUNC_PTR(Trampolines::TrampolinePtr, result + masm.distanceOf(entry));
--- a/js/src/nanojit-import-rev
+++ b/js/src/nanojit-import-rev
@@ -1,1 +1,1 @@
-37586d0b07857d871d1cc5184db25336bc0b8864
+8eec2117b714ec754c483b681acb3737f63b994c
--- a/js/src/nanojit/Assembler.h
+++ b/js/src/nanojit/Assembler.h
@@ -524,34 +524,16 @@ namespace nanojit
             static const RegisterMask PREFER_SPECIAL = 0xffffffff;
 
             // platform specific methods
         public:
             const static Register savedRegs[NumSavedRegs+1]; // Allocate an extra element in case NumSavedRegs == 0
             DECLARE_PLATFORM_ASSEMBLER()
 
         private:
-#ifdef NANOJIT_IA32
-            debug_only( int32_t _fpuStkDepth; )
-            debug_only( int32_t _sv_fpuStkDepth; )
-
-            // The FPU stack depth is the number of pushes in excess of the number of pops.
-            // Since we generate backwards, we track the FPU stack depth as a negative number.
-            // We use the top of the x87 stack as the single allocatable FP register, FST0.
-            // Thus, between LIR instructions, the depth of the FPU stack must be either 0 or -1,
-            // depending on whether FST0 is in use.  Within the expansion of a single LIR
-            // instruction, however, deeper levels of the stack may be used as unmanaged
-            // temporaries.  Hence, we allow for all eight levels in the assertions below.
-            inline void fpu_push() {
-                debug_only( ++_fpuStkDepth; NanoAssert(_fpuStkDepth <= 0); )
-            }
-            inline void fpu_pop() {
-                debug_only( --_fpuStkDepth; NanoAssert(_fpuStkDepth >= -7); )
-            }
-#endif
             const Config& _config;
     };
 
     inline int32_t arDisp(LIns* ins)
     {
         // even on 64bit cpu's, we allocate stack area in 4byte chunks
         return -4 * int32_t(ins->getArIndex());
     }
--- a/js/src/nanojit/Containers.cpp
+++ b/js/src/nanojit/Containers.cpp
@@ -41,18 +41,23 @@
 
 #ifdef FEATURE_NANOJIT
 
 namespace nanojit
 {
     BitSet::BitSet(Allocator& allocator, int nbits)
         : allocator(allocator)
         , cap((nbits+63)>>6)
-        , bits((int64_t*)allocator.alloc(cap * sizeof(int64_t)))
     {
+        resetAndAlloc();
+    }
+
+    void BitSet::resetAndAlloc()
+    {
+        bits = (int64_t*)allocator.alloc(cap * sizeof(int64_t));
         reset();
     }
 
     void BitSet::reset()
     {
         for (int i=0, n=cap; i < n; i++)
             bits[i] = 0;
     }
--- a/js/src/nanojit/Containers.h
+++ b/js/src/nanojit/Containers.h
@@ -48,38 +48,42 @@ namespace nanojit
      *  by passing nbits to the constructor. */
     class BitSet {
         Allocator &allocator;
         int cap;
         int64_t *bits;
         static const int64_t ONE = 1;
         static const int SHIFT = 6;
 
-        inline int bitnum2word(int i) {
+        inline int bitnum2word(int i) const {
             return i >> 6;
         }
-        inline int64_t bitnum2mask(int i) {
+        inline int64_t bitnum2mask(int i) const {
             return ONE << (i & 63);
         }
 
         /** keep doubling array to fit at least w words */
         void grow(int w);
 
     public:
         BitSet(Allocator& allocator, int nbits=128);
 
         /** clear all bits */
         void reset();
 
+        /** allocates new bits and clears them;  any old bits are lost and will
+         * be freed according to their allocator's policy. */
+        void resetAndAlloc();
+
         /** perform a bitwise or with BitSet other, return true if
          *  this bitset was modified */
         bool setFrom(BitSet& other);
 
         /** return bit i as a bool */
-        bool get(int i) {
+        bool get(int i) const {
             NanoAssert(i >= 0);
             int w = bitnum2word(i);
             if (w < cap)
                 return (bits[w] & bitnum2mask(i)) != 0;
             return false;
         }
 
         /** set bit i */
--- a/js/src/nanojit/NativeARM.cpp
+++ b/js/src/nanojit/NativeARM.cpp
@@ -1238,17 +1238,20 @@ Assembler::asm_restore(LIns* i, Register
             // one, by creating or extending an LDM instruction.
             if (/* is it safe to poke _nIns[1] ? */
                 does_next_instruction_exist(_nIns, codeStart, codeEnd,
                                                    exitStart, exitEnd)
                 && /* can we merge _nIns[0] into _nIns[1] ? */
                    do_peep_2_1(&merged, _nIns[0], _nIns[1])) {
                 _nIns[1] = merged;
                 _nIns++;
-                verbose_only( asm_output("merge next into LDMDB"); )
+                verbose_only(
+                    _nInsAfter++;
+                    asm_output("merge next into LDMDB");
+                )
             }
         }
     }
 }
 
 void
 Assembler::asm_spill(Register rr, int d, bool quad)
 {
@@ -1274,17 +1277,20 @@ Assembler::asm_spill(Register rr, int d,
             // one, by creating or extending a STM instruction.
             if (/* is it safe to poke _nIns[1] ? */
                     does_next_instruction_exist(_nIns, codeStart, codeEnd,
                         exitStart, exitEnd)
                     && /* can we merge _nIns[0] into _nIns[1] ? */
                     do_peep_2_1(&merged, _nIns[0], _nIns[1])) {
                 _nIns[1] = merged;
                 _nIns++;
-                verbose_only( asm_output("merge next into STMDB"); )
+                verbose_only(
+                    _nInsAfter++;
+                    asm_output("merge next into STMDB");
+                )
             }
         }
     }
 }
 
 void
 Assembler::asm_load64(LIns* ins)
 {
--- a/js/src/nanojit/NativeMIPS.cpp
+++ b/js/src/nanojit/NativeMIPS.cpp
@@ -2002,16 +2002,17 @@ namespace nanojit
     {
         /*
          * move    $sp,$fp
          * lw      $ra,RA_OFFSET($sp)
          * lw      $fp,FP_OFFSET($sp)
          * j       $ra
          * addiu   $sp,FRAMESIZE
          */
+        underrunProtect(2*4);   // j $ra; addiu $sp,FRAMESIZE
         ADDIU(SP, SP, FRAMESIZE);
         JR(RA);
         LW(FP, FP_OFFSET, SP);
         LW(RA, RA_OFFSET, SP);
         MOVE(SP, FP);
 
         TAG("genEpilogue()");
 
--- a/js/src/nanojit/NativeX64.cpp
+++ b/js/src/nanojit/NativeX64.cpp
@@ -52,17 +52,16 @@ completion
 - validate asm_cond with other conditions
 
 better code
 - put R12 back in play as a base register
 - no-disp addr modes (except RBP/R13)
 - disp64 branch/call
 - spill gp values to xmm registers?
 - prefer xmm registers for copies since gprs are in higher demand?
-- stack arg doubles
 - stack based LIR_paramp
 
 tracing
 - nFragExit
 
 */
 
 namespace nanojit
@@ -489,17 +488,17 @@ namespace nanojit
     void Assembler::XORPS(   R l, R r)  { emitrr(X64_xorps,    l,r); asm_output("xorps %s, %s",   RQ(l),RQ(r)); }
     void Assembler::DIVSD(   R l, R r)  { emitprr(X64_divsd,   l,r); asm_output("divsd %s, %s",   RQ(l),RQ(r)); }
     void Assembler::MULSD(   R l, R r)  { emitprr(X64_mulsd,   l,r); asm_output("mulsd %s, %s",   RQ(l),RQ(r)); }
     void Assembler::ADDSD(   R l, R r)  { emitprr(X64_addsd,   l,r); asm_output("addsd %s, %s",   RQ(l),RQ(r)); }
     void Assembler::SUBSD(   R l, R r)  { emitprr(X64_subsd,   l,r); asm_output("subsd %s, %s",   RQ(l),RQ(r)); }
     void Assembler::CVTSQ2SD(R l, R r)  { emitprr(X64_cvtsq2sd,l,r); asm_output("cvtsq2sd %s, %s",RQ(l),RQ(r)); }
     void Assembler::CVTSI2SD(R l, R r)  { emitprr(X64_cvtsi2sd,l,r); asm_output("cvtsi2sd %s, %s",RQ(l),RL(r)); }
     void Assembler::CVTSS2SD(R l, R r)  { emitprr(X64_cvtss2sd,l,r); asm_output("cvtss2sd %s, %s",RQ(l),RL(r)); }
-    void Assembler::CVTSD2SS(R l, R r)  { emitprr(X64_cvtsd2ss,l,r); asm_output("cvtsd2ss %s, %s",RQ(l),RQ(r)); }
+    void Assembler::CVTSD2SS(R l, R r)  { emitprr(X64_cvtsd2ss,l,r); asm_output("cvtsd2ss %s, %s",RL(l),RQ(r)); }
     void Assembler::CVTSD2SI(R l, R r)  { emitprr(X64_cvtsd2si,l,r); asm_output("cvtsd2si %s, %s",RL(l),RQ(r)); }
     void Assembler::CVTTSD2SI(R l, R r) { emitprr(X64_cvttsd2si,l,r);asm_output("cvttsd2si %s, %s",RL(l),RQ(r));}
     void Assembler::UCOMISD( R l, R r)  { emitprr(X64_ucomisd, l,r); asm_output("ucomisd %s, %s", RQ(l),RQ(r)); }
     void Assembler::MOVQRX(  R l, R r)  { emitprr(X64_movqrx,  r,l); asm_output("movq %s, %s",    RQ(l),RQ(r)); } // Nb: r and l are deliberately reversed within the emitprr() call.
     void Assembler::MOVQXR(  R l, R r)  { emitprr(X64_movqxr,  l,r); asm_output("movq %s, %s",    RQ(l),RQ(r)); }
 
     // MOVI must not affect condition codes!
     void Assembler::MOVI(  R r, I32 i32)    { emitr_imm(X64_movi,  r,i32); asm_output("movl %s, %d",RL(r),i32); }
@@ -624,16 +623,17 @@ namespace nanojit
     void Assembler::RET()           { emit(X64_ret);     asm_output("ret");        }
 
     void Assembler::MOVQMI(R r, I d, I32 imm) { emitrm_imm32(X64_movqmi,r,d,imm); asm_output("movq %d(%s), %d",d,RQ(r),imm); }
     void Assembler::MOVLMI(R r, I d, I32 imm) { emitrm_imm32(X64_movlmi,r,d,imm); asm_output("movl %d(%s), %d",d,RQ(r),imm); }
     void Assembler::MOVSMI(R r, I d, I32 imm) { emitprm_imm16(X64_movsmi,r,d,imm); asm_output("movs %d(%s), %d",d,RQ(r),imm); }
     void Assembler::MOVBMI(R r, I d, I32 imm) { emitrm_imm8(X64_movbmi,r,d,imm); asm_output("movb %d(%s), %d",d,RQ(r),imm); }
 
     void Assembler::MOVQSPR(I d, R r)   { emit(X64_movqspr | U64(d) << 56 | U64((REGNUM(r)&7)<<3) << 40 | U64((REGNUM(r)&8)>>1) << 24); asm_output("movq %d(rsp), %s", d, RQ(r)); }    // insert r into mod/rm and rex bytes
+    void Assembler::MOVQSPX(I d, R r)   { emit(rexprb(X64_movqspx,RSP,r) | U64(d) << 56 | U64((REGNUM(r)&7)<<3) << 40); asm_output("movq %d(rsp), %s", d, RQ(r)); }
 
     void Assembler::XORPSA(R r, I32 i32)    { emitxm_abs(X64_xorpsa, r, i32); asm_output("xorps %s, (0x%x)",RQ(r), i32); }
     void Assembler::XORPSM(R r, NIns* a64)  { emitxm_rel(X64_xorpsm, r, a64); asm_output("xorps %s, (%p)",  RQ(r), a64); }
 
     void Assembler::X86_AND8R(R r)  { emit(X86_and8r | U64(REGNUM(r)<<3|(REGNUM(r)|4))<<56); asm_output("andb %s, %s", RB(r), RBhi(r)); }
     void Assembler::X86_SETNP(R r)  { emit(X86_setnp | U64(REGNUM(r)|4)<<56); asm_output("setnp %s", RBhi(r)); }
     void Assembler::X86_SETE(R r)   { emit(X86_sete  | U64(REGNUM(r))<<56);   asm_output("sete %s", RB(r)); }
 
@@ -1072,16 +1072,20 @@ namespace nanojit
             } else if (ty == ARGTYPE_UI) {
                 // zero extend uint32 to uint64
                 NanoAssert(p->isI());
                 MOVLR(r, r);
             } else {
                 NanoAssert(ty == ARGTYPE_Q);
                 // Do nothing.
             }
+        } else if (ty == ARGTYPE_D) {
+            NanoAssert(p->isD());
+            Register r = findRegFor(p, FpRegs);
+            MOVQSPX(stk_off, r);    // movsd [rsp+d8], xmm
         } else {
             TODO(asm_stkarg_non_int);
         }
     }
 
     void Assembler::asm_q2i(LIns *ins) {
         Register rr, ra;
         beginOp1Regs(ins, GpRegs, rr, ra);
@@ -1718,22 +1722,19 @@ namespace nanojit
             }
             case LIR_std: {
                 Register b = getBaseReg(base, d, BaseRegs);
                 Register r = findRegFor(value, FpRegs);
                 MOVSDMR(r, d, b);   // xmm store
                 break;
             }
             case LIR_std2f: {
+                Register b = getBaseReg(base, d, BaseRegs);
                 Register r = findRegFor(value, FpRegs);
                 Register t = registerAllocTmp(FpRegs & ~rmask(r));
-                // Here, it is safe to call getBaseReg after registerAllocTmp
-                // because BaseRegs does not overlap with FpRegs, so getBaseReg
-                // will not allocate register |t|.
-                Register b = getBaseReg(base, d, BaseRegs);
 
                 MOVSSMR(t, d, b);   // store
                 CVTSD2SS(t, r);     // cvt to single-precision
                 XORPS(t);           // break dependency chains
                 break;
             }
             default:
                 NanoAssertMsg(0, "asm_store64 should never receive this LIR opcode");
--- a/js/src/nanojit/NativeX64.h
+++ b/js/src/nanojit/NativeX64.h
@@ -243,17 +243,18 @@ namespace nanojit
         X64_lealrm  = 0x00000000808D4007LL, // 32bit load effective addr reg <- disp32+base
         X64_learip  = 0x00000000058D4807LL, // 64bit RIP-relative lea. reg <- disp32+rip (modrm = 00rrr101 = 05)
         X64_movlr   = 0xC08B400000000003LL, // 32bit mov r <- b
         X64_movbmr  = 0x0000000080884007LL, // 8bit store r -> [b+d32]
         X64_movsmr  = 0x8089406600000004LL, // 16bit store r -> [b+d32]
         X64_movlmr  = 0x0000000080894007LL, // 32bit store r -> [b+d32]
         X64_movlrm  = 0x00000000808B4007LL, // 32bit load r <- [b+d32]
         X64_movqmr  = 0x0000000080894807LL, // 64bit store gpr -> [b+d32]
-        X64_movqspr = 0x0024448948000005LL, // 64bit store gpr -> [rsp+d32] (sib required)
+        X64_movqspr = 0x0024448948000005LL, // 64bit store gpr -> [rsp+d8] (sib required)
+        X64_movqspx = 0x002444110F40F207LL, // 64bit store xmm -> [rsp+d8] (sib required)
         X64_movqr   = 0xC08B480000000003LL, // 64bit mov r <- b
         X64_movqi   = 0xB848000000000002LL, // 64bit mov r <- imm64
         X64_movi    = 0xB840000000000002LL, // 32bit mov r <- immI
         X64_movqi32 = 0xC0C7480000000003LL, // 64bit mov r <- int64(immI)
         X64_movapsr = 0xC0280F4000000004LL, // 128bit mov xmm <- xmm
         X64_movqrx  = 0xC07E0F4866000005LL, // 64bit mov b <- xmm-r (reverses the usual r/b order)
         X64_movqxr  = 0xC06E0F4866000005LL, // 64bit mov b -> xmm-r
         X64_movqrm  = 0x00000000808B4807LL, // 64bit load r <- [b+d32]
@@ -603,16 +604,17 @@ namespace nanojit
         void JNB8(size_t n, NIns* t);\
         void JNBE8(size_t n, NIns* t);\
         void JNA8(size_t n, NIns* t);\
         void JNAE8(size_t n, NIns* t);\
         void CALL(size_t n, NIns* t);\
         void CALLRAX();\
         void RET();\
         void MOVQSPR(int d, Register r);\
+        void MOVQSPX(int d, Register r);\
         void XORPSA(Register r, int32_t i32);\
         void XORPSM(Register r, NIns* a64);\
         void X86_AND8R(Register r);\
         void X86_SETNP(Register r);\
         void X86_SETE(Register r);\
         void MOVQMI(Register base, int disp, int32_t imm32); \
         void MOVLMI(Register base, int disp, int32_t imm32); \
         void MOVSMI(Register base, int disp, int32_t imm16); \
--- a/js/src/nanojit/Nativei386.cpp
+++ b/js/src/nanojit/Nativei386.cpp
@@ -808,16 +808,31 @@ namespace nanojit
         count_alu();
         underrunProtect(3);
         OPCODE(i);
         OPCODE(0xc4);
         OPCODE(0xf6);
         asm_output("test ah, %d", i);
     }
 
+    // The FPU stack depth is the number of pushes in excess of the number of pops.
+    // Since we generate backwards, we track the FPU stack depth as a negative number.
+    // We use the top of the x87 stack as the single allocatable FP register, FST0.
+    // Thus, between LIR instructions, the depth of the FPU stack must be either 0 or -1,
+    // depending on whether FST0 is in use.  Within the expansion of a single LIR
+    // instruction, however, deeper levels of the stack may be used as unmanaged
+    // temporaries.  Hence, we allow for all eight levels in the assertions below.
+    void Assembler::fpu_push() {
+        debug_only( ++_fpuStkDepth; NanoAssert(_fpuStkDepth <= 0); )
+    }
+
+    void Assembler::fpu_pop() {
+        debug_only( --_fpuStkDepth; NanoAssert(_fpuStkDepth >= -7); )
+    }
+
     inline void Assembler::FNSTSW_AX() { count_fpu(); FPUc(0xdfe0);    asm_output("fnstsw_ax"); }
     inline void Assembler::FCHS()      { count_fpu(); FPUc(0xd9e0);    asm_output("fchs"); }
     inline void Assembler::FLD1()      { count_fpu(); FPUc(0xd9e8);    asm_output("fld1"); fpu_push(); }
     inline void Assembler::FLDZ()      { count_fpu(); FPUc(0xd9ee);    asm_output("fldz"); fpu_push(); }
 
     inline void Assembler::FST32(bool p, I32 d, R b){ count_stq(); FPUm(0xd902|(p?1:0), d, b);   asm_output("fst%s32 %d(%s)", (p?"p":""), d, gpn(b)); if (p) fpu_pop(); }
     inline void Assembler::FSTQ(bool p, I32 d, R b) { count_stq(); FPUm(0xdd02|(p?1:0), d, b);   asm_output("fst%sq %d(%s)", (p?"p":""), d, gpn(b)); if (p) fpu_pop(); }
 
@@ -2855,16 +2870,19 @@ namespace nanojit
             case 2: MR(rECX,rECX);        break;
             case 3: LEA(rECX,0,rECX);     break;
             case 4: LEA(rESP,0,rESP);     break;
         }
     }
 
     void Assembler::asm_ret(LIns* ins)
     {
+        // Unreachable, so assume correct stack depth.
+        debug_only( _fpuStkDepth = 0; )
+
         genEpilogue();
 
         // Restore rESP from rEBP, undoing SUBi(SP,amt) in the prologue
         MR(SP,FP);
 
         releaseRegisters();
         assignSavedRegs();
 
--- a/js/src/nanojit/Nativei386.h
+++ b/js/src/nanojit/Nativei386.h
@@ -185,16 +185,18 @@ namespace nanojit
 
     #define JCC32 0x0f
     #define JMP8  0xeb
     #define JMP32 0xe9
 
     #define DECLARE_PLATFORM_ASSEMBLER()    \
         const static Register argRegs[2], retRegs[2]; \
         int32_t max_stk_args;\
+        debug_only( int32_t _fpuStkDepth; ) \
+        debug_only( int32_t _sv_fpuStkDepth; ) \
         void nativePageReset();\
         void nativePageSetup();\
         void underrunProtect(int);\
         bool hardenNopInsertion(const Config& c) { return c.harden_nop_insertion; } \
         void asm_immi(Register r, int32_t val, bool canClobberCCs);\
         void asm_stkarg(LIns* p, int32_t& stkd);\
         void asm_farg(LIns*, int32_t& stkd);\
         void asm_arg(ArgType ty, LIns* p, Register r, int32_t& stkd);\
@@ -428,16 +430,18 @@ namespace nanojit
         void SSE_ADDSD(Register rd, Register rs); \
         void SSE_ADDSDm(Register r, const double* addr); \
         void SSE_SUBSD(Register rd, Register rs); \
         void SSE_MULSD(Register rd, Register rs); \
         void SSE_DIVSD(Register rd, Register rs); \
         void SSE_UCOMISD(Register rl, Register rr); \
         void SSE_XORPD(Register r, const uint32_t* maskaddr); \
         void SSE_XORPDr(Register rd, Register rs); \
+        void fpu_push(); \
+        void fpu_pop(); \
         void FPUc(int32_t o); \
         void FPU(int32_t o, Register r) { \
             underrunProtect(2); \
             *(--_nIns) = uint8_t((uint8_t(o) & 0xff) | (REGNUM(r) & 7)); \
             *(--_nIns) = uint8_t((o >> 8) & 0xff); \
         }; \
         void FPUm(int32_t o, int32_t d, Register b); \
         void FPUdm(int32_t o, const double* const m); \
--- a/js/src/nanojit/avmplus.h
+++ b/js/src/nanojit/avmplus.h
@@ -188,94 +188,11 @@ static __inline__ unsigned long long rdt
 # define PERFM_NTPROF(n)
 # define PERFM_TPROF_END()
 #endif
 
 namespace avmplus {
 
     extern void AvmLog(char const *msg, ...);
 
-    /**
-     * Bit vectors are an efficent method of keeping True/False information
-     * on a set of items or conditions. Class BitSet provides functions
-     * to manipulate individual bits in the vector.
-     *
-     * This object is not optimized for a fixed sized bit vector
-     * it instead allows for dynamically growing the bit vector.
-     */
-    class BitSet
-    {
-        public:
-            enum {  kUnit = 8*sizeof(long),
-                    kDefaultCapacity = 4   };
-
-            BitSet()
-            {
-                capacity = kDefaultCapacity;
-                ar = (long*)calloc(capacity, sizeof(long));
-                reset();
-            }
-
-            ~BitSet()
-            {
-                free(ar);
-            }
-
-            void reset()
-            {
-                for (int i = 0; i < capacity; i++)
-                    ar[i] = 0;
-            }
-
-            void set(int bitNbr)
-            {
-                int index = bitNbr / kUnit;
-                int bit = bitNbr % kUnit;
-                if (index >= capacity)
-                    grow(index+1);
-
-                ar[index] |= (1<<bit);
-            }
-
-            void clear(int bitNbr)
-            {
-                int index = bitNbr / kUnit;
-                int bit = bitNbr % kUnit;
-                if (index < capacity)
-                    ar[index] &= ~(1<<bit);
-            }
-
-            bool get(int bitNbr) const
-            {
-                int index = bitNbr / kUnit;
-                int bit = bitNbr % kUnit;
-                bool value = false;
-                if (index < capacity)
-                    value = ( ar[index] & (1<<bit) ) ? true : false;
-                return value;
-            }
-
-        private:
-            // Grow the array until at least newCapacity big
-            void grow(int newCapacity)
-            {
-                // create vector that is 2x bigger than requested
-                newCapacity *= 2;
-                //MEMTAG("BitVector::Grow - long[]");
-                long* newAr = (long*)calloc(newCapacity, sizeof(long));
-
-                // copy the old one
-                for (int i = 0; i < capacity; i++)
-                    newAr[i] = ar[i];
-
-                // in with the new out with the old
-                free(ar);
-
-                ar = newAr;
-                capacity = newCapacity;
-            }
-
-            int capacity;
-            long* ar;
-    };
 }
 
 #endif
--- a/js/src/vprof/vprof.cpp
+++ b/js/src/vprof/vprof.cpp
@@ -88,17 +88,17 @@
 
 static entry* entries = NULL;
 static bool notInitialized = true;
 static long glock = LOCK_IS_FREE;
 
 #define Lock(lock) while (_InterlockedCompareExchange(lock, LOCK_IS_TAKEN, LOCK_IS_FREE) == LOCK_IS_TAKEN){};
 #define Unlock(lock) _InterlockedCompareExchange(lock, LOCK_IS_FREE, LOCK_IS_TAKEN);
 
-#if defined(WIN32) && !defined(UNDER_CE)
+#if defined(WIN32)
 	static void vprof_printf(const char* format, ...)
 	{
 		va_list args;
 		va_start(args, format);
 
 		char buf[1024];
 		vsnprintf(buf, sizeof(buf), format, args);
 		
--- a/js/src/xpconnect/src/xpcjsruntime.cpp
+++ b/js/src/xpconnect/src/xpcjsruntime.cpp
@@ -250,18 +250,17 @@ xpc::CompartmentPrivate::~CompartmentPri
         delete waiverWrapperMap;
     if (expandoMap)
         delete expandoMap;
 }
 
 static JSBool
 CompartmentCallback(JSContext *cx, JSCompartment *compartment, uintN op)
 {
-    if(op == JSCOMPARTMENT_NEW)
-        return JS_TRUE;
+    JS_ASSERT(op == JSCOMPARTMENT_DESTROY);
 
     XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance();
     if(!self)
         return JS_TRUE;
 
     nsAutoPtr<xpc::CompartmentPrivate> priv(
         static_cast<xpc::CompartmentPrivate*>(JS_SetCompartmentPrivate(cx, compartment, nsnull)));
     if(!priv)
--- a/js/src/xpconnect/tests/chrome/Makefile.in
+++ b/js/src/xpconnect/tests/chrome/Makefile.in
@@ -60,16 +60,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug601803.xul \
 		test_bug610390.xul \
 		test_bug614757.xul \
 		test_bug616992.xul \
 		test_bug618176.xul \
 		file_bug618176.xul \
 		test_bug596580.xul \
 		test_bug654370.xul \
+		test_bug658560.xul \
 		$(NULL)
 
 # Disabled until this test gets updated to test the new proxy based
 # wrappers.
 #		test_wrappers-2.xul \
 
 libs:: $(_CHROME_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/js/src/xpconnect/tests/chrome/test_bug658560.xul
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=658560
+-->
+<window title="Mozilla Bug 658560"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <script type="application/javascript"
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <!-- test results are displayed in the html:body -->
+  <body xmlns="http://www.w3.org/1999/xhtml">
+  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=658560"
+     target="_blank">Mozilla Bug 658560</a>
+  </body>
+
+  <!-- test code goes here -->
+  <script type="application/javascript"><![CDATA[
+
+      SimpleTest.waitForExplicitFinish();
+      function go() {
+        var win = $('ifr').contentWindow.wrappedJSObject;
+        let o = { prop: true };
+        win.foo = o;
+
+        is(win.foo, o, "should have === identity through a CrossOriginWrapper");
+        SimpleTest.finish();
+      }
+
+  ]]></script>
+
+  <iframe
+      src="http://example.org/tests/js/src/xpconnect/tests/mochitest/file_bug658560.html"
+          id="ifr"
+          type="content"
+          onload="go()" />
+</window>
--- a/js/src/xpconnect/tests/mochitest/Makefile.in
+++ b/js/src/xpconnect/tests/mochitest/Makefile.in
@@ -86,20 +86,23 @@ include $(topsrcdir)/config/rules.mk
 		file2_bug629227.html \
 		test_bug629331.html \
 		test1_bug629331.html \
 		test2_bug629331.html \
 		test_bug618017.html \
 		test_bug636097.html \
 		test_bug650273.html \
 		file_bug650273.html \
+		file_bug658560.html \
 		$(NULL)
 
+ifndef ANDROID
 ifndef MOZ_PLATFORM_MAEMO
 _TEST_FILES +=	test_bug657267.html \
 		bug657267.jar
 endif
+endif
 
 
 		#test_bug484107.html \
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/js/src/xpconnect/tests/mochitest/file_bug658560.html
@@ -0,0 +1,4 @@
+<html>
+    <body>
+    </body>
+</html>
--- a/js/src/xpconnect/wrappers/WrapperFactory.cpp
+++ b/js/src/xpconnect/wrappers/WrapperFactory.cpp
@@ -131,16 +131,20 @@ WrapperFactory::WaiveXray(JSContext *cx,
         }
 
         obj = wobj;
     }
 
     return obj;
 }
 
+// DoubleWrap is called from PrepareForWrapping to maintain the state that
+// we're supposed to waive Xray wrappers for the given on. On entrance, it
+// expects |cx->compartment != obj->compartment()|. The returned object will
+// be in the same compartment as |obj|.
 JSObject *
 WrapperFactory::DoubleWrap(JSContext *cx, JSObject *obj, uintN flags)
 {
     if (flags & WrapperFactory::WAIVE_XRAY_WRAPPER_FLAG) {
         JSAutoEnterCompartment ac;
         if (!ac.enter(cx, obj))
             return nsnull;
 
@@ -231,16 +235,25 @@ WrapperFactory::PrepareForWrapping(JSCon
         XPCWrappedNative *newwn = static_cast<XPCWrappedNative *>(xpc_GetJSPrivate(obj));
         if (newwn->GetSet()->GetInterfaceCount() < wn->GetSet()->GetInterfaceCount())
             newwn->SetSet(wn->GetSet());
     }
 
     return DoubleWrap(cx, obj, flags);
 }
 
+static XPCWrappedNative *
+GetWrappedNative(JSContext *cx, JSObject *obj)
+{
+    OBJ_TO_INNER_OBJECT(cx, obj);
+    return IS_WN_WRAPPER(obj)
+           ? static_cast<XPCWrappedNative *>(obj->getPrivate())
+           : nsnull;
+}
+
 JSObject *
 WrapperFactory::Rewrap(JSContext *cx, JSObject *obj, JSObject *wrappedProto, JSObject *parent,
                        uintN flags)
 {
     NS_ASSERTION(!obj->isWrapper() ||
                  (obj->isWrapper() &&
                   obj->getProxyHandler() == &WaiveXrayWrapperWrapper) ||
                  obj->getClass()->ext.innerObject,
@@ -290,22 +303,20 @@ WrapperFactory::Rewrap(JSContext *cx, JS
         if (obj->isFunction()) {
             JSFunction *fun = obj->getFunctionPrivate();
             if (JS_IsBuiltinEvalFunction(fun) || JS_IsBuiltinFunctionConstructor(fun)) {
                 JS_ReportError(cx, "Not allowed to access chrome eval or Function from content");
                 return nsnull;
             }
         }
 
-        JSObject *inner = obj;
-        OBJ_TO_INNER_OBJECT(cx, inner);
         XPCWrappedNative *wn;
-        if (IS_WN_WRAPPER(inner) &&
-            (wn = static_cast<XPCWrappedNative *>(inner->getPrivate()))->HasProto() &&
-            wn->GetProto()->ClassIsDOMObject()) {
+        if (targetdata &&
+            (wn = GetWrappedNative(cx, obj)) &&
+            wn->HasProto() && wn->GetProto()->ClassIsDOMObject()) {
             typedef XrayWrapper<JSCrossCompartmentWrapper> Xray;
             wrapper = &FilteringWrapper<Xray,
                                         CrossOriginAccessiblePropertiesOnly>::singleton;
             xrayHolder = Xray::createHolder(cx, obj, parent);
             if (!xrayHolder)
                 return nsnull;
         } else {
             wrapper = &FilteringWrapper<JSCrossCompartmentWrapper,
@@ -386,23 +397,32 @@ WrapperFactory::WrapLocationObject(JSCon
     JSObject *wrapperObj = JSWrapper::New(cx, obj, obj->getProto(), obj->getParent(),
                                           &LW::singleton);
     if (!wrapperObj)
         return nsnull;
     wrapperObj->setProxyExtra(js::ObjectValue(*xrayHolder));
     return wrapperObj;
 }
 
+// Call WaiveXrayAndWrap when you have a JS object that you don't want to be
+// wrapped in an Xray wrapper. cx->compartment is the compartment that will be
+// using the returned object. If the object to be wrapped is already in the
+// correct compartment, then this returns the unwrapped object.
 bool
 WrapperFactory::WaiveXrayAndWrap(JSContext *cx, jsval *vp)
 {
     if (JSVAL_IS_PRIMITIVE(*vp))
         return JS_WrapValue(cx, vp);
 
-    JSObject *obj = JSVAL_TO_OBJECT(*vp);
+    JSObject *obj = JSVAL_TO_OBJECT(*vp)->unwrap();
+    obj = GetCurrentOuter(cx, obj);
+    if (obj->compartment() == cx->compartment) {
+        *vp = OBJECT_TO_JSVAL(obj);
+        return true;
+    }
 
     obj = WaiveXray(cx, obj);
     if (!obj)
         return false;
 
     *vp = OBJECT_TO_JSVAL(obj);
     return JS_WrapValue(cx, vp);
 }
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/ASCIICType.h
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef WTF_ASCIICType_h
+#define WTF_ASCIICType_h
+
+#include "assembler/wtf/Assertions.h"
+
+// The behavior of many of the functions in the <ctype.h> header is dependent
+// on the current locale. But in the WebKit project, all uses of those functions
+// are in code processing something that's not locale-specific. These equivalents
+// for some of the <ctype.h> functions are named more explicitly, not dependent
+// on the C library locale, and we should also optimize them as needed.
+
+// All functions return false or leave the character unchanged if passed a character
+// that is outside the range 0-7F. So they can be used on Unicode strings or
+// characters if the intent is to do processing only if the character is ASCII.
+
+namespace WTF {
+
+    inline bool isASCII(char c) { return !(c & ~0x7F); }
+    inline bool isASCII(unsigned short c) { return !(c & ~0x7F); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCII(wchar_t c) { return !(c & ~0x7F); }
+#endif
+    inline bool isASCII(int c) { return !(c & ~0x7F); }
+    inline bool isASCII(unsigned c) { return !(c & ~0x7F); }
+
+    inline bool isASCIIAlpha(char c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
+    inline bool isASCIIAlpha(unsigned short c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIAlpha(wchar_t c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
+#endif
+    inline bool isASCIIAlpha(int c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
+    inline bool isASCIIAlpha(unsigned c) { return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; }
+
+    inline bool isASCIIAlphanumeric(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
+    inline bool isASCIIAlphanumeric(unsigned short c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIAlphanumeric(wchar_t c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
+#endif
+    inline bool isASCIIAlphanumeric(int c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
+    inline bool isASCIIAlphanumeric(unsigned c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); }
+
+    inline bool isASCIIDigit(char c) { return (c >= '0') & (c <= '9'); }
+    inline bool isASCIIDigit(unsigned short c) { return (c >= '0') & (c <= '9'); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIDigit(wchar_t c) { return (c >= '0') & (c <= '9'); }
+#endif
+    inline bool isASCIIDigit(int c) { return (c >= '0') & (c <= '9'); }
+    inline bool isASCIIDigit(unsigned c) { return (c >= '0') & (c <= '9'); }
+
+    inline bool isASCIIHexDigit(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
+    inline bool isASCIIHexDigit(unsigned short c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIHexDigit(wchar_t c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
+#endif
+    inline bool isASCIIHexDigit(int c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
+    inline bool isASCIIHexDigit(unsigned c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); }
+
+    inline bool isASCIIOctalDigit(char c) { return (c >= '0') & (c <= '7'); }
+    inline bool isASCIIOctalDigit(unsigned short c) { return (c >= '0') & (c <= '7'); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIOctalDigit(wchar_t c) { return (c >= '0') & (c <= '7'); }
+#endif
+    inline bool isASCIIOctalDigit(int c) { return (c >= '0') & (c <= '7'); }
+    inline bool isASCIIOctalDigit(unsigned c) { return (c >= '0') & (c <= '7'); }
+
+    inline bool isASCIILower(char c) { return c >= 'a' && c <= 'z'; }
+    inline bool isASCIILower(unsigned short c) { return c >= 'a' && c <= 'z'; }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIILower(wchar_t c) { return c >= 'a' && c <= 'z'; }
+#endif
+    inline bool isASCIILower(int c) { return c >= 'a' && c <= 'z'; }
+    inline bool isASCIILower(unsigned c) { return c >= 'a' && c <= 'z'; }
+
+    inline bool isASCIIUpper(char c) { return c >= 'A' && c <= 'Z'; }
+    inline bool isASCIIUpper(unsigned short c) { return c >= 'A' && c <= 'Z'; }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIUpper(wchar_t c) { return c >= 'A' && c <= 'Z'; }
+#endif
+    inline bool isASCIIUpper(int c) { return c >= 'A' && c <= 'Z'; }
+    inline bool isASCIIUpper(unsigned c) { return c >= 'A' && c <= 'Z'; }
+
+    /*
+        Statistics from a run of Apple's page load test for callers of isASCIISpace:
+
+            character          count
+            ---------          -----
+            non-spaces         689383
+        20  space              294720
+        0A  \n                 89059
+        09  \t                 28320
+        0D  \r                 0
+        0C  \f                 0
+        0B  \v                 0
+    */
+    inline bool isASCIISpace(char c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
+    inline bool isASCIISpace(unsigned short c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIISpace(wchar_t c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
+#endif
+    inline bool isASCIISpace(int c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
+    inline bool isASCIISpace(unsigned c) { return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); }
+
+    inline char toASCIILower(char c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
+    inline unsigned short toASCIILower(unsigned short c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline wchar_t toASCIILower(wchar_t c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
+#endif
+    inline int toASCIILower(int c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
+    inline unsigned toASCIILower(unsigned c) { return c | ((c >= 'A' && c <= 'Z') << 5); }
+
+    // FIXME: Why do these need static_cast?
+    inline char toASCIIUpper(char c) { return static_cast<char>(c & ~((c >= 'a' && c <= 'z') << 5)); }
+    inline unsigned short toASCIIUpper(unsigned short c) { return static_cast<unsigned short>(c & ~((c >= 'a' && c <= 'z') << 5)); }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline wchar_t toASCIIUpper(wchar_t c) { return static_cast<wchar_t>(c & ~((c >= 'a' && c <= 'z') << 5)); }
+#endif
+    inline int toASCIIUpper(int c) { return static_cast<int>(c & ~((c >= 'a' && c <= 'z') << 5)); }
+    inline unsigned toASCIIUpper(unsigned c) { return static_cast<unsigned>(c & ~((c >= 'a' && c <= 'z') << 5)); }
+
+    inline int toASCIIHexValue(char c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
+    inline int toASCIIHexValue(unsigned short c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline int toASCIIHexValue(wchar_t c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
+#endif
+    inline int toASCIIHexValue(int c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
+    inline int toASCIIHexValue(unsigned c) { ASSERT(isASCIIHexDigit(c)); return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; }
+
+    inline bool isASCIIPrintable(char c) { return c >= ' ' && c <= '~'; }
+    inline bool isASCIIPrintable(unsigned short c) { return c >= ' ' && c <= '~'; }
+#if !WTF_COMPILER_MSVC || defined(_NATIVE_WCHAR_T_DEFINED)
+    inline bool isASCIIPrintable(wchar_t c) { return c >= ' ' && c <= '~'; }
+#endif
+    inline bool isASCIIPrintable(int c) { return c >= ' ' && c <= '~'; }
+    inline bool isASCIIPrintable(unsigned c) { return c >= ' ' && c <= '~'; }
+}
+
+using WTF::isASCII;
+using WTF::isASCIIAlpha;
+using WTF::isASCIIAlphanumeric;
+using WTF::isASCIIDigit;
+using WTF::isASCIIHexDigit;
+using WTF::isASCIILower;
+using WTF::isASCIIOctalDigit;
+using WTF::isASCIIPrintable;
+using WTF::isASCIISpace;
+using WTF::isASCIIUpper;
+using WTF::toASCIIHexValue;
+using WTF::toASCIILower;
+using WTF::toASCIIUpper;
+
+#endif
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/BumpPointerAllocator.h
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * 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. 
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef BumpPointerAllocator_h
+#define BumpPointerAllocator_h
+
+#include "PageAllocation.h"
+
+namespace WTF {
+
+#define MINIMUM_BUMP_POOL_SIZE 0x1000
+
+class BumpPointerPool {
+public:
+    // ensureCapacity will check whether the current pool has capacity to
+    // allocate 'size' bytes of memory  If it does not, it will attempt to
+    // allocate a new pool (which will be added to this one in a chain).
+    //
+    // If allocation fails (out of memory) this method will return null.
+    // If the return value is non-null, then callers should update any
+    // references they have to this current (possibly full) BumpPointerPool
+    // to instead point to the newly returned BumpPointerPool.
+    BumpPointerPool* ensureCapacity(size_t size)
+    {
+        void* allocationEnd = static_cast<char*>(m_current) + size;
+        ASSERT(allocationEnd > m_current); // check for overflow
+        if (allocationEnd <= static_cast<void*>(this))
+            return this;
+        return ensureCapacityCrossPool(this, size);
+    }
+
+    // alloc should only be called after calling ensureCapacity; as such
+    // alloc will never fail.
+    void* alloc(size_t size)
+    {
+        void* current = m_current;
+        void* allocationEnd = static_cast<char*>(current) + size;
+        ASSERT(allocationEnd > current); // check for overflow
+        ASSERT(allocationEnd <= static_cast<void*>(this));
+        m_current = allocationEnd;
+        return current;
+    }
+
+    // The dealloc method releases memory allocated using alloc.  Memory
+    // must be released in a LIFO fashion, e.g. if the client calls alloc
+    // four times, returning pointer A, B, C, D, then the only valid order
+    // in which these may be deallocaed is D, C, B, A.
+    //
+    // The client may optionally skip some deallocations.  In the example
+    // above, it would be valid to only explicitly dealloc C, A (D being
+    // dealloced along with C, B along with A).
+    //
+    // If pointer was not allocated from this pool (or pools) then dealloc
+    // will CRASH().  Callers should update any references they have to
+    // this current BumpPointerPool to instead point to the returned
+    // BumpPointerPool.
+    BumpPointerPool* dealloc(void* position)
+    {
+        if ((position >= m_start) && (position <= static_cast<void*>(this))) {
+            ASSERT(position <= m_current);
+            m_current = position;
+            return this;
+        }
+        return deallocCrossPool(this, position);
+    }
+
+private:
+    // Placement operator new, returns the last 'size' bytes of allocation for use as this.
+    void* operator new(size_t size, const PageAllocation& allocation)
+    {
+        ASSERT(size < allocation.size());
+        return reinterpret_cast<char*>(reinterpret_cast<intptr_t>(allocation.base()) + allocation.size()) - size;
+    }
+
+    BumpPointerPool(const PageAllocation& allocation)
+        : m_current(allocation.base())
+        , m_start(allocation.base())
+        , m_next(0)
+        , m_previous(0)
+        , m_allocation(allocation)
+    {
+    }
+
+    static BumpPointerPool* create(size_t minimumCapacity = 0)
+    {
+        // Add size of BumpPointerPool object, check for overflow.
+        minimumCapacity += sizeof(BumpPointerPool);
+        if (minimumCapacity < sizeof(BumpPointerPool))
+            return 0;
+
+        size_t poolSize = MINIMUM_BUMP_POOL_SIZE;
+        while (poolSize < minimumCapacity) {
+            poolSize <<= 1;
+            // The following if check relies on MINIMUM_BUMP_POOL_SIZE being a power of 2!
+            ASSERT(!(MINIMUM_BUMP_POOL_SIZE & (MINIMUM_BUMP_POOL_SIZE - 1)));
+            if (!poolSize)
+                return 0;
+        }
+
+        PageAllocation allocation = PageAllocation::allocate(poolSize);
+        if (!!allocation)
+            return new(allocation) BumpPointerPool(allocation);
+        return 0;
+    }
+
+    void shrink()
+    {
+        ASSERT(!m_previous);
+        m_current = m_start;
+        while (m_next) {
+            BumpPointerPool* nextNext = m_next->m_next;
+            m_next->destroy();
+            m_next = nextNext;
+        }
+    }
+
+    void destroy()
+    {
+        m_allocation.deallocate();
+    }
+
+    static BumpPointerPool* ensureCapacityCrossPool(BumpPointerPool* previousPool, size_t size)
+    {
+        // The pool passed should not have capacity, so we'll start with the next one.
+        ASSERT(previousPool);
+        ASSERT((static_cast<char*>(previousPool->m_current) + size) > previousPool->m_current); // check for overflow
+        ASSERT((static_cast<char*>(previousPool->m_current) + size) > static_cast<void*>(previousPool));
+        BumpPointerPool* pool = previousPool->m_next;
+
+        while (true) {
+            if (!pool) {
+                // We've run to the end; allocate a new pool.
+                pool = BumpPointerPool::create(size);
+                previousPool->m_next = pool;
+                pool->m_previous = previousPool;
+                return pool;
+            }
+
+            // 
+            void* current = pool->m_current;
+            void* allocationEnd = static_cast<char*>(current) + size;
+            ASSERT(allocationEnd > current); // check for overflow
+            if (allocationEnd <= static_cast<void*>(pool))
+                return pool;
+        }
+    }
+
+    static BumpPointerPool* deallocCrossPool(BumpPointerPool* pool, void* position)
+    {
+        // Should only be called if position is not in the current pool.
+        ASSERT((position < pool->m_start) || (position > static_cast<void*>(pool)));
+
+        while (true) {
+            // Unwind the current pool to the start, move back in the chain to the previous pool.
+            pool->m_current = pool->m_start;
+            pool = pool->m_previous;
+
+            // position was nowhere in the chain!
+            if (!pool)
+                CRASH();
+
+            if ((position >= pool->m_start) && (position <= static_cast<void*>(pool))) {
+                ASSERT(position <= pool->m_current);
+                pool->m_current = position;
+                return pool;
+            }
+        }
+    }
+
+    void* m_current;
+    void* m_start;
+    BumpPointerPool* m_next;
+    BumpPointerPool* m_previous;
+    PageAllocation m_allocation;
+
+    friend class BumpPointerAllocator;
+};
+
+// A BumpPointerAllocator manages a set of BumpPointerPool objects, which
+// can be used for LIFO (stack like) allocation.
+//
+// To begin allocating using this class call startAllocator().  The result
+// of this method will be null if the initial pool allocation fails, or a
+// pointer to a BumpPointerPool object that can be used to perform
+// allocations.  Whilst running no memory will be released until
+// stopAllocator() is called.  At this point all allocations made through
+// this allocator will be reaped, and underlying memory may be freed.
+//
+// (In practice we will still hold on to the initial pool to allow allocation
+// to be quickly restared, but aditional pools will be freed).
+//
+// This allocator is non-renetrant, it is encumbant on the clients to ensure
+// startAllocator() is not called again until stopAllocator() has been called.
+class BumpPointerAllocator {
+public:
+    BumpPointerAllocator()
+        : m_head(0)
+    {
+    }
+
+    ~BumpPointerAllocator()
+    {
+        if (m_head)
+            m_head->destroy();
+    }
+
+    BumpPointerPool* startAllocator()
+    {
+        if (!m_head)
+            m_head = BumpPointerPool::create();
+        return m_head;
+    }
+
+    void stopAllocator()
+    {
+        if (m_head)
+            m_head->shrink();
+    }
+
+private:
+    BumpPointerPool* m_head;
+};
+
+}
+
+using WTF::BumpPointerAllocator;
+
+#endif // BumpPointerAllocator_h
deleted file mode 100644
--- a/js/src/yarr/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-INCLUDES := -I. -Iyarr -Iwtf -I../assembler/assembler -I../assembler
-
-all: 
-	$(CXX) -g3 -c $(INCLUDES) yarr/*.cpp
-	$(CXX) -g3 $(INCLUDES) TestMain.cpp *.o
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/OSAllocator.h
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef OSAllocator_h
+#define OSAllocator_h
+
+#include <stdlib.h>
+#include "wtfbridge.h"
+#include "assembler/wtf/VMTags.h"
+#include "assembler/wtf/Assertions.h"
+
+namespace WTF {
+
+class OSAllocator {
+public:
+    enum Usage {
+        UnknownUsage = -1,
+        FastMallocPages = VM_TAG_FOR_TCMALLOC_MEMORY,
+        JSGCHeapPages = VM_TAG_FOR_COLLECTOR_MEMORY,
+        JSVMStackPages = VM_TAG_FOR_REGISTERFILE_MEMORY,
+        JSJITCodePages = VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY
+    };
+
+    // These methods are symmetric; reserveUncommitted allocates VM in an uncommitted state,
+    // releaseDecommitted should be called on a region of VM allocated by a single reservation,
+    // the memory must all currently be in a decommitted state.
+    static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+    static void releaseDecommitted(void*, size_t);
+
+    // These methods are symmetric; they commit or decommit a region of VM (uncommitted VM should
+    // never be accessed, since the OS may not have attached physical memory for these regions).
+    // Clients should only call commit on uncommitted regions and decommit on committed regions.
+    static void commit(void*, size_t, bool writable, bool executable);
+    static void decommit(void*, size_t);
+
+    // These methods are symmetric; reserveAndCommit allocates VM in an committed state,
+    // decommitAndRelease should be called on a region of VM allocated by a single reservation,
+    // the memory must all currently be in a committed state.
+    static void* reserveAndCommit(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
+    static void decommitAndRelease(void* base, size_t size);
+
+    // These methods are akin to reserveAndCommit/decommitAndRelease, above - however rather than
+    // committing/decommitting the entire region additional parameters allow a subregion to be
+    // specified.
+    static void* reserveAndCommit(size_t reserveSize, size_t commitSize, Usage = UnknownUsage, bool writable = true, bool executable = false);
+    static void decommitAndRelease(void* releaseBase, size_t releaseSize, void* decommitBase, size_t decommitSize);
+};
+
+inline void* OSAllocator::reserveAndCommit(size_t reserveSize, size_t commitSize, Usage usage, bool writable, bool executable)
+{
+    void* base = reserveUncommitted(reserveSize, usage, writable, executable);
+    commit(base, commitSize, writable, executable);
+    return base;
+}
+
+inline void OSAllocator::decommitAndRelease(void* releaseBase, size_t releaseSize, void* decommitBase, size_t decommitSize)
+{
+    ASSERT(decommitBase >= releaseBase && (static_cast<char*>(decommitBase) + decommitSize) <= (static_cast<char*>(releaseBase) + releaseSize));
+#if WTF_OS_WINCE || WTF_OS_SYMBIAN
+    // On most platforms we can actually skip this final decommit; releasing the VM will
+    // implicitly decommit any physical memory in the region. This is not true on WINCE.
+    // On Symbian, this makes implementation simpler and better aligned with the RChunk API
+    decommit(decommitBase, decommitSize);
+#endif
+    releaseDecommitted(releaseBase, releaseSize);
+}
+
+inline void OSAllocator::decommitAndRelease(void* base, size_t size)
+{
+    decommitAndRelease(base, size, base, size);
+}
+
+} // namespace WTF
+
+using WTF::OSAllocator;
+
+#endif // OSAllocator_h
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/OSAllocatorPosix.cpp
@@ -0,0 +1,129 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "assembler/wtf/Platform.h"
+
+#if ENABLE_ASSEMBLER && WTF_OS_UNIX && !WTF_OS_SYMBIAN
+
+#include "OSAllocator.h"
+
+#include <errno.h>
+#include <sys/mman.h>
+#include "wtf/Assertions.h"
+
+namespace WTF {
+
+void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable)
+{
+    void* result = reserveAndCommit(bytes, usage, writable, executable);
+#if HAVE_MADV_FREE_REUSE
+    // To support the "reserve then commit" model, we have to initially decommit.
+    while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
+#endif
+    return result;
+}
+
+void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bool executable)
+{
+    // All POSIX reservations start out logically committed.
+    int protection = PROT_READ;
+    if (writable)
+        protection |= PROT_WRITE;
+    if (executable)
+        protection |= PROT_EXEC;
+
+    int flags = MAP_PRIVATE | MAP_ANON;
+
+#if WTF_OS_DARWIN && !defined(BUILDING_ON_TIGER)
+    int fd = usage;
+#else
+    int fd = -1;
+#endif
+
+    void* result = 0;
+#if (WTF_OS_DARWIN && WTF_CPU_X86_64)
+    if (executable) {
+        // Cook up an address to allocate at, using the following recipe:
+        //   17 bits of zero, stay in userspace kids.
+        //   26 bits of randomness for ASLR.
+        //   21 bits of zero, at least stay aligned within one level of the pagetables.
+        //
+        // But! - as a temporary workaround for some plugin problems (rdar://problem/6812854),
+        // for now instead of 2^26 bits of ASLR lets stick with 25 bits of randomization plus
+        // 2^24, which should put up somewhere in the middle of userspace (in the address range
+        // 0x200000000000 .. 0x5fffffffffff).
+        intptr_t randomLocation = 0;
+        randomLocation = arc4random() & ((1 << 25) - 1);
+        randomLocation += (1 << 24);
+        randomLocation <<= 21;
+        result = reinterpret_cast<void*>(randomLocation);
+    }
+#endif
+
+    result = mmap(result, bytes, protection, flags, fd, 0);
+    if (result == MAP_FAILED)
+        CRASH();
+    return result;
+}
+
+void OSAllocator::commit(void* address, size_t bytes, bool, bool)
+{
+#if HAVE_MADV_FREE_REUSE
+    while (madvise(address, bytes, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
+#else
+    // Non-MADV_FREE_REUSE reservations automatically commit on demand.
+    UNUSED_PARAM(address);
+    UNUSED_PARAM(bytes);
+#endif
+}
+
+void OSAllocator::decommit(void* address, size_t bytes)
+{
+#if HAVE_MADV_FREE_REUSE
+    while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
+#elif HAVE_MADV_FREE
+    while (madvise(address, bytes, MADV_FREE) == -1 && errno == EAGAIN) { }
+#elif HAVE_MADV_DONTNEED
+    while (madvise(address, bytes, MADV_DONTNEED) == -1 && errno == EAGAIN) { }
+#else
+    UNUSED_PARAM(address);
+    UNUSED_PARAM(bytes);
+#endif
+}
+
+void OSAllocator::releaseDecommitted(void* address, size_t bytes)
+{
+    int result = munmap(address, bytes);
+    if (result == -1)
+        CRASH();
+}
+
+} // namespace WTF
+
+#endif
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/OSAllocatorWin.cpp
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "assembler/wtf/Platform.h"
+
+#if ENABLE_ASSEMBLER && WTF_OS_WINDOWS
+
+#include "windows.h"
+#include "wtf/Assertions.h"
+
+#include "OSAllocator.h"
+
+namespace WTF {
+
+static inline DWORD protection(bool writable, bool executable)
+{
+    return executable ?
+        (writable ? PAGE_EXECUTE_READWRITE : PAGE_EXECUTE_READ) :
+        (writable ? PAGE_READWRITE : PAGE_READONLY);
+}
+
+void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool writable, bool executable)
+{
+    void* result = VirtualAlloc(0, bytes, MEM_RESERVE, protection(writable, executable));
+    if (!result)
+        CRASH();
+    return result;
+}
+
+void* OSAllocator::reserveAndCommit(size_t bytes, Usage, bool writable, bool executable)
+{
+    void* result = VirtualAlloc(0, bytes, MEM_RESERVE | MEM_COMMIT, protection(writable, executable));
+    if (!result)
+        CRASH();
+    return result;
+}
+
+void OSAllocator::commit(void* address, size_t bytes, bool writable, bool executable)
+{
+    void* result = VirtualAlloc(address, bytes, MEM_COMMIT, protection(writable, executable));
+    if (!result)
+        CRASH();
+}
+
+void OSAllocator::decommit(void* address, size_t bytes)
+{
+    bool result = VirtualFree(address, bytes, MEM_DECOMMIT);
+    if (!result)
+        CRASH();
+}
+
+void OSAllocator::releaseDecommitted(void* address, size_t bytes)
+{
+    // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx,
+    // dwSize must be 0 if dwFreeType is MEM_RELEASE.
+    bool result = VirtualFree(address, 0, MEM_RELEASE);
+    if (!result)
+        CRASH();
+}
+
+} // namespace WTF
+
+#endif
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/PageAllocation.h
@@ -0,0 +1,131 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * 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. 
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef PageAllocation_h
+#define PageAllocation_h
+
+#include "wtfbridge.h"
+#include "OSAllocator.h"
+#include "PageBlock.h"
+#include "assembler/wtf/VMTags.h"
+
+#if WTF_OS_DARWIN
+#include <mach/mach_init.h>
+#include <mach/vm_map.h>
+#endif
+
+#if WTF_OS_HAIKU
+#include <OS.h>
+#endif
+
+#if WTF_OS_WINDOWS
+#include <malloc.h>
+#include <windows.h>
+#endif
+
+#if WTF_OS_SYMBIAN
+#include <e32hal.h>
+#include <e32std.h>
+#endif
+
+#if WTF_HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#if WTF_HAVE_MMAP
+#include <sys/mman.h>
+#include <unistd.h>
+#endif
+
+namespace WTF {
+
+/*
+    PageAllocation
+
+    The PageAllocation class provides a cross-platform memory allocation interface
+    with similar capabilities to posix mmap/munmap.  Memory is allocated by calling
+    PageAllocation::allocate, and deallocated by calling deallocate on the
+    PageAllocation object.  The PageAllocation holds the allocation's base pointer
+    and size.
+
+    The allocate method is passed the size required (which must be a multiple of
+    the system page size, which can be accessed using PageAllocation::pageSize).
+    Callers may also optinally provide a flag indicating the usage (for use by
+    system memory usage tracking tools, where implemented), and boolean values
+    specifying the required protection (defaulting to writable, non-executable).
+*/
+
+class PageAllocation : private PageBlock {
+public:
+    PageAllocation()
+    {
+    }
+
+    using PageBlock::size;
+    using PageBlock::base;
+
+#ifndef __clang__
+    using PageBlock::operator bool;
+#else
+    // FIXME: This is a workaround for <rdar://problem/8876150>, wherein Clang incorrectly emits an access
+    // control warning when a client tries to use operator bool exposed above via "using PageBlock::operator bool".
+    operator bool() const { return PageBlock::operator bool(); }
+#endif
+
+    static PageAllocation allocate(size_t size, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true, bool executable = false)
+    {
+        ASSERT(isPageAligned(size));
+        return PageAllocation(OSAllocator::reserveAndCommit(size, usage, writable, executable), size);
+    }
+
+    void deallocate()
+    {
+        // Clear base & size before calling release; if this is *inside* allocation
+        // then we won't be able to clear then after deallocating the memory.
+        PageAllocation tmp;
+        JSC::std::swap(tmp, *this);
+
+        ASSERT(tmp);
+        ASSERT(!*this);
+
+        OSAllocator::decommitAndRelease(tmp.base(), tmp.size());
+    }
+
+private:
+    PageAllocation(void* base, size_t size)
+        : PageBlock(base, size)
+    {
+    }
+};
+
+} // namespace WTF
+
+using WTF::PageAllocation;
+
+#endif // PageAllocation_h
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/PageBlock.cpp
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "PageBlock.h"
+#include "wtf/Assertions.h"
+
+#if WTF_OS_UNIX && !WTF_OS_SYMBIAN
+#include <unistd.h>
+#endif
+
+#if WTF_OS_WINDOWS
+#include <malloc.h>
+#include <windows.h>
+#endif
+
+#if WTF_OS_SYMBIAN
+#include <e32hal.h>
+#include <e32std.h>
+#endif
+
+namespace WTF {
+
+static size_t s_pageSize;
+
+#if WTF_OS_UNIX && !WTF_OS_SYMBIAN
+
+inline size_t systemPageSize()
+{
+    return getpagesize();
+}
+
+#elif WTF_OS_WINDOWS
+
+inline size_t systemPageSize()
+{
+    static size_t size = 0;
+    SYSTEM_INFO system_info;
+    GetSystemInfo(&system_info);
+    size = system_info.dwPageSize;
+    return size;
+}
+
+#elif WTF_OS_SYMBIAN
+
+inline size_t systemPageSize()
+{
+    static TInt page_size = 0;
+    UserHal::PageSizeInBytes(page_size);
+    return page_size;
+}
+
+#endif
+
+size_t pageSize()
+{
+    if (!s_pageSize)
+        s_pageSize = systemPageSize();
+    ASSERT(isPowerOfTwo(s_pageSize));
+    return s_pageSize;
+}
+
+} // namespace WTF
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/PageBlock.h
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99 ft=cpp:
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef PageBlock_h
+#define PageBlock_h
+
+#include <stdlib.h>
+#include "jsstdint.h"
+#include "assembler/wtf/Platform.h"
+
+namespace WTF {
+
+size_t pageSize();
+inline bool isPageAligned(void* address) { return !(reinterpret_cast<intptr_t>(address) & (pageSize() - 1)); }
+inline bool isPageAligned(size_t size) { return !(size & (pageSize() - 1)); }
+inline bool isPowerOfTwo(size_t size) { return !(size & (size - 1)); }
+
+class PageBlock {
+public:
+    PageBlock();
+    PageBlock(const PageBlock&);
+    PageBlock(void*, size_t);
+    
+    void* base() const { return m_base; }
+    size_t size() const { return m_size; }
+
+    operator bool() const { return !!m_base; }
+
+    bool contains(void* containedBase, size_t containedSize)
+    {
+        return containedBase >= m_base
+            && (static_cast<char*>(containedBase) + containedSize) <= (static_cast<char*>(m_base) + m_size);
+    }
+
+private:
+    void* m_base;
+    size_t m_size;
+};
+
+inline PageBlock::PageBlock()
+    : m_base(0)
+    , m_size(0)
+{
+}
+
+inline PageBlock::PageBlock(const PageBlock& other)
+    : m_base(other.m_base)
+    , m_size(other.m_size)
+{
+}
+
+inline PageBlock::PageBlock(void* base, size_t size)
+    : m_base(base)
+    , m_size(size)
+{
+}
+
+} // namespace WTF
+
+using WTF::pageSize;
+using WTF::isPageAligned;
+using WTF::isPageAligned;
+using WTF::isPowerOfTwo;
+
+#endif // PageBlock_h
new file mode 100644
--- /dev/null
+++ b/js/src/yarr/RegExpJitTables.h
@@ -0,0 +1,2720 @@
+static const char _spacesData[65536] = {
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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