| 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_CODE_DESCRIPTORS_H_ | 5 #ifndef VM_CODE_DESCRIPTORS_H_ |
| 6 #define VM_CODE_DESCRIPTORS_H_ | 6 #define VM_CODE_DESCRIPTORS_H_ |
| 7 | 7 |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void AddHandler(intptr_t try_index, | 95 void AddHandler(intptr_t try_index, |
| 96 intptr_t outer_try_index, | 96 intptr_t outer_try_index, |
| 97 intptr_t pc_offset, | 97 intptr_t pc_offset, |
| 98 const Array& handler_types, | 98 const Array& handler_types, |
| 99 bool needs_stacktrace) { | 99 bool needs_stacktrace) { |
| 100 ASSERT(try_index >= 0); | 100 ASSERT(try_index >= 0); |
| 101 while (Length() <= try_index) { | 101 while (Length() <= try_index) { |
| 102 AddPlaceHolder(); | 102 AddPlaceHolder(); |
| 103 } | 103 } |
| 104 list_[try_index].outer_try_index = outer_try_index; | 104 list_[try_index].outer_try_index = outer_try_index; |
| 105 ASSERT(list_[try_index].pc_offset == ExceptionHandlers::kInvalidPcOffset); |
| 105 list_[try_index].pc_offset = pc_offset; | 106 list_[try_index].pc_offset = pc_offset; |
| 106 ASSERT(handler_types.IsZoneHandle()); | 107 ASSERT(handler_types.IsZoneHandle()); |
| 107 list_[try_index].handler_types = &handler_types; | 108 list_[try_index].handler_types = &handler_types; |
| 108 list_[try_index].needs_stacktrace |= needs_stacktrace; | 109 list_[try_index].needs_stacktrace |= needs_stacktrace; |
| 109 } | 110 } |
| 110 | 111 |
| 111 | 112 |
| 112 // Called by rethrows, to mark their enclosing handlers. | 113 // Called by rethrows, to mark their enclosing handlers. |
| 113 void SetNeedsStacktrace(intptr_t try_index) { | 114 void SetNeedsStacktrace(intptr_t try_index) { |
| 114 // Rethrows can be generated outside a try by the compiler. | 115 // Rethrows can be generated outside a try by the compiler. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 135 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const; | 136 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) const; |
| 136 | 137 |
| 137 private: | 138 private: |
| 138 GrowableArray<struct HandlerDesc> list_; | 139 GrowableArray<struct HandlerDesc> list_; |
| 139 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 140 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 } // namespace dart | 143 } // namespace dart |
| 143 | 144 |
| 144 #endif // VM_CODE_DESCRIPTORS_H_ | 145 #endif // VM_CODE_DESCRIPTORS_H_ |
| OLD | NEW |