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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 M(AssertAssignable) \ | 522 M(AssertAssignable) \ |
523 M(AssertBoolean) \ | 523 M(AssertBoolean) \ |
524 M(ArgumentDefinitionTest) \ | 524 M(ArgumentDefinitionTest) \ |
525 M(CurrentContext) \ | 525 M(CurrentContext) \ |
526 M(StoreContext) \ | 526 M(StoreContext) \ |
527 M(ClosureCall) \ | 527 M(ClosureCall) \ |
528 M(InstanceCall) \ | 528 M(InstanceCall) \ |
529 M(PolymorphicInstanceCall) \ | 529 M(PolymorphicInstanceCall) \ |
530 M(StaticCall) \ | 530 M(StaticCall) \ |
531 M(LoadLocal) \ | 531 M(LoadLocal) \ |
| 532 M(PushTemp) \ |
| 533 M(DropTemps) \ |
532 M(StoreLocal) \ | 534 M(StoreLocal) \ |
533 M(StrictCompare) \ | 535 M(StrictCompare) \ |
534 M(EqualityCompare) \ | 536 M(EqualityCompare) \ |
535 M(RelationalOp) \ | 537 M(RelationalOp) \ |
536 M(NativeCall) \ | 538 M(NativeCall) \ |
537 M(LoadIndexed) \ | 539 M(LoadIndexed) \ |
538 M(StoreIndexed) \ | 540 M(StoreIndexed) \ |
539 M(StoreInstanceField) \ | 541 M(StoreInstanceField) \ |
540 M(LoadStaticField) \ | 542 M(LoadStaticField) \ |
541 M(StoreStaticField) \ | 543 M(StoreStaticField) \ |
(...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 } | 3140 } |
3139 | 3141 |
3140 private: | 3142 private: |
3141 const LocalVariable& local_; | 3143 const LocalVariable& local_; |
3142 bool is_last_; | 3144 bool is_last_; |
3143 | 3145 |
3144 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); | 3146 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); |
3145 }; | 3147 }; |
3146 | 3148 |
3147 | 3149 |
| 3150 class PushTempInstr : public TemplateDefinition<1> { |
| 3151 public: |
| 3152 explicit PushTempInstr(Value* value) { |
| 3153 SetInputAt(0, value); |
| 3154 } |
| 3155 |
| 3156 DECLARE_INSTRUCTION(PushTemp) |
| 3157 |
| 3158 Value* value() const { return inputs_[0]; } |
| 3159 |
| 3160 virtual CompileType ComputeType() const; |
| 3161 |
| 3162 virtual bool CanDeoptimize() const { return false; } |
| 3163 |
| 3164 virtual EffectSet Effects() const { |
| 3165 UNREACHABLE(); // Eliminated by SSA construction. |
| 3166 return EffectSet::None(); |
| 3167 } |
| 3168 |
| 3169 virtual bool MayThrow() const { |
| 3170 UNREACHABLE(); |
| 3171 return false; |
| 3172 } |
| 3173 |
| 3174 private: |
| 3175 DISALLOW_COPY_AND_ASSIGN(PushTempInstr); |
| 3176 }; |
| 3177 |
| 3178 |
| 3179 class DropTempsInstr : public TemplateDefinition<1> { |
| 3180 public: |
| 3181 explicit DropTempsInstr(intptr_t num_temps, Value* value) |
| 3182 : num_temps_(num_temps) { |
| 3183 SetInputAt(0, value); |
| 3184 } |
| 3185 |
| 3186 DECLARE_INSTRUCTION(DropTemps) |
| 3187 |
| 3188 Value* value() const { return inputs_[0]; } |
| 3189 |
| 3190 intptr_t num_temps() const { return num_temps_; } |
| 3191 |
| 3192 virtual CompileType ComputeType() const; |
| 3193 |
| 3194 virtual bool CanDeoptimize() const { return false; } |
| 3195 |
| 3196 virtual EffectSet Effects() const { |
| 3197 UNREACHABLE(); // Eliminated by SSA construction. |
| 3198 return EffectSet::None(); |
| 3199 } |
| 3200 |
| 3201 virtual bool MayThrow() const { |
| 3202 UNREACHABLE(); |
| 3203 return false; |
| 3204 } |
| 3205 |
| 3206 private: |
| 3207 intptr_t num_temps_; |
| 3208 |
| 3209 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr); |
| 3210 }; |
| 3211 |
| 3212 |
3148 class StoreLocalInstr : public TemplateDefinition<1> { | 3213 class StoreLocalInstr : public TemplateDefinition<1> { |
3149 public: | 3214 public: |
3150 StoreLocalInstr(const LocalVariable& local, Value* value) | 3215 StoreLocalInstr(const LocalVariable& local, Value* value) |
3151 : local_(local), is_dead_(false), is_last_(false) { | 3216 : local_(local), is_dead_(false), is_last_(false) { |
3152 SetInputAt(0, value); | 3217 SetInputAt(0, value); |
3153 } | 3218 } |
3154 | 3219 |
3155 DECLARE_INSTRUCTION(StoreLocal) | 3220 DECLARE_INSTRUCTION(StoreLocal) |
3156 virtual CompileType* ComputeInitialType() const; | 3221 virtual CompileType* ComputeInitialType() const; |
3157 | 3222 |
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6410 ForwardInstructionIterator* current_iterator_; | 6475 ForwardInstructionIterator* current_iterator_; |
6411 | 6476 |
6412 private: | 6477 private: |
6413 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6478 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
6414 }; | 6479 }; |
6415 | 6480 |
6416 | 6481 |
6417 } // namespace dart | 6482 } // namespace dart |
6418 | 6483 |
6419 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6484 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |