Bug 879831, part 7 - Isolate the frontend. Make files outside the frontend include frontend/BytecodeCompiler.h or frontend/SourceNotes.h if possible; those two act as facades and do not include all the rest of the frontend headers. r=njn.
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 06 Jun 2013 22:49:17 -0500
changeset 146691 b252464d739e6f981bd4fe16aedf6e0395a2e5c7
parent 146690 9d940604f3be5fa1f035b492bfc5e27b34ad7725
child 146692 679350e2d6992d37b2a439182dba9e82c31d9f79
push id368
push userbbajaj@mozilla.com
push dateMon, 09 Sep 2013 22:57:58 +0000
treeherdermozilla-release@5a4f47ae1217 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs879831
milestone24.0a1
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
Bug 879831, part 7 - Isolate the frontend. Make files outside the frontend include frontend/BytecodeCompiler.h or frontend/SourceNotes.h if possible; those two act as facades and do not include all the rest of the frontend headers. r=njn.
js/src/builtin/Object.cpp
js/src/frontend/BytecodeCompiler.h
js/src/frontend/BytecodeEmitter-inl.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/frontend/FoldConstants.cpp
js/src/frontend/NameFunctions.cpp
js/src/frontend/ParseNode-inl.h
js/src/frontend/ParseNode.cpp
js/src/frontend/Parser-inl.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
js/src/gc/RootMarking.cpp
js/src/ion/ExecutionModeInlines.h
js/src/ion/IonBuilder.cpp
js/src/ion/MIRGraph.cpp
js/src/ion/VMFunctions.cpp
js/src/jsobj.cpp
js/src/jsopcode.cpp
js/src/jsprvtd.h
js/src/vm/Debugger.cpp
js/src/vm/GlobalObject.cpp
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Util.h"
 
 #include "jscntxt.h"
 #include "jsobj.h"
 
 #include "builtin/Object.h"
-#include "frontend/Parser.h"
+#include "frontend/BytecodeCompiler.h"
 #include "vm/StringBuffer.h"
 
 #include "jsfuninlines.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::types;
 
--- a/js/src/frontend/BytecodeCompiler.h
+++ b/js/src/frontend/BytecodeCompiler.h
@@ -23,12 +23,32 @@ bool
 CompileLazyFunction(JSContext *cx, HandleFunction fun, LazyScript *lazy,
                     const jschar *chars, size_t length);
 
 bool
 CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, CompileOptions options,
                     const AutoNameVector &formals, const jschar *chars, size_t length,
                     bool isAsmJSRecompile = false);
 
+/*
+ * True if str consists of an IdentifierStart character, followed by one or
+ * more IdentifierPart characters, i.e. it matches the IdentifierName production
+ * in the language spec.
+ *
+ * This returns true even if str is a keyword like "if".
+ *
+ * Defined in TokenStream.cpp.
+ */
+bool
+IsIdentifier(JSLinearString *str);
+
+/* True if str is a keyword. Defined in TokenStream.cpp. */
+bool
+IsKeyword(JSLinearString *str);
+
+/* GC marking. Defined in Parser.cpp. */
+void
+MarkParser(JSTracer *trc, AutoGCRooter *parser);
+
 } /* namespace frontend */
 } /* namespace js */
 
 #endif /* BytecodeCompiler_h__ */
new file mode 100644
--- /dev/null
+++ b/js/src/frontend/BytecodeEmitter-inl.h
@@ -0,0 +1,25 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+#ifndef BytecodeEmitter_inl_h__
+#define BytecodeEmitter_inl_h__
+
+#include "frontend/BytecodeEmitter.h"
+#include "frontend/Parser.h"
+
+namespace js {
+namespace frontend {
+
+inline TokenStream *
+BytecodeEmitter::tokenStream()
+{
+    return &parser->tokenStream;
+}
+
+} // namespace frontend
+} // namespace js
+
+#endif // BytecodeEmitter_inl_h__
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3,16 +3,18 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 /*
  * JS bytecode generation.
  */
 
+#include "frontend/BytecodeEmitter-inl.h"
+
 #include "mozilla/DebugOnly.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
 
 #ifdef HAVE_MEMORY_H
 #include <memory.h>
 #endif
 #include <string.h>
@@ -26,17 +28,16 @@
 #include "jsversion.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 #include "jsautooplen.h"        // generated headers last
 
 #include "ds/LifoAlloc.h"
-#include "frontend/BytecodeEmitter.h"
 #include "frontend/Parser.h"
 #include "frontend/TokenStream.h"
 #include "ion/AsmJS.h"
 #include "vm/Debugger.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -10,18 +10,16 @@
 /*
  * JS bytecode generation.
  */
 #include "jsatom.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 #include "jspubtd.h"
 
-#include "frontend/BytecodeCompiler.h"
-#include "frontend/Parser.h"
 #include "frontend/ParseMaps.h"
 #include "frontend/SharedContext.h"
 #include "frontend/SourceNotes.h"
 
 #include "vm/ScopeObject.h"
 
 namespace js {
 namespace frontend {
@@ -179,17 +177,17 @@ struct BytecodeEmitter
 
     bool isInLoop();
     bool checkSingletonContext();
 
     bool needsImplicitThis();
 
     void tellDebuggerAboutCompiledScript(JSContext *cx);
 
-    TokenStream *tokenStream() { return &parser->tokenStream; }
+    inline TokenStream *tokenStream();
 
     BytecodeVector &code() const { return current->code; }
     jsbytecode *code(ptrdiff_t offset) const { return current->code.begin() + offset; }
     ptrdiff_t offset() const { return current->code.end() - current->code.begin(); }
     ptrdiff_t prologOffset() const { return prolog.code.end() - prolog.code.begin(); }
     void switchToMain() { current = &main; }
     void switchToProlog() { current = &prolog; }
 
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -106,17 +106,17 @@ FoldType(JSContext *cx, ParseNode *pn, P
 
 /*
  * Fold two numeric constants.  Beware that pn1 and pn2 are recycled, unless
  * one of them aliases pn, so you can't safely fetch pn2->pn_next, e.g., after
  * a successful call to this function.
  */
 static bool
 FoldBinaryNumeric(JSContext *cx, JSOp op, ParseNode *pn1, ParseNode *pn2,
-                  ParseNode *pn, Parser<FullParseHandler> *parser)
+                  ParseNode *pn)
 {
     double d, d2;
     int32_t i, j;
 
     JS_ASSERT(pn1->isKind(PNK_NUMBER) && pn2->isKind(PNK_NUMBER));
     d = pn1->pn_dval;
     d2 = pn2->pn_dval;
     switch (op) {
@@ -618,32 +618,32 @@ FoldConstants<FullParseHandler>(JSContex
                 if (!pn2->isKind(PNK_NUMBER))
                     break;
             }
             if (!pn2) {
                 JSOp op = pn->getOp();
 
                 pn2 = pn1->pn_next;
                 pn3 = pn2->pn_next;
-                if (!FoldBinaryNumeric(cx, op, pn1, pn2, pn, parser))
+                if (!FoldBinaryNumeric(cx, op, pn1, pn2, pn))
                     return false;
                 while ((pn2 = pn3) != NULL) {
                     pn3 = pn2->pn_next;
-                    if (!FoldBinaryNumeric(cx, op, pn, pn2, pn, parser))
+                    if (!FoldBinaryNumeric(cx, op, pn, pn2, pn))
                         return false;
                 }
             }
         } else {
             JS_ASSERT(pn->isArity(PN_BINARY));
             if (!FoldType(cx, pn1, PNK_NUMBER) ||
                 !FoldType(cx, pn2, PNK_NUMBER)) {
                 return false;
             }
             if (pn1->isKind(PNK_NUMBER) && pn2->isKind(PNK_NUMBER)) {
-                if (!FoldBinaryNumeric(cx, pn->getOp(), pn1, pn2, pn, parser))
+                if (!FoldBinaryNumeric(cx, pn->getOp(), pn1, pn2, pn))
                     return false;
             }
         }
         break;
 
       case PNK_TYPEOF:
       case PNK_VOID:
       case PNK_NOT:
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -1,20 +1,21 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #include "frontend/NameFunctions.h"
-#include "frontend/ParseNode.h"
-#include "frontend/SharedContext.h"
 
 #include "jsfun.h"
 #include "jsprf.h"
+#include "frontend/BytecodeCompiler.h"
+#include "frontend/ParseNode.h"
+#include "frontend/SharedContext.h"
 
 #include "vm/String-inl.h"
 #include "vm/StringBuffer.h"
 
 using namespace js;
 using namespace js::frontend;
 
 class NameResolver
--- a/js/src/frontend/ParseNode-inl.h
+++ b/js/src/frontend/ParseNode-inl.h
@@ -2,18 +2,18 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef ParseNode_inl_h__
 #define ParseNode_inl_h__
 
-#include "frontend/Parser.h"
 #include "frontend/ParseNode.h"
+#include "frontend/SharedContext.h"
 
 namespace js {
 namespace frontend {
 
 inline bool
 UpvarCookie::set(JSContext *cx, unsigned newLevel, uint16_t newSlot)
 {
     // This is an unsigned-to-uint16_t conversion, test for too-high values.
@@ -39,23 +39,12 @@ ParseNode::name() const
 
 inline JSAtom *
 ParseNode::atom() const
 {
     JS_ASSERT(isKind(PNK_MODULE) || isKind(PNK_STRING));
     return isKind(PNK_MODULE) ? pn_modulebox->module()->atom() : pn_atom;
 }
 
-inline void
-NameNode::initCommon(ParseContext<FullParseHandler> *pc)
-{
-    pn_expr = NULL;
-    pn_cookie.makeFree();
-    pn_dflags = (!pc->topStmt || pc->topStmt->type == STMT_BLOCK)
-                ? PND_BLOCKCHILD
-                : 0;
-    pn_blockid = pc->blockid();
-}
-
 } /* namespace frontend */
 } /* namespace js */
 
 #endif /* ParseNode_inl_h__ */
--- a/js/src/frontend/ParseNode.cpp
+++ b/js/src/frontend/ParseNode.cpp
@@ -341,16 +341,27 @@ ParseNode::newBinaryOrAppend(ParseNodeKi
         left->pn_pos.end = right->pn_pos.end;
         handler->freeTree(right);
         return left;
     }
 
     return handler->new_<BinaryNode>(kind, op, left, right);
 }
 
+inline void
+NameNode::initCommon(ParseContext<FullParseHandler> *pc)
+{
+    pn_expr = NULL;
+    pn_cookie.makeFree();
+    pn_dflags = (!pc->topStmt || pc->topStmt->type == STMT_BLOCK)
+                ? PND_BLOCKCHILD
+                : 0;
+    pn_blockid = pc->blockid();
+}
+
 // Note: the parse context passed into this may not equal the associated
 // parser's current context.
 NameNode *
 NameNode::create(ParseNodeKind kind, JSAtom *atom, FullParseHandler *handler,
                  ParseContext<FullParseHandler> *pc)
 {
     ParseNode *pn = ParseNode::create(kind, PN_NAME, handler);
     if (pn) {
--- a/js/src/frontend/Parser-inl.h
+++ b/js/src/frontend/Parser-inl.h
@@ -2,16 +2,17 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef Parser_inl_h__
 #define Parser_inl_h__
 
+#include "frontend/BytecodeCompiler.h"
 #include "frontend/Parser.h"
 
 #include "frontend/SharedContext-inl.h"
 
 namespace js {
 namespace frontend {
 
 template <typename ParseHandler>
@@ -99,20 +100,17 @@ ParseContext<ParseHandler>::~ParseContex
 template <typename ParseHandler>
 static bool
 CheckStrictBinding(JSContext *cx, ParseHandler *handler, ParseContext<ParseHandler> *pc,
                    HandlePropertyName name, ParseNode *pn)
 {
     if (!pc->sc->needStrictChecks())
         return true;
 
-    if (name == cx->names().eval ||
-        name == cx->names().arguments ||
-        FindKeyword(name->charsZ(), name->length()))
-    {
+    if (name == cx->names().eval || name == cx->names().arguments || IsKeyword(name)) {
         JSAutoByteString bytes;
         if (!js_AtomToPrintableString(cx, name, &bytes))
             return false;
         return handler->report(ParseStrictError, pn, JSMSG_BAD_BINDING, bytes.ptr());
     }
 
     return true;
 }
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -34,19 +34,19 @@
 #include "jsiter.h"
 #include "jslock.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 #include "jsstr.h"
 
+#include "frontend/BytecodeCompiler.h"
 #include "frontend/FoldConstants.h"
 #include "frontend/ParseMaps.h"
-#include "frontend/Parser.h"
 #include "frontend/TokenStream.h"
 #include "gc/Marking.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
 #include "jsscriptinlines.h"
 
@@ -592,16 +592,22 @@ Parser<FullParseHandler>::newModuleBox(M
 
 template <typename ParseHandler>
 void
 Parser<ParseHandler>::trace(JSTracer *trc)
 {
     traceListHead->trace(trc);
 }
 
+void
+MarkParser(JSTracer *trc, AutoGCRooter *parser)
+{
+    static_cast<Parser<FullParseHandler> *>(parser)->trace(trc);
+}
+
 /*
  * Parse a top-level JS script.
  */
 template <typename ParseHandler>
 typename ParseHandler::Node
 Parser<ParseHandler>::parse(JSObject *chain)
 {
     /*
@@ -825,20 +831,17 @@ Parser<ParseHandler>::checkStrictAssignm
  */
 template <typename ParseHandler>
 bool
 Parser<ParseHandler>::checkStrictBinding(HandlePropertyName name, Node pn)
 {
     if (!pc->sc->needStrictChecks())
         return true;
 
-    if (name == context->names().eval ||
-        name == context->names().arguments ||
-        FindKeyword(name->charsZ(), name->length()))
-    {
+    if (name == context->names().eval || name == context->names().arguments || IsKeyword(name)) {
         JSAutoByteString bytes;
         if (!js_AtomToPrintableString(context, name, &bytes))
             return false;
         return report(ParseStrictError, pc->sc->strict, pn,
                       JSMSG_BAD_BINDING, bytes.ptr());
     }
 
     return true;
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -12,17 +12,17 @@
  */
 #include "jsversion.h"
 #include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsatom.h"
 #include "jsscript.h"
 #include "jswin.h"
 
-#include "frontend/FoldConstants.h"
+#include "frontend/BytecodeCompiler.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseMaps.h"
 #include "frontend/ParseNode.h"
 #include "frontend/SharedContext.h"
 #include "frontend/SyntaxParseHandler.h"
 
 namespace js {
 namespace frontend {
@@ -324,17 +324,17 @@ struct Parser : private AutoGCRooter, pu
                           ...);
 
     Parser(JSContext *cx, const CompileOptions &options,
            const jschar *chars, size_t length, bool foldConstants,
            Parser<SyntaxParseHandler> *syntaxParser,
            LazyScript *lazyOuterFunction);
     ~Parser();
 
-    friend void AutoGCRooter::trace(JSTracer *trc);
+    friend void js::frontend::MarkParser(JSTracer *trc, AutoGCRooter *parser);
 
     const char *getFilename() const { return tokenStream.getFilename(); }
     JSVersion versionNumber() const { return tokenStream.versionNumber(); }
 
     /*
      * Parse a top-level JS script.
      */
     Node parse(JSObject *chain);
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -27,16 +27,17 @@
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsversion.h"
 #include "jsexn.h"
 #include "jsnum.h"
 #include "jsopcode.h"
 #include "jsscript.h"
 
+#include "frontend/BytecodeCompiler.h"
 #include "frontend/Parser.h"
 #include "frontend/TokenStream.h"
 #include "js/CharacterEncoding.h"
 #include "vm/Keywords.h"
 #include "vm/RegExpObject.h"
 #include "vm/StringBuffer.h"
 
 #include "jsscriptinlines.h"
@@ -44,30 +45,41 @@
 using namespace js;
 using namespace js::frontend;
 using namespace js::unicode;
 
 using mozilla::PodAssign;
 using mozilla::PodCopy;
 using mozilla::PodZero;
 
+struct KeywordInfo {
+    const char  *chars;         /* C string with keyword text */
+    TokenKind   tokentype;
+    JSOp        op;             /* JSOp */
+    JSVersion   version;        /* JSVersion */
+};
+
 static const KeywordInfo keywords[] = {
 #define KEYWORD_INFO(keyword, name, type, op, version) \
     {js_##keyword##_str, type, op, version},
     FOR_EACH_JAVASCRIPT_KEYWORD(KEYWORD_INFO)
 #undef KEYWORD_INFO
 };
 
-const KeywordInfo *
-frontend::FindKeyword(const jschar *s, size_t length)
+/*
+ * Returns a KeywordInfo for the specified characters, or NULL if the string is
+ * not a keyword.
+ */
+static const KeywordInfo *
+FindKeyword(const jschar *s, size_t length)
 {
     JS_ASSERT(length != 0);
 
     register size_t i;
-    const struct KeywordInfo *kw;
+    const KeywordInfo *kw;
     const char *chars;
 
 #define JSKW_LENGTH()           length
 #define JSKW_AT(column)         s[column]
 #define JSKW_GOT_MATCH(index)   i = (index); goto got_match;
 #define JSKW_TEST_GUESS(index)  i = (index); goto test_guess;
 #define JSKW_NO_MATCH()         goto no_match;
 #include "jsautokw.h"
@@ -108,16 +120,22 @@ frontend::IsIdentifier(JSLinearString *s
     while (++chars != end) {
         c = *chars;
         if (!IsIdentifierPart(c))
             return false;
     }
     return true;
 }
 
+bool
+frontend::IsKeyword(JSLinearString *str)
+{
+    return FindKeyword(str->chars(), str->length()) != NULL;
+}
+
 TokenStream::SourceCoords::SourceCoords(JSContext *cx, uint32_t ln)
   : lineStartOffsets_(cx), initialLineNum_(ln), lastLineIndex_(0)
 {
     // This is actually necessary!  Removing it causes compile errors on
     // GCC and clang.  You could try declaring this:
     //
     //   const uint32_t TokenStream::SourceCoords::MAX_PTR;
     //
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -934,37 +934,16 @@ class MOZ_STACK_CLASS TokenStream
      */
     SkipRoot            tokenSkip;
 
     // Bug 846011
     SkipRoot            linebaseSkip;
     SkipRoot            prevLinebaseSkip;
 };
 
-struct KeywordInfo {
-    const char  *chars;         /* C string with keyword text */
-    TokenKind   tokentype;
-    JSOp        op;             /* JSOp */
-    JSVersion   version;        /* JSVersion */
-};
-
-/*
- * Returns a KeywordInfo for the specified characters, or NULL if the string is
- * not a keyword.
- */
-const KeywordInfo *
-FindKeyword(const jschar *s, size_t length);
-
-/*
- * Check that str forms a valid JS identifier name. The function does not
- * check if str is a JS keyword.
- */
-bool
-IsIdentifier(JSLinearString *str);
-
 /*
  * Steal one JSREPORT_* bit (see jsapi.h) to tell that arguments to the error
  * message have const jschar* type, not const char*.
  */
 #define JSREPORT_UC 0x100
 
 } /* namespace frontend */
 } /* namespace js */
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -11,17 +11,17 @@
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsonparser.h"
 #include "jsprf.h"
 #include "jswatchpoint.h"
 
 #include "builtin/MapObject.h"
-#include "frontend/Parser.h"
+#include "frontend/BytecodeCompiler.h"
 #include "gc/GCInternals.h"
 #include "gc/Marking.h"
 #ifdef JS_ION
 # include "ion/IonMacroAssembler.h"
 # include "ion/IonFrameIterator.h"
 #endif
 #include "js/HashTable.h"
 #include "vm/Debugger.h"
@@ -383,17 +383,17 @@ JS::AutoIdArray::trace(JSTracer *trc)
     gc::MarkIdRange(trc, idArray->length, idArray->vector, "JSAutoIdArray.idArray");
 }
 
 inline void
 AutoGCRooter::trace(JSTracer *trc)
 {
     switch (tag_) {
       case PARSER:
-        static_cast<frontend::Parser<frontend::FullParseHandler> *>(this)->trace(trc);
+        frontend::MarkParser(trc, this);
         return;
 
       case IDARRAY: {
         JSIdArray *ida = static_cast<AutoIdArray *>(this)->idArray;
         MarkIdRange(trc, ida->length, ida->vector, "JS::AutoIdArray.idArray");
         return;
       }
 
--- a/js/src/ion/ExecutionModeInlines.h
+++ b/js/src/ion/ExecutionModeInlines.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#if !defined(jsion_compilemode_h__) && defined(JS_ION)
-#define jsion_compilemode_h__
+#if !defined(jsion_executionmodeinlines_h__) && defined(JS_ION)
+#define jsion_executionmodeinlines_h__
 
 namespace js {
 namespace ion {
 
 static inline bool
 HasIonScript(JSScript *script, ExecutionMode cmode)
 {
     switch (cmode) {
@@ -100,9 +100,9 @@ CompilerOutputKind(ExecutionMode cmode)
     }
     JS_NOT_REACHED("No such execution mode");
     return types::CompilerOutput::Ion;
 }
 
 }
 }
 
-#endif
+#endif  // jsion_executionmodeinlines_h__
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -1,26 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
+#include "ion/IonBuilder.h"
+
 #include "mozilla/DebugOnly.h"
 
-#include "IonAnalysis.h"
-#include "IonBuilder.h"
-#include "Lowering.h"
-#include "MIRGraph.h"
-#include "Ion.h"
-#include "IonAnalysis.h"
-#include "IonSpewer.h"
-#include "BaselineInspector.h"
 #include "builtin/Eval.h"
-#include "frontend/BytecodeEmitter.h"
+#include "frontend/SourceNotes.h"
+#include "ion/BaselineInspector.h"
+#include "ion/Ion.h"
+#include "ion/IonAnalysis.h"
+#include "ion/IonAnalysis.h"
+#include "ion/IonSpewer.h"
+#include "ion/Lowering.h"
+#include "ion/MIRGraph.h"
 
 #include "CompileInfo-inl.h"
 #include "ExecutionModeInlines.h"
 #include "jsanalyzeinlines.h"
 #include "jsscriptinlines.h"
 #include "jstypedarrayinlines.h"
 
 #ifdef JS_THREADSAFE
--- a/js/src/ion/MIRGraph.cpp
+++ b/js/src/ion/MIRGraph.cpp
@@ -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/. */
 
 #include "Ion.h"
 #include "IonSpewer.h"
 #include "MIR.h"
 #include "MIRGraph.h"
 #include "IonBuilder.h"
-#include "frontend/BytecodeEmitter.h"
 #include "jsscriptinlines.h"
 
 using namespace js;
 using namespace js::ion;
 
 MIRGenerator::MIRGenerator(JSCompartment *compartment,
                            TempAllocator *temp, MIRGraph *graph, CompileInfo *info)
   : compartment(compartment),
--- a/js/src/ion/VMFunctions.cpp
+++ b/js/src/ion/VMFunctions.cpp
@@ -11,17 +11,17 @@
 #include "ion/IonFrames.h"
 
 #include "vm/Debugger.h"
 #include "vm/Interpreter.h"
 #include "vm/StringObject-inl.h"
 
 #include "builtin/ParallelArray.h"
 
-#include "frontend/TokenStream.h"
+#include "frontend/BytecodeCompiler.h"
 
 #include "jsboolinlines.h"
 
 #include "ion/IonFrames-inl.h" // for GetTopIonJSScript
 
 #include "vm/Interpreter-inl.h"
 #include "vm/StringObject-inl.h"
 
@@ -531,17 +531,17 @@ GetDynamicName(JSContext *cx, JSObject *
     } else {
         atom = AtomizeString<NoGC>(cx, str);
         if (!atom) {
             vp->setUndefined();
             return;
         }
     }
 
-    if (!frontend::IsIdentifier(atom) || frontend::FindKeyword(atom->chars(), atom->length())) {
+    if (!frontend::IsIdentifier(atom) || frontend::IsKeyword(atom)) {
         vp->setUndefined();
         return;
     }
 
     Shape *shape = NULL;
     JSObject *scope = NULL, *pobj = NULL;
     if (LookupNameNoGC(cx, atom->asPropertyName(), scopeChain, &scope, &pobj, &shape)) {
         if (FetchNameNoGC(pobj, shape, MutableHandleValue::fromMarkedLocation(vp)))
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -28,17 +28,17 @@
 #include "jsopcode.h"
 #include "jsprototypes.h"
 #include "jsproxy.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jsdbgapi.h"
 #include "jswatchpoint.h"
 #include "jswrapper.h"
-#include "frontend/TokenStream.h"
+#include "frontend/BytecodeCompiler.h"
 #include "gc/Marking.h"
 #include "ion/BaselineJIT.h"
 #include "js/MemoryMetrics.h"
 #include "vm/Interpreter.h"
 #include "vm/Shape.h"
 
 #include "jsatominlines.h"
 #include "jsboolinlines.h"
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -23,18 +23,18 @@
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsscript.h"
 #include "jsstr.h"
 
-#include "frontend/BytecodeEmitter.h"
-#include "frontend/TokenStream.h"
+#include "frontend/BytecodeCompiler.h"
+#include "frontend/SourceNotes.h"
 #include "js/CharacterEncoding.h"
 #include "vm/Shape.h"
 #include "vm/StringBuffer.h"
 
 #include "jscntxtinlines.h"
 #include "jsobjinlines.h"
 #include "jsopcodeinlines.h"
 
--- a/js/src/jsprvtd.h
+++ b/js/src/jsprvtd.h
@@ -142,16 +142,17 @@ typedef JSStrictPropertyOp   StrictPrope
 typedef JSPropertyDescriptor PropertyDescriptor;
 
 struct SourceCompressionToken;
 
 namespace frontend {
 
 struct BytecodeEmitter;
 struct Definition;
+class FullParseHandler;
 class FunctionBox;
 class ObjectBox;
 struct Token;
 struct TokenPos;
 class TokenStream;
 class ParseMapPool;
 struct ParseNode;
 
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -11,17 +11,16 @@
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jswrapper.h"
 
 #include "frontend/BytecodeCompiler.h"
-#include "frontend/BytecodeEmitter.h"
 #include "gc/Marking.h"
 #include "ion/BaselineJIT.h"
 #include "js/Vector.h"
 
 #include "jsgcinlines.h"
 #include "jsobjinlines.h"
 #include "jsopcodeinlines.h"
 #include "gc/FindSCCs-inl.h"
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -14,17 +14,16 @@
 #include "json.h"
 #include "jsweakmap.h"
 
 #include "builtin/Eval.h"
 #include "builtin/Intl.h"
 #include "builtin/MapObject.h"
 #include "builtin/Object.h"
 #include "builtin/RegExp.h"
-#include "frontend/BytecodeEmitter.h"
 
 #include "jsobjinlines.h"
 
 #include "vm/GlobalObject-inl.h"
 #include "vm/RegExpObject-inl.h"
 #include "vm/RegExpStatics-inl.h"
 
 using namespace js;