Back out 9712dc86183e (bug 787703) for Windows PGO bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 29 Oct 2012 20:37:02 -0700
changeset 116472 97c6c326435e9066baf457c7a39db188a2fb0bb5
parent 116471 3357927c7aca226d5979f5edb82069f4d14565e0
child 116473 7d89cb78c6df02fb238db0ff9e0566c405ff56bb
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs787703
milestone18.0a2
backs out9712dc86183e2b0a4d9914dd1a0cdaabc849423a
Back out 9712dc86183e (bug 787703) for Windows PGO bustage on a=CLOSED TREE
js/src/gc/Root.h
js/src/jspubtd.h
--- a/js/src/gc/Root.h
+++ b/js/src/gc/Root.h
@@ -327,44 +327,16 @@ struct RootKind<T *> { static ThingRootK
 template <typename T>
 struct RootMethods<T *>
 {
     static T *initial() { return NULL; }
     static ThingRootKind kind() { return RootKind<T *>::rootKind(); }
     static bool poisoned(T *v) { return IsPoisonedPtr(v); }
 };
 
-#if !defined(JSGC_ROOT_ANALYSIS) && !defined(JSGC_USE_EXACT_ROOTING)
-template <typename T>
-struct RootSink {
-    static inline void dispose(const T &) {}
-};
-
-/*
- * The *alleged* killer whale hack (see JS::Anchor<T> in jsapi.h) duplicated
- * here because using JS::Anchor causes clang to emit bad instructions.
- *
- * In exact-gc builds, Rooted<T> always keeps the T reachable. In non-exact-gc
- * builds, it does not, but conservative scanning usually picks up the slack.
- * However in the case where the Rooted pointer is no longer used, but some
- * subobject or malloc'd memory with the same lifetime may be used,
- * conservative scanning can fail. JSStableString's chars() method makes it
- * particularly attractive to use that way, so we use some voodoo to convince
- * the compiler to keep the string pointer on the stack for the full lifetime
- * of the Rooted<JSStableString *>.
- */
-template <>
-struct RootSink<JSStableString *> {
-    static void dispose(JSStableString *ptr) {
-        JSStableString * volatile sink;
-        sink = ptr;
-    }
-};
-#endif
-
 template <typename T>
 class RootedBase {};
 
 /*
  * Local variable of type T whose value is always rooted. This is typically
  * used for local variables, or for non-rooted values being passed to a
  * function that requires a handle, e.g. Foo(Root<T>(cx, x)).
  *
@@ -435,18 +407,16 @@ class Rooted : public RootedBase<T>
         init(cx);
     }
 
     ~Rooted()
     {
 #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING)
         JS_ASSERT(*stack == this);
         *stack = prev;
-#else
-        RootSink<T>::dispose(ptr);
 #endif
     }
 
 #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING)
     Rooted<T> *previous() { return prev; }
 #endif
 
     operator T () const { return ptr; }
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -198,17 +198,16 @@ typedef struct JSStackFrame             
 typedef struct JSScript          JSScript;
 typedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;
 typedef struct JSStructuredCloneReader      JSStructuredCloneReader;
 typedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;
 typedef struct JSTracer                     JSTracer;
 
 #ifdef __cplusplus
 class                                       JSFlatString;
-class                                       JSStableString;  // long story
 class                                       JSString;
 #else
 typedef struct JSFlatString                 JSFlatString;
 typedef struct JSString                     JSString;
 #endif /* !__cplusplus */
 
 #ifdef JS_THREADSAFE
 typedef struct PRCallOnceType    JSCallOnceType;