| 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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 }; | 1509 }; |
| 1510 | 1510 |
| 1511 | 1511 |
| 1512 class CatchBlockEntryInstr : public BlockEntryInstr { | 1512 class CatchBlockEntryInstr : public BlockEntryInstr { |
| 1513 public: | 1513 public: |
| 1514 CatchBlockEntryInstr(intptr_t block_id, | 1514 CatchBlockEntryInstr(intptr_t block_id, |
| 1515 intptr_t try_index, | 1515 intptr_t try_index, |
| 1516 const Array& handler_types, | 1516 const Array& handler_types, |
| 1517 intptr_t catch_try_index, | 1517 intptr_t catch_try_index, |
| 1518 const LocalVariable& exception_var, | 1518 const LocalVariable& exception_var, |
| 1519 const LocalVariable& stacktrace_var) | 1519 const LocalVariable& stacktrace_var, |
| 1520 bool needs_stacktrace) |
| 1520 : BlockEntryInstr(block_id, try_index), | 1521 : BlockEntryInstr(block_id, try_index), |
| 1521 predecessor_(NULL), | 1522 predecessor_(NULL), |
| 1522 catch_handler_types_(Array::ZoneHandle(handler_types.raw())), | 1523 catch_handler_types_(Array::ZoneHandle(handler_types.raw())), |
| 1523 catch_try_index_(catch_try_index), | 1524 catch_try_index_(catch_try_index), |
| 1524 exception_var_(exception_var), | 1525 exception_var_(exception_var), |
| 1525 stacktrace_var_(stacktrace_var) { } | 1526 stacktrace_var_(stacktrace_var), |
| 1527 needs_stacktrace_(needs_stacktrace) { } |
| 1526 | 1528 |
| 1527 DECLARE_INSTRUCTION(CatchBlockEntry) | 1529 DECLARE_INSTRUCTION(CatchBlockEntry) |
| 1528 | 1530 |
| 1529 virtual intptr_t PredecessorCount() const { | 1531 virtual intptr_t PredecessorCount() const { |
| 1530 return (predecessor_ == NULL) ? 0 : 1; | 1532 return (predecessor_ == NULL) ? 0 : 1; |
| 1531 } | 1533 } |
| 1532 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 1534 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 1533 ASSERT((index == 0) && (predecessor_ != NULL)); | 1535 ASSERT((index == 0) && (predecessor_ != NULL)); |
| 1534 return predecessor_; | 1536 return predecessor_; |
| 1535 } | 1537 } |
| 1536 | 1538 |
| 1537 const LocalVariable& exception_var() const { return exception_var_; } | 1539 const LocalVariable& exception_var() const { return exception_var_; } |
| 1538 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } | 1540 const LocalVariable& stacktrace_var() const { return stacktrace_var_; } |
| 1539 | 1541 |
| 1542 bool needs_stacktrace() const { return needs_stacktrace_; } |
| 1543 |
| 1540 // Returns try index for the try block to which this catch handler | 1544 // Returns try index for the try block to which this catch handler |
| 1541 // corresponds. | 1545 // corresponds. |
| 1542 intptr_t catch_try_index() const { | 1546 intptr_t catch_try_index() const { |
| 1543 return catch_try_index_; | 1547 return catch_try_index_; |
| 1544 } | 1548 } |
| 1545 GrowableArray<Definition*>* initial_definitions() { | 1549 GrowableArray<Definition*>* initial_definitions() { |
| 1546 return &initial_definitions_; | 1550 return &initial_definitions_; |
| 1547 } | 1551 } |
| 1548 | 1552 |
| 1549 virtual void PrintTo(BufferFormatter* f) const; | 1553 virtual void PrintTo(BufferFormatter* f) const; |
| 1550 | 1554 |
| 1551 private: | 1555 private: |
| 1552 friend class BlockEntryInstr; // Access to predecessor_ when inlining. | 1556 friend class BlockEntryInstr; // Access to predecessor_ when inlining. |
| 1553 | 1557 |
| 1554 virtual void ClearPredecessors() { predecessor_ = NULL; } | 1558 virtual void ClearPredecessors() { predecessor_ = NULL; } |
| 1555 virtual void AddPredecessor(BlockEntryInstr* predecessor) { | 1559 virtual void AddPredecessor(BlockEntryInstr* predecessor) { |
| 1556 ASSERT(predecessor_ == NULL); | 1560 ASSERT(predecessor_ == NULL); |
| 1557 predecessor_ = predecessor; | 1561 predecessor_ = predecessor; |
| 1558 } | 1562 } |
| 1559 | 1563 |
| 1560 BlockEntryInstr* predecessor_; | 1564 BlockEntryInstr* predecessor_; |
| 1561 const Array& catch_handler_types_; | 1565 const Array& catch_handler_types_; |
| 1562 const intptr_t catch_try_index_; | 1566 const intptr_t catch_try_index_; |
| 1563 GrowableArray<Definition*> initial_definitions_; | 1567 GrowableArray<Definition*> initial_definitions_; |
| 1564 const LocalVariable& exception_var_; | 1568 const LocalVariable& exception_var_; |
| 1565 const LocalVariable& stacktrace_var_; | 1569 const LocalVariable& stacktrace_var_; |
| 1570 const bool needs_stacktrace_; |
| 1566 | 1571 |
| 1567 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr); | 1572 DISALLOW_COPY_AND_ASSIGN(CatchBlockEntryInstr); |
| 1568 }; | 1573 }; |
| 1569 | 1574 |
| 1570 | 1575 |
| 1571 // Abstract super-class of all instructions that define a value (Bind, Phi). | 1576 // Abstract super-class of all instructions that define a value (Bind, Phi). |
| 1572 class Definition : public Instruction { | 1577 class Definition : public Instruction { |
| 1573 public: | 1578 public: |
| 1574 enum UseKind { kEffect, kValue }; | 1579 enum UseKind { kEffect, kValue }; |
| 1575 | 1580 |
| (...skipping 5205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6781 ForwardInstructionIterator* current_iterator_; | 6786 ForwardInstructionIterator* current_iterator_; |
| 6782 | 6787 |
| 6783 private: | 6788 private: |
| 6784 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6789 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6785 }; | 6790 }; |
| 6786 | 6791 |
| 6787 | 6792 |
| 6788 } // namespace dart | 6793 } // namespace dart |
| 6789 | 6794 |
| 6790 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6795 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |