Backed out changeset e50e7d030a33 (bug 1180985)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 29 Jul 2015 15:26:12 +0200
changeset 286812 40c5f66980a9857223e059c826a1eba50731db33
parent 286811 edc5fdb6ea5bd6e4fdab884c5edc8f3448b84890
child 286813 90500c5ebface5c24378fcc9ea1d050dcdbd6f1b
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1180985
milestone42.0a1
backs oute50e7d030a339f3364d540bcd5ea2e92b6bebadd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e50e7d030a33 (bug 1180985)
js/src/gdb/moz.build
js/src/gdb/mozilla/GCCellPtr.py
js/src/gdb/mozilla/autoload.py
js/src/gdb/mozilla/prettyprinters.py
js/src/gdb/tests/test-GCCellPtr.cpp
js/src/gdb/tests/test-GCCellPtr.py
--- a/js/src/gdb/moz.build
+++ b/js/src/gdb/moz.build
@@ -4,17 +4,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 GeckoProgram('gdb-tests', linkage=None)
 
 UNIFIED_SOURCES += [
     'gdb-tests.cpp',
     'tests/test-asmjs.cpp',
-    'tests/test-GCCellPtr.cpp',
     'tests/test-Interpreter.cpp',
     'tests/test-jsid.cpp',
     'tests/test-JSObject.cpp',
     'tests/test-JSString.cpp',
     'tests/test-JSSymbol.cpp',
     'tests/test-jsval.cpp',
     'tests/test-prettyprinters.cpp',
     'tests/test-Root.cpp',
deleted file mode 100644
--- a/js/src/gdb/mozilla/GCCellPtr.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Pretty-printers for GCCellPtr values.
-
-import gdb
-import mozilla.prettyprinters
-
-from mozilla.prettyprinters import pretty_printer
-
-# Forget any printers from previous loads of this module.
-mozilla.prettyprinters.clear_module_printers(__name__)
-
-# Cache information about the JS::TraceKind type for this objfile.
-class GCCellPtrTypeCache(object):
-    def __init__(self, cache):
-        self.TraceKind_t = gdb.lookup_type('JS::TraceKind')
-
-        # Build a mapping from TraceKind enum values to the types they denote.
-        e = gdb.types.make_enum_dict(self.TraceKind_t)
-        kind_to_type = {}
-        def kind(k, t):
-            kind_to_type[e['JS::TraceKind::' + k]] = gdb.lookup_type(t)
-        kind('Object',      'JSObject')
-        kind('String',      'JSString')
-        kind('Symbol',      'JS::Symbol')
-        kind('Script',      'JSScript')
-        kind('Shape',       'js::Shape')
-        kind('ObjectGroup', 'js::ObjectGroup')
-        kind('BaseShape',   'js::BaseShape')
-        kind('JitCode',     'js::jit::JitCode')
-        kind('LazyScript',  'js::LazyScript')
-        self.kind_to_type = kind_to_type
-
-        self.Null = e['JS::TraceKind::Null']
-        self.mask = gdb.parse_and_eval('JS::OutOfLineTraceKindMask')
-
-@pretty_printer('JS::GCCellPtr')
-class GCCellPtr(object):
-    def __init__(self, value, cache):
-        self.value = value
-        if not cache.mod_GCCellPtr:
-            cache.mod_GCCellPtr = GCCellPtrTypeCache(cache)
-        self.cache = cache
-
-    def to_string(self):
-        ptr = self.value['ptr']
-        kind = ptr & self.cache.mod_GCCellPtr.mask
-        if kind == self.cache.mod_GCCellPtr.Null:
-            return "JS::GCCellPtr(nullptr)"
-        tipe = self.cache.mod_GCCellPtr.kind_to_type[int(kind)]
-        return "JS::GCCellPtr(({}*) {})".format(tipe, ptr.cast(self.cache.void_ptr_t))
--- a/js/src/gdb/mozilla/autoload.py
+++ b/js/src/gdb/mozilla/autoload.py
@@ -3,24 +3,23 @@
 print("Loading JavaScript value pretty-printers; see js/src/gdb/README.")
 print("If they cause trouble, type: disable pretty-printer .* SpiderMonkey")
 
 import gdb.printing
 import mozilla.prettyprinters
 
 # Import the pretty-printer modules. As a side effect, loading these
 # modules registers their printers with mozilla.prettyprinters.
-import mozilla.GCCellPtr
 import mozilla.Interpreter
+import mozilla.jsid
 import mozilla.JSObject
 import mozilla.JSString
 import mozilla.JSSymbol
+import mozilla.jsval
 import mozilla.Root
-import mozilla.jsid
-import mozilla.jsval
 
 # The user may have personal pretty-printers. Get those, too, if they exist.
 try:
     import my_mozilla_printers
 except ImportError:
     pass
 
 # Register our pretty-printers with |objfile|.
--- a/js/src/gdb/mozilla/prettyprinters.py
+++ b/js/src/gdb/mozilla/prettyprinters.py
@@ -174,21 +174,20 @@ class TypeCache(object):
         self.void_ptr_t = self.void_t.pointer()
         try:
             self.JSString_ptr_t = gdb.lookup_type('JSString').pointer()
             self.JSSymbol_ptr_t = gdb.lookup_type('JS::Symbol').pointer()
             self.JSObject_ptr_t = gdb.lookup_type('JSObject').pointer()
         except gdb.error:
             raise NotSpiderMonkeyObjfileError
 
-        self.mod_GCCellPtr = None
-        self.mod_Interpreter = None
+        self.mod_JSString = None
         self.mod_JSObject = None
-        self.mod_JSString = None
         self.mod_jsval = None
+        self.mod_Interpreter = None
 
 # Yield a series of all the types that |t| implements, by following typedefs
 # and iterating over base classes. Specifically:
 # - |t| itself is the first value yielded.
 # - If we yield a typedef, we later yield its definition.
 # - If we yield a type with base classes, we later yield those base classes.
 # - If we yield a type with some base classes that are typedefs,
 #   we yield all the type's base classes before following the typedefs.
deleted file mode 100644
--- a/js/src/gdb/tests/test-GCCellPtr.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "gdb-tests.h"
-#include "jsapi.h"
-
-#include "js/HeapAPI.h"
-
-FRAGMENT(GCCellPtr, simple) {
-  JS::GCCellPtr nulll(nullptr);
-
-  JS::Rooted<JSObject*> glob(cx, JS::CurrentGlobalOrNull(cx));
-  JS::Rooted<JSString*> empty(cx, JS_NewStringCopyN(cx, nullptr, 0));
-  JS::Rooted<Symbol*> unique(cx, NewSymbol(cx, nullptr));
-
-  JS::GCCellPtr object(glob.get());
-  JS::GCCellPtr string(empty.get());
-  JS::GCCellPtr symbol(unique.get());
-
-  breakpoint();
-
-  (void) nulll;
-  (void) object;
-  (void) string;
-  (void) symbol;
-}
deleted file mode 100644
--- a/js/src/gdb/tests/test-GCCellPtr.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Tests for GCCellPtr pretty-printing
-
-assert_subprinter_registered('SpiderMonkey', 'JS::GCCellPtr')
-
-run_fragment('GCCellPtr.simple')
-
-assert_pretty('nulll', 'JS::GCCellPtr(nullptr)')
-assert_pretty('object', 'JS::GCCellPtr((JSObject*) )')
-assert_pretty('string', 'JS::GCCellPtr((JSString*) )')
-assert_pretty('symbol', 'JS::GCCellPtr((JS::Symbol*) )')