Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 static CompileType Dynamic(); | 295 static CompileType Dynamic(); |
| 296 | 296 |
| 297 static CompileType Null(); | 297 static CompileType Null(); |
| 298 | 298 |
| 299 // Create non-nullable Bool type. | 299 // Create non-nullable Bool type. |
| 300 static CompileType Bool(); | 300 static CompileType Bool(); |
| 301 | 301 |
| 302 // Create non-nullable Int type. | 302 // Create non-nullable Int type. |
| 303 static CompileType Int(); | 303 static CompileType Int(); |
| 304 | 304 |
| 305 // Create non-nullable String type. | |
| 306 static CompileType String(); | |
| 307 | |
| 305 // Perform a join operation over the type lattice. | 308 // Perform a join operation over the type lattice. |
| 306 void Union(CompileType* other); | 309 void Union(CompileType* other); |
| 307 | 310 |
| 308 // Returns true if this and other types are the same. | 311 // Returns true if this and other types are the same. |
| 309 bool IsEqualTo(CompileType* other) { | 312 bool IsEqualTo(CompileType* other) { |
| 310 return (is_nullable_ == other->is_nullable_) && | 313 return (is_nullable_ == other->is_nullable_) && |
| 311 (ToNullableCid() == other->ToNullableCid()) && | 314 (ToNullableCid() == other->ToNullableCid()) && |
| 312 (ToAbstractType()->Equals(*other->ToAbstractType())); | 315 (ToAbstractType()->Equals(*other->ToAbstractType())); |
| 313 } | 316 } |
| 314 | 317 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 M(BoxUint32x4) \ | 646 M(BoxUint32x4) \ |
| 644 M(UnboxUint32x4) \ | 647 M(UnboxUint32x4) \ |
| 645 M(UnboxInteger) \ | 648 M(UnboxInteger) \ |
| 646 M(BoxInteger) \ | 649 M(BoxInteger) \ |
| 647 M(BinaryMintOp) \ | 650 M(BinaryMintOp) \ |
| 648 M(ShiftMintOp) \ | 651 M(ShiftMintOp) \ |
| 649 M(UnaryMintOp) \ | 652 M(UnaryMintOp) \ |
| 650 M(CheckArrayBound) \ | 653 M(CheckArrayBound) \ |
| 651 M(Constraint) \ | 654 M(Constraint) \ |
| 652 M(StringFromCharCode) \ | 655 M(StringFromCharCode) \ |
| 656 M(StringInterpolate) \ | |
| 653 M(InvokeMathCFunction) \ | 657 M(InvokeMathCFunction) \ |
| 654 M(GuardField) \ | 658 M(GuardField) \ |
| 655 M(IfThenElse) \ | 659 M(IfThenElse) \ |
| 656 M(BinaryFloat32x4Op) \ | 660 M(BinaryFloat32x4Op) \ |
| 657 M(Float32x4Shuffle) \ | 661 M(Float32x4Shuffle) \ |
| 658 M(Simd32x4GetSignMask) \ | 662 M(Simd32x4GetSignMask) \ |
| 659 M(Float32x4Constructor) \ | 663 M(Float32x4Constructor) \ |
| 660 M(Float32x4Zero) \ | 664 M(Float32x4Zero) \ |
| 661 M(Float32x4Splat) \ | 665 M(Float32x4Splat) \ |
| 662 M(Float32x4Comparison) \ | 666 M(Float32x4Comparison) \ |
| (...skipping 2979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3642 | 3646 |
| 3643 virtual bool MayThrow() const { return false; } | 3647 virtual bool MayThrow() const { return false; } |
| 3644 | 3648 |
| 3645 private: | 3649 private: |
| 3646 const intptr_t cid_; | 3650 const intptr_t cid_; |
| 3647 | 3651 |
| 3648 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); | 3652 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); |
| 3649 }; | 3653 }; |
| 3650 | 3654 |
| 3651 | 3655 |
| 3656 class StringInterpolateInstr : public TemplateDefinition<1> { | |
| 3657 public: | |
| 3658 StringInterpolateInstr(Value* value, intptr_t token_pos) | |
| 3659 : token_pos_(token_pos), function_(Function::Handle()) { | |
| 3660 SetInputAt(0, value); | |
| 3661 } | |
| 3662 | |
| 3663 Value* value() const { return inputs_[0]; } | |
| 3664 intptr_t token_pos() const { return token_pos_; } | |
| 3665 virtual bool CanDeoptimize() const { return true; } | |
|
Kevin Millikin (Google)
2013/10/16 15:14:03
Really?
srdjan
2013/10/16 17:46:37
Offline discsussion: adapt Effects, CanDeoptimize,
| |
| 3666 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 3667 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
| 3668 | |
| 3669 virtual CompileType ComputeType() const; | |
| 3670 // Calls toString on objects, which could throw exceptions | |
| 3671 virtual bool MayThrow() const { return true; } | |
| 3672 virtual bool AllowsCSE() const { return true; } | |
| 3673 | |
| 3674 const Function& CallFunction() const; | |
| 3675 | |
| 3676 DECLARE_INSTRUCTION(StringInterpolate) | |
| 3677 | |
| 3678 private: | |
| 3679 const intptr_t token_pos_; | |
| 3680 Function& function_; | |
| 3681 | |
| 3682 DISALLOW_COPY_AND_ASSIGN(StringInterpolateInstr); | |
| 3683 }; | |
| 3684 | |
| 3685 | |
| 3652 class StoreIndexedInstr : public TemplateDefinition<3> { | 3686 class StoreIndexedInstr : public TemplateDefinition<3> { |
| 3653 public: | 3687 public: |
| 3654 StoreIndexedInstr(Value* array, | 3688 StoreIndexedInstr(Value* array, |
| 3655 Value* index, | 3689 Value* index, |
| 3656 Value* value, | 3690 Value* value, |
| 3657 StoreBarrierType emit_store_barrier, | 3691 StoreBarrierType emit_store_barrier, |
| 3658 intptr_t index_scale, | 3692 intptr_t index_scale, |
| 3659 intptr_t class_id, | 3693 intptr_t class_id, |
| 3660 intptr_t deopt_id) | 3694 intptr_t deopt_id) |
| 3661 : emit_store_barrier_(emit_store_barrier), | 3695 : emit_store_barrier_(emit_store_barrier), |
| (...skipping 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6822 ForwardInstructionIterator* current_iterator_; | 6856 ForwardInstructionIterator* current_iterator_; |
| 6823 | 6857 |
| 6824 private: | 6858 private: |
| 6825 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6859 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6826 }; | 6860 }; |
| 6827 | 6861 |
| 6828 | 6862 |
| 6829 } // namespace dart | 6863 } // namespace dart |
| 6830 | 6864 |
| 6831 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6865 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |