| Index: src/full-codegen/full-codegen.h
|
| diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h
|
| index 7f238a716fdf42d1147a8ca7e26e394ad6af2b1e..dbb4a0b028c0a6cd883e3a0ca479da465536140c 100644
|
| --- a/src/full-codegen/full-codegen.h
|
| +++ b/src/full-codegen/full-codegen.h
|
| @@ -14,7 +14,6 @@
|
| #include "src/code-stubs.h"
|
| #include "src/codegen.h"
|
| #include "src/compiler.h"
|
| -#include "src/deoptimizer.h"
|
| #include "src/globals.h"
|
| #include "src/objects.h"
|
|
|
| @@ -29,6 +28,11 @@
|
|
|
| class FullCodeGenerator: public AstVisitor {
|
| public:
|
| + enum State {
|
| + NO_REGISTERS,
|
| + TOS_REG
|
| + };
|
| +
|
| FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info)
|
| : masm_(masm),
|
| info_(info),
|
| @@ -56,10 +60,19 @@
|
|
|
| static bool MakeCode(CompilationInfo* info);
|
|
|
| - // Encode bailout state and pc-offset as a BitField<type, start, size>.
|
| + // Encode state and pc-offset as a BitField<type, start, size>.
|
| // Only use 30 bits because we encode the result as a smi.
|
| - class BailoutStateField : public BitField<Deoptimizer::BailoutState, 0, 1> {};
|
| - class PcField : public BitField<unsigned, 1, 30 - 1> {};
|
| + class StateField : public BitField<State, 0, 1> { };
|
| + class PcField : public BitField<unsigned, 1, 30-1> { };
|
| +
|
| + static const char* State2String(State state) {
|
| + switch (state) {
|
| + case NO_REGISTERS: return "NO_REGISTERS";
|
| + case TOS_REG: return "TOS_REG";
|
| + }
|
| + UNREACHABLE();
|
| + return NULL;
|
| + }
|
|
|
| static const int kMaxBackEdgeWeight = 127;
|
|
|
| @@ -93,8 +106,6 @@
|
| static Register result_register();
|
|
|
| private:
|
| - typedef Deoptimizer::BailoutState BailoutState;
|
| -
|
| class Breakable;
|
| class Iteration;
|
| class TryFinally;
|
| @@ -355,21 +366,21 @@
|
| if (FLAG_verify_operand_stack_depth) EmitOperandStackDepthCheck();
|
| EffectContext context(this);
|
| Visit(expr);
|
| - PrepareForBailout(expr, BailoutState::NO_REGISTERS);
|
| + PrepareForBailout(expr, NO_REGISTERS);
|
| }
|
|
|
| void VisitForAccumulatorValue(Expression* expr) {
|
| if (FLAG_verify_operand_stack_depth) EmitOperandStackDepthCheck();
|
| AccumulatorValueContext context(this);
|
| Visit(expr);
|
| - PrepareForBailout(expr, BailoutState::TOS_REGISTER);
|
| + PrepareForBailout(expr, TOS_REG);
|
| }
|
|
|
| void VisitForStackValue(Expression* expr) {
|
| if (FLAG_verify_operand_stack_depth) EmitOperandStackDepthCheck();
|
| StackValueContext context(this);
|
| Visit(expr);
|
| - PrepareForBailout(expr, BailoutState::NO_REGISTERS);
|
| + PrepareForBailout(expr, NO_REGISTERS);
|
| }
|
|
|
| void VisitForControl(Expression* expr,
|
| @@ -441,8 +452,8 @@
|
| NilValue nil);
|
|
|
| // Bailout support.
|
| - void PrepareForBailout(Expression* node, Deoptimizer::BailoutState state);
|
| - void PrepareForBailoutForId(BailoutId id, Deoptimizer::BailoutState state);
|
| + void PrepareForBailout(Expression* node, State state);
|
| + void PrepareForBailoutForId(BailoutId id, State state);
|
|
|
| // Returns a smi for the index into the FixedArray that backs the feedback
|
| // vector
|
|
|