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

Side by Side Diff: vm/symbols.h

Issue 10783035: Create frequently used symbols in the vm isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« vm/object.cc ('K') | « vm/snapshot.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« vm/object.cc ('K') | « vm/snapshot.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698