OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 #ifndef VM_SYMBOLS_H_ | |
6 #define VM_SYMBOLS_H_ | |
7 | |
8 #include "vm/object.h" | |
9 | |
10 namespace dart { | |
11 | |
12 // Forward declarations. | |
13 class Isolate; | |
14 class ObjectPointerVisitor; | |
15 | |
16 // Contains a list of frequently used strings in a canonicalized form. This | |
17 // list is kept in the vm_isolate in order to share the copy across isolates | |
18 // without having to maintain copies in each isolate. | |
19 class Symbols { | |
20 public: | |
21 ~Symbols(); | |
22 | |
23 void VisitObjectPointers(ObjectPointerVisitor* visitor); | |
24 | |
25 // Access methods for symbols stored in the vm isolate. | |
26 static RawString* Dot() { return Dart::vm_isolate()->symbols()->dot_; } | |
Ivan Posva
2012/07/18 04:09:22
static RawString dot() { return dot_; }
See below
siva
2012/07/19 01:12:34
Done.
| |
27 | |
28 // Initialize frequently used symbols in the vm isolate. | |
29 static void Init(Isolate* isolate); | |
30 | |
31 private: | |
32 Symbols(); | |
33 | |
34 RawObject** from() { return reinterpret_cast<RawObject**>(&dot_); } | |
Ivan Posva
2012/07/18 04:09:22
from() and to() should not be needed, neither is V
siva
2012/07/19 01:12:34
Done.
| |
35 | |
36 // List of symbols that are stored in the vm isolate for easy access. | |
37 RawString* dot_; // "." string. | |
Ivan Posva
2012/07/18 04:09:22
Why is this not a static? That would avoid having
siva
2012/07/19 01:12:34
Made a static entry.
On 2012/07/18 04:09:22, Ivan
| |
38 | |
39 RawObject** to() { return reinterpret_cast<RawObject**>(&dot_); } | |
40 | |
41 friend class SnapshotReader; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(Symbols); | |
44 }; | |
45 | |
46 } // namespace dart | |
47 | |
48 #endif // VM_SYMBOLS_H_ | |
OLD | NEW |