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

Side by Side Diff: src/heap.cc

Issue 7879: Introduce a lookup cache class in the runtime system and use it for... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | src/heap-inl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 gc_state_ = NOT_IN_GC; 415 gc_state_ = NOT_IN_GC;
416 416
417 Shrink(); 417 Shrink();
418 418
419 Counters::objs_since_last_full.Set(0); 419 Counters::objs_since_last_full.Set(0);
420 } 420 }
421 421
422 422
423 void Heap::MarkCompactPrologue() { 423 void Heap::MarkCompactPrologue() {
424 ClearKeyedLookupCache();
424 CompilationCache::MarkCompactPrologue(); 425 CompilationCache::MarkCompactPrologue();
425 RegExpImpl::OldSpaceCollectionPrologue(); 426 RegExpImpl::OldSpaceCollectionPrologue();
426 Top::MarkCompactPrologue(); 427 Top::MarkCompactPrologue();
427 ThreadManager::MarkCompactPrologue(); 428 ThreadManager::MarkCompactPrologue();
428 } 429 }
429 430
430 431
431 void Heap::MarkCompactEpilogue() { 432 void Heap::MarkCompactEpilogue() {
432 Top::MarkCompactEpilogue(); 433 Top::MarkCompactEpilogue();
433 ThreadManager::MarkCompactEpilogue(); 434 ThreadManager::MarkCompactEpilogue();
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 // Allocate cache for single character strings. 1189 // Allocate cache for single character strings.
1189 obj = AllocateFixedArray(String::kMaxAsciiCharCode+1); 1190 obj = AllocateFixedArray(String::kMaxAsciiCharCode+1);
1190 if (obj->IsFailure()) return false; 1191 if (obj->IsFailure()) return false;
1191 single_character_string_cache_ = FixedArray::cast(obj); 1192 single_character_string_cache_ = FixedArray::cast(obj);
1192 1193
1193 // Allocate cache for external strings pointing to native source code. 1194 // Allocate cache for external strings pointing to native source code.
1194 obj = AllocateFixedArray(Natives::GetBuiltinsCount()); 1195 obj = AllocateFixedArray(Natives::GetBuiltinsCount());
1195 if (obj->IsFailure()) return false; 1196 if (obj->IsFailure()) return false;
1196 natives_source_cache_ = FixedArray::cast(obj); 1197 natives_source_cache_ = FixedArray::cast(obj);
1197 1198
1199 // Initialize keyed lookup cache.
bak 2008/10/23 06:08:11 Use ClearKeyedLookupCache();
1200 keyed_lookup_cache_ = undefined_value();
1201
1198 // Initialize compilation cache. 1202 // Initialize compilation cache.
1199 CompilationCache::Clear(); 1203 CompilationCache::Clear();
1200 1204
1201 return true; 1205 return true;
1202 } 1206 }
1203 1207
1204 1208
1205 static inline int double_get_hash(double d) { 1209 static inline int double_get_hash(double d) {
1206 DoubleRepresentation rep(d); 1210 DoubleRepresentation rep(d);
1207 return ((static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32)) & 1211 return ((static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32)) &
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
3165 #ifdef DEBUG 3169 #ifdef DEBUG
3166 bool Heap::GarbageCollectionGreedyCheck() { 3170 bool Heap::GarbageCollectionGreedyCheck() {
3167 ASSERT(FLAG_gc_greedy); 3171 ASSERT(FLAG_gc_greedy);
3168 if (Bootstrapper::IsActive()) return true; 3172 if (Bootstrapper::IsActive()) return true;
3169 if (disallow_allocation_failure()) return true; 3173 if (disallow_allocation_failure()) return true;
3170 return CollectGarbage(0, NEW_SPACE); 3174 return CollectGarbage(0, NEW_SPACE);
3171 } 3175 }
3172 #endif 3176 #endif
3173 3177
3174 } } // namespace v8::internal 3178 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | src/heap-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698