Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: runtime/vm/object.h

Issue 2683633005: Add exception handler cache to isolate (Closed)
Patch Set: Add exception handler cache to isolate Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 4361 matching lines...) Expand 10 before | Expand all | Expand 10 after
8893 8891
8894 inline void TypeArguments::SetHash(intptr_t value) const { 8892 inline void TypeArguments::SetHash(intptr_t value) const {
8895 // This is only safe because we create a new Smi, which does not cause 8893 // This is only safe because we create a new Smi, which does not cause
8896 // heap allocation. 8894 // heap allocation.
8897 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8895 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8898 } 8896 }
8899 8897
8900 } // namespace dart 8898 } // namespace dart
8901 8899
8902 #endif // RUNTIME_VM_OBJECT_H_ 8900 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« runtime/vm/isolate.h ('K') | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698