OLD | NEW |
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 #include "vm/symbols.h" | 5 #include "vm/symbols.h" |
6 | 6 |
7 #include "vm/handles.h" | 7 #include "vm/handles.h" |
8 #include "vm/handles_impl.h" | 8 #include "vm/handles_impl.h" |
9 #include "vm/hash_table.h" | 9 #include "vm/hash_table.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #undef DEFINE_SYMBOL_LITERAL | 29 #undef DEFINE_SYMBOL_LITERAL |
30 | 30 |
31 "", // matches kKwTableStart. | 31 "", // matches kKwTableStart. |
32 | 32 |
33 #define DEFINE_KEYWORD_SYMBOL_INDEX(t, s, p, a) \ | 33 #define DEFINE_KEYWORD_SYMBOL_INDEX(t, s, p, a) \ |
34 s, | 34 s, |
35 DART_KEYWORD_LIST(DEFINE_KEYWORD_SYMBOL_INDEX) | 35 DART_KEYWORD_LIST(DEFINE_KEYWORD_SYMBOL_INDEX) |
36 #undef DEFINE_KEYWORD_SYMBOL_INDEX | 36 #undef DEFINE_KEYWORD_SYMBOL_INDEX |
37 }; | 37 }; |
38 | 38 |
39 DEFINE_FLAG(bool, dump_symbol_stats, false, "Dump symbol table statistics"); | |
40 | |
41 | |
42 RawString* StringFrom(const uint8_t* data, intptr_t len, Heap::Space space) { | 39 RawString* StringFrom(const uint8_t* data, intptr_t len, Heap::Space space) { |
43 return String::FromLatin1(data, len, space); | 40 return String::FromLatin1(data, len, space); |
44 } | 41 } |
45 RawString* StringFrom(const uint16_t* data, intptr_t len, Heap::Space space) { | 42 RawString* StringFrom(const uint16_t* data, intptr_t len, Heap::Space space) { |
46 return String::FromUTF16(data, len, space); | 43 return String::FromUTF16(data, len, space); |
47 } | 44 } |
48 RawString* StringFrom(const int32_t* data, intptr_t len, Heap::Space space) { | 45 RawString* StringFrom(const int32_t* data, intptr_t len, Heap::Space space) { |
49 return String::FromUTF32(data, len, space); | 46 return String::FromUTF32(data, len, space); |
50 } | 47 } |
51 | 48 |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { | 686 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { |
690 ASSERT(IsVMSymbolId(object_id)); | 687 ASSERT(IsVMSymbolId(object_id)); |
691 intptr_t i = (object_id - kMaxPredefinedObjectIds); | 688 intptr_t i = (object_id - kMaxPredefinedObjectIds); |
692 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { | 689 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { |
693 return symbol_handles_[i]->raw(); | 690 return symbol_handles_[i]->raw(); |
694 } | 691 } |
695 return Object::null(); | 692 return Object::null(); |
696 } | 693 } |
697 | 694 |
698 } // namespace dart | 695 } // namespace dart |
OLD | NEW |