| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 void MarkCompactCollector::Finish() { | 140 void MarkCompactCollector::Finish() { |
| 141 #ifdef DEBUG | 141 #ifdef DEBUG |
| 142 ASSERT(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS); | 142 ASSERT(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS); |
| 143 state_ = IDLE; | 143 state_ = IDLE; |
| 144 #endif | 144 #endif |
| 145 // The stub cache is not traversed during GC; clear the cache to | 145 // The stub cache is not traversed during GC; clear the cache to |
| 146 // force lazy re-initialization of it. This must be done after the | 146 // force lazy re-initialization of it. This must be done after the |
| 147 // GC, because it relies on the new address of certain old space | 147 // GC, because it relies on the new address of certain old space |
| 148 // objects (empty string, illegal builtin). | 148 // objects (empty string, illegal builtin). |
| 149 StubCache::Clear(); | 149 Isolate::Current()->stub_cache()->Clear(); |
| 150 | 150 |
| 151 ExternalStringTable::CleanUp(); | 151 ExternalStringTable::CleanUp(); |
| 152 | 152 |
| 153 // If we've just compacted old space there's no reason to check the | 153 // If we've just compacted old space there's no reason to check the |
| 154 // fragmentation limit. Just return. | 154 // fragmentation limit. Just return. |
| 155 if (HasCompacted()) return; | 155 if (HasCompacted()) return; |
| 156 | 156 |
| 157 // We compact the old generation on the next GC if it has gotten too | 157 // We compact the old generation on the next GC if it has gotten too |
| 158 // fragmented (ie, we could recover an expected amount of space by | 158 // fragmented (ie, we could recover an expected amount of space by |
| 159 // reclaiming the waste and free list blocks). | 159 // reclaiming the waste and free list blocks). |
| (...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 #ifdef ENABLE_LOGGING_AND_PROFILING | 2309 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 2310 if (obj->IsCode()) { | 2310 if (obj->IsCode()) { |
| 2311 PROFILE(CodeDeleteEvent(obj->address())); | 2311 PROFILE(CodeDeleteEvent(obj->address())); |
| 2312 } else if (obj->IsJSFunction()) { | 2312 } else if (obj->IsJSFunction()) { |
| 2313 PROFILE(FunctionDeleteEvent(obj->address())); | 2313 PROFILE(FunctionDeleteEvent(obj->address())); |
| 2314 } | 2314 } |
| 2315 #endif | 2315 #endif |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 } } // namespace v8::internal | 2318 } } // namespace v8::internal |
| OLD | NEW |