Chromium Code Reviews| 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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1052 | 1052 |
| 1053 private: | 1053 private: |
| 1054 const intptr_t token_pos_; | 1054 const intptr_t token_pos_; |
| 1055 const intptr_t try_index_; | 1055 const intptr_t try_index_; |
| 1056 ObjectKind receiver_type_; | 1056 ObjectKind receiver_type_; |
| 1057 | 1057 |
| 1058 DISALLOW_COPY_AND_ASSIGN(StoreIndexedComp); | 1058 DISALLOW_COPY_AND_ASSIGN(StoreIndexedComp); |
| 1059 }; | 1059 }; |
| 1060 | 1060 |
| 1061 | 1061 |
| 1062 // Not simply an InstanceCall because it has somewhat more complicated | 1062 // TODO(fschneider): Make this an instance call. |
| 1063 // semantics: the value operand is preserved before the call. | 1063 class InstanceSetterComp : public Computation { |
| 1064 class InstanceSetterComp : public TemplateComputation<2> { | |
| 1065 public: | 1064 public: |
| 1066 InstanceSetterComp(intptr_t token_pos, | 1065 InstanceSetterComp(intptr_t token_pos, |
| 1067 intptr_t try_index, | 1066 intptr_t try_index, |
| 1068 const String& field_name, | 1067 const String& field_name, |
| 1069 Value* receiver, | 1068 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
|
srdjan
2012/08/01 16:53:31
It is OK that way, but I wonder why not pass expli
Florian Schneider
2012/08/02 10:06:59
As part of introducing push-argument instructions
| |
| 1070 Value* value) | |
| 1071 : token_pos_(token_pos), | 1069 : token_pos_(token_pos), |
| 1072 try_index_(try_index), | 1070 try_index_(try_index), |
| 1073 field_name_(field_name) { | 1071 field_name_(field_name), |
| 1074 inputs_[0] = receiver; | 1072 arguments_(arguments) { } |
| 1075 inputs_[1] = value; | |
| 1076 } | |
| 1077 | 1073 |
| 1078 DECLARE_COMPUTATION(InstanceSetter) | 1074 DECLARE_CALL_COMPUTATION(InstanceSetter) |
| 1079 | 1075 |
| 1080 intptr_t token_pos() const { return token_pos_; } | 1076 intptr_t token_pos() const { return token_pos_; } |
| 1081 intptr_t try_index() const { return try_index_; } | 1077 intptr_t try_index() const { return try_index_; } |
| 1082 const String& field_name() const { return field_name_; } | 1078 const String& field_name() const { return field_name_; } |
| 1083 Value* receiver() const { return inputs_[0]; } | 1079 |
| 1084 Value* value() const { return inputs_[1]; } | 1080 intptr_t ArgumentCount() const { return arguments_->length(); } |
| 1081 PushArgumentInstr* ArgumentAt(intptr_t index) const { | |
| 1082 return (*arguments_)[index]; | |
| 1083 } | |
| 1085 | 1084 |
| 1086 virtual bool CanDeoptimize() const { return true; } | 1085 virtual bool CanDeoptimize() const { return true; } |
| 1087 | 1086 |
| 1087 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
| 1088 | |
| 1088 private: | 1089 private: |
| 1089 const intptr_t token_pos_; | 1090 const intptr_t token_pos_; |
| 1090 const intptr_t try_index_; | 1091 const intptr_t try_index_; |
| 1091 const String& field_name_; | 1092 const String& field_name_; |
| 1093 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | |
| 1092 | 1094 |
| 1093 DISALLOW_COPY_AND_ASSIGN(InstanceSetterComp); | 1095 DISALLOW_COPY_AND_ASSIGN(InstanceSetterComp); |
| 1094 }; | 1096 }; |
| 1095 | 1097 |
| 1096 | 1098 |
| 1097 // Not simply a StaticCall because it has somewhat more complicated | 1099 // Not simply a StaticCall because it has somewhat more complicated |
| 1098 // semantics: the value operand is preserved before the call. | 1100 // semantics: the value operand is preserved before the call. |
| 1099 class StaticSetterComp : public TemplateComputation<1> { | 1101 class StaticSetterComp : public TemplateComputation<1> { |
| 1100 public: | 1102 public: |
| 1101 StaticSetterComp(intptr_t token_pos, | 1103 StaticSetterComp(intptr_t token_pos, |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2638 // Parallel move that will be used by linear scan register allocator to | 2640 // Parallel move that will be used by linear scan register allocator to |
| 2639 // connect live ranges at the end of the block and resolve phis. | 2641 // connect live ranges at the end of the block and resolve phis. |
| 2640 ParallelMoveInstr* parallel_move_; | 2642 ParallelMoveInstr* parallel_move_; |
| 2641 }; | 2643 }; |
| 2642 | 2644 |
| 2643 | 2645 |
| 2644 class BranchInstr : public InstructionWithInputs { | 2646 class BranchInstr : public InstructionWithInputs { |
| 2645 public: | 2647 public: |
| 2646 BranchInstr(intptr_t token_pos, | 2648 BranchInstr(intptr_t token_pos, |
| 2647 intptr_t try_index, | 2649 intptr_t try_index, |
| 2648 Value* left, | 2650 Value* left, |
| 2649 Value* right, | 2651 Value* right, |
| 2650 Token::Kind kind) | 2652 Token::Kind kind) |
| 2651 : InstructionWithInputs(), | 2653 : InstructionWithInputs(), |
| 2652 token_pos_(token_pos), | 2654 token_pos_(token_pos), |
| 2653 try_index_(try_index), | 2655 try_index_(try_index), |
| 2654 left_(left), | 2656 left_(left), |
| 2655 right_(right), | 2657 right_(right), |
| 2656 kind_(kind), | 2658 kind_(kind), |
| 2657 true_successor_(NULL), | 2659 true_successor_(NULL), |
| 2658 false_successor_(NULL) { | 2660 false_successor_(NULL) { |
| 2659 ASSERT(left_ != NULL); | 2661 ASSERT(left_ != NULL); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2795 const GrowableArray<BlockEntryInstr*>& block_order_; | 2797 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2796 | 2798 |
| 2797 private: | 2799 private: |
| 2798 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2800 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2799 }; | 2801 }; |
| 2800 | 2802 |
| 2801 | 2803 |
| 2802 } // namespace dart | 2804 } // namespace dart |
| 2803 | 2805 |
| 2804 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2806 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |