Bug 1069416 - Part 4: Remove JS_HAS_SYMBOLS support from make_opcode_doc.py. r=Waldo
authorTooru Fujisawa <arai_a@mac.com>
Wed, 28 Jan 2015 13:06:37 +0900
changeset 239553 5af5deffe0cfaafdd92e4a29e6165f43303743d2
parent 239552 ff4b721149af17ada758f1300359ca1c3af5025d
child 239554 670fb41e2cc46ee2f98fcd372da54308b152319f
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewersWaldo
bugs1069416
milestone38.0a1
Bug 1069416 - Part 4: Remove JS_HAS_SYMBOLS support from make_opcode_doc.py. r=Waldo
js/src/vm/make_opcode_doc.py
--- a/js/src/vm/make_opcode_doc.py
+++ b/js/src/vm/make_opcode_doc.py
@@ -19,40 +19,31 @@ SOURCE_BASE = 'http://mxr.mozilla.org/mo
 
 def error(message):
     print("Error: {message}".format(message=message), file=sys.stderr)
     sys.exit(1)
 
 def get_xdr_version(dir):
     subtrahend_pat = re.compile('XDR_BYTECODE_VERSION_SUBTRAHEND\s*=\s*(\d+);', re.S)
     version_expr_pat = re.compile('XDR_BYTECODE_VERSION\s*=\s*uint32_t\(0xb973c0de\s*-\s*(.+?)\);', re.S)
-    # FIXME: Bug 1066322 - Enable ES6 symbols in all builds.
-    bug1066322_pat = re.compile('#ifdef\s+JS_HAS_SYMBOLS\s+\+\s*1*\s+#endif', re.S)
 
     with open('{dir}/js/src/vm/Xdr.h'.format(dir=dir), 'r') as f:
         data = f.read()
 
     m = subtrahend_pat.search(data)
     if not m:
         error('XDR_BYTECODE_VERSION_SUBTRAHEND is not recognized.')
 
     subtrahend = int(m.group(1))
 
     m = version_expr_pat.search(data)
     if not m:
         error('XDR_BYTECODE_VERSION is not recognized.')
 
-    version_expr = m.group(1)
-
-    bug1066322 = False
-    m = bug1066322_pat.search(version_expr)
-    if m:
-        bug1066322 = True
-
-    return (subtrahend, bug1066322)
+    return subtrahend
 
 quoted_pat = re.compile(r"([^A-Za-z0-9]|^)'([^']+)'")
 js_pat = re.compile(r"([^A-Za-z0-9]|^)(JS[A-Z0-9_\*]+)")
 def codify(text):
     text = re.sub(quoted_pat, '\\1<code>\\2</code>', text)
     text = re.sub(js_pat, '\\1<code>\\2</code>', text)
 
     return text
@@ -337,39 +328,30 @@ def print_opcode(opcode):
                                   opcode.length_override)),
            stack_uses=escape(opcode.stack_uses),
            stack_defs=escape(opcode.stack_defs),
            desc=opcode.desc)) # desc is already escaped
 
 def make_element_id(name):
     return name.replace(' ', '-')
 
-def print_doc(version, bug1066322, index):
+def print_doc(version, index):
     print("""<h2 id="Bytecode_Listing">Bytecode Listing</h2>
 
 <p>This document is automatically generated from
 <a href="{source_base}/js/src/vm/Opcodes.h">Opcodes.h</a> and
 <a href="{source_base}/js/src/vm/Xdr.h">Xdr.h</a> by
 <a href="{source_base}/js/src/vm/make_opcode_doc.py">make_opcode_doc.py</a>.</p>
 
 <p>Bytecode version: <code>{version}</code>
 (<code>0x{actual_version:08x}</code>).</p>
 """.format(source_base=SOURCE_BASE,
            version=version,
            actual_version=0xb973c0de - version))
 
-    if bug1066322:
-        symbol_version = version + 1
-        print("""
-<p>Until {{{{bug(1066322)}}}} is fixed, JSOP_SYMBOL exists only in Nightly, and it uses different version.</p>
-<p>Bytecode version with JSOP_SYMBOL: <code>{version}</code>
-(<code>0x{actual_version:08x}</code>).</p>
-""".format(version=symbol_version,
-           actual_version=0xb973c0de - symbol_version))
-
     for (category_name, types) in index:
         print('<h3 id="{id}">{name}</h3>'.format(name=category_name,
                                                  id=make_element_id(category_name)))
         for (type_name, opcodes) in types:
             if type_name:
                 print('<h4 id="{id}">{name}</h4>'.format(name=type_name,
                                                          id=make_element_id(type_name)))
             print('<dl>')
@@ -379,11 +361,11 @@ def print_doc(version, bug1066322, index
             print('</dl>')
 
 if __name__ == '__main__':
     if len(sys.argv) < 2:
         print("Usage: make_opcode_doc.py PATH_TO_MOZILLA_CENTRAL",
               file=sys.stderr)
         sys.exit(1)
     dir = sys.argv[1]
-    (version, bug1066322) = get_xdr_version(dir)
+    version = get_xdr_version(dir)
     index = get_opcodes(dir)
-    print_doc(version, bug1066322, index)
+    print_doc(version, index)