Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 } else { | 158 } else { |
| 159 int remaining = byte_size / kPointerSize; | 159 int remaining = byte_size / kPointerSize; |
| 160 do { | 160 do { |
| 161 remaining--; | 161 remaining--; |
| 162 *dst++ = *src++; | 162 *dst++ = *src++; |
| 163 } while (remaining > 0); | 163 } while (remaining > 0); |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 | 167 |
| 168 Object* Heap::GetKeyedLookupCache() { | |
| 169 if (keyed_lookup_cache()->IsUndefined()) { | |
| 170 Object* obj = LookupCache::Allocate(4); | |
| 171 if (obj->IsFailure()) return obj; | |
| 172 keyed_lookup_cache_ = obj; | |
| 173 } | |
|
bak
2008/10/23 06:08:11
Use keyed_lookup_cache() instead of keyed_lookup_c
| |
| 174 return keyed_lookup_cache_; | |
| 175 } | |
| 176 | |
| 177 | |
| 178 void Heap::SetKeyedLookupCache(LookupCache* cache) { | |
| 179 keyed_lookup_cache_ = cache; | |
| 180 } | |
| 181 | |
| 182 | |
| 183 void Heap::ClearKeyedLookupCache() { | |
| 184 keyed_lookup_cache_ = undefined_value(); | |
| 185 } | |
| 186 | |
| 187 | |
| 168 #define GC_GREEDY_CHECK() \ | 188 #define GC_GREEDY_CHECK() \ |
| 169 ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck()) | 189 ASSERT(!FLAG_gc_greedy || v8::internal::Heap::GarbageCollectionGreedyCheck()) |
| 170 | 190 |
| 171 // Do not use the identifier __object__ in a call to this macro. | 191 // Do not use the identifier __object__ in a call to this macro. |
| 172 // | 192 // |
| 173 // Call the function FUNCTION_CALL. If it fails with a RetryAfterGC | 193 // Call the function FUNCTION_CALL. If it fails with a RetryAfterGC |
| 174 // failure, call the garbage collector and retry the function. If the | 194 // failure, call the garbage collector and retry the function. If the |
| 175 // garbage collector cannot reclaim the required space or the second | 195 // garbage collector cannot reclaim the required space or the second |
| 176 // call fails with a RetryAfterGC failure, fail with out of memory. | 196 // call fails with a RetryAfterGC failure, fail with out of memory. |
| 177 // If there is any other failure, return a null handle. If either | 197 // If there is any other failure, return a null handle. If either |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 allocation_allowed_ = new_state; | 265 allocation_allowed_ = new_state; |
| 246 return old; | 266 return old; |
| 247 } | 267 } |
| 248 | 268 |
| 249 #endif | 269 #endif |
| 250 | 270 |
| 251 | 271 |
| 252 } } // namespace v8::internal | 272 } } // namespace v8::internal |
| 253 | 273 |
| 254 #endif // V8_HEAP_INL_H_ | 274 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |