Chromium Code Reviews| Index: vm/object_store.cc |
| =================================================================== |
| --- vm/object_store.cc (revision 4579) |
| +++ vm/object_store.cc (working copy) |
| @@ -54,6 +54,8 @@ |
| empty_context_(Context::null()), |
| stack_overflow_(Instance::null()), |
| out_of_memory_(Instance::null()), |
| + literal_tokens_canonical_list_(Array::null()), |
| + keyword_symbols_(Array::null()), |
| preallocate_objects_called_(false) { |
| } |
| @@ -104,6 +106,25 @@ |
| } |
| +RawObject* ObjectStore::GetKeywordSymbol(int index) { |
| + Array& keywords = Array::Handle(keyword_symbols()); |
| + if (keywords.IsNull()) { |
|
hausner
2012/02/25 00:41:57
Could you move the creation of this table to the i
siva
2012/02/28 19:57:31
Done.
|
| + // Set up the keywords symbol array so that we can access it while scanning. |
| + keywords = Array::New(Token::numKeywords, Heap::kOld); |
| + ASSERT(!keywords.IsError() && !keywords.IsNull()); |
| + set_keyword_symbols(keywords); |
| + } |
| + return keywords.At(index); |
| +} |
| + |
| + |
| +void ObjectStore::SetKeywordSymbol(int index, const String& symbol) { |
| + Array& keywords = Array::Handle(keyword_symbols()); |
| + ASSERT(!keywords.IsNull()); |
| + keywords.SetAt(index, symbol); |
| +} |
| + |
| + |
| RawClass* ObjectStore::GetClass(int index) { |
| switch (index) { |
| case kObjectClass: return object_class_; |