Chromium Code Reviews| Index: vm/intermediate_language.h |
| =================================================================== |
| --- vm/intermediate_language.h (revision 10050) |
| +++ vm/intermediate_language.h (working copy) |
| @@ -146,6 +146,10 @@ |
| // number of pushed arguments. |
| virtual intptr_t ArgumentCount() const = 0; |
| + // Returns true, if this computation can deoptimize. By default |
| + // we assume every computation can deoptimize. |
|
srdjan
2012/07/31 15:53:15
The comment (by default we return true) does not m
Florian Schneider
2012/08/01 11:46:36
Done.
|
| + virtual bool CanDeoptimize() const = 0; |
| + |
| // Static type of the computation. |
| virtual RawAbstractType* StaticType() const = 0; |
| @@ -352,6 +356,8 @@ |
| definition_ = definition; |
| } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| Definition* definition_; |
| @@ -371,6 +377,8 @@ |
| const Object& value() const { return value_; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const Object& value_; |
| @@ -416,6 +424,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -443,6 +453,8 @@ |
| intptr_t try_index() const { return try_index_; } |
| Value* value() const { return inputs_[0]; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -459,6 +471,8 @@ |
| DECLARE_COMPUTATION(CurrentContext) |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(CurrentContextComp); |
| }; |
| @@ -475,6 +489,8 @@ |
| Value* value() const { return inputs_[0]; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(StoreContextComp); |
| }; |
| @@ -502,6 +518,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
|
srdjan
2012/07/31 19:49:28
All calls have to return true (future work).
Florian Schneider
2012/08/01 11:46:36
Yes. It will have to change once we have something
|
| + |
| private: |
| const ClosureCallNode& ast_node_; |
| const intptr_t try_index_; |
| @@ -551,6 +569,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -584,6 +604,8 @@ |
| DECLARE_COMPUTATION(PolymorphicInstanceCall) |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| InstanceCallComp* instance_call_; |
| @@ -623,6 +645,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(StrictCompareComp); |
| }; |
| @@ -651,6 +675,8 @@ |
| intptr_t receiver_class_id() const { return receiver_class_id_; } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -689,6 +715,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -733,6 +761,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -758,6 +788,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const LocalVariable& local_; |
| const intptr_t context_level_; |
| @@ -787,6 +819,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const LocalVariable& local_; |
| const intptr_t context_level_; |
| @@ -825,6 +859,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const NativeBodyNode& ast_node_; |
| const intptr_t try_index_; |
| @@ -851,6 +887,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const Field& field_; |
| const InstanceCallComp* original_; // For optimizations. |
| @@ -883,6 +921,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const Field& field_; |
| const InstanceSetterComp* original_; // For optimizations. |
| @@ -901,6 +941,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const Field& field_; |
| @@ -924,6 +966,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const Field& field_; |
| @@ -961,6 +1005,8 @@ |
| return receiver_type_; |
| } |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1003,6 +1049,8 @@ |
| return receiver_type_; |
| } |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1036,6 +1084,8 @@ |
| Value* receiver() const { return inputs_[0]; } |
| Value* value() const { return inputs_[1]; } |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1066,6 +1116,8 @@ |
| const Function& setter_function() const { return setter_function_; } |
| Value* value() const { return inputs_[0]; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1086,6 +1138,8 @@ |
| Value* value() const { return inputs_[0]; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(BooleanNegateComp); |
| }; |
| @@ -1126,6 +1180,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1164,6 +1220,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const ConstructorCallNode& ast_node_; |
| const intptr_t try_index_; |
| @@ -1197,6 +1255,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const ConstructorCallNode& ast_node_; |
| const intptr_t try_index_; |
| @@ -1237,6 +1297,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1268,6 +1330,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const ClosureNode& ast_node_; |
| const intptr_t try_index_; |
| @@ -1300,6 +1364,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t offset_in_bytes_; |
| const AbstractType& type_; |
| @@ -1332,6 +1398,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t offset_in_bytes_; |
| const AbstractType& type_; |
| @@ -1364,6 +1432,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1398,6 +1468,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1425,6 +1497,8 @@ |
| const Function& constructor() const { return ast_node_.constructor(); } |
| intptr_t token_pos() const { return ast_node_.token_pos(); } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const ConstructorCallNode& ast_node_; |
| @@ -1449,6 +1523,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1469,6 +1545,8 @@ |
| Value* context_value() const { return inputs_[0]; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(ChainContextComp); |
| }; |
| @@ -1491,6 +1569,8 @@ |
| DECLARE_COMPUTATION(CloneContext) |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1512,6 +1592,8 @@ |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const LocalVariable& exception_var_; |
| const LocalVariable& stacktrace_var_; |
| @@ -1556,6 +1638,8 @@ |
| DECLARE_COMPUTATION(BinaryOp) |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const Token::Kind op_kind_; |
| const OperandsType operands_type_; |
| @@ -1585,6 +1669,8 @@ |
| DECLARE_COMPUTATION(UnarySmiOp) |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const Token::Kind op_kind_; |
| InstanceCallComp* instance_call_; |
| @@ -1608,6 +1694,8 @@ |
| DECLARE_COMPUTATION(NumberNegate) |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| InstanceCallComp* instance_call_; |
| @@ -1626,6 +1714,8 @@ |
| DECLARE_COMPUTATION(CheckStackOverflow) |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -1653,6 +1743,8 @@ |
| DECLARE_COMPUTATION(ToDouble) |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const ObjectKind from_; |
| InstanceCallComp* instance_call_; |
| @@ -1759,6 +1851,9 @@ |
| // number of pushed arguments. |
| virtual intptr_t ArgumentCount() const = 0; |
| + // Returns true, if this instruction can deoptimize. |
| + virtual bool CanDeoptimize() const = 0; |
| + |
| // Visiting support. |
| virtual void Accept(FlowGraphVisitor* visitor) = 0; |
| @@ -1939,6 +2034,8 @@ |
| virtual intptr_t ArgumentCount() const { return 0; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| protected: |
| BlockEntryInstr() |
| : preorder_number_(-1), |
| @@ -2201,6 +2298,8 @@ |
| return computation()->ArgumentCount(); |
| } |
| + virtual bool CanDeoptimize() const { return computation()->CanDeoptimize(); } |
| + |
| Computation* computation() const { return computation_; } |
| void set_computation(Computation* value) { computation_ = value; } |
| bool is_used() const { return is_used_; } |
| @@ -2240,6 +2339,8 @@ |
| virtual intptr_t ArgumentCount() const { return 0; } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| DECLARE_INSTRUCTION(Phi) |
| private: |
| @@ -2253,6 +2354,8 @@ |
| public: |
| explicit ParameterInstr(intptr_t index) : index_(index) { } |
| + DECLARE_INSTRUCTION(Parameter) |
| + |
| intptr_t index() const { return index_; } |
| // Static type of the passed-in parameter. |
| @@ -2260,7 +2363,7 @@ |
| virtual intptr_t ArgumentCount() const { return 0; } |
| - DECLARE_INSTRUCTION(Parameter) |
| + virtual bool CanDeoptimize() const { return false; } |
| private: |
| const intptr_t index_; |
| @@ -2281,6 +2384,8 @@ |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| Value* value_; |
| @@ -2304,6 +2409,8 @@ |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| Value* value_; |
| @@ -2334,6 +2441,8 @@ |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -2369,6 +2478,8 @@ |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -2394,6 +2505,8 @@ |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler); |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| JoinEntryInstr* successor_; |
| }; |
| @@ -2460,6 +2573,8 @@ |
| void EmitBranchOnCondition(FlowGraphCompiler* compiler, |
| Condition true_condition); |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| private: |
| const intptr_t token_pos_; |
| const intptr_t try_index_; |
| @@ -2553,6 +2668,8 @@ |
| intptr_t NumMoves() const { return moves_.length(); } |
| + virtual bool CanDeoptimize() const { return false; } |
| + |
| private: |
| GrowableArray<MoveOperands*> moves_; // Elements cannot be null. |