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

Side by Side Diff: runtime/vm/symbols.h

Issue 10829022: - Avoid C++ pitfalls with "static const int" in header files. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 9
10 namespace dart { 10 namespace dart {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 static RawString* New(const char* str); 84 static RawString* New(const char* str);
85 template<typename T> 85 template<typename T>
86 static RawString* New(const T* characters, intptr_t len); 86 static RawString* New(const T* characters, intptr_t len);
87 static RawString* New(const String& str); 87 static RawString* New(const String& str);
88 static RawString* New(const String& str, 88 static RawString* New(const String& str,
89 intptr_t begin_index, 89 intptr_t begin_index,
90 intptr_t length); 90 intptr_t length);
91 91
92 92
93 private: 93 private:
94 static const int kInitialVMIsolateSymtabSize = ((kMaxPredefined + 15) & -16); 94 enum {
95 static const int kInitialSymtabSize = 256; 95 kInitialVMIsolateSymtabSize = ((kMaxPredefined + 15) & -16),
96 kInitialSymtabSize = 256
97 };
96 98
97 // Add the string into the VM isolate symbol table. 99 // Add the string into the VM isolate symbol table.
98 static void Add(const Array& symbol_table, const String& str); 100 static void Add(const Array& symbol_table, const String& str);
99 101
100 // Insert symbol into symbol table, growing it if necessary. 102 // Insert symbol into symbol table, growing it if necessary.
101 static void InsertIntoSymbolTable(const Array& symbol_table, 103 static void InsertIntoSymbolTable(const Array& symbol_table,
102 const String& symbol, 104 const String& symbol,
103 intptr_t index); 105 intptr_t index);
104 106
105 // Grow the symbol table. 107 // Grow the symbol table.
(...skipping 16 matching lines...) Expand all
122 static RawString* predefined_[kMaxPredefined]; 124 static RawString* predefined_[kMaxPredefined];
123 125
124 friend class SnapshotReader; 126 friend class SnapshotReader;
125 127
126 DISALLOW_COPY_AND_ASSIGN(Symbols); 128 DISALLOW_COPY_AND_ASSIGN(Symbols);
127 }; 129 };
128 130
129 } // namespace dart 131 } // namespace dart
130 132
131 #endif // VM_SYMBOLS_H_ 133 #endif // VM_SYMBOLS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698