| 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 18 matching lines...) Expand all Loading... |
| 29 class FlowGraphOptimizer; | 29 class FlowGraphOptimizer; |
| 30 | 30 |
| 31 | 31 |
| 32 // TODO(srdjan): Unify with INTRINSIC_LIST. | 32 // TODO(srdjan): Unify with INTRINSIC_LIST. |
| 33 // (class-name, function-name, recognized enum, fingerprint). | 33 // (class-name, function-name, recognized enum, fingerprint). |
| 34 // See intrinsifier for fingerprint computation. | 34 // See intrinsifier for fingerprint computation. |
| 35 #define RECOGNIZED_LIST(V) \ | 35 #define RECOGNIZED_LIST(V) \ |
| 36 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ | 36 V(_ObjectArray, get:length, ObjectArrayLength, 405297088) \ |
| 37 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ | 37 V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233) \ |
| 38 V(_ByteArrayBase, get:length, ByteArrayBaseLength, 1098081765) \ | 38 V(_ByteArrayBase, get:length, ByteArrayBaseLength, 1098081765) \ |
| 39 V(_ByteArrayBase, _getInt8, ByteArrayBaseGetInt8, 261365835) \ |
| 40 V(_ByteArrayBase, _getUint8, ByteArrayBaseGetUint8, 261365835) \ |
| 41 V(_ByteArrayBase, _getInt16, ByteArrayBaseGetInt16, 261365835) \ |
| 42 V(_ByteArrayBase, _getUint16, ByteArrayBaseGetUint16, 261365835) \ |
| 43 V(_ByteArrayBase, _getInt32, ByteArrayBaseGetInt32, 261365835) \ |
| 44 V(_ByteArrayBase, _getUint32, ByteArrayBaseGetUint32, 261365835) \ |
| 45 V(_ByteArrayBase, _getFloat32, ByteArrayBaseGetFloat32, 434247298) \ |
| 46 V(_ByteArrayBase, _getFloat64, ByteArrayBaseGetFloat64, 434247298) \ |
| 39 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ | 47 V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050) \ |
| 40 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ | 48 V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050) \ |
| 41 V(_StringBase, get:length, StringBaseLength, 320803993) \ | 49 V(_StringBase, get:length, StringBaseLength, 320803993) \ |
| 42 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 711547329) \ | 50 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 711547329) \ |
| 43 V(_StringBase, charCodeAt, StringBaseCharCodeAt, 984449525) \ | 51 V(_StringBase, charCodeAt, StringBaseCharCodeAt, 984449525) \ |
| 44 V(_StringBase, [], StringBaseCharAt, 1062366987) \ | 52 V(_StringBase, [], StringBaseCharAt, 1062366987) \ |
| 45 V(_IntegerImplementation, toDouble, IntegerToDouble, 733149324) \ | 53 V(_IntegerImplementation, toDouble, IntegerToDouble, 733149324) \ |
| 46 V(_Double, toInt, DoubleToInteger, 362666636) \ | 54 V(_Double, toInt, DoubleToInteger, 362666636) \ |
| 47 V(_Double, truncate, DoubleTruncate, 620870996) \ | 55 V(_Double, truncate, DoubleTruncate, 620870996) \ |
| 48 V(_Double, round, DoubleRound, 620870996) \ | 56 V(_Double, round, DoubleRound, 620870996) \ |
| (...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2714 const Field& field_; | 2722 const Field& field_; |
| 2715 | 2723 |
| 2716 DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldInstr); | 2724 DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldInstr); |
| 2717 }; | 2725 }; |
| 2718 | 2726 |
| 2719 | 2727 |
| 2720 class LoadIndexedInstr : public TemplateDefinition<2> { | 2728 class LoadIndexedInstr : public TemplateDefinition<2> { |
| 2721 public: | 2729 public: |
| 2722 LoadIndexedInstr(Value* array, | 2730 LoadIndexedInstr(Value* array, |
| 2723 Value* index, | 2731 Value* index, |
| 2732 intptr_t index_scale, |
| 2724 intptr_t class_id, | 2733 intptr_t class_id, |
| 2725 intptr_t deopt_id) | 2734 intptr_t deopt_id) |
| 2726 : class_id_(class_id) { | 2735 : index_scale_(index_scale), class_id_(class_id) { |
| 2727 ASSERT(array != NULL); | 2736 ASSERT(array != NULL); |
| 2728 ASSERT(index != NULL); | 2737 ASSERT(index != NULL); |
| 2729 inputs_[0] = array; | 2738 inputs_[0] = array; |
| 2730 inputs_[1] = index; | 2739 inputs_[1] = index; |
| 2731 deopt_id_ = deopt_id; | 2740 deopt_id_ = deopt_id; |
| 2732 } | 2741 } |
| 2733 | 2742 |
| 2734 DECLARE_INSTRUCTION(LoadIndexed) | 2743 DECLARE_INSTRUCTION(LoadIndexed) |
| 2735 virtual RawAbstractType* CompileType() const; | 2744 virtual RawAbstractType* CompileType() const; |
| 2736 | 2745 |
| 2737 Value* array() const { return inputs_[0]; } | 2746 Value* array() const { return inputs_[0]; } |
| 2738 Value* index() const { return inputs_[1]; } | 2747 Value* index() const { return inputs_[1]; } |
| 2748 intptr_t index_scale() const { return index_scale_; } |
| 2739 intptr_t class_id() const { return class_id_; } | 2749 intptr_t class_id() const { return class_id_; } |
| 2740 | 2750 |
| 2741 virtual bool CanDeoptimize() const { | 2751 virtual bool CanDeoptimize() const { |
| 2742 return deopt_id_ != Isolate::kNoDeoptId; | 2752 return deopt_id_ != Isolate::kNoDeoptId; |
| 2743 } | 2753 } |
| 2744 | 2754 |
| 2745 virtual bool HasSideEffect() const { return false; } | 2755 virtual bool HasSideEffect() const { return false; } |
| 2746 | 2756 |
| 2747 virtual intptr_t ResultCid() const; | 2757 virtual intptr_t ResultCid() const; |
| 2748 | 2758 |
| 2749 virtual Representation representation() const; | 2759 virtual Representation representation() const; |
| 2750 | 2760 |
| 2751 virtual bool AttributesEqual(Instruction* other) const; | 2761 virtual bool AttributesEqual(Instruction* other) const; |
| 2752 | 2762 |
| 2753 virtual bool AffectedBySideEffect() const { return true; } | 2763 virtual bool AffectedBySideEffect() const { return true; } |
| 2754 | 2764 |
| 2755 virtual void InferRange(); | 2765 virtual void InferRange(); |
| 2756 | 2766 |
| 2757 private: | 2767 private: |
| 2768 const intptr_t index_scale_; |
| 2758 const intptr_t class_id_; | 2769 const intptr_t class_id_; |
| 2759 | 2770 |
| 2760 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); | 2771 DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr); |
| 2761 }; | 2772 }; |
| 2762 | 2773 |
| 2763 | 2774 |
| 2764 class StringFromCharCodeInstr : public TemplateDefinition<1> { | 2775 class StringFromCharCodeInstr : public TemplateDefinition<1> { |
| 2765 public: | 2776 public: |
| 2766 explicit StringFromCharCodeInstr(Value* char_code, | 2777 explicit StringFromCharCodeInstr(Value* char_code, |
| 2767 intptr_t cid) : cid_(cid) { | 2778 intptr_t cid) : cid_(cid) { |
| (...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4498 ForwardInstructionIterator* current_iterator_; | 4509 ForwardInstructionIterator* current_iterator_; |
| 4499 | 4510 |
| 4500 private: | 4511 private: |
| 4501 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4512 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4502 }; | 4513 }; |
| 4503 | 4514 |
| 4504 | 4515 |
| 4505 } // namespace dart | 4516 } // namespace dart |
| 4506 | 4517 |
| 4507 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4518 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |