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

Side by Side Diff: src/objects.cc

Issue 1933: Generalized the EvalCache into a CompilationCache and enabled... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5558 matching lines...) Expand 10 before | Expand all | Expand 10 after
5569 5569
5570 // Add the new symbol and return it along with the symbol table. 5570 // Add the new symbol and return it along with the symbol table.
5571 entry = table->FindInsertionEntry(symbol, key->Hash()); 5571 entry = table->FindInsertionEntry(symbol, key->Hash());
5572 table->set(EntryToIndex(entry), symbol); 5572 table->set(EntryToIndex(entry), symbol);
5573 table->ElementAdded(); 5573 table->ElementAdded();
5574 *s = symbol; 5574 *s = symbol;
5575 return table; 5575 return table;
5576 } 5576 }
5577 5577
5578 5578
5579 Object* EvalCache::Lookup(String* src) { 5579 Object* CompilationCacheTable::Lookup(String* src) {
5580 StringKey key(src); 5580 StringKey key(src);
5581 int entry = FindEntry(&key); 5581 int entry = FindEntry(&key);
5582 if (entry != -1) { 5582 if (entry != -1) {
5583 return get(EntryToIndex(entry) + 1); 5583 return get(EntryToIndex(entry) + 1);
5584 } else { 5584 } else {
5585 return Heap::undefined_value(); 5585 return Heap::undefined_value();
5586 } 5586 }
5587 } 5587 }
5588 5588
5589 5589
5590 Object* EvalCache::Put(String* src, Object* value) { 5590 Object* CompilationCacheTable::Put(String* src, Object* value) {
5591 StringKey key(src); 5591 StringKey key(src);
5592 Object* obj = EnsureCapacity(1, &key); 5592 Object* obj = EnsureCapacity(1, &key);
5593 if (obj->IsFailure()) return obj; 5593 if (obj->IsFailure()) return obj;
5594 5594
5595 EvalCache* cache = reinterpret_cast<EvalCache*>(obj); 5595 CompilationCacheTable* cache =
5596 reinterpret_cast<CompilationCacheTable*>(obj);
5596 int entry = cache->FindInsertionEntry(src, key.Hash()); 5597 int entry = cache->FindInsertionEntry(src, key.Hash());
5597 cache->set(EntryToIndex(entry), src); 5598 cache->set(EntryToIndex(entry), src);
5598 cache->set(EntryToIndex(entry) + 1, value); 5599 cache->set(EntryToIndex(entry) + 1, value);
5599 cache->ElementAdded(); 5600 cache->ElementAdded();
5600 return cache; 5601 return cache;
5601 } 5602 }
5602 5603
5603 5604
5604 Object* Dictionary::Allocate(int at_least_space_for) { 5605 Object* Dictionary::Allocate(int at_least_space_for) {
5605 Object* obj = DictionaryBase::Allocate(at_least_space_for); 5606 Object* obj = DictionaryBase::Allocate(at_least_space_for);
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
6260 // No break point. 6261 // No break point.
6261 if (break_point_objects()->IsUndefined()) return 0; 6262 if (break_point_objects()->IsUndefined()) return 0;
6262 // Single beak point. 6263 // Single beak point.
6263 if (!break_point_objects()->IsFixedArray()) return 1; 6264 if (!break_point_objects()->IsFixedArray()) return 1;
6264 // Multiple break points. 6265 // Multiple break points.
6265 return FixedArray::cast(break_point_objects())->length(); 6266 return FixedArray::cast(break_point_objects())->length();
6266 } 6267 }
6267 6268
6268 6269
6269 } } // namespace v8::internal 6270 } } // namespace v8::internal
OLDNEW
« src/compilation-cache.h ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698