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 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "lib/mirrors.h" | 9 #include "lib/mirrors.h" |
10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 ~IsolateMessageHandler(); | 39 ~IsolateMessageHandler(); |
40 | 40 |
41 const char* name() const; | 41 const char* name() const; |
42 void MessageNotify(Message::Priority priority); | 42 void MessageNotify(Message::Priority priority); |
43 bool HandleMessage(Message* message); | 43 bool HandleMessage(Message* message); |
44 | 44 |
45 #if defined(DEBUG) | 45 #if defined(DEBUG) |
46 // Check that it is safe to access this handler. | 46 // Check that it is safe to access this handler. |
47 void CheckAccess(); | 47 void CheckAccess(); |
48 #endif | 48 #endif |
| 49 bool IsCurrentIsolate() const; |
| 50 |
49 private: | 51 private: |
50 Isolate* isolate_; | 52 Isolate* isolate_; |
51 }; | 53 }; |
52 | 54 |
53 | 55 |
54 IsolateMessageHandler::IsolateMessageHandler(Isolate* isolate) | 56 IsolateMessageHandler::IsolateMessageHandler(Isolate* isolate) |
55 : isolate_(isolate) { | 57 : isolate_(isolate) { |
56 } | 58 } |
57 | 59 |
58 | 60 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 return false; | 115 return false; |
114 } | 116 } |
115 ASSERT(result.IsNull()); | 117 ASSERT(result.IsNull()); |
116 } | 118 } |
117 return true; | 119 return true; |
118 } | 120 } |
119 | 121 |
120 | 122 |
121 #if defined(DEBUG) | 123 #if defined(DEBUG) |
122 void IsolateMessageHandler::CheckAccess() { | 124 void IsolateMessageHandler::CheckAccess() { |
123 ASSERT(isolate_ == Isolate::Current()); | 125 ASSERT(IsCurrentIsolate()); |
124 } | 126 } |
125 #endif | 127 #endif |
126 | 128 |
127 | 129 |
| 130 bool IsolateMessageHandler::IsCurrentIsolate() const { |
| 131 return (isolate_ == Isolate::Current()); |
| 132 } |
| 133 |
| 134 |
128 #if defined(DEBUG) | 135 #if defined(DEBUG) |
129 // static | 136 // static |
130 void BaseIsolate::AssertCurrent(BaseIsolate* isolate) { | 137 void BaseIsolate::AssertCurrent(BaseIsolate* isolate) { |
131 ASSERT(isolate == Isolate::Current()); | 138 ASSERT(isolate == Isolate::Current()); |
132 } | 139 } |
133 #endif | 140 #endif |
134 | 141 |
135 | 142 |
136 Isolate::Isolate() | 143 Isolate::Isolate() |
137 : store_buffer_(), | 144 : store_buffer_(), |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 464 |
458 | 465 |
459 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 466 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
460 bool visit_prologue_weak_handles) { | 467 bool visit_prologue_weak_handles) { |
461 if (api_state() != NULL) { | 468 if (api_state() != NULL) { |
462 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 469 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
463 } | 470 } |
464 } | 471 } |
465 | 472 |
466 } // namespace dart | 473 } // namespace dart |
OLD | NEW |