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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 // Recompute compile type. | 359 // Recompute compile type. |
360 virtual void Update() = 0; | 360 virtual void Update() = 0; |
361 | 361 |
362 protected: | 362 protected: |
363 explicit ConstrainedCompileType(const CompileType& type) | 363 explicit ConstrainedCompileType(const CompileType& type) |
364 : ZoneCompileType(type) { } | 364 : ZoneCompileType(type) { } |
365 }; | 365 }; |
366 | 366 |
367 | 367 |
368 // NotNullConstrainedCompileType represents not-null constraint applied to | 368 // NotNullConstrainedCompileType represents not-null constraint applied to |
369 // the source compile type. Result is non-nullable version of the incomming | 369 // the source compile type. Result is non-nullable version of the incoming |
370 // compile type. It is used to represent compile type propagated downwards | 370 // compile type. It is used to represent compile type propagated downwards |
371 // from strict comparison with the null constant. | 371 // from strict comparison with the null constant. |
372 class NotNullConstrainedCompileType : public ConstrainedCompileType { | 372 class NotNullConstrainedCompileType : public ConstrainedCompileType { |
373 public: | 373 public: |
374 explicit NotNullConstrainedCompileType(CompileType* source) | 374 explicit NotNullConstrainedCompileType(CompileType* source) |
375 : ConstrainedCompileType(source->CopyNonNullable()), source_(source) { } | 375 : ConstrainedCompileType(source->CopyNonNullable()), source_(source) { } |
376 | 376 |
377 virtual void Update() { | 377 virtual void Update() { |
378 type_ = source_->CopyNonNullable(); | 378 type_ = source_->CopyNonNullable(); |
379 } | 379 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 // Assert if BindsToConstant() is false, otherwise returns the constant value. | 499 // Assert if BindsToConstant() is false, otherwise returns the constant value. |
500 const Object& BoundConstant() const; | 500 const Object& BoundConstant() const; |
501 | 501 |
502 // Compile time constants, Bool, Smi and Nulls do not need to update | 502 // Compile time constants, Bool, Smi and Nulls do not need to update |
503 // the store buffer. | 503 // the store buffer. |
504 bool NeedsStoreBuffer(); | 504 bool NeedsStoreBuffer(); |
505 | 505 |
506 bool Equals(Value* other) const; | 506 bool Equals(Value* other) const; |
507 | 507 |
508 private: | 508 private: |
| 509 friend class FlowGraphPrinter; |
| 510 |
509 Definition* definition_; | 511 Definition* definition_; |
510 Value* previous_use_; | 512 Value* previous_use_; |
511 Value* next_use_; | 513 Value* next_use_; |
512 Instruction* instruction_; | 514 Instruction* instruction_; |
513 intptr_t use_index_; | 515 intptr_t use_index_; |
514 | 516 |
515 CompileType* reaching_type_; | 517 CompileType* reaching_type_; |
516 | 518 |
517 DISALLOW_COPY_AND_ASSIGN(Value); | 519 DISALLOW_COPY_AND_ASSIGN(Value); |
518 }; | 520 }; |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 | 1747 |
1746 void SetReplacement(Definition* other) { | 1748 void SetReplacement(Definition* other) { |
1747 ASSERT(ssa_temp_index_ >= 0); | 1749 ASSERT(ssa_temp_index_ >= 0); |
1748 ASSERT(WasEliminated()); | 1750 ASSERT(WasEliminated()); |
1749 ssa_temp_index_ = kReplacementMarker; | 1751 ssa_temp_index_ = kReplacementMarker; |
1750 temp_index_ = reinterpret_cast<intptr_t>(other); | 1752 temp_index_ = reinterpret_cast<intptr_t>(other); |
1751 } | 1753 } |
1752 | 1754 |
1753 protected: | 1755 protected: |
1754 friend class RangeAnalysis; | 1756 friend class RangeAnalysis; |
| 1757 friend class Value; |
1755 | 1758 |
1756 Range* range_; | 1759 Range* range_; |
1757 CompileType* type_; | 1760 CompileType* type_; |
1758 | 1761 |
1759 private: | 1762 private: |
1760 intptr_t temp_index_; | 1763 intptr_t temp_index_; |
1761 intptr_t ssa_temp_index_; | 1764 intptr_t ssa_temp_index_; |
1762 Value* input_use_list_; | 1765 Value* input_use_list_; |
1763 Value* env_use_list_; | 1766 Value* env_use_list_; |
1764 UseKind use_kind_; | 1767 UseKind use_kind_; |
(...skipping 5091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6856 ForwardInstructionIterator* current_iterator_; | 6859 ForwardInstructionIterator* current_iterator_; |
6857 | 6860 |
6858 private: | 6861 private: |
6859 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6862 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
6860 }; | 6863 }; |
6861 | 6864 |
6862 | 6865 |
6863 } // namespace dart | 6866 } // namespace dart |
6864 | 6867 |
6865 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6868 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |