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

Side by Side Diff: src/heap-inl.h

Issue 126262: Reimplemented the KeyedLookupCache to speed up access. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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.cc ('k') | src/objects.h » ('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 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (first_word.IsForwardingAddress()) { 208 if (first_word.IsForwardingAddress()) {
209 *p = first_word.ToForwardingAddress(); 209 *p = first_word.ToForwardingAddress();
210 return; 210 return;
211 } 211 }
212 212
213 // Call the slow part of scavenge object. 213 // Call the slow part of scavenge object.
214 return ScavengeObjectSlow(p, object); 214 return ScavengeObjectSlow(p, object);
215 } 215 }
216 216
217 217
218 Object* Heap::GetKeyedLookupCache() {
219 if (keyed_lookup_cache()->IsUndefined()) {
220 Object* obj = LookupCache::Allocate(4);
221 if (obj->IsFailure()) return obj;
222 keyed_lookup_cache_ = obj;
223 }
224 return keyed_lookup_cache();
225 }
226
227
228 void Heap::SetKeyedLookupCache(LookupCache* cache) {
229 keyed_lookup_cache_ = cache;
230 }
231
232
233 void Heap::ClearKeyedLookupCache() {
234 keyed_lookup_cache_ = undefined_value();
235 }
236
237
238 void Heap::SetLastScriptId(Object* last_script_id) { 218 void Heap::SetLastScriptId(Object* last_script_id) {
239 last_script_id_ = last_script_id; 219 last_script_id_ = last_script_id;
240 } 220 }
241 221
242 222
243 #define GC_GREEDY_CHECK() \ 223 #define GC_GREEDY_CHECK() \
244 ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck()) 224 ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck())
245 225
246 226
247 // Calls the FUNCTION_CALL function and retries it up to three times 227 // Calls the FUNCTION_CALL function and retries it up to three times
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 allocation_allowed_ = new_state; 281 allocation_allowed_ = new_state;
302 return old; 282 return old;
303 } 283 }
304 284
305 #endif 285 #endif
306 286
307 287
308 } } // namespace v8::internal 288 } } // namespace v8::internal
309 289
310 #endif // V8_HEAP_INL_H_ 290 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698