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

Side by Side Diff: vm/symbols.h

Issue 11519006: Add read only handles for the following predefined symbols (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« no previous file with comments | « vm/stub_code_x64.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
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 #ifndef VM_SYMBOLS_H_ 5 #ifndef VM_SYMBOLS_H_
6 #define VM_SYMBOLS_H_ 6 #define VM_SYMBOLS_H_
7 7
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/snapshot_ids.h" 9 #include "vm/snapshot_ids.h"
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 V(_ExternalInt64Array, "_ExternalInt64Array") \ 140 V(_ExternalInt64Array, "_ExternalInt64Array") \
141 V(_ExternalUint64Array, "_ExternalUint64Array") \ 141 V(_ExternalUint64Array, "_ExternalUint64Array") \
142 V(_ExternalFloat32Array, "_ExternalFloat32Array") \ 142 V(_ExternalFloat32Array, "_ExternalFloat32Array") \
143 V(_ExternalFloat64Array, "_ExternalFloat64Array") \ 143 V(_ExternalFloat64Array, "_ExternalFloat64Array") \
144 V(_WeakProperty, "_WeakProperty") \ 144 V(_WeakProperty, "_WeakProperty") \
145 V(InvocationMirror, "_InvocationMirror") \ 145 V(InvocationMirror, "_InvocationMirror") \
146 V(AllocateInvocationMirror, "_allocateInvocationMirror") \ 146 V(AllocateInvocationMirror, "_allocateInvocationMirror") \
147 147
148 #define PREDEFINED_SYMBOL_HANDLES_LIST(V) \ 148 #define PREDEFINED_SYMBOL_HANDLES_LIST(V) \
149 V(Dot) \ 149 V(Dot) \
150 V(EqualOperator) \
151 V(IndexToken) \
152 V(AssignIndexToken) \
153 V(This) \
150 154
151 // Contains a list of frequently used strings in a canonicalized form. This 155 // Contains a list of frequently used strings in a canonicalized form. This
152 // list is kept in the vm_isolate in order to share the copy across isolates 156 // list is kept in the vm_isolate in order to share the copy across isolates
153 // without having to maintain copies in each isolate. 157 // without having to maintain copies in each isolate.
154 class Symbols : public AllStatic { 158 class Symbols : public AllStatic {
155 public: 159 public:
156 enum { kMaxOneCharCodeSymbol = 0xFF }; 160 enum { kMaxOneCharCodeSymbol = 0xFF };
157 161
158 // List of strings that are pre created in the vm isolate. 162 // List of strings that are pre created in the vm isolate.
159 enum SymbolId { 163 enum SymbolId {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 217
214 // Returns char* of predefined symbol. 218 // Returns char* of predefined symbol.
215 static const char* Name(SymbolId symbol); 219 static const char* Name(SymbolId symbol);
216 220
217 static RawString* FromCharCode(int32_t char_code); 221 static RawString* FromCharCode(int32_t char_code);
218 222
219 static RawString** PredefinedAddress() { 223 static RawString** PredefinedAddress() {
220 return reinterpret_cast<RawString**>(&predefined_); 224 return reinterpret_cast<RawString**>(&predefined_);
221 } 225 }
222 226
227 static bool IsPredefinedHandle(uword address);
228
223 private: 229 private:
224 enum { 230 enum {
225 kInitialVMIsolateSymtabSize = ((kMaxId + 15) & -16), 231 kInitialVMIsolateSymtabSize = ((kMaxId + 15) & -16),
226 kInitialSymtabSize = 256 232 kInitialSymtabSize = 256
227 }; 233 };
228 234
229 // Helper functions to create a symbol given a string or set of characters. 235 // Helper functions to create a symbol given a string or set of characters.
230 template<typename CharacterType, typename CallbackType> 236 template<typename CharacterType, typename CallbackType>
231 static RawString* NewSymbol(const CharacterType* characters, 237 static RawString* NewSymbol(const CharacterType* characters,
232 intptr_t len, 238 intptr_t len,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 friend class SnapshotReader; 284 friend class SnapshotReader;
279 friend class SnapshotWriter; 285 friend class SnapshotWriter;
280 friend class ApiMessageReader; 286 friend class ApiMessageReader;
281 287
282 DISALLOW_COPY_AND_ASSIGN(Symbols); 288 DISALLOW_COPY_AND_ASSIGN(Symbols);
283 }; 289 };
284 290
285 } // namespace dart 291 } // namespace dart
286 292
287 #endif // VM_SYMBOLS_H_ 293 #endif // VM_SYMBOLS_H_
OLDNEW
« no previous file with comments | « vm/stub_code_x64.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698