| 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 RUNTIME_VM_OBJECT_H_ | 5 #ifndef RUNTIME_VM_OBJECT_H_ |
| 6 #define RUNTIME_VM_OBJECT_H_ | 6 #define RUNTIME_VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 4475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4486 friend class Class; | 4486 friend class Class; |
| 4487 }; | 4487 }; |
| 4488 | 4488 |
| 4489 | 4489 |
| 4490 class ExceptionHandlers : public Object { | 4490 class ExceptionHandlers : public Object { |
| 4491 public: | 4491 public: |
| 4492 static const intptr_t kInvalidPcOffset = 0; | 4492 static const intptr_t kInvalidPcOffset = 0; |
| 4493 | 4493 |
| 4494 intptr_t num_entries() const; | 4494 intptr_t num_entries() const; |
| 4495 | 4495 |
| 4496 void GetHandlerInfo(intptr_t try_index, | 4496 void GetHandlerInfo(intptr_t try_index, HandlerInfo* info) const; |
| 4497 RawExceptionHandlers::HandlerInfo* info) const; | |
| 4498 | 4497 |
| 4499 uword HandlerPCOffset(intptr_t try_index) const; | 4498 uword HandlerPCOffset(intptr_t try_index) const; |
| 4500 intptr_t OuterTryIndex(intptr_t try_index) const; | 4499 intptr_t OuterTryIndex(intptr_t try_index) const; |
| 4501 bool NeedsStackTrace(intptr_t try_index) const; | 4500 bool NeedsStackTrace(intptr_t try_index) const; |
| 4502 | 4501 |
| 4503 void SetHandlerInfo(intptr_t try_index, | 4502 void SetHandlerInfo(intptr_t try_index, |
| 4504 intptr_t outer_try_index, | 4503 intptr_t outer_try_index, |
| 4505 uword handler_pc_offset, | 4504 uword handler_pc_offset, |
| 4506 bool needs_stacktrace, | 4505 bool needs_stacktrace, |
| 4507 bool has_catch_all) const; | 4506 bool has_catch_all) const; |
| 4508 | 4507 |
| 4509 RawArray* GetHandledTypes(intptr_t try_index) const; | 4508 RawArray* GetHandledTypes(intptr_t try_index) const; |
| 4510 void SetHandledTypes(intptr_t try_index, const Array& handled_types) const; | 4509 void SetHandledTypes(intptr_t try_index, const Array& handled_types) const; |
| 4511 bool HasCatchAll(intptr_t try_index) const; | 4510 bool HasCatchAll(intptr_t try_index) const; |
| 4512 | 4511 |
| 4513 static intptr_t InstanceSize() { | 4512 static intptr_t InstanceSize() { |
| 4514 ASSERT(sizeof(RawExceptionHandlers) == | 4513 ASSERT(sizeof(RawExceptionHandlers) == |
| 4515 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data)); | 4514 OFFSET_OF_RETURNED_VALUE(RawExceptionHandlers, data)); |
| 4516 return 0; | 4515 return 0; |
| 4517 } | 4516 } |
| 4518 static intptr_t InstanceSize(intptr_t len) { | 4517 static intptr_t InstanceSize(intptr_t len) { |
| 4519 return RoundedAllocationSize( | 4518 return RoundedAllocationSize(sizeof(RawExceptionHandlers) + |
| 4520 sizeof(RawExceptionHandlers) + | 4519 (len * sizeof(HandlerInfo))); |
| 4521 (len * sizeof(RawExceptionHandlers::HandlerInfo))); | |
| 4522 } | 4520 } |
| 4523 | 4521 |
| 4524 static RawExceptionHandlers* New(intptr_t num_handlers); | 4522 static RawExceptionHandlers* New(intptr_t num_handlers); |
| 4525 static RawExceptionHandlers* New(const Array& handled_types_data); | 4523 static RawExceptionHandlers* New(const Array& handled_types_data); |
| 4526 | 4524 |
| 4527 // We would have a VisitPointers function here to traverse the | 4525 // We would have a VisitPointers function here to traverse the |
| 4528 // exception handler table to visit objects if any in the table. | 4526 // exception handler table to visit objects if any in the table. |
| 4529 | 4527 |
| 4530 private: | 4528 private: |
| 4531 // Pick somewhat arbitrary maximum number of exception handlers | 4529 // Pick somewhat arbitrary maximum number of exception handlers |
| (...skipping 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8901 | 8899 |
| 8902 inline void TypeArguments::SetHash(intptr_t value) const { | 8900 inline void TypeArguments::SetHash(intptr_t value) const { |
| 8903 // This is only safe because we create a new Smi, which does not cause | 8901 // This is only safe because we create a new Smi, which does not cause |
| 8904 // heap allocation. | 8902 // heap allocation. |
| 8905 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8903 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
| 8906 } | 8904 } |
| 8907 | 8905 |
| 8908 } // namespace dart | 8906 } // namespace dart |
| 8909 | 8907 |
| 8910 #endif // RUNTIME_VM_OBJECT_H_ | 8908 #endif // RUNTIME_VM_OBJECT_H_ |
| OLD | NEW |