| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 bool IsControl() { return (AsControl() != NULL); } | 290 bool IsControl() { return (AsControl() != NULL); } |
| 291 virtual ControlInstruction* AsControl() { return NULL; } | 291 virtual ControlInstruction* AsControl() { return NULL; } |
| 292 | 292 |
| 293 virtual intptr_t InputCount() const = 0; | 293 virtual intptr_t InputCount() const = 0; |
| 294 virtual Value* InputAt(intptr_t i) const = 0; | 294 virtual Value* InputAt(intptr_t i) const = 0; |
| 295 virtual void SetInputAt(intptr_t i, Value* value) = 0; | 295 virtual void SetInputAt(intptr_t i, Value* value) = 0; |
| 296 | 296 |
| 297 // Call instructions override this function and return the number of | 297 // Call instructions override this function and return the number of |
| 298 // pushed arguments. | 298 // pushed arguments. |
| 299 virtual intptr_t ArgumentCount() const = 0; | 299 virtual intptr_t ArgumentCount() const = 0; |
| 300 virtual PushArgumentInstr* ArgumentAt(intptr_t index) const { |
| 301 UNREACHABLE(); |
| 302 return NULL; |
| 303 }; |
| 300 | 304 |
| 301 // Returns true, if this instruction can deoptimize. | 305 // Returns true, if this instruction can deoptimize. |
| 302 virtual bool CanDeoptimize() const = 0; | 306 virtual bool CanDeoptimize() const = 0; |
| 303 | 307 |
| 304 // Visiting support. | 308 // Visiting support. |
| 305 virtual void Accept(FlowGraphVisitor* visitor) = 0; | 309 virtual void Accept(FlowGraphVisitor* visitor) = 0; |
| 306 | 310 |
| 307 Instruction* previous() const { return previous_; } | 311 Instruction* previous() const { return previous_; } |
| 308 void set_previous(Instruction* instr) { | 312 void set_previous(Instruction* instr) { |
| 309 ASSERT(!IsBlockEntry()); | 313 ASSERT(!IsBlockEntry()); |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 with_checks_(with_checks) { | 1735 with_checks_(with_checks) { |
| 1732 ASSERT(instance_call_ != NULL); | 1736 ASSERT(instance_call_ != NULL); |
| 1733 } | 1737 } |
| 1734 | 1738 |
| 1735 InstanceCallInstr* instance_call() const { return instance_call_; } | 1739 InstanceCallInstr* instance_call() const { return instance_call_; } |
| 1736 bool with_checks() const { return with_checks_; } | 1740 bool with_checks() const { return with_checks_; } |
| 1737 | 1741 |
| 1738 virtual intptr_t ArgumentCount() const { | 1742 virtual intptr_t ArgumentCount() const { |
| 1739 return instance_call()->ArgumentCount(); | 1743 return instance_call()->ArgumentCount(); |
| 1740 } | 1744 } |
| 1745 PushArgumentInstr* ArgumentAt(intptr_t index) const { |
| 1746 return instance_call()->ArgumentAt(index); |
| 1747 } |
| 1741 | 1748 |
| 1742 DECLARE_INSTRUCTION(PolymorphicInstanceCall) | 1749 DECLARE_INSTRUCTION(PolymorphicInstanceCall) |
| 1743 virtual RawAbstractType* CompileType() const; | 1750 virtual RawAbstractType* CompileType() const; |
| 1744 | 1751 |
| 1745 const ICData& ic_data() const { return ic_data_; } | 1752 const ICData& ic_data() const { return ic_data_; } |
| 1746 | 1753 |
| 1747 virtual bool CanDeoptimize() const { return true; } | 1754 virtual bool CanDeoptimize() const { return true; } |
| 1748 virtual intptr_t ResultCid() const { return kDynamicCid; } | 1755 virtual intptr_t ResultCid() const { return kDynamicCid; } |
| 1749 | 1756 |
| 1750 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1757 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| (...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3398 ForwardInstructionIterator* current_iterator_; | 3405 ForwardInstructionIterator* current_iterator_; |
| 3399 | 3406 |
| 3400 private: | 3407 private: |
| 3401 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3408 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3402 }; | 3409 }; |
| 3403 | 3410 |
| 3404 | 3411 |
| 3405 } // namespace dart | 3412 } // namespace dart |
| 3406 | 3413 |
| 3407 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3414 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |