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

Unified Diff: vm/object_store.cc

Issue 9462003: Changes to shrink the token stream representation from two words to one word. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698