| 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 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 successor_(NULL) { | 1519 successor_(NULL) { |
| 1520 ASSERT(exception_ != NULL); | 1520 ASSERT(exception_ != NULL); |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 DECLARE_INSTRUCTION(Throw) | 1523 DECLARE_INSTRUCTION(Throw) |
| 1524 | 1524 |
| 1525 intptr_t token_index() const { return token_index_; } | 1525 intptr_t token_index() const { return token_index_; } |
| 1526 intptr_t try_index() const { return try_index_; } | 1526 intptr_t try_index() const { return try_index_; } |
| 1527 Value* exception() const { return exception_; } | 1527 Value* exception() const { return exception_; } |
| 1528 | 1528 |
| 1529 // Parser can generate a throw within an expression tree. | 1529 // Parser can generate a throw within an expression tree. We never |
| 1530 virtual Instruction* StraightLineSuccessor() const { | 1530 // add successor instructions to the graph. |
| 1531 return successor_; | 1531 virtual Instruction* StraightLineSuccessor() const { return NULL; } |
| 1532 } | |
| 1533 virtual void SetSuccessor(Instruction* instr) { | 1532 virtual void SetSuccessor(Instruction* instr) { |
| 1534 ASSERT(successor_ == NULL); | 1533 ASSERT(successor_ == NULL); |
| 1535 successor_ = instr; | |
| 1536 } | 1534 } |
| 1537 | 1535 |
| 1538 private: | 1536 private: |
| 1539 const intptr_t token_index_; | 1537 const intptr_t token_index_; |
| 1540 const intptr_t try_index_; | 1538 const intptr_t try_index_; |
| 1541 Value* exception_; | 1539 Value* exception_; |
| 1542 Instruction* successor_; | 1540 Instruction* successor_; |
| 1543 | 1541 |
| 1544 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); | 1542 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); |
| 1545 }; | 1543 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1560 ASSERT(stack_trace_ != NULL); | 1558 ASSERT(stack_trace_ != NULL); |
| 1561 } | 1559 } |
| 1562 | 1560 |
| 1563 DECLARE_INSTRUCTION(ReThrow) | 1561 DECLARE_INSTRUCTION(ReThrow) |
| 1564 | 1562 |
| 1565 intptr_t token_index() const { return token_index_; } | 1563 intptr_t token_index() const { return token_index_; } |
| 1566 intptr_t try_index() const { return try_index_; } | 1564 intptr_t try_index() const { return try_index_; } |
| 1567 Value* exception() const { return exception_; } | 1565 Value* exception() const { return exception_; } |
| 1568 Value* stack_trace() const { return stack_trace_; } | 1566 Value* stack_trace() const { return stack_trace_; } |
| 1569 | 1567 |
| 1570 // Parser can generate a rethrow within an expression tree. | 1568 // Parser can generate a rethrow within an expression tree. We |
| 1569 // never add successor instructions to the graph. |
| 1571 virtual Instruction* StraightLineSuccessor() const { | 1570 virtual Instruction* StraightLineSuccessor() const { |
| 1572 return successor_; | 1571 return NULL; |
| 1573 } | 1572 } |
| 1574 virtual void SetSuccessor(Instruction* instr) { | 1573 virtual void SetSuccessor(Instruction* instr) { |
| 1575 ASSERT(successor_ == NULL); | 1574 ASSERT(successor_ == NULL); |
| 1576 successor_ = instr; | |
| 1577 } | 1575 } |
| 1578 | 1576 |
| 1579 private: | 1577 private: |
| 1580 const intptr_t token_index_; | 1578 const intptr_t token_index_; |
| 1581 const intptr_t try_index_; | 1579 const intptr_t try_index_; |
| 1582 Value* exception_; | 1580 Value* exception_; |
| 1583 Value* stack_trace_; | 1581 Value* stack_trace_; |
| 1584 Instruction* successor_; | 1582 Instruction* successor_; |
| 1585 | 1583 |
| 1586 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); | 1584 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 const GrowableArray<BlockEntryInstr*>& block_order_; | 1658 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 1661 | 1659 |
| 1662 private: | 1660 private: |
| 1663 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 1661 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 1664 }; | 1662 }; |
| 1665 | 1663 |
| 1666 | 1664 |
| 1667 } // namespace dart | 1665 } // namespace dart |
| 1668 | 1666 |
| 1669 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 1667 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |