| 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(LoadUntagged) \ | 650 M(LoadUntagged) \ |
| 652 M(LoadClassId) \ | 651 M(LoadClassId) \ |
| 653 M(InstantiateType) \ | 652 M(InstantiateType) \ |
| 654 M(InstantiateTypeArguments) \ | 653 M(InstantiateTypeArguments) \ |
| 655 M(AllocateContext) \ | 654 M(AllocateContext) \ |
| 656 M(CloneContext) \ | 655 M(CloneContext) \ |
| 657 M(BinarySmiOp) \ | 656 M(BinarySmiOp) \ |
| 658 M(UnarySmiOp) \ | 657 M(UnarySmiOp) \ |
| (...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3341 } | 3340 } |
| 3342 | 3341 |
| 3343 DECLARE_INSTRUCTION(DropTemps) | 3342 DECLARE_INSTRUCTION(DropTemps) |
| 3344 | 3343 |
| 3345 Value* value() const { return inputs_[0]; } | 3344 Value* value() const { return inputs_[0]; } |
| 3346 | 3345 |
| 3347 intptr_t num_temps() const { return num_temps_; } | 3346 intptr_t num_temps() const { return num_temps_; } |
| 3348 | 3347 |
| 3349 virtual CompileType* ComputeInitialType() const; | 3348 virtual CompileType* ComputeInitialType() const; |
| 3350 | 3349 |
| 3350 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3351 |
| 3351 virtual bool CanDeoptimize() const { return false; } | 3352 virtual bool CanDeoptimize() const { return false; } |
| 3352 | 3353 |
| 3353 virtual EffectSet Effects() const { | 3354 virtual EffectSet Effects() const { |
| 3354 UNREACHABLE(); // Eliminated by SSA construction. | 3355 UNREACHABLE(); // Eliminated by SSA construction. |
| 3355 return EffectSet::None(); | 3356 return EffectSet::None(); |
| 3356 } | 3357 } |
| 3357 | 3358 |
| 3358 virtual bool MayThrow() const { | 3359 virtual bool MayThrow() const { |
| 3359 UNREACHABLE(); | 3360 UNREACHABLE(); |
| 3360 return false; | 3361 return false; |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4135 | 4136 |
| 4136 virtual bool MayThrow() const { return false; } | 4137 virtual bool MayThrow() const { return false; } |
| 4137 | 4138 |
| 4138 private: | 4139 private: |
| 4139 const intptr_t token_pos_; | 4140 const intptr_t token_pos_; |
| 4140 | 4141 |
| 4141 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); | 4142 DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr); |
| 4142 }; | 4143 }; |
| 4143 | 4144 |
| 4144 | 4145 |
| 4145 class CreateClosureInstr : public TemplateDefinition<0> { | |
| 4146 public: | |
| 4147 CreateClosureInstr(const Function& function, | |
| 4148 ZoneGrowableArray<PushArgumentInstr*>* arguments, | |
| 4149 intptr_t token_pos) | |
| 4150 : function_(function), | |
| 4151 arguments_(arguments), | |
| 4152 token_pos_(token_pos) { } | |
| 4153 | |
| 4154 DECLARE_INSTRUCTION(CreateClosure) | |
| 4155 virtual CompileType ComputeType() const; | |
| 4156 | |
| 4157 intptr_t token_pos() const { return token_pos_; } | |
| 4158 const Function& function() const { return function_; } | |
| 4159 | |
| 4160 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | |
| 4161 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | |
| 4162 return (*arguments_)[index]; | |
| 4163 } | |
| 4164 | |
| 4165 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
| 4166 | |
| 4167 virtual bool CanDeoptimize() const { return false; } | |
| 4168 | |
| 4169 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 4170 | |
| 4171 virtual bool MayThrow() const { return false; } | |
| 4172 | |
| 4173 private: | |
| 4174 const Function& function_; | |
| 4175 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | |
| 4176 intptr_t token_pos_; | |
| 4177 | |
| 4178 DISALLOW_COPY_AND_ASSIGN(CreateClosureInstr); | |
| 4179 }; | |
| 4180 | |
| 4181 | |
| 4182 class LoadUntaggedInstr : public TemplateDefinition<1> { | 4146 class LoadUntaggedInstr : public TemplateDefinition<1> { |
| 4183 public: | 4147 public: |
| 4184 LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) { | 4148 LoadUntaggedInstr(Value* object, intptr_t offset) : offset_(offset) { |
| 4185 SetInputAt(0, object); | 4149 SetInputAt(0, object); |
| 4186 } | 4150 } |
| 4187 | 4151 |
| 4188 virtual Representation representation() const { | 4152 virtual Representation representation() const { |
| 4189 return kUntagged; | 4153 return kUntagged; |
| 4190 } | 4154 } |
| 4191 DECLARE_INSTRUCTION(LoadUntagged) | 4155 DECLARE_INSTRUCTION(LoadUntagged) |
| (...skipping 3006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7198 ForwardInstructionIterator* current_iterator_; | 7162 ForwardInstructionIterator* current_iterator_; |
| 7199 | 7163 |
| 7200 private: | 7164 private: |
| 7201 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7165 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 7202 }; | 7166 }; |
| 7203 | 7167 |
| 7204 | 7168 |
| 7205 } // namespace dart | 7169 } // namespace dart |
| 7206 | 7170 |
| 7207 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7171 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |