Merge TM -> JM
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 11 Apr 2011 07:33:47 -0700
changeset 74925 100ab867dda157e7cd2bb81d9780c0218526e083
parent 74924 b6d65a4eb2b3c538903262707e22f364c38a1794 (current diff)
parent 67941 d014f4c16b8564d6e773bec60a80d3c9dd503caf (diff)
child 74926 265baede77e319379f562fcdebe18184a84e706c
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone2.2a1pre
Merge TM -> JM
js/src/Makefile.in
js/src/jsapi-tests/Makefile.in
js/src/jsapi.cpp
js/src/jscntxtinlines.h
js/src/jsgc.cpp
js/src/jsmath.cpp
js/src/jsscopeinlines.h
js/src/jstracer.cpp
js/src/jswince.asm
js/src/shell/Makefile.in
js/src/shell/js.cpp
js/src/xpconnect/shell/xpcshell.cpp
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -54,19 +54,18 @@ ifdef JS_NATIVE_EDITLINE
 DIRS += editline
 endif
 
 # editline needs to get built before the shell
 ifndef JS_DISABLE_SHELL
 DIRS += shell
 endif
 
-# FIXME: bug 515383 covers getting these working on wince
-# bug 530688 covers Android
-ifneq (,$(filter-out WINCE ANDROID,$(OS_ARCH)))
+# FIXME: bug 530688 covers getting these working on Android
+ifneq (,$(filter-out ANDROID,$(OS_ARCH)))
 ifdef ENABLE_TESTS
 DIRS += jsapi-tests
 endif
 endif
 
 ifdef ENABLE_TESTS
 DIRS += tests
 endif
@@ -314,23 +313,16 @@ CPPSRCS += \
 		RegAlloc.cpp   \
 		avmplus.cpp    \
 		Native$(NANOJIT_ARCH).cpp \
 		jsbuiltins.cpp \
 		VMPI.cpp       \
 		Writer.cpp     \
 		$(NULL)
 
-ifdef WINCE
-# don't need -c
-AS_DASH_C_FLAG =
-ASFLAGS += -arch 6
-ASFILES += jswince.asm
-endif
-
 endif # ENABLE_TRACEJIT
 ifdef ENABLE_METHODJIT
 
 ###############################################
 # BEGIN include sources for the method JIT
 #
 VPATH += 	$(srcdir)/methodjit
 
@@ -503,25 +495,25 @@ VPATH += $(srcdir)/perf
 INSTALLED_HEADERS += jsperf.h
 CPPSRCS += jsperf.cpp
 ifdef HAVE_LINUX_PERF_EVENT_H
 CPPSRCS += pm_linux.cpp
 else
 CPPSRCS += pm_stub.cpp
 endif
 
-ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifeq (,$(filter-out WINNT,$(OS_ARCH)))
 INSTALLED_HEADERS += jscpucfg.h
 endif
 
 EXPORTS = $(INSTALLED_HEADERS)
 
 DASH_R		= -r
 
-ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif
 
 include $(topsrcdir)/config/config.mk
 
 EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
@@ -545,17 +537,17 @@ ifneq ($(OS_ARCH),Darwin)
 DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX)
 endif
 MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
 endif
 
 default::
 
 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
-ifneq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
+ifneq (,$(filter-out SYMBIAN,$(OS_ARCH)))
 # nsinstall doesn't get built until we enter config/ in the exports phase,
 # so we'll have to manually ensure it gets built here if we want to use
 # $(EXPORTS)
 export:: config/nsinstall$(HOST_BIN_SUFFIX)
 $(PUBLIC) $(SDK_PUBLIC): config/nsinstall$(HOST_BIN_SUFFIX)
 
 config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c
 	$(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)
@@ -672,22 +664,19 @@ check-jstests:
 				--timeout 300 \
 				--args="`echo $$f | sed 's/\(.\)/ -\1/g'`" \
 				$(DIST)/bin/js$(BIN_SUFFIX); \
 			RC=$$(( $$RC || $$?)); \
 		done; \
 	exit $$RC
 
 
-
-ifndef WINCE
 check:: check-jit-test
 #check:: check-jstests
 check-valgrind:: check-jit-test-valgrind
-endif
 
 DIST_GARBAGE = config.cache config.log config.status \
    config/autoconf.mk \
    unallmakefiles js-config js-config.h js-confdefs.h
 
 distclean::
 	cat unallmakefiles | $(XARGS) rm -f
 	rm -f $(DIST_GARBAGE)
@@ -737,17 +726,17 @@ endif
 
 ifdef MOZ_VTUNE
 CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
 EXTRA_DSO_LDOPTS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
 LIBS +=  C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib
 endif
 
 # HP-UX does not require the extra linking of "-lm"
-ifeq (,$(filter HP-UX WINNT WINCE OS2,$(OS_ARCH)))
+ifeq (,$(filter HP-UX WINNT OS2,$(OS_ARCH)))
 EXTRA_LIBS	+= -lm
 endif
 
 # Prevent floating point errors caused by VC++ optimizations
 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
 CFLAGS += -Op
 else
@@ -846,26 +835,21 @@ jsdtoa.o: jsdtoa.cpp Makefile.in
 endif
 
 export:: jsautocfg.h
 
 ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH)))
 jsautocfg.h:
 	touch $@
 else
-ifeq ($(OS_ARCH),WINCE)
-jsautocfg.h:
-	touch $@
-else
 jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
 	@rm -f $@ jsautocfg.tmp
 	./jscpucfg > jsautocfg.tmp
 	mv jsautocfg.tmp $@
 endif
-endif
 
 # jscpucfg is a strange target
 # Needs to be built with the host compiler but needs to include
 # the mdcpucfg for the target so it needs the appropriate target defines
 ifdef HOST_NSPR_MDCPUCFG
 HOST_CXX := $(HOST_CXX) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
 HOST_CXXFLAGS := $(patsubst -DXP_%,,$(HOST_CXXFLAGS))
 endif
@@ -880,24 +864,19 @@ ifneq ($(OS_TARGET),NTO)
 # QNX's compiler apparently can't build a binary directly from a source file.
 jscpucfg.o: jscpucfg.cpp Makefile.in
 	$(HOST_CXX) $(HOST_CXXFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
 
 jscpucfg: jscpucfg.o
 	$(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
 endif
 else
-ifeq ($(OS_ARCH),WINCE)
-jscpucfg$(HOST_BIN_SUFFIX):
-	echo no need to build jscpucfg $<
-else
 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
 	$(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
 endif
-endif
 
 # Compute the linker flags that programs linking against SpiderMonkey should
 # pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
 # for the SpiderMonkey library itself.
 # - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
 # - OS_LIBS includes libraries selected by the configure script.
 # - EXTRA_LIBS includes libraries selected by this Makefile.
 JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) 
--- a/js/src/jsapi-tests/Makefile.in
+++ b/js/src/jsapi-tests/Makefile.in
@@ -98,18 +98,12 @@ DEFINES         += -DEXPORT_JS_API
 # one below before including any header, but that's obscure and
 # fragile, so we do it here.
 DEFINES         += -D__STDC_LIMIT_MACROS
 
 LIBS      = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS)
 
 LOCAL_INCLUDES += -I$(topsrcdir) -I..
 
-ifdef _MSC_VER
-ifdef WINCE
-WIN32_EXE_LDFLAGS += -ENTRY:mainACRTStartup
-endif
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 check::
 	$(wildcard $(RUN_TEST_PROGRAM)) $(DIST)/bin/jsapi-tests$(BIN_SUFFIX)
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6388,17 +6388,17 @@ JS_PUBLIC_API(void)
 JS_SetGCZeal(JSContext *cx, uint8 zeal)
 {
     cx->runtime->gcZeal = zeal;
 }
 #endif
 
 /************************************************************************/
 
-#if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && defined(XP_WIN) && !defined (WINCE)
+#if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && defined(XP_WIN)
 
 #include "jswin.h"
 
 /*
  * Initialization routine for the JS DLL.
  */
 BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
 {
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -754,22 +754,22 @@ CallJSNativeConstructor(JSContext *cx, j
     JS_ASSERT_IF(native != proxy_Construct && native != js::CallOrConstructBoundFunction &&
                  (!callee->isFunction() || callee->getFunctionPrivate()->u.n.clasp != &js_ObjectClass),
                  !vp->isPrimitive() && callee != &vp[0].toObject());
 
     return true;
 }
 
 JS_ALWAYS_INLINE bool
-CallJSPropertyOp(JSContext *cx, js::PropertyOp op, JSObject *obj, jsid id, js::Value *vp)
+CallJSPropertyOp(JSContext *cx, js::PropertyOp op, JSObject *receiver, jsid id, js::Value *vp)
 {
-    assertSameCompartment(cx, obj, id, *vp);
-    JSBool ok = op(cx, obj, id, vp);
+    assertSameCompartment(cx, receiver, id, *vp);
+    JSBool ok = op(cx, receiver, id, vp);
     if (ok)
-        assertSameCompartment(cx, obj, *vp);
+        assertSameCompartment(cx, receiver, *vp);
     return ok;
 }
 
 JS_ALWAYS_INLINE bool
 CallJSPropertyOpSetter(JSContext *cx, js::StrictPropertyOp op, JSObject *obj, jsid id,
                        JSBool strict, js::Value *vp)
 {
     assertSameCompartment(cx, obj, id, *vp);
--- a/js/src/jscpucfg.h
+++ b/js/src/jscpucfg.h
@@ -37,45 +37,45 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef js_cpucfg___
 #define js_cpucfg___
 
 #define JS_HAVE_LONG_LONG
 
-#if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE)
+#if defined(XP_WIN) || defined(XP_OS2)
 
 #if defined(_WIN64)
 
 #if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define JS_BYTES_PER_DOUBLE 8L
 #define JS_BYTES_PER_WORD   8L
 #define JS_BITS_PER_WORD_LOG2   6
 #define JS_ALIGN_OF_POINTER 8L
 #else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
 #error "CPU type is unknown"
 #endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
 
-#elif defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
+#elif defined(_WIN32) || defined(XP_OS2)
 
 #ifdef __WATCOMC__
 #define HAVE_VA_LIST_AS_ARRAY 1
 #endif
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define JS_BYTES_PER_DOUBLE 8L
 #define JS_BYTES_PER_WORD   4L
 #define JS_BITS_PER_WORD_LOG2   5
 #define JS_ALIGN_OF_POINTER 4L
 
-#endif /* _WIN32 || XP_OS2 || WINCE*/
+#endif /* _WIN32 || XP_OS2 */
 
 #elif defined(XP_UNIX)
 
 #error "This file is supposed to be auto-generated on UNIX platforms, but the"
 #error "static version for Mac and Windows platforms is being used."
 #error "Something's probably wrong with paths/headers/dependencies/Makefiles."
 
 #else
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -238,17 +238,17 @@ checkArenaListsForThing(JSCompartment *c
 {
     if (comp->arenas[FINALIZE_OBJECT0].arenasContainThing<JSObject>(thing) ||
         comp->arenas[FINALIZE_OBJECT2].arenasContainThing<JSObject_Slots2>(thing) ||
         comp->arenas[FINALIZE_OBJECT4].arenasContainThing<JSObject_Slots4>(thing) ||
         comp->arenas[FINALIZE_OBJECT8].arenasContainThing<JSObject_Slots8>(thing) ||
         comp->arenas[FINALIZE_OBJECT12].arenasContainThing<JSObject_Slots12>(thing) ||
         comp->arenas[FINALIZE_OBJECT16].arenasContainThing<JSObject_Slots16>(thing) ||
         comp->arenas[FINALIZE_FUNCTION].arenasContainThing<JSFunction>(thing) ||
-        comp->arenas[FINALIZE_FUNCTION].arenasContainThing<Shape>(thing) ||
+        comp->arenas[FINALIZE_SHAPE].arenasContainThing<Shape>(thing) ||
 #if JS_HAS_XML_SUPPORT
         comp->arenas[FINALIZE_XML].arenasContainThing<JSXML>(thing) ||
 #endif
         comp->arenas[FINALIZE_STRING].arenasContainThing<JSString>(thing) ||
         comp->arenas[FINALIZE_EXTERNAL_STRING].arenasContainThing<JSExternalString>(thing) ||
         comp->arenas[FINALIZE_SHORT_STRING].arenasContainThing<JSShortString>(thing))
     {
         return true;
--- a/js/src/jsgcchunk.cpp
+++ b/js/src/jsgcchunk.cpp
@@ -64,108 +64,30 @@
 # ifndef MAP_NOSYNC
 #  define MAP_NOSYNC    0
 # endif
 
 #endif
 
 #ifdef XP_WIN
 
-/*
- * On Windows CE < 6 we must use separated MEM_RESERVE and MEM_COMMIT
- * VirtualAlloc calls and we cannot use MEM_RESERVE to allocate at the given
- * address. So we use a workaround based on oversized allocation.
- */
-# if defined(WINCE) && !defined(MOZ_MEMORY_WINCE6)
-
-#  define JS_GC_HAS_MAP_ALIGN
-
-static void
-UnmapPagesAtBase(void *p)
-{
-    JS_ALWAYS_TRUE(VirtualFree(p, 0, MEM_RELEASE));
-}
-
-static void *
-MapAlignedPages(size_t size, size_t alignment)
-{
-    JS_ASSERT(size % alignment == 0);
-    JS_ASSERT(size >= alignment);
-
-    void *reserve = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
-    if (!reserve)
-        return NULL;
-
-    void *p = VirtualAlloc(reserve, size, MEM_COMMIT, PAGE_READWRITE);
-    JS_ASSERT(p == reserve);
-
-    size_t mask = alignment - 1;
-    size_t offset = (uintptr_t) p & mask;
-    if (!offset)
-        return p;
-
-    /* Try to extend the initial allocation. */
-    UnmapPagesAtBase(reserve);
-    reserve = VirtualAlloc(NULL, size + alignment - offset, MEM_RESERVE,
-                           PAGE_NOACCESS);
-    if (!reserve)
-        return NULL;
-    if (offset == ((uintptr_t) reserve & mask)) {
-        void *aligned = (void *) ((uintptr_t) reserve + alignment - offset);
-        p = VirtualAlloc(aligned, size, MEM_COMMIT, PAGE_READWRITE);
-        JS_ASSERT(p == aligned);
-        return p;
-    }
-
-    /* over allocate to ensure we have an aligned region */
-    UnmapPagesAtBase(reserve);
-    reserve = VirtualAlloc(NULL, size + alignment, MEM_RESERVE, PAGE_NOACCESS);
-    if (!reserve)
-        return NULL;
-
-    offset = (uintptr_t) reserve & mask;
-    void *aligned = (void *) ((uintptr_t) reserve + alignment - offset);
-    p = VirtualAlloc(aligned, size, MEM_COMMIT, PAGE_READWRITE);
-    JS_ASSERT(p == aligned);
-
-    return p;
-}
-
-static void
-UnmapPages(void *p, size_t size)
-{
-    if (VirtualFree(p, 0, MEM_RELEASE))
-        return;
-
-    /* We could have used the over allocation. */
-    JS_ASSERT(GetLastError() == ERROR_INVALID_PARAMETER);
-    MEMORY_BASIC_INFORMATION info;
-    VirtualQuery(p, &info, sizeof(info));
-
-    UnmapPagesAtBase(info.AllocationBase);
-}
-
-# else /* WINCE */
-
 static void *
 MapPages(void *addr, size_t size)
 {
     void *p = VirtualAlloc(addr, size, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
     JS_ASSERT_IF(p && addr, p == addr);
     return p;
 }
 
 static void
 UnmapPages(void *addr, size_t size)
 {
     JS_ALWAYS_TRUE(VirtualFree(addr, 0, MEM_RELEASE));
 }
 
-# endif /* !WINCE */
-
 #elif defined(XP_OS2)
 
 #define JS_GC_HAS_MAP_ALIGN 1
 #define OS2_MAX_RECURSIONS  16
 
 static void
 UnmapPages(void *addr, size_t size)
 {
--- a/js/src/jsgcchunk.h
+++ b/js/src/jsgcchunk.h
@@ -40,22 +40,17 @@
 #ifndef jsgchunk_h__
 #define jsgchunk_h__
 
 #include "jsprvtd.h"
 #include "jsutil.h"
 
 namespace js {
 
-#if defined(WINCE) && !defined(MOZ_MEMORY_WINCE6)
-const size_t GC_CHUNK_SHIFT = 21;
-#else
 const size_t GC_CHUNK_SHIFT = 20;
-#endif
-
 const size_t GC_CHUNK_SIZE = size_t(1) << GC_CHUNK_SHIFT;
 const size_t GC_CHUNK_MASK = GC_CHUNK_SIZE - 1;
 
 JS_FRIEND_API(void *)
 AllocGCChunk();
 
 JS_FRIEND_API(void)
 FreeGCChunk(void *p);
--- a/js/src/jsinttypes.h
+++ b/js/src/jsinttypes.h
@@ -119,22 +119,16 @@ typedef unsigned JS_INT64_TYPE  JSUint64
 #endif
 
 /* Microsoft Visual C/C++ defines intptr_t and uintptr_t in <stddef.h>.  */
 #if defined(JS_STDDEF_H_HAS_INTPTR_T)
 #include <stddef.h>
 typedef intptr_t JSIntPtr;
 typedef uintptr_t JSUintPtr;
 
-/* Windows Mobile defines intptr_t and uintptr_t in <crtdefs.h>.  Why not?  */
-#elif defined(JS_CRTDEFS_H_HAS_INTPTR_T)
-#include <crtdefs.h>
-typedef intptr_t JSIntPtr;
-typedef uintptr_t JSUintPtr;
-
 /* Failing that, the configure script will have found something.  */
 #elif defined(JS_INTPTR_TYPE)
 typedef signed   JS_INTPTR_TYPE JSIntPtr;
 typedef unsigned JS_INTPTR_TYPE JSUintPtr;
 
 #else
 #error "couldn't find pointer-sized integer types"
 #endif
--- a/js/src/jslibmath.h
+++ b/js/src/jslibmath.h
@@ -48,18 +48,16 @@
 
 /*
  * Use system provided math routines.
  */
 
 /* The right copysign function is not always named the same thing. */
 #if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 #define js_copysign __builtin_copysign
-#elif defined WINCE
-#define js_copysign _copysign
 #elif defined _WIN32
 #if _MSC_VER < 1400
 /* Try to work around apparent _copysign bustage in VC7.x. */
 #define js_copysign js_copysign
 extern double js_copysign(double, double);
 #else
 #define js_copysign _copysign
 #endif
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -577,17 +577,17 @@ random_nextDouble(JSContext *cx)
 static JSBool
 math_random(JSContext *cx, uintN argc, Value *vp)
 {
     jsdouble z = random_nextDouble(cx);
     vp->setDouble(z);
     return JS_TRUE;
 }
 
-#if defined _WIN32 && !defined WINCE && _MSC_VER < 1400
+#if defined _WIN32 && _MSC_VER < 1400
 /* Try to work around apparent _copysign bustage in VC7.x. */
 double
 js_copysign(double x, double y)
 {
     jsdpun xu, yu;
 
     xu.d = x;
     yu.d = y;
--- a/js/src/jsnativestack.cpp
+++ b/js/src/jsnativestack.cpp
@@ -56,73 +56,17 @@
 
 #else
 # error "Unsupported platform"
 
 #endif
 
 namespace js {
 
-#if defined(XP_WIN) && defined(WINCE)
-
-inline bool
-isPageWritable(void *page)
-{
-    MEMORY_BASIC_INFORMATION memoryInformation;
-    jsuword result = VirtualQuery(page, &memoryInformation, sizeof(memoryInformation));
-
-    /* return false on error, including ptr outside memory */
-    if (result != sizeof(memoryInformation))
-        return false;
-
-    jsuword protect = memoryInformation.Protect & ~(PAGE_GUARD | PAGE_NOCACHE);
-    return protect == PAGE_READWRITE ||
-           protect == PAGE_WRITECOPY ||
-           protect == PAGE_EXECUTE_READWRITE ||
-           protect == PAGE_EXECUTE_WRITECOPY;
-}
-
-void *
-GetNativeStackBase()
-{
-    /* find the address of this stack frame by taking the address of a local variable */
-    bool isGrowingDownward = JS_STACK_GROWTH_DIRECTION < 0;
-    void *thisFrame = (void *)(&isGrowingDownward);
-
-    static jsuword pageSize = 0;
-    if (!pageSize) {
-        SYSTEM_INFO systemInfo;
-        GetSystemInfo(&systemInfo);
-        pageSize = systemInfo.dwPageSize;
-    }
-
-    /* scan all of memory starting from this frame, and return the last writeable page found */
-    register char *currentPage = (char *)((jsuword)thisFrame & ~(pageSize - 1));
-    if (isGrowingDownward) {
-        while (currentPage > 0) {
-            /* check for underflow */
-            if (currentPage >= (char *)pageSize)
-                currentPage -= pageSize;
-            else
-                currentPage = 0;
-            if (!isPageWritable(currentPage))
-                return currentPage + pageSize;
-        }
-        return 0;
-    } else {
-        while (true) {
-            /* guaranteed to complete because isPageWritable returns false at end of memory */
-            currentPage += pageSize;
-            if (!isPageWritable(currentPage))
-                return currentPage;
-        }
-    }
-}
-
-#elif defined(XP_WIN)
+#if defined(XP_WIN)
 
 void *
 GetNativeStackBaseImpl()
 {
 # if defined(_M_IX86) && defined(_MSC_VER)
     /*
      * offset 0x18 from the FS segment register gives a pointer to
      * the thread information block for the current thread
--- a/js/src/jsscopeinlines.h
+++ b/js/src/jsscopeinlines.h
@@ -225,17 +225,17 @@ Shape::get(JSContext* cx, JSObject *rece
     }
 
     /*
      * |with (it) color;| ends up here, as do XML filter-expressions.
      * Avoid exposing the With object to native getters.
      */
     if (obj->getClass() == &js_WithClass)
         obj = js_UnwrapWithObject(cx, obj);
-    return js::CallJSPropertyOp(cx, getterOp(), obj, SHAPE_USERID(this), vp);
+    return js::CallJSPropertyOp(cx, getterOp(), receiver, SHAPE_USERID(this), vp);
 }
 
 inline bool
 Shape::set(JSContext* cx, JSObject* obj, bool strict, js::Value* vp) const
 {
     JS_ASSERT_IF(hasDefaultSetter(), hasGetterValue());
 
     if (attrs & JSPROP_SETTER) {
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -7432,83 +7432,17 @@ CheckForSSE2()
        );
 #endif
     return (features & (1<<26)) != 0;
 }
 #endif
 
 #if defined(NANOJIT_ARM)
 
-#if defined(_MSC_VER) && defined(WINCE)
-
-// these come in from jswince.asm
-extern "C" int js_arm_try_armv5_op();
-extern "C" int js_arm_try_armv6_op();
-extern "C" int js_arm_try_armv7_op();
-extern "C" int js_arm_try_vfp_op();
-
-static unsigned int
-arm_check_arch()
-{
-    unsigned int arch = 4;
-    __try {
-        js_arm_try_armv5_op();
-        arch = 5;
-        js_arm_try_armv6_op();
-        arch = 6;
-        js_arm_try_armv7_op();
-        arch = 7;
-    } __except(GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION) {
-    }
-    return arch;
-}
-
-static bool
-arm_check_vfp()
-{
-#ifdef WINCE_WINDOWS_MOBILE
-    return false;
-#else
-    bool ret = false;
-    __try {
-        js_arm_try_vfp_op();
-        ret = true;
-    } __except(GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION) {
-        ret = false;
-    }
-    return ret;
-#endif
-}
-
-#define HAVE_ENABLE_DISABLE_DEBUGGER_EXCEPTIONS 1
-
-/* See "Suppressing Exception Notifications while Debugging", at
- * http://msdn.microsoft.com/en-us/library/ms924252.aspx
- */
-static void
-disable_debugger_exceptions()
-{
-    // 2 == TLSSLOT_KERNEL
-    DWORD kctrl = (DWORD) TlsGetValue(2);
-    // 0x12 = TLSKERN_NOFAULT | TLSKERN_NOFAULTMSG
-    kctrl |= 0x12;
-    TlsSetValue(2, (LPVOID) kctrl);
-}
-
-static void
-enable_debugger_exceptions()
-{
-    // 2 == TLSSLOT_KERNEL
-    DWORD kctrl = (DWORD) TlsGetValue(2);
-    // 0x12 = TLSKERN_NOFAULT | TLSKERN_NOFAULTMSG
-    kctrl &= ~0x12;
-    TlsSetValue(2, (LPVOID) kctrl);
-}
-
-#elif defined(__GNUC__) && defined(AVMPLUS_LINUX)
+#if defined(__GNUC__) && defined(AVMPLUS_LINUX)
 
 // Assume ARMv4 by default.
 static unsigned int arm_arch = 4;
 static bool arm_has_vfp = false;
 static bool arm_has_neon = false;
 static bool arm_has_iwmmxt = false;
 static bool arm_tests_initialized = false;
 
deleted file mode 100644
--- a/js/src/jswince.asm
+++ /dev/null
@@ -1,82 +0,0 @@
-    INCLUDE kxarm.h
-
-    area js_msvc, code, readonly
-
-    MACRO
-    FUNC_HEADER $Name
-FuncName    SETS    VBar:CC:"$Name":CC:VBar
-PrologName  SETS    VBar:CC:"$Name":CC:"_Prolog":CC:VBar
-FuncEndName SETS    VBar:CC:"$Name":CC:"_end":CC:VBar
-
-    AREA |.pdata|,ALIGN=2,PDATA
-    DCD	$FuncName
-    DCD	(($PrologName-$FuncName)/4) :OR: ((($FuncEndName-$FuncName)/4):SHL:8) :OR: 0x40000000
-    AREA $AreaName,CODE,READONLY
-    ALIGN	2
-    GLOBAL	$FuncName
-    EXPORT	$FuncName
-$FuncName
-    ROUT
-$PrologName
-    MEND
-
-    ;; -------- Functions to test processor features.
-    export  js_arm_try_thumb_op
-    export  js_arm_try_armv6t2_op
-    export  js_arm_try_armv7_op
-    export  js_arm_try_armv6_op
-    export  js_arm_try_armv5_op
-    export  js_arm_try_vfp_op
-
-    ;; Test for Thumb support.
-    FUNC_HEADER js_arm_try_thumb_op
-    bx lr
-    mov pc, lr
-    ENTRY_END
-    endp
-
-    ;; I'm not smart enough to figure out which flags to pass to armasm to get it
-    ;; to understand movt and fmdrr/vmov; the disassembler figures them out just fine!
-
-    ;; Test for Thumb2 support.
-    FUNC_HEADER js_arm_try_armv6t2_op
-    ;; movt r0,#0xFFFF
-    DCD 0xE34F0FFF
-    mov pc,lr
-    ENTRY_END
-    endp
-
-    ;; Test for VFP support.
-    FUNC_HEADER js_arm_try_vfp_op
-    ;; fmdrr d0, r0, r1
-    DCD 0xEC410B10
-    mov pc,lr
-    ENTRY_END
-    endp
-
-    ;; Tests for each architecture version.
-
-    FUNC_HEADER js_arm_try_armv7_op
-    ;; pli pc, #0
-    DCD 0xF45FF000
-    mov pc, lr
-    ENTRY_END
-    endp
-
-    FUNC_HEADER js_arm_try_armv6_op
-    ;; rev ip, ip
-    DCD 0xE6BFCF3C
-    mov pc, lr
-    ENTRY_END
-    endp
-
-    FUNC_HEADER js_arm_try_armv5_op
-    ;; clz ip, ip
-    DCD 0xE16FCF1C
-    mov pc, lr
-    ENTRY_END
-    endp
-
-    ;; --------
-
-    end
--- a/js/src/lirasm/Makefile.in
+++ b/js/src/lirasm/Makefile.in
@@ -62,18 +62,15 @@ CPPSRCS		    = lirasm.cpp \
 		$(NULL)
 
 
 LOCAL_INCLUDES += -I$(topsrcdir) -I..
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
-ifdef WINCE
-WIN32_EXE_LDFLAGS += -ENTRY:mainACRTStartup
-endif
 CFLAGS += -EHsc
 CXXFLAGS += -EHsc
 endif
 
 check:: $(PROGRAM)
 	$(srcdir)/testlirc.sh $(PROGRAM)
 
--- a/js/src/prmjtime.cpp
+++ b/js/src/prmjtime.cpp
@@ -59,18 +59,18 @@
 #ifdef XP_OS2
 #include <sys/timeb.h>
 #endif
 #ifdef XP_WIN
 #include <windef.h>
 #include <winbase.h>
 #include <math.h>     /* for fabs */
 #include <mmsystem.h> /* for timeBegin/EndPeriod */
-/* VC++ 8.0 or later, and not WINCE */
-#if _MSC_VER >= 1400 && !defined(WINCE)
+/* VC++ 8.0 or later */
+#if _MSC_VER >= 1400
 #define NS_HAVE_INVALID_PARAMETER_HANDLER 1
 #endif
 #ifdef NS_HAVE_INVALID_PARAMETER_HANDLER
 #include <stdlib.h>   /* for _set_invalid_parameter_handler */
 #include <crtdbg.h>   /* for _CrtSetReportMode */
 #endif
 
 #ifdef JS_THREADSAFE
@@ -114,17 +114,17 @@ ComputeLocalTime(time_t local, struct tm
 }
 
 /*
  * get the difference in seconds between this time zone and UTC (GMT)
  */
 JSInt32
 PRMJ_LocalGMTDifference()
 {
-#if defined(XP_WIN) && !defined(WINCE)
+#if defined(XP_WIN)
     /* Windows does not follow POSIX. Updates to the
      * TZ environment variable are not reflected
      * immediately on that platform as they are
      * on UNIX systems without this call.
      */
     _tzset();
 #endif
 
@@ -195,19 +195,16 @@ typedef struct CalibrationData {
     JSInt64 last;
 
     JSBool calibrated;
 
 #ifdef JS_THREADSAFE
     CRITICAL_SECTION data_lock;
     CRITICAL_SECTION calibration_lock;
 #endif
-#ifdef WINCE
-    JSInt64 granularity;
-#endif
 } CalibrationData;
 
 static CalibrationData calibration = { 0 };
 
 static void
 NowCalibrate()
 {
     FILETIME ft, ftStart;
@@ -228,20 +225,16 @@ NowCalibrate()
            the loop seems to take much less time (1 ms vs 15ms) on Vista. */
         timeBeginPeriod(1);
         LowResTime(&ftStart);
         do {
             LowResTime(&ft);
         } while (memcmp(&ftStart,&ft, sizeof(ft)) == 0);
         timeEndPeriod(1);
 
-#ifdef WINCE
-        calibration.granularity = (FILETIME2INT64(ft) -
-                                   FILETIME2INT64(ftStart))/10;
-#endif
         /*
         calibrationDelta = (FILETIME2INT64(ft) - FILETIME2INT64(ftStart))/10;
         fprintf(stderr, "Calibration delta was %I64d us\n", calibrationDelta);
         */
 
         QueryPerformanceCounter(&now);
 
         calibration.offset = (long double) FILETIME2INT64(ft);
@@ -263,41 +256,32 @@ NowCalibrate()
 #define LASTLOCK_SPINCOUNT 4096
 
 #ifdef JS_THREADSAFE
 static PRStatus
 NowInit(void)
 {
     memset(&calibration, 0, sizeof(calibration));
     NowCalibrate();
-#ifdef WINCE
-    InitializeCriticalSection(&calibration.calibration_lock);
-    InitializeCriticalSection(&calibration.data_lock);
-#else
     InitializeCriticalSectionAndSpinCount(&calibration.calibration_lock, CALIBRATIONLOCK_SPINCOUNT);
     InitializeCriticalSectionAndSpinCount(&calibration.data_lock, DATALOCK_SPINCOUNT);
-#endif
     return PR_SUCCESS;
 }
 
 void
 PRMJ_NowShutdown()
 {
     DeleteCriticalSection(&calibration.calibration_lock);
     DeleteCriticalSection(&calibration.data_lock);
 }
 
 #define MUTEX_LOCK(m) EnterCriticalSection(m)
 #define MUTEX_TRYLOCK(m) TryEnterCriticalSection(m)
 #define MUTEX_UNLOCK(m) LeaveCriticalSection(m)
-#ifdef WINCE
-#define MUTEX_SETSPINCOUNT(m, c)
-#else
 #define MUTEX_SETSPINCOUNT(m, c) SetCriticalSectionSpinCount((m),(c))
-#endif
 
 static PRCallOnceType calibrationOnce = { 0 };
 
 #else
 
 #define MUTEX_LOCK(m)
 #define MUTEX_TRYLOCK(m) 1
 #define MUTEX_UNLOCK(m)
@@ -486,33 +470,29 @@ PRMJ_Now(void)
             cachedOffset = calibration.offset;
 
             /* On some dual processor/core systems, we might get an earlier time
                so we cache the last time that we returned */
             calibration.last = JS_MAX(calibration.last,(JSInt64)highresTime);
             returnedTime = calibration.last;
             MUTEX_UNLOCK(&calibration.data_lock);
 
-#ifdef WINCE
-            /* Get an estimate of clock ticks per second from our own test */
-            skewThreshold = calibration.granularity;
-#else
             /* Rather than assume the NT kernel ticks every 15.6ms, ask it */
             if (GetSystemTimeAdjustment(&timeAdjustment,
                                         &timeIncrement,
                                         &timeAdjustmentDisabled)) {
                 if (timeAdjustmentDisabled) {
                     /* timeAdjustment is in units of 100ns */
                     skewThreshold = timeAdjustment/10.0;
                 } else {
                     /* timeIncrement is in units of 100ns */
                     skewThreshold = timeIncrement/10.0;
                 }
             }
-#endif
+
             /* Check for clock skew */
             diff = lowresTime - highresTime;
 
             /* For some reason that I have not determined, the skew can be
                up to twice a kernel tick. This does not seem to happen by
                itself, but I have only seen it triggered by another program
                doing some kind of file I/O. The symptoms are a negative diff
                followed by an equally large positive diff. */
@@ -693,17 +673,17 @@ PRMJ_FormatTime(char *buf, int buflen, c
 }
 
 JSInt64
 DSTOffsetCache::computeDSTOffsetMilliseconds(int64 localTimeSeconds)
 {
     JS_ASSERT(localTimeSeconds >= 0);
     JS_ASSERT(localTimeSeconds <= MAX_UNIX_TIMET);
 
-#if defined(XP_WIN) && !defined(WINCE)
+#if defined(XP_WIN)
     /* Windows does not follow POSIX. Updates to the
      * TZ environment variable are not reflected
      * immediately on that platform as they are
      * on UNIX systems without this call.
      */
     _tzset();
 #endif
 
--- a/js/src/shell/Makefile.in
+++ b/js/src/shell/Makefile.in
@@ -51,22 +51,16 @@ CPPSRCS		= \
   $(NULL)
 
 DEFINES         += -DEXPORT_JS_API
 
 LIBS      = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
 
 LOCAL_INCLUDES += -I$(topsrcdir) -I..
 
-ifdef _MSC_VER
-ifdef WINCE
-WIN32_EXE_LDFLAGS += -ENTRY:mainACRTStartup
-endif
-endif
-
 ifeq ($(OS_ARCH),Darwin)
 ifeq ($(TARGET_CPU),x86_64)
 DARWIN_EXE_LDFLAGS += -pagezero_size 10000 -image_base 100000000
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -390,20 +390,16 @@ ShellOperationCallback(JSContext *cx)
 static void
 SetContextOptions(JSContext *cx)
 {
     JS_SetNativeStackQuota(cx, gMaxStackSize);
     JS_SetScriptStackQuota(cx, gScriptStackQuota);
     JS_SetOperationCallback(cx, ShellOperationCallback);
 }
 
-#ifdef WINCE
-int errno;
-#endif
-
 static void
 Process(JSContext *cx, JSObject *obj, char *filename, JSBool forceTTY, JSBool last)
 {
     JSBool ok, hitEOF;
     JSObject *scriptObj;
     jsval result;
     JSString *str;
     char *buffer;
@@ -422,20 +418,17 @@ Process(JSContext *cx, JSObject *obj, ch
                                  JSSMSG_CANT_OPEN, filename, strerror(errno));
             gExitCode = EXITCODE_FILE_NOT_FOUND;
             return;
         }
     }
 
     SetContextOptions(cx);
 
-#ifndef WINCE
-    /* windows mobile (and possibly other os's) does not have a TTY */
     if (!forceTTY && !isatty(fileno(file)))
-#endif
     {
         /*
          * It's not interactive - just execute it.
          *
          * Support the UNIX #! shell hack; gobble the first line if it starts
          * with '#'.  TODO - this isn't quite compatible with sharp variables,
          * as a legal js program (using sharp variables) might start with '#'.
          * But that would require multi-character lookahead.
--- a/js/src/tests/Makefile.in
+++ b/js/src/tests/Makefile.in
@@ -64,17 +64,16 @@ TEST_FILES = \
   js1_3/ \
   js1_4/ \
   js1_5/ \
   js1_6/ \
   js1_7/ \
   js1_8/ \
   js1_8_1/ \
   js1_8_5/ \
-  proxies/ \
   $(NULL)
 
 PKG_STAGE = $(DIST)/test-package-stage
 
 # stage tests for packaging
 stage-package:
 	$(NSINSTALL) -D $(PKG_STAGE)/jsreftest/tests
 	@(cd $(srcdir) && tar $(TAR_CREATE_FLAGS) - $(TEST_FILES)) | (cd $(PKG_STAGE)/jsreftest/tests && tar -xf -)
--- 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/shell/Makefile.in
+++ b/js/src/xpconnect/shell/Makefile.in
@@ -63,20 +63,16 @@ ifdef JS_SHARED_LIBRARY
 LIBS +=	$(MOZ_JS_LIBS)
 endif
 
 LIBS +=	$(NSPR_LIBS)
 
 NSDISTMODE = copy
 
 ifdef _MSC_VER
-ifdef WINCE
-WIN32_EXE_LDFLAGS += -ENTRY:mainWCRTStartup
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre/
-endif
 ifeq ($(OS_TEST),x86_64)
 # set stack to 2MB on x64 build.  See bug 582910
 WIN32_EXE_LDFLAGS += -STACK:2097152
 endif
 endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/js/src/xpconnect/shell/xpcshell.cpp
+++ b/js/src/xpconnect/shell/xpcshell.cpp
@@ -154,17 +154,17 @@ static JSBool reportWarnings = JS_TRUE;
 static JSBool compileOnly = JS_FALSE;
 
 JSPrincipals *gJSPrincipals = nsnull;
 nsAutoString *gWorkingDirectory = nsnull;
 
 static JSBool
 GetLocationProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 {
-#if (!defined(XP_WIN) && !defined(XP_UNIX)) || defined(WINCE)
+#if !defined(XP_WIN) && !defined(XP_UNIX)
     //XXX: your platform should really implement this
     return JS_FALSE;
 #else
     JSStackFrame *fp = JS_GetScriptedCaller(cx, NULL);
     JSScript *script = JS_GetFrameScript(cx, fp);
     const char *filename = JS_GetScriptFilename(cx, script);
 
     if (filename) {
@@ -1739,17 +1739,17 @@ ContextCallback(JSContext *cx, uintN con
         JS_SetVersion(cx, JSVERSION_LATEST);
     }
     return JS_TRUE;
 }
 
 static bool
 GetCurrentWorkingDirectory(nsAString& workingDirectory)
 {
-#if (!defined(XP_WIN) && !defined(XP_UNIX)) || defined(WINCE)
+#if !defined(XP_WIN) && !defined(XP_UNIX)
     //XXX: your platform should really implement this
     return false;
 #elif XP_WIN
     DWORD requiredLength = GetCurrentDirectoryW(0, NULL);
     workingDirectory.SetLength(requiredLength);
     GetCurrentDirectoryW(workingDirectory.Length(),
                          (LPWSTR)workingDirectory.BeginWriting());
     // we got a trailing null there
@@ -1774,29 +1774,19 @@ GetCurrentWorkingDirectory(nsAString& wo
     // size back down to the actual string length
     cwd.SetLength(strlen(result) + 1);
     cwd.Replace(cwd.Length() - 1, 1, '/');
     workingDirectory = NS_ConvertUTF8toUTF16(cwd);
 #endif
     return true;
 }
 
-#ifdef WINCE
-#include "nsWindowsWMain.cpp"
-#endif
-
 int
-#ifndef WINCE
 main(int argc, char **argv, char **envp)
 {
-#else
-main(int argc, char **argv)
-{
-	char **envp = 0;
-#endif
 #ifdef XP_MACOSX
     InitAutoreleasePool();
 #endif
     JSRuntime *rt;
     JSContext *cx;
     JSObject *glob, *envobj;
     int result;
     nsresult rv;
--- a/js/src/xpconnect/src/XPCDispConvert.cpp
+++ b/js/src/xpconnect/src/XPCDispConvert.cpp
@@ -406,22 +406,18 @@ JSBool XPCDispConvert::COMArrayToJSArray
     // Divine the type of our array
     VARTYPE vartype;
     if((src.vt & VT_ARRAY) != 0)
     {
         vartype = src.vt & ~VT_ARRAY;
     }
     else // This was maybe a VT_SAFEARRAY
     {
-#ifndef WINCE
         if(FAILED(SafeArrayGetVartype(src.parray, &vartype)))
             return JS_FALSE;
-#else
-        return JS_FALSE;
-#endif
     }
     jsval val = JSVAL_NULL;
     AUTO_MARK_JSVAL(ccx, &val);
     for(long index = lbound; index <= ubound; ++index)
     {
         HRESULT hr;
         _variant_t var;
         if(vartype == VT_VARIANT)
--- a/js/src/xpconnect/src/nsDispatchSupport.cpp
+++ b/js/src/xpconnect/src/nsDispatchSupport.cpp
@@ -109,17 +109,16 @@ ClassExists(const CLSID &clsid)
         return PR_FALSE; // Class doesn't exist
 
     return PR_TRUE;
 }
 
 static PRBool
 ClassImplementsCategory(const CLSID &clsid, const CATID &catid, PRBool &bClassExists)
 {
-#ifndef WINCE
     bClassExists = ClassExists(clsid);
     // Non existent classes won't implement any category...
     if(!bClassExists)
         return PR_FALSE;
 
     // CLSID exists, so try checking what categories it implements
     bClassExists = PR_TRUE;
     CComPtr<ICatInformation> catInfo;
@@ -136,17 +135,16 @@ ClassImplementsCategory(const CLSID &cls
     // Search for matching categories
     BOOL bFound = FALSE;
     CATID catidNext = GUID_NULL;
     while(enumCATID->Next(1, &catidNext, NULL) == S_OK)
     {
         if(::IsEqualCATID(catid, catidNext))
             return PR_TRUE; // Match
     }
-#endif
     return PR_FALSE;
 }
 
 nsDispatchSupport* nsDispatchSupport::mInstance = nsnull;
 
 NS_IMPL_THREADSAFE_ISUPPORTS1(nsDispatchSupport, nsIDispatchSupport)
 
 nsDispatchSupport::nsDispatchSupport()
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -134,26 +134,16 @@
 #include "nsISecurityCheckedComponent.h"
 #endif
 
 #include "nsIThreadInternal.h"
 
 #ifdef XPC_IDISPATCH_SUPPORT
 // This goop was added because of EXCEPINFO in ThrowCOMError
 // This include is here, because it needs to occur before the undefines below
-#ifdef WINCE
-/* atlbase.h on WINCE has a bug, in that it tries to use
- * GetProcAddress with a wide string, when that is explicitly not
- * supported.  So we use C++ to overload that here, and implement
- * something that works.
- */
-#include <windows.h>
-static FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName);
-#endif /* WINCE */
-
 #include <atlbase.h>
 #include "oaidl.h"
 #endif
 
 #ifdef XP_WIN
 // Nasty MS defines
 #ifdef GetClassInfo
 #undef GetClassInfo
@@ -4568,37 +4558,16 @@ inline bool
 ParticipatesInCycleCollection(JSContext *cx, js::gc::Cell *cell)
 {
     return CompartmentParticipatesInCycleCollection(cx, cell->compartment());
 }
 
 }
 
 #ifdef XPC_IDISPATCH_SUPPORT
-
-#ifdef WINCE
-/* defined static near the top here */
-FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName) {
-  FARPROC ret = NULL;
-  int len = wcslen(procName);
-  char *s = new char[len + 1];
-
-  for (int i = 0; i < len; i++) {
-    s[i] = (char) procName[i];
-  }
-  s[len-1] = 0;
-
-  ret = ::GetProcAddress(hMod, s);
-  delete [] s;
-
-  return ret;
-}
-#endif /* WINCE */
-
-
 // IDispatch specific classes
 #include "XPCDispPrivate.h"
 #endif
 
 /***************************************************************************/
 // Inlines use the above - include last.
 
 #include "xpcinlines.h"
--- a/js/src/xpconnect/src/xpcthrower.cpp
+++ b/js/src/xpconnect/src/xpcthrower.cpp
@@ -347,17 +347,16 @@ XPCThrower::ThrowCOMError(JSContext* cx,
                           nsresult rv, const EXCEPINFO * exception)
 {
     nsCAutoString msg;
     IErrorInfo * pError;
     const char * format;
     if(!nsXPCException::NameAndFormatForNSResult(rv, nsnull, &format))
         format = "";
     msg = format;
-#ifndef WINCE
     if(exception)
     {
         msg += static_cast<const char *>
                           (_bstr_t(exception->bstrSource, false));
         msg += " : ";
         msg.AppendInt(static_cast<PRUint32>(COMErrorCode));
         msg += " - ";
         msg += static_cast<const char *>
@@ -388,19 +387,12 @@ XPCThrower::ThrowCOMError(JSContext* cx,
         }
         else
         {
             // No error object, so just report the result
             msg += "COM Error Result = ";
             msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
         }
     }
-
-#else
-    // No error object, so just report the result
-    msg += "COM Error Result = ";
-    msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
-#endif
-
     XPCThrower::BuildAndThrowException(cx, rv, msg.get());
 }
 
 #endif