Renamed BytecodeAnalyzer to IonBuilder.
authorDavid Anderson <danderson@mozilla.com>
Wed, 18 May 2011 15:57:34 -0700
changeset 104797 e39539c471e4c24d56c6d59440e0be34a347f226
parent 104796 e156b3dff7c6f1acb9545b0928f894e83068074f
child 104798 4c2438684d08a68cf626037b6b80ce6aec11fff7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
milestone6.0a1
Renamed BytecodeAnalyzer to IonBuilder.
js/src/Makefile.in
js/src/ion/BytecodeAnalyzer.cpp
js/src/ion/BytecodeAnalyzer.h
js/src/ion/IonBuilder.cpp
js/src/ion/IonBuilder.h
js/src/ion/IonSpew.cpp
js/src/ion/MIR.h
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -362,17 +362,17 @@ CPPSRCS += 	MethodJIT.cpp \
 		Retcon.cpp \
 		TrampolineCompiler.cpp \
 		$(NULL)
 
 # Ion
 VPATH +=	$(srcdir)/ion
 
 CPPSRCS +=	MIR.cpp \
-		BytecodeAnalyzer.cpp \
+		IonBuilder.cpp \
 		IonSpew.cpp \
 		MIRGraph.cpp \
 		$(NULL)
 
 ifeq (86, $(findstring 86,$(TARGET_CPU)))
 ifeq (x86_64, $(TARGET_CPU))
 ifdef _MSC_VER
 ASFILES +=	TrampolineMasmX64.asm
rename from js/src/ion/BytecodeAnalyzer.cpp
rename to js/src/ion/IonBuilder.cpp
--- a/js/src/ion/BytecodeAnalyzer.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -34,17 +34,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "BytecodeAnalyzer.h"
+#include "IonBuilder.h"
 #include "MIRGraph.h"
 #include "Ion.h"
 #include "IonSpew.h"
 #include "jsemit.h"
 #include "jsscriptinlines.h"
 
 using namespace js;
 using namespace js::ion;
@@ -53,28 +53,28 @@ bool
 ion::Go(JSContext *cx, JSScript *script, StackFrame *fp)
 {
     TempAllocator temp(&cx->tempPool);
 
     JSFunction *fun = fp->isFunctionFrame() ? fp->fun() : NULL;
 
     MIRGraph graph(cx);
     C1Spewer spew(graph, script);
-    BytecodeAnalyzer analyzer(cx, script, fun, temp, graph);
+    IonBuilder analyzer(cx, script, fun, temp, graph);
     spew.enable("/tmp/ion.cfg");
 
     if (!analyzer.analyze())
         return false;
 
     spew.spew("Building SSA");
 
     return false;
 }
 
-BytecodeAnalyzer::BytecodeAnalyzer(JSContext *cx, JSScript *script, JSFunction *fun, TempAllocator &temp,
+IonBuilder::IonBuilder(JSContext *cx, JSScript *script, JSFunction *fun, TempAllocator &temp,
                                    MIRGraph &graph)
   : MIRGenerator(cx, temp, script, fun, graph),
     cfgStack_(TempAllocPolicy(cx)),
     loops_(TempAllocPolicy(cx))
 {
     pc = script->code;
     atoms = script->atomMap.vector;
 }
@@ -92,33 +92,33 @@ GetJumpOffset(jsbytecode *pc)
 
 static inline jsbytecode *
 GetNextPc(jsbytecode *pc)
 {
     return pc + js_CodeSpec[JSOp(*pc)].length;
 }
 
 uint32
-BytecodeAnalyzer::readIndex(jsbytecode *pc)
+IonBuilder::readIndex(jsbytecode *pc)
 {
     return (atoms - script->atomMap.vector) + GET_INDEX(pc);
 }
 
-BytecodeAnalyzer::CFGState
-BytecodeAnalyzer::CFGState::If(jsbytecode *join, MBasicBlock *ifFalse)
+IonBuilder::CFGState
+IonBuilder::CFGState::If(jsbytecode *join, MBasicBlock *ifFalse)
 {
     CFGState state;
     state.state = IF_TRUE;
     state.stopAt = join;
     state.branch.ifFalse = ifFalse;
     return state;
 }
 
-BytecodeAnalyzer::CFGState
-BytecodeAnalyzer::CFGState::IfElse(jsbytecode *trueEnd, jsbytecode *falseEnd, MBasicBlock *ifFalse) 
+IonBuilder::CFGState
+IonBuilder::CFGState::IfElse(jsbytecode *trueEnd, jsbytecode *falseEnd, MBasicBlock *ifFalse) 
 {
     CFGState state;
     // If the end of the false path is the same as the start of the
     // false path, then the "else" block is empty and we can devolve
     // this to the IF_TRUE case. We handle this here because there is
     // still an extra GOTO on the true path and we want stopAt to point
     // there, whereas the IF_TRUE case does not have the GOTO.
     state.state = (falseEnd == ifFalse->pc())
@@ -126,25 +126,25 @@ BytecodeAnalyzer::CFGState::IfElse(jsbyt
                   : IF_ELSE_TRUE;
     state.stopAt = trueEnd;
     state.branch.falseEnd = falseEnd;
     state.branch.ifFalse = ifFalse;
     return state;
 }
 
 void
-BytecodeAnalyzer::popCfgStack()
+IonBuilder::popCfgStack()
 {
     if (cfgStack_.back().isLoop())
         loops_.popBack();
     cfgStack_.popBack();
 }
 
 bool
-BytecodeAnalyzer::pushLoop(CFGState::State initial, jsbytecode *stopAt, MBasicBlock *entry,
+IonBuilder::pushLoop(CFGState::State initial, jsbytecode *stopAt, MBasicBlock *entry,
                            jsbytecode *bodyStart, jsbytecode *bodyEnd, jsbytecode *exitpc)
 {
     LoopInfo loop(cfgStack_.length());
     if (!loops_.append(loop))
         return false;
 
     CFGState state;
     state.state = initial;
@@ -155,17 +155,17 @@ BytecodeAnalyzer::pushLoop(CFGState::Sta
     state.loop.entry = entry;
     state.loop.successor = NULL;
     state.loop.breaks = NULL;
     state.loop.continues = NULL;
     return cfgStack_.append(state);
 }
 
 bool
-BytecodeAnalyzer::analyze()
+IonBuilder::analyze()
 {
     current = newBlock(pc);
     if (!current)
         return false;
 
     // Initialize argument references if inside a function frame.
     if (fun()) {
         MParameter *param = MParameter::New(this, MParameter::CALLEE_SLOT);
@@ -225,17 +225,17 @@ BytecodeAnalyzer::analyze()
 // For (1), we expect that there is a current block in the progress of being
 // built, and we complete the necessary edges in the CFG. For (2), we expect
 // that there is no active block.
 //
 // For normal diamond join points, we construct Phi nodes as we add
 // predecessors. For loops, care must be taken to propagate Phi nodes back
 // through uses in the loop body.
 bool
-BytecodeAnalyzer::traverseBytecode()
+IonBuilder::traverseBytecode()
 {
     for (;;) {
         JS_ASSERT(pc < script->code + script->length);
 
         for (;;) {
             // Check if we've hit an expected join point or edge in the bytecode.
             // Leaving one control structure could place us at the edge of another,
             // thus |while| instead of |if| so we don't skip any opcodes.
@@ -279,18 +279,18 @@ BytecodeAnalyzer::traverseBytecode()
             return false;
 
         pc += js_CodeSpec[op].length;
     }
 
     return true;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::snoopControlFlow(JSOp op)
+IonBuilder::ControlStatus
+IonBuilder::snoopControlFlow(JSOp op)
 {
     switch (op) {
       case JSOP_NOP:
         return maybeLoop(op, js_GetSrcNote(script, pc));
 
       case JSOP_POP:
         return maybeLoop(op, js_GetSrcNote(script, pc));
 
@@ -340,17 +340,17 @@ BytecodeAnalyzer::snoopControlFlow(JSOp 
 
       default:
         break;
     }
     return ControlStatus_None;
 }
 
 bool
-BytecodeAnalyzer::inspectOpcode(JSOp op)
+IonBuilder::inspectOpcode(JSOp op)
 {
     switch (op) {
       case JSOP_PUSH:
         return pushConstant(UndefinedValue());
 
       case JSOP_IFEQ:
         return jsop_ifeq(JSOP_IFEQ);
 
@@ -422,18 +422,18 @@ BytecodeAnalyzer::inspectOpcode(JSOp op)
 // for (...) {
 //   for (...) {
 //     return x;
 //   }
 // }
 //
 // If |current| is NULL when this function returns, then there is no more
 // control flow to be processed.
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processControlEnd()
+IonBuilder::ControlStatus
+IonBuilder::processControlEnd()
 {
     JS_ASSERT(!current);
 
     if (cfgStack_.empty()) {
         // If there is no more control flow to process, then this is the
         // last return in the function.
         return ControlStatus_Ended;
     }
@@ -442,18 +442,18 @@ BytecodeAnalyzer::processControlEnd()
 }
 
 // Processes the top of the CFG stack. This is used from two places:
 // (1) processControlEnd(), whereby a break, continue, or return may interrupt
 //     an in-progress CFG structure before reaching its actual termination
 //     point in the bytecode.
 // (2) traverseBytecode(), whereby we reach the last instruction in a CFG
 //     structure.
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processCfgStack()
+IonBuilder::ControlStatus
+IonBuilder::processCfgStack()
 {
     ControlStatus status = processCfgEntry(cfgStack_.back());
 
     // If this terminated a CFG structure, act like processControlEnd() and
     // keep propagating upward.
     while (status == ControlStatus_Ended) {
         popCfgStack();
         if (cfgStack_.empty())
@@ -463,18 +463,18 @@ BytecodeAnalyzer::processCfgStack()
 
     // If some join took place, the current structure is finished.
     if (status == ControlStatus_Joined)
         popCfgStack();
 
     return status;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processCfgEntry(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processCfgEntry(CFGState &state)
 {
     switch (state.state) {
       case CFGState::IF_TRUE:
       case CFGState::IF_TRUE_EMPTY_ELSE:
         return processIfEnd(state);
 
       case CFGState::IF_ELSE_TRUE:
         return processIfElseTrueEnd(state);
@@ -501,18 +501,18 @@ BytecodeAnalyzer::processCfgEntry(CFGSta
         return processForUpdateEnd(state);
 
       default:
         JS_NOT_REACHED("unknown cfgstate");
     }
     return ControlStatus_Error;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processIfEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processIfEnd(CFGState &state)
 {
     if (!current)
         return ControlStatus_Ended;
 
     // Here, the false block is the join point. Create an edge from the
     // current block to the false block. Note that a RETURN opcode
     // could have already ended the block.
     MGoto *ins = MGoto::New(this, state.branch.ifFalse);
@@ -521,31 +521,31 @@ BytecodeAnalyzer::processIfEnd(CFGState 
 
     if (!current->addPredecessor(state.branch.ifFalse))
         return ControlStatus_Error;
 
     current = state.branch.ifFalse;
     return ControlStatus_Joined;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processIfElseTrueEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processIfElseTrueEnd(CFGState &state)
 {
     // We've reached the end of the true branch of an if-else. Don't
     // create an edge yet, just transition to parsing the false branch.
     state.state = CFGState::IF_ELSE_FALSE;
     state.branch.ifTrue = current;
     state.stopAt = state.branch.falseEnd;
     pc = state.branch.ifFalse->pc();
     current = state.branch.ifFalse;
     return ControlStatus_Jumped;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processIfElseFalseEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processIfElseFalseEnd(CFGState &state)
 {
     // Update the state to have the latest block from the false path.
     state.branch.ifFalse = current;
   
     // To create the join node, we need an incoming edge that has not been
     // terminated yet.
     MBasicBlock *pred = state.branch.ifTrue
                         ? state.branch.ifTrue
@@ -573,17 +573,17 @@ BytecodeAnalyzer::processIfElseFalseEnd(
     }
   
     // Continue parsing at the join point.
     current = join;
     return ControlStatus_Joined;
 }
 
 bool
-BytecodeAnalyzer::finalizeLoop(CFGState &state, MInstruction *last)
+IonBuilder::finalizeLoop(CFGState &state, MInstruction *last)
 {
     JS_ASSERT(!state.loop.continues);
 
     // Create a block to catch all breaks.
     MBasicBlock *breaks = NULL;
     if (state.loop.breaks) {
         breaks = newBlock(state.loop.exitpc);
 
@@ -631,18 +631,18 @@ BytecodeAnalyzer::finalizeLoop(CFGState 
         if (!successor->addPredecessor(breaks))
             return false;
     }
 
     state.loop.successor = successor;
     return true;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processDoWhileEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processDoWhileEnd(CFGState &state)
 {
     if (current || state.loop.breaks) {
         state.loop.successor = newBlock(current, state.loop.exitpc);
         if (!state.loop.successor)
             return ControlStatus_Error;
     }
 
     if (!processDeferredContinues(state))
@@ -651,18 +651,18 @@ BytecodeAnalyzer::processDoWhileEnd(CFGS
         return ControlStatus_Error;
 
     JS_ASSERT(JSOp(*pc) == JSOP_IFNE || JSOp(*pc) == JSOP_IFNEX);
     pc += js_CodeSpec[JSOp(*pc)].length;
     current = state.loop.successor;
     return current ? ControlStatus_Joined : ControlStatus_Ended;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processWhileCondEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processWhileCondEnd(CFGState &state)
 {
     JS_ASSERT(JSOp(*pc) == JSOP_IFNE || JSOp(*pc) == JSOP_IFNEX);
 
     // Balance the stack past the IFNE.
     MInstruction *ins = current->pop();
 
     // Create the body and successor blocks.
     MBasicBlock *body = newBlock(current, state.loop.bodyStart);
@@ -673,34 +673,34 @@ BytecodeAnalyzer::processWhileCondEnd(CF
 
     state.state = CFGState::WHILE_LOOP_BODY;
     state.stopAt = state.loop.bodyEnd;
     pc = state.loop.bodyStart;
     current = body;
     return ControlStatus_Jumped;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processWhileBodyEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processWhileBodyEnd(CFGState &state)
 {
     if (!processDeferredContinues(state))
         return ControlStatus_Error;
     if (!finalizeLoop(state, NULL))
         return ControlStatus_Error;
 
     current = state.loop.successor;
     if (!current)
         return ControlStatus_Ended;
 
     pc = current->pc();
     return ControlStatus_Joined;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processForCondEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processForCondEnd(CFGState &state)
 {
     JS_ASSERT(JSOp(*pc) == JSOP_IFNE || JSOp(*pc) == JSOP_IFNEX);
 
     // Balance the stack past the IFNE.
     MInstruction *ins = current->pop();
 
     // Create the body and successor blocks.
     MBasicBlock *body = newBlock(current, state.loop.bodyStart);
@@ -712,17 +712,17 @@ BytecodeAnalyzer::processForCondEnd(CFGS
     state.state = CFGState::FOR_LOOP_BODY;
     state.stopAt = state.loop.bodyEnd;
     pc = state.loop.bodyStart;
     current = body;
     return ControlStatus_Jumped;
 }
 
 bool
-BytecodeAnalyzer::processDeferredContinues(CFGState &state)
+IonBuilder::processDeferredContinues(CFGState &state)
 {
     // If there are any continues for this loop, and there is an update block,
     // then we need to create a new basic block to house the update.
     if (state.loop.continues) {
         MBasicBlock *update = newBlock(pc);
         if (current) {
             MGoto *ins = MGoto::New(this, update);
             if (!current->end(ins))
@@ -743,48 +743,48 @@ BytecodeAnalyzer::processDeferredContinu
         state.loop.continues = NULL;
 
         current = update;
     }
 
     return true;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processForBodyEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processForBodyEnd(CFGState &state)
 {
     if (!processDeferredContinues(state))
         return ControlStatus_Error;
 
     if (!state.loop.updatepc)
         return processForUpdateEnd(state);
 
     pc = state.loop.updatepc;
 
     state.state = CFGState::FOR_LOOP_UPDATE;
     state.stopAt = state.loop.updateEnd;
     return ControlStatus_Jumped;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processForUpdateEnd(CFGState &state)
+IonBuilder::ControlStatus
+IonBuilder::processForUpdateEnd(CFGState &state)
 {
     if (!finalizeLoop(state, NULL))
         return ControlStatus_Error;
 
     current = state.loop.successor;
     if (!current)
         return ControlStatus_Ended;
 
     pc = current->pc();
     return ControlStatus_Joined;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processBreak(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::processBreak(JSOp op, jssrcnote *sn)
 {
     JS_ASSERT(op == JSOP_GOTO || op == JSOP_GOTOX);
 
     // Find the target loop.
     CFGState *found = NULL;
     jsbytecode *target = pc + GetJumpOffset(pc);
     for (size_t i = loops_.length() - 1; i < loops_.length(); i--) {
         CFGState &cfg = cfgStack_[loops_[i].cfgEntry];
@@ -804,18 +804,18 @@ BytecodeAnalyzer::processBreak(JSOp op, 
         return ControlStatus_Error;
     state.loop.breaks = edge;
 
     current = NULL;
     pc += js_CodeSpec[op].length;
     return processControlEnd();
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processContinue(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::processContinue(JSOp op, jssrcnote *sn)
 {
     JS_ASSERT(op == JSOP_GOTO || op == JSOP_GOTOX);
 
     // Find the target loop.
     CFGState *found = NULL;
     jsbytecode *target = pc + GetJumpOffset(pc);
     for (size_t i = loops_.length() - 1; i < loops_.length(); i--) {
         CFGState &cfg = cfgStack_[loops_[i].cfgEntry];
@@ -835,18 +835,18 @@ BytecodeAnalyzer::processContinue(JSOp o
         return ControlStatus_Error;
     state.loop.continues = edge;
 
     current = NULL;
     pc += js_CodeSpec[op].length;
     return processControlEnd();
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::maybeLoop(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::maybeLoop(JSOp op, jssrcnote *sn)
 {
     // This function looks at the opcode and source note and tries to
     // determine the structure of the loop. For some opcodes, like
     // POP/NOP which are not explicitly control flow, this source note is
     // optional. For opcodes with control flow, like GOTO, an unrecognized
     // or not-present source note is a compilation failure.
     switch (op) {
       case JSOP_POP:
@@ -873,17 +873,17 @@ BytecodeAnalyzer::maybeLoop(JSOp op, jss
         JS_NOT_REACHED("unexpected opcode");
         return ControlStatus_Error;
     }
 
     return ControlStatus_None;
 }
 
 void
-BytecodeAnalyzer::assertValidTraceOp(JSOp op)
+IonBuilder::assertValidTraceOp(JSOp op)
 {
 #ifdef DEBUG
     jssrcnote *sn = js_GetSrcNote(script, pc);
     jsbytecode *ifne = pc + js_GetSrcNoteOffset(sn, 0);
     CFGState &state = cfgStack_.back();
 
     // Make sure this is the next opcode after the loop header.
     JS_ASSERT(GetNextPc(state.loop.entry->pc()) == pc);
@@ -900,18 +900,18 @@ BytecodeAnalyzer::assertValidTraceOp(JSO
     }
 
     // Make sure this trace op goes to the same ifne as the loop header's
     // source notes or GOTO.
     JS_ASSERT(ifne == expected_ifne);
 #endif
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::doWhileLoop(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::doWhileLoop(JSOp op, jssrcnote *sn)
 {
     int offset = js_GetSrcNoteOffset(sn, 0);
     jsbytecode *ifne = pc + offset;
     JS_ASSERT(ifne > pc);
 
     // Verify that the IFNE goes back to a trace op.
     JS_ASSERT(JSOp(*GetNextPc(pc)) == JSOP_TRACE);
     JS_ASSERT(GetNextPc(pc) == ifne + GetJumpOffset(ifne));
@@ -930,18 +930,18 @@ BytecodeAnalyzer::doWhileLoop(JSOp op, j
     jsbytecode *bodyStart = GetNextPc(GetNextPc(pc));
     jsbytecode *exitpc = GetNextPc(ifne);
     if (!pushLoop(CFGState::DO_WHILE_LOOP, ifne, header, bodyStart, ifne, exitpc))
         return ControlStatus_Error;
 
     return ControlStatus_Jumped;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::whileLoop(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::whileLoop(JSOp op, jssrcnote *sn)
 {
     // while (cond) { } loops have the following structure:
     //    GOTO cond   ; SRC_WHILE (offset to IFNE)
     //    TRACE       ; SRC_WHILE (offset to IFNE)
     //    ...
     //  cond:
     //    ...
     //    IFNE        ; goes to TRACE
@@ -966,18 +966,18 @@ BytecodeAnalyzer::whileLoop(JSOp op, jss
         return ControlStatus_Error;
 
     // Parse the condition first.
     pc = bodyEnd;
     current = header;
     return ControlStatus_Jumped;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::forLoop(JSOp op, jssrcnote *sn)
+IonBuilder::ControlStatus
+IonBuilder::forLoop(JSOp op, jssrcnote *sn)
 {
     // Skip the NOP or POP.
     JS_ASSERT(op == JSOP_POP || op == JSOP_NOP);
     pc = GetNextPc(pc);
 
     jsbytecode *condpc = pc + js_GetSrcNoteOffset(sn, 0);
     jsbytecode *updatepc = pc + js_GetSrcNoteOffset(sn, 1);
     jsbytecode *ifne = pc + js_GetSrcNoteOffset(sn, 2);
@@ -1036,17 +1036,17 @@ BytecodeAnalyzer::forLoop(JSOp op, jssrc
     if (state.loop.updatepc)
         state.loop.updateEnd = condpc;
 
     current = header;
     return ControlStatus_Jumped;
 }
 
 bool
-BytecodeAnalyzer::jsop_ifeq(JSOp op)
+IonBuilder::jsop_ifeq(JSOp op)
 {
     // IFEQ always has a forward offset.
     jsbytecode *trueStart = pc + js_CodeSpec[op].length;
     jsbytecode *falseStart = pc + GetJumpOffset(pc);
     JS_ASSERT(falseStart > pc);
 
     // We only handle cases that emit source notes.
     jssrcnote *sn = js_GetSrcNote(script, pc);
@@ -1115,18 +1115,18 @@ BytecodeAnalyzer::jsop_ifeq(JSOp op)
 
     // Switch to parsing the true branch. Note that no PC update is needed,
     // it's the next instruction.
     current = ifTrue;
 
     return true;
 }
 
-BytecodeAnalyzer::ControlStatus
-BytecodeAnalyzer::processReturn(JSOp op)
+IonBuilder::ControlStatus
+IonBuilder::processReturn(JSOp op)
 {
     MInstruction *ins;
     switch (op) {
       case JSOP_RETURN:
         ins = current->pop();
         break;
 
       case JSOP_STOP:
@@ -1146,27 +1146,27 @@ BytecodeAnalyzer::processReturn(JSOp op)
         return ControlStatus_Error;
 
     // Make sure no one tries to use this block now.
     current = NULL;
     return processControlEnd();
 }
 
 bool
-BytecodeAnalyzer::pushConstant(const Value &v)
+IonBuilder::pushConstant(const Value &v)
 {
     MConstant *ins = MConstant::New(this, v);
     if (!current->add(ins))
         return false;
     current->push(ins);
     return true;
 }
 
 bool
-BytecodeAnalyzer::jsop_binary(JSOp op)
+IonBuilder::jsop_binary(JSOp op)
 {
     MInstruction *right = current->pop();
     MInstruction *left = current->pop();
 
     MInstruction *ins;
     switch (op) {
       case JSOP_BITAND:
         ins = MBitAnd::New(this, left, right);
@@ -1180,25 +1180,25 @@ BytecodeAnalyzer::jsop_binary(JSOp op)
     if (!current->add(ins))
         return false;
     current->push(ins);
 
     return true;
 }
 
 MBasicBlock *
-BytecodeAnalyzer::newBlock(MBasicBlock *predecessor, jsbytecode *pc)
+IonBuilder::newBlock(MBasicBlock *predecessor, jsbytecode *pc)
 {
     MBasicBlock *block = MBasicBlock::New(this, predecessor, pc);
     if (!graph().addBlock(block))
         return NULL;
     return block;
 }
 
 MBasicBlock *
-BytecodeAnalyzer::newLoopHeader(MBasicBlock *predecessor, jsbytecode *pc)
+IonBuilder::newLoopHeader(MBasicBlock *predecessor, jsbytecode *pc)
 {
     MBasicBlock *block = MBasicBlock::NewLoopHeader(this, predecessor, pc);
     if (!graph().addBlock(block))
         return NULL;
     return block;
 }
 
rename from js/src/ion/BytecodeAnalyzer.h
rename to js/src/ion/IonBuilder.h
--- a/js/src/ion/BytecodeAnalyzer.h
+++ b/js/src/ion/IonBuilder.h
@@ -42,17 +42,17 @@
 #ifndef jsion_bytecode_analyzer_h__
 #define jsion_bytecode_analyzer_h__
 
 #include "MIR.h"
 
 namespace js {
 namespace ion {
 
-class BytecodeAnalyzer : public MIRGenerator
+class IonBuilder : public MIRGenerator
 {
     enum ControlStatus {
         ControlStatus_Error,
         ControlStatus_Ended,        // There is no continuation/join point.
         ControlStatus_Joined,       // Created a join node.
         ControlStatus_Jumped,       // Parsing another branch at the same level.
         ControlStatus_None          // No control flow.
     };
@@ -139,17 +139,17 @@ class BytecodeAnalyzer : public MIRGener
             }
         }
 
         static CFGState If(jsbytecode *join, MBasicBlock *ifFalse);
         static CFGState IfElse(jsbytecode *trueEnd, jsbytecode *falseEnd, MBasicBlock *ifFalse);
     };
 
   public:
-    BytecodeAnalyzer(JSContext *cx, JSScript *script, JSFunction *fun, TempAllocator &temp,
+    IonBuilder(JSContext *cx, JSScript *script, JSFunction *fun, TempAllocator &temp,
                      MIRGraph &graph);
 
   public:
     bool analyze();
 
   private:
     bool traverseBytecode();
     ControlStatus snoopControlFlow(JSOp op);
--- a/js/src/ion/IonSpew.cpp
+++ b/js/src/ion/IonSpew.cpp
@@ -34,17 +34,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "BytecodeAnalyzer.h"
+#include "IonBuilder.h"
 #include "Ion.h"
 #include "IonSpew.h"
 #include "MIRGraph.h"
 #include "jsscriptinlines.h"
 
 using namespace js;
 using namespace js::ion;
 
--- a/js/src/ion/MIR.h
+++ b/js/src/ion/MIR.h
@@ -123,17 +123,16 @@ class MIRGenerator
 {
   public:
     MIRGenerator(JSContext *cx, TempAllocator &temp, JSScript *script, JSFunction *fun,
                  MIRGraph &graph);
 
     TempAllocator &temp() {
         return temp_;
     }
-
     JSFunction *fun() const {
         return fun_;
     }
     uint32 nslots() const {
         return nslots_;
     }
     uint32 nargs() const {
         return fun()->nargs;