| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 M(NativeCall) \ | 638 M(NativeCall) \ |
| 639 M(DebugStepCheck) \ | 639 M(DebugStepCheck) \ |
| 640 M(LoadIndexed) \ | 640 M(LoadIndexed) \ |
| 641 M(StoreIndexed) \ | 641 M(StoreIndexed) \ |
| 642 M(StoreInstanceField) \ | 642 M(StoreInstanceField) \ |
| 643 M(LoadStaticField) \ | 643 M(LoadStaticField) \ |
| 644 M(StoreStaticField) \ | 644 M(StoreStaticField) \ |
| 645 M(BooleanNegate) \ | 645 M(BooleanNegate) \ |
| 646 M(InstanceOf) \ | 646 M(InstanceOf) \ |
| 647 M(CreateArray) \ | 647 M(CreateArray) \ |
| 648 M(CreateClosure) \ | |
| 649 M(AllocateObject) \ | 648 M(AllocateObject) \ |
| 650 M(LoadField) \ | 649 M(LoadField) \ |
| 651 M(StoreVMField) \ | 650 M(StoreVMField) \ |
| 652 M(LoadUntagged) \ | 651 M(LoadUntagged) \ |
| 653 M(LoadClassId) \ | 652 M(LoadClassId) \ |
| 654 M(InstantiateType) \ | 653 M(InstantiateType) \ |
| 655 M(InstantiateTypeArguments) \ | 654 M(InstantiateTypeArguments) \ |
| 656 M(AllocateContext) \ | 655 M(AllocateContext) \ |
| 657 M(CloneContext) \ | 656 M(CloneContext) \ |
| 658 M(BinarySmiOp) \ | 657 M(BinarySmiOp) \ |
| (...skipping 2683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3342 } | 3341 } |
| 3343 | 3342 |
| 3344 DECLARE_INSTRUCTION(DropTemps) | 3343 DECLARE_INSTRUCTION(DropTemps) |
| 3345 | 3344 |
| 3346 Value* value() const { return inputs_[0]; } | 3345 Value* value() const { return inputs_[0]; } |
| 3347 | 3346 |
| 3348 intptr_t num_temps() const { return num_temps_; } | 3347 intptr_t num_temps() const { return num_temps_; } |
| 3349 | 3348 |
| 3350 virtual CompileType* ComputeInitialType() const; | 3349 virtual CompileType* ComputeInitialType() const; |
| 3351 | 3350 |
| 3351 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3352 |
| 3352 virtual bool CanDeoptimize() const { return false; } | 3353 virtual bool CanDeoptimize() const { return false; } |
| 3353 | 3354 |
| 3354 virtual EffectSet Effects() const { | 3355 virtual EffectSet Effects() const { |
| 3355 UNREACHABLE(); // Eliminated by SSA construction. | 3356 UNREACHABLE(); // Eliminated by SSA construction. |
| 3356 return EffectSet::None(); | 3357 return EffectSet::None(); |
| 3357 } | 3358 } |
| 3358 | 3359 |
| 3359 virtual bool MayThrow() const { | 3360 virtual bool MayThrow() const { |
| 3360 UNREACHABLE(); | 3361 UNREACHABLE(); |
| 3361 return false; | 3362 return false; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4120 | 4121 |
| 4121 virtual bool MayThrow() const { return false; } | 4122 virtual bool MayThrow() const { return false; } |
| 4122 | 4123 |
| 4123 private: | 4124 private: |
| 4124 const intptr_t token_pos_; | 4125 const intptr_t token_pos_; |
| 4125 | 4126 |
| 4126 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); | 4127 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); |
| 4127 }; | 4128 }; |
| 4128 | 4129 |
| 4129 | 4130 |
| 4130 class CreateClosureInstr : public TemplateDefinition<0> { | |
| 4131 public: | |
| 4132 CreateClosureInstr(const Function& function, | |
| 4133 ZoneGrowableArray<PushArgumentInstr*>* arguments, | |
| 4134 intptr_t token_pos) | |
| 4135 : function_(function), | |
| 4136 arguments_(arguments), | |
| 4137 token_pos_(token_pos) { } | |
| 4138 | |
| 4139 DECLARE_INSTRUCTION(CreateClosure) | |
| 4140 virtual CompileType ComputeType() const; | |
| 4141 | |
| 4142 intptr_t token_pos() const { return token_pos_; } | |
| 4143 const Function& function() const { return function_; } | |
| 4144 | |
| 4145 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | |
| 4146 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | |
| 4147 return (*arguments_)[index]; | |
| 4148 } | |
| 4149 | |
| 4150 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
| 4151 | |
| 4152 virtual bool CanDeoptimize() const { return false; } | |
| 4153 | |
| 4154 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 4155 | |
| 4156 virtual bool MayThrow() const { return false; } | |
| 4157 | |
| 4158 private: | |
| 4159 const Function& function_; | |
| 4160 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | |
| 4161 intptr_t token_pos_; | |
| 4162 | |
| 4163 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr); | |
| 4164 }; | |
| 4165 | |
| 4166 | |
| 4167 class LoadUntaggedInstr : public TemplateDefinition<1> { | 4131 class LoadUntaggedInstr : public TemplateDefinition<1> { |
| 4168 public: | 4132 public: |
| 4169 LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) { | 4133 LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) { |
| 4170 SetInputAt(0, object); | 4134 SetInputAt(0, object); |
| 4171 } | 4135 } |
| 4172 | 4136 |
| 4173 virtual Representation representation() const { | 4137 virtual Representation representation() const { |
| 4174 return kUntagged; | 4138 return kUntagged; |
| 4175 } | 4139 } |
| 4176 DECLARE_INSTRUCTION(LoadUntagged) | 4140 DECLARE_INSTRUCTION(LoadUntagged) |
| (...skipping 3033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7210 ForwardInstructionIterator* current_iterator_; | 7174 ForwardInstructionIterator* current_iterator_; |
| 7211 | 7175 |
| 7212 private: | 7176 private: |
| 7213 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7177 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 7214 }; | 7178 }; |
| 7215 | 7179 |
| 7216 | 7180 |
| 7217 } // namespace dart | 7181 } // namespace dart |
| 7218 | 7182 |
| 7219 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7183 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |