| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 SymbolTable table(isolate, vm_isolate->object_store()->symbol_table()); | 326 SymbolTable table(isolate, vm_isolate->object_store()->symbol_table()); |
| 327 symbol ^= table.GetOrNull(str); | 327 symbol ^= table.GetOrNull(str); |
| 328 table.Release(); | 328 table.Release(); |
| 329 } | 329 } |
| 330 if (symbol.IsNull()) { | 330 if (symbol.IsNull()) { |
| 331 SymbolTable table(isolate, isolate->object_store()->symbol_table()); | 331 SymbolTable table(isolate, isolate->object_store()->symbol_table()); |
| 332 symbol ^= table.InsertNewOrGet(str); | 332 symbol ^= table.InsertNewOrGet(str); |
| 333 isolate->object_store()->set_symbol_table(table.Release()); | 333 isolate->object_store()->set_symbol_table(table.Release()); |
| 334 } | 334 } |
| 335 ASSERT(symbol.IsSymbol()); | 335 ASSERT(symbol.IsSymbol()); |
| 336 ASSERT(symbol.HasHash()); |
| 336 return symbol.raw(); | 337 return symbol.raw(); |
| 337 } | 338 } |
| 338 | 339 |
| 339 | 340 |
| 340 RawString* Symbols::New(const String& str) { | 341 RawString* Symbols::New(const String& str) { |
| 341 if (str.IsSymbol()) { | 342 if (str.IsSymbol()) { |
| 342 return str.raw(); | 343 return str.raw(); |
| 343 } | 344 } |
| 344 return New(str, 0, str.Length()); | 345 return New(str, 0, str.Length()); |
| 345 } | 346 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { | 390 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { |
| 390 ASSERT(IsVMSymbolId(object_id)); | 391 ASSERT(IsVMSymbolId(object_id)); |
| 391 intptr_t i = (object_id - kMaxPredefinedObjectIds); | 392 intptr_t i = (object_id - kMaxPredefinedObjectIds); |
| 392 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { | 393 if ((i > kIllegal) && (i < Symbols::kMaxPredefinedId)) { |
| 393 return symbol_handles_[i]->raw(); | 394 return symbol_handles_[i]->raw(); |
| 394 } | 395 } |
| 395 return Object::null(); | 396 return Object::null(); |
| 396 } | 397 } |
| 397 | 398 |
| 398 } // namespace dart | 399 } // namespace dart |
| OLD | NEW |