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

Side by Side Diff: runtime/vm/isolate.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ISOLATE_H_ 5 #ifndef RUNTIME_VM_ISOLATE_H_
6 #define RUNTIME_VM_ISOLATE_H_ 6 #define RUNTIME_VM_ISOLATE_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 "vm/atomic.h" 10 #include "vm/atomic.h"
11 #include "vm/base_isolate.h" 11 #include "vm/base_isolate.h"
12 #include "vm/class_table.h" 12 #include "vm/class_table.h"
13 #include "vm/exceptions.h"
14 #include "vm/fixed_cache.h"
13 #include "vm/handles.h" 15 #include "vm/handles.h"
14 #include "vm/megamorphic_cache_table.h" 16 #include "vm/megamorphic_cache_table.h"
15 #include "vm/metrics.h" 17 #include "vm/metrics.h"
16 #include "vm/random.h" 18 #include "vm/random.h"
17 #include "vm/tags.h" 19 #include "vm/tags.h"
18 #include "vm/thread.h" 20 #include "vm/thread.h"
19 #include "vm/os_thread.h" 21 #include "vm/os_thread.h"
20 #include "vm/timer.h" 22 #include "vm/timer.h"
21 #include "vm/token_position.h" 23 #include "vm/token_position.h"
22 #include "vm/growable_array.h" 24 #include "vm/growable_array.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 public: 119 public:
118 NoReloadScope(Isolate* isolate, Thread* thread); 120 NoReloadScope(Isolate* isolate, Thread* thread);
119 ~NoReloadScope(); 121 ~NoReloadScope();
120 122
121 private: 123 private:
122 Isolate* isolate_; 124 Isolate* isolate_;
123 DISALLOW_COPY_AND_ASSIGN(NoReloadScope); 125 DISALLOW_COPY_AND_ASSIGN(NoReloadScope);
124 }; 126 };
125 127
126 128
129 // Fixed cache for exception handler lookup.
130 typedef FixedCache<intptr_t, HandlerInfo, 16> HandlerInfoCache;
131
132
127 class Isolate : public BaseIsolate { 133 class Isolate : public BaseIsolate {
128 public: 134 public:
129 // Keep both these enums in sync with isolate_patch.dart. 135 // Keep both these enums in sync with isolate_patch.dart.
130 // The different Isolate API message types. 136 // The different Isolate API message types.
131 enum LibMsgId { 137 enum LibMsgId {
132 kPauseMsg = 1, 138 kPauseMsg = 1,
133 kResumeMsg = 2, 139 kResumeMsg = 2,
134 kPingMsg = 3, 140 kPingMsg = 3,
135 kKillMsg = 4, 141 kKillMsg = 4,
136 kAddExitMsg = 5, 142 kAddExitMsg = 5,
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 // Has a reload ever been attempted? 835 // Has a reload ever been attempted?
830 bool has_attempted_reload_; 836 bool has_attempted_reload_;
831 intptr_t no_reload_scope_depth_; // we can only reload when this is 0. 837 intptr_t no_reload_scope_depth_; // we can only reload when this is 0.
832 // Per-isolate copy of FLAG_reload_every. 838 // Per-isolate copy of FLAG_reload_every.
833 intptr_t reload_every_n_stack_overflow_checks_; 839 intptr_t reload_every_n_stack_overflow_checks_;
834 IsolateReloadContext* reload_context_; 840 IsolateReloadContext* reload_context_;
835 int64_t last_reload_timestamp_; 841 int64_t last_reload_timestamp_;
836 // Should we pause in the debug message loop after this request? 842 // Should we pause in the debug message loop after this request?
837 bool should_pause_post_service_request_; 843 bool should_pause_post_service_request_;
838 844
845 public:
846 HandlerInfoCache handler_info_cache;
Florian Schneider 2017/02/08 21:34:05 Maybe make this private and add a public getter me
Dmitry Olshansky 2017/02/09 17:54:34 Done.
847
848 private:
839 static Dart_IsolateCreateCallback create_callback_; 849 static Dart_IsolateCreateCallback create_callback_;
840 static Dart_IsolateShutdownCallback shutdown_callback_; 850 static Dart_IsolateShutdownCallback shutdown_callback_;
841 851
842 static void WakePauseEventHandler(Dart_Isolate isolate); 852 static void WakePauseEventHandler(Dart_Isolate isolate);
843 853
844 // Manage list of existing isolates. 854 // Manage list of existing isolates.
845 static bool AddIsolateToList(Isolate* isolate); 855 static bool AddIsolateToList(Isolate* isolate);
846 static void RemoveIsolateFromList(Isolate* isolate); 856 static void RemoveIsolateFromList(Isolate* isolate);
847 857
848 // This monitor protects isolates_list_head_, and creation_enabled_. 858 // This monitor protects isolates_list_head_, and creation_enabled_.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 intptr_t* spawn_count_; 1002 intptr_t* spawn_count_;
993 1003
994 Dart_IsolateFlags isolate_flags_; 1004 Dart_IsolateFlags isolate_flags_;
995 bool paused_; 1005 bool paused_;
996 bool errors_are_fatal_; 1006 bool errors_are_fatal_;
997 }; 1007 };
998 1008
999 } // namespace dart 1009 } // namespace dart
1000 1010
1001 #endif // RUNTIME_VM_ISOLATE_H_ 1011 #endif // RUNTIME_VM_ISOLATE_H_
OLDNEW
« runtime/vm/heap.cc ('K') | « runtime/vm/heap.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698