OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 | 293 |
294 template<typename StaticVisitor> | 294 template<typename StaticVisitor> |
295 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( | 295 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
296 Map* map, HeapObject* object) { | 296 Map* map, HeapObject* object) { |
297 Heap* heap = map->GetHeap(); | 297 Heap* heap = map->GetHeap(); |
298 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 298 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
299 if (shared->ic_age() != heap->global_ic_age()) { | 299 if (shared->ic_age() != heap->global_ic_age()) { |
300 shared->ResetForNewContext(heap->global_ic_age()); | 300 shared->ResetForNewContext(heap->global_ic_age()); |
301 } | 301 } |
| 302 if (FLAG_cache_optimized_code) { |
| 303 // Flush optimized code map on major GC. |
| 304 // TODO(mstarzinger): We may experiment with rebuilding it or with |
| 305 // retaining entries which should survive as we iterate through |
| 306 // optimized functions anyway. |
| 307 shared->ClearOptimizedCodeMap(); |
| 308 } |
302 MarkCompactCollector* collector = heap->mark_compact_collector(); | 309 MarkCompactCollector* collector = heap->mark_compact_collector(); |
303 if (collector->is_code_flushing_enabled()) { | 310 if (collector->is_code_flushing_enabled()) { |
304 if (IsFlushable(heap, shared)) { | 311 if (IsFlushable(heap, shared)) { |
305 // This function's code looks flushable. But we have to postpone | 312 // This function's code looks flushable. But we have to postpone |
306 // the decision until we see all functions that point to the same | 313 // the decision until we see all functions that point to the same |
307 // SharedFunctionInfo because some of them might be optimized. | 314 // SharedFunctionInfo because some of them might be optimized. |
308 // That would also make the non-optimized version of the code | 315 // That would also make the non-optimized version of the code |
309 // non-flushable, because it is required for bailing out from | 316 // non-flushable, because it is required for bailing out from |
310 // optimized code. | 317 // optimized code. |
311 collector->code_flusher()->AddCandidate(shared); | 318 collector->code_flusher()->AddCandidate(shared); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 RelocIterator it(this, mode_mask); | 679 RelocIterator it(this, mode_mask); |
673 for (; !it.done(); it.next()) { | 680 for (; !it.done(); it.next()) { |
674 it.rinfo()->template Visit<StaticVisitor>(heap); | 681 it.rinfo()->template Visit<StaticVisitor>(heap); |
675 } | 682 } |
676 } | 683 } |
677 | 684 |
678 | 685 |
679 } } // namespace v8::internal | 686 } } // namespace v8::internal |
680 | 687 |
681 #endif // V8_OBJECTS_VISITING_INL_H_ | 688 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |