| Index: src/hydrogen.h
|
| diff --git a/src/hydrogen.h b/src/hydrogen.h
|
| index b05e927730a1ec3cd20343b75d520bdd42f18554..751ead8a5686ca0f785a71fb7958afc48b3f7cee 100644
|
| --- a/src/hydrogen.h
|
| +++ b/src/hydrogen.h
|
| @@ -125,7 +125,9 @@ class HBasicBlock: public ZoneObject {
|
| void Goto(HBasicBlock* block, FunctionState* state = NULL);
|
|
|
| int PredecessorIndexOf(HBasicBlock* predecessor) const;
|
| - void AddSimulate(BailoutId ast_id) { AddInstruction(CreateSimulate(ast_id)); }
|
| + void AddSimulate(BailoutId ast_id, RemovableSimulate removable = FIXED) {
|
| + AddInstruction(CreateSimulate(ast_id, removable));
|
| + }
|
| void AssignCommonDominator(HBasicBlock* other);
|
| void AssignLoopSuccessorDominators();
|
|
|
| @@ -166,7 +168,7 @@ class HBasicBlock: public ZoneObject {
|
| void RegisterPredecessor(HBasicBlock* pred);
|
| void AddDominatedBlock(HBasicBlock* block);
|
|
|
| - HSimulate* CreateSimulate(BailoutId ast_id);
|
| + HSimulate* CreateSimulate(BailoutId ast_id, RemovableSimulate removable);
|
| HDeoptimize* CreateDeoptimize(HDeoptimize::UseEnvironment has_uses);
|
|
|
| int block_id_;
|
| @@ -255,6 +257,7 @@ class HGraph: public ZoneObject {
|
|
|
| void InitializeInferredTypes();
|
| void InsertTypeConversions();
|
| + void MergeRemovableSimulates();
|
| void InsertRepresentationChanges();
|
| void MarkDeoptimizeOnUndefined();
|
| void ComputeMinusZeroChecks();
|
| @@ -612,6 +615,25 @@ class HEnvironment: public ZoneObject {
|
| };
|
|
|
|
|
| +class HInferRepresentation BASE_EMBEDDED {
|
| + public:
|
| + explicit HInferRepresentation(HGraph* graph)
|
| + : graph_(graph),
|
| + worklist_(8, graph->zone()),
|
| + in_worklist_(graph->GetMaximumValueID(), graph->zone()) { }
|
| +
|
| + void Analyze();
|
| + void AddToWorklist(HValue* current);
|
| +
|
| + private:
|
| + Zone* zone() const { return graph_->zone(); }
|
| +
|
| + HGraph* graph_;
|
| + ZoneList<HValue*> worklist_;
|
| + BitVector in_worklist_;
|
| +};
|
| +
|
| +
|
| class HGraphBuilder;
|
|
|
| enum ArgumentsAllowedFlag {
|
| @@ -879,7 +901,7 @@ class HGraphBuilder: public AstVisitor {
|
|
|
| // Adding instructions.
|
| HInstruction* AddInstruction(HInstruction* instr);
|
| - void AddSimulate(BailoutId ast_id);
|
| + void AddSimulate(BailoutId ast_id, RemovableSimulate removable = FIXED);
|
|
|
| // Bailout environment manipulation.
|
| void Push(HValue* value) { environment()->Push(value); }
|
| @@ -1024,10 +1046,6 @@ class HGraphBuilder: public AstVisitor {
|
| // to push them as outgoing parameters.
|
| template <class Instruction> HInstruction* PreProcessCall(Instruction* call);
|
|
|
| - void TraceRepresentation(Token::Value op,
|
| - TypeInfo info,
|
| - HValue* value,
|
| - Representation rep);
|
| static Representation ToRepresentation(TypeInfo info);
|
|
|
| void SetUpScope(Scope* scope);
|
|
|