| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 M(LoadField) \ | 237 M(LoadField) \ |
| 238 M(StoreVMField) \ | 238 M(StoreVMField) \ |
| 239 M(InstantiateTypeArguments) \ | 239 M(InstantiateTypeArguments) \ |
| 240 M(ExtractConstructorTypeArguments) \ | 240 M(ExtractConstructorTypeArguments) \ |
| 241 M(ExtractConstructorInstantiator) \ | 241 M(ExtractConstructorInstantiator) \ |
| 242 M(AllocateContext) \ | 242 M(AllocateContext) \ |
| 243 M(ChainContext) \ | 243 M(ChainContext) \ |
| 244 M(CloneContext) \ | 244 M(CloneContext) \ |
| 245 M(CatchEntry) \ | 245 M(CatchEntry) \ |
| 246 M(BinarySmiOp) \ | 246 M(BinarySmiOp) \ |
| 247 M(BinaryMintOp) \ | |
| 248 M(UnarySmiOp) \ | 247 M(UnarySmiOp) \ |
| 249 M(CheckStackOverflow) \ | 248 M(CheckStackOverflow) \ |
| 250 M(DoubleToDouble) \ | 249 M(DoubleToDouble) \ |
| 251 M(SmiToDouble) \ | 250 M(SmiToDouble) \ |
| 252 M(CheckClass) \ | 251 M(CheckClass) \ |
| 253 M(CheckSmi) \ | 252 M(CheckSmi) \ |
| 254 M(Constant) \ | 253 M(Constant) \ |
| 255 M(CheckEitherNonSmi) \ | 254 M(CheckEitherNonSmi) \ |
| 256 M(UnboxedDoubleBinaryOp) \ | 255 M(UnboxedDoubleBinaryOp) \ |
| 257 M(MathSqrt) \ | 256 M(MathSqrt) \ |
| (...skipping 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3624 | 3623 |
| 3625 private: | 3624 private: |
| 3626 const Token::Kind op_kind_; | 3625 const Token::Kind op_kind_; |
| 3627 InstanceCallInstr* instance_call_; | 3626 InstanceCallInstr* instance_call_; |
| 3628 bool overflow_; | 3627 bool overflow_; |
| 3629 | 3628 |
| 3630 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); | 3629 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); |
| 3631 }; | 3630 }; |
| 3632 | 3631 |
| 3633 | 3632 |
| 3634 class BinaryMintOpInstr : public TemplateDefinition<2> { | |
| 3635 public: | |
| 3636 BinaryMintOpInstr(Token::Kind op_kind, | |
| 3637 InstanceCallInstr* instance_call, | |
| 3638 Value* left, | |
| 3639 Value* right) | |
| 3640 : op_kind_(op_kind), | |
| 3641 instance_call_(instance_call) { | |
| 3642 ASSERT(left != NULL); | |
| 3643 ASSERT(right != NULL); | |
| 3644 inputs_[0] = left; | |
| 3645 inputs_[1] = right; | |
| 3646 } | |
| 3647 | |
| 3648 Value* left() const { return inputs_[0]; } | |
| 3649 Value* right() const { return inputs_[1]; } | |
| 3650 | |
| 3651 Token::Kind op_kind() const { return op_kind_; } | |
| 3652 | |
| 3653 InstanceCallInstr* instance_call() const { return instance_call_; } | |
| 3654 | |
| 3655 const ICData* ic_data() const { return instance_call()->ic_data(); } | |
| 3656 | |
| 3657 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
| 3658 | |
| 3659 DECLARE_INSTRUCTION(BinaryMintOp) | |
| 3660 virtual RawAbstractType* CompileType() const; | |
| 3661 | |
| 3662 virtual bool CanDeoptimize() const { return true; } | |
| 3663 | |
| 3664 virtual bool HasSideEffect() const { return false; } | |
| 3665 | |
| 3666 virtual intptr_t ResultCid() const; | |
| 3667 | |
| 3668 private: | |
| 3669 const Token::Kind op_kind_; | |
| 3670 InstanceCallInstr* instance_call_; | |
| 3671 | |
| 3672 DISALLOW_COPY_AND_ASSIGN(BinaryMintOpInstr); | |
| 3673 }; | |
| 3674 | |
| 3675 | |
| 3676 // Handles both Smi operations: BIT_OR and NEGATE. | 3633 // Handles both Smi operations: BIT_OR and NEGATE. |
| 3677 class UnarySmiOpInstr : public TemplateDefinition<1> { | 3634 class UnarySmiOpInstr : public TemplateDefinition<1> { |
| 3678 public: | 3635 public: |
| 3679 UnarySmiOpInstr(Token::Kind op_kind, | 3636 UnarySmiOpInstr(Token::Kind op_kind, |
| 3680 InstanceCallInstr* instance_call, | 3637 InstanceCallInstr* instance_call, |
| 3681 Value* value) | 3638 Value* value) |
| 3682 : op_kind_(op_kind), instance_call_(instance_call) { | 3639 : op_kind_(op_kind), instance_call_(instance_call) { |
| 3683 ASSERT((op_kind == Token::kNEGATE) || (op_kind == Token::kBIT_NOT)); | 3640 ASSERT((op_kind == Token::kNEGATE) || (op_kind == Token::kBIT_NOT)); |
| 3684 ASSERT(value != NULL); | 3641 ASSERT(value != NULL); |
| 3685 inputs_[0] = value; | 3642 inputs_[0] = value; |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4101 ForwardInstructionIterator* current_iterator_; | 4058 ForwardInstructionIterator* current_iterator_; |
| 4102 | 4059 |
| 4103 private: | 4060 private: |
| 4104 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4061 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4105 }; | 4062 }; |
| 4106 | 4063 |
| 4107 | 4064 |
| 4108 } // namespace dart | 4065 } // namespace dart |
| 4109 | 4066 |
| 4110 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4067 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |