Chromium Code Reviews| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 GrowableArray<struct PcDesc> list_; | 69 GrowableArray<struct PcDesc> list_; |
| 70 bool has_try_index_; | 70 bool has_try_index_; |
| 71 DISALLOW_COPY_AND_ASSIGN(DescriptorList); | 71 DISALLOW_COPY_AND_ASSIGN(DescriptorList); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 | 74 |
| 75 class StackmapTableBuilder : public ZoneAllocated { | 75 class StackmapTableBuilder : public ZoneAllocated { |
| 76 public: | 76 public: |
| 77 explicit StackmapTableBuilder() | 77 StackmapTableBuilder() |
|
hausner
2014/09/15 23:33:16
Unrelated to this CL. gcl upload complained about
srdjan
2014/09/15 23:47:14
gcl and its rules/tools get also occasionally upda
| |
| 78 : stack_map_(Stackmap::ZoneHandle()), | 78 : stack_map_(Stackmap::ZoneHandle()), |
| 79 list_(GrowableObjectArray::ZoneHandle( | 79 list_(GrowableObjectArray::ZoneHandle( |
| 80 GrowableObjectArray::New(Heap::kOld))) { } | 80 GrowableObjectArray::New(Heap::kOld))) { } |
| 81 ~StackmapTableBuilder() { } | 81 ~StackmapTableBuilder() { } |
| 82 | 82 |
| 83 void AddEntry(intptr_t pc_offset, | 83 void AddEntry(intptr_t pc_offset, |
| 84 BitmapBuilder* bitmap, | 84 BitmapBuilder* bitmap, |
| 85 intptr_t register_bit_count); | 85 intptr_t register_bit_count); |
| 86 | 86 |
| 87 bool Verify(); | 87 bool Verify(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 if (array.At(i) == Type::DynamicType()) { | 155 if (array.At(i) == Type::DynamicType()) { |
| 156 return true; | 156 return true; |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 return false; | 159 return false; |
| 160 } | 160 } |
| 161 | 161 |
| 162 | 162 |
| 163 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) { | 163 RawExceptionHandlers* FinalizeExceptionHandlers(uword entry_point) { |
| 164 intptr_t num_handlers = Length(); | 164 intptr_t num_handlers = Length(); |
| 165 if (num_handlers == 0) { | |
| 166 return Object::empty_exception_handlers().raw(); | |
| 167 } | |
| 165 const ExceptionHandlers& handlers = | 168 const ExceptionHandlers& handlers = |
| 166 ExceptionHandlers::Handle(ExceptionHandlers::New(num_handlers)); | 169 ExceptionHandlers::Handle(ExceptionHandlers::New(num_handlers)); |
| 167 for (intptr_t i = 0; i < num_handlers; i++) { | 170 for (intptr_t i = 0; i < num_handlers; i++) { |
| 168 // Assert that every element in the array has been initialized. | 171 // Assert that every element in the array has been initialized. |
| 169 ASSERT(list_[i].handler_types != NULL); | 172 ASSERT(list_[i].handler_types != NULL); |
| 170 bool has_catch_all = ContainsDynamic(*list_[i].handler_types); | 173 bool has_catch_all = ContainsDynamic(*list_[i].handler_types); |
| 171 handlers.SetHandlerInfo(i, | 174 handlers.SetHandlerInfo(i, |
| 172 list_[i].outer_try_index, | 175 list_[i].outer_try_index, |
| 173 (entry_point + list_[i].pc_offset), | 176 (entry_point + list_[i].pc_offset), |
| 174 list_[i].needs_stacktrace, | 177 list_[i].needs_stacktrace, |
| 175 has_catch_all); | 178 has_catch_all); |
| 176 handlers.SetHandledTypes(i, *list_[i].handler_types); | 179 handlers.SetHandledTypes(i, *list_[i].handler_types); |
| 177 } | 180 } |
| 178 return handlers.raw(); | 181 return handlers.raw(); |
| 179 } | 182 } |
| 180 | 183 |
| 181 private: | 184 private: |
| 182 GrowableArray<struct HandlerDesc> list_; | 185 GrowableArray<struct HandlerDesc> list_; |
| 183 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); | 186 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 } // namespace dart | 189 } // namespace dart |
| 187 | 190 |
| 188 #endif // VM_CODE_DESCRIPTORS_H_ | 191 #endif // VM_CODE_DESCRIPTORS_H_ |
| OLD | NEW |