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

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

Issue 11364134: Merge libv1. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error Created 8 years, 1 month 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 | « runtime/vm/snapshot_test.cc ('k') | samples/calculator/calculator.dart » ('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 #include "vm/symbols.h" 5 #include "vm/symbols.h"
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // Create and setup a symbol table in the vm isolate. 41 // Create and setup a symbol table in the vm isolate.
42 SetupSymbolTable(isolate); 42 SetupSymbolTable(isolate);
43 43
44 // Turn off population of symbols in the VM symbol table, so that we 44 // Turn off population of symbols in the VM symbol table, so that we
45 // don't find these symbols while doing a Symbols::New(...). 45 // don't find these symbols while doing a Symbols::New(...).
46 // Create all predefined symbols. 46 // Create all predefined symbols.
47 ASSERT((sizeof(names) / sizeof(const char*)) == Symbols::kMaxId); 47 ASSERT((sizeof(names) / sizeof(const char*)) == Symbols::kMaxId);
48 const Array& symbol_table = 48 const Array& symbol_table =
49 Array::Handle(isolate->object_store()->symbol_table()); 49 Array::Handle(isolate->object_store()->symbol_table());
50 dart::OneByteString& str = OneByteString::Handle(); 50 dart::String& str = String::Handle();
51 51
52 for (intptr_t i = 1; i < Symbols::kMaxId; i++) { 52 for (intptr_t i = 1; i < Symbols::kMaxId; i++) {
53 str = OneByteString::New(names[i], Heap::kOld); 53 str = OneByteString::New(names[i], Heap::kOld);
54 Add(symbol_table, str); 54 Add(symbol_table, str);
55 predefined_[i] = str.raw(); 55 predefined_[i] = str.raw();
56 } 56 }
57 Object::RegisterSingletonClassNames(); 57 Object::RegisterSingletonClassNames();
58 } 58 }
59 59
60 60
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 314
315 RawObject* Symbols::GetVMSymbol(intptr_t object_id) { 315 RawObject* Symbols::GetVMSymbol(intptr_t object_id) {
316 ASSERT(IsVMSymbolId(object_id)); 316 ASSERT(IsVMSymbolId(object_id));
317 intptr_t i = (object_id - kMaxPredefinedObjectIds); 317 intptr_t i = (object_id - kMaxPredefinedObjectIds);
318 return (i > 0 && i < Symbols::kMaxId) ? predefined_[i] : Object::null(); 318 return (i > 0 && i < Symbols::kMaxId) ? predefined_[i] : Object::null();
319 } 319 }
320 320
321 } // namespace dart 321 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot_test.cc ('k') | samples/calculator/calculator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698