OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_PORT_H_ | 5 #ifndef VM_PORT_H_ |
6 #define VM_PORT_H_ | 6 #define VM_PORT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 static bool IsLocalPort(Dart_Port id); | 52 static bool IsLocalPort(Dart_Port id); |
53 | 53 |
54 // Returns the owning Isolate for port 'id'. | 54 // Returns the owning Isolate for port 'id'. |
55 static Isolate* GetIsolate(Dart_Port id); | 55 static Isolate* GetIsolate(Dart_Port id); |
56 | 56 |
57 static void InitOnce(); | 57 static void InitOnce(); |
58 | 58 |
59 static void PrintPortsForMessageHandler(MessageHandler* handler, | 59 static void PrintPortsForMessageHandler(MessageHandler* handler, |
60 JSONStream* stream); | 60 JSONStream* stream); |
61 | 61 |
| 62 static void DebugDumpForMessageHandler(MessageHandler* handler); |
| 63 |
62 private: | 64 private: |
63 friend class dart::PortMapTestPeer; | 65 friend class dart::PortMapTestPeer; |
64 | 66 |
65 // Mapping between port numbers and handlers. | 67 // Mapping between port numbers and handlers. |
66 // | 68 // |
67 // Free entries have id == 0 and handler == NULL. Deleted entries | 69 // Free entries have id == 0 and handler == NULL. Deleted entries |
68 // have id == 0 and handler == deleted_entry_. | 70 // have id == 0 and handler == deleted_entry_. |
69 typedef struct { | 71 typedef struct { |
70 Dart_Port port; | 72 Dart_Port port; |
71 MessageHandler* handler; | 73 MessageHandler* handler; |
(...skipping 22 matching lines...) Expand all Loading... |
94 static intptr_t capacity_; | 96 static intptr_t capacity_; |
95 static intptr_t used_; | 97 static intptr_t used_; |
96 static intptr_t deleted_; | 98 static intptr_t deleted_; |
97 | 99 |
98 static Random* prng_; | 100 static Random* prng_; |
99 }; | 101 }; |
100 | 102 |
101 } // namespace dart | 103 } // namespace dart |
102 | 104 |
103 #endif // VM_PORT_H_ | 105 #endif // VM_PORT_H_ |
OLD | NEW |