OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 #include "src/heap/array-buffer-tracker.h" | 8 #include "src/heap/array-buffer-tracker.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/ic/ic-state.h" | 10 #include "src/ic/ic-state.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 // the decision until we see all functions that point to the same | 471 // the decision until we see all functions that point to the same |
472 // SharedFunctionInfo because some of them might be optimized. | 472 // SharedFunctionInfo because some of them might be optimized. |
473 // That would also make the non-optimized version of the code | 473 // That would also make the non-optimized version of the code |
474 // non-flushable, because it is required for bailing out from | 474 // non-flushable, because it is required for bailing out from |
475 // optimized code. | 475 // optimized code. |
476 collector->code_flusher()->AddCandidate(shared); | 476 collector->code_flusher()->AddCandidate(shared); |
477 // Treat the reference to the code object weakly. | 477 // Treat the reference to the code object weakly. |
478 VisitSharedFunctionInfoWeakCode(heap, object); | 478 VisitSharedFunctionInfoWeakCode(heap, object); |
479 return; | 479 return; |
480 } | 480 } |
481 } else { | |
482 // TODO(mstarzinger): Drop this case, it shouldn't be done here! | |
483 if (!shared->optimized_code_map()->IsSmi()) { | |
484 // Flush optimized code map on major GCs without code flushing, | |
485 // needed because cached code doesn't contain breakpoints. | |
486 shared->ClearOptimizedCodeMap(); | |
487 } | |
488 } | 481 } |
489 VisitSharedFunctionInfoStrongCode(heap, object); | 482 VisitSharedFunctionInfoStrongCode(heap, object); |
490 } | 483 } |
491 | 484 |
492 | 485 |
493 template <typename StaticVisitor> | 486 template <typename StaticVisitor> |
494 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, | 487 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, |
495 HeapObject* object) { | 488 HeapObject* object) { |
496 Heap* heap = map->GetHeap(); | 489 Heap* heap = map->GetHeap(); |
497 JSFunction* function = JSFunction::cast(object); | 490 JSFunction* function = JSFunction::cast(object); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 | 897 |
905 RelocIterator it(this, mode_mask); | 898 RelocIterator it(this, mode_mask); |
906 for (; !it.done(); it.next()) { | 899 for (; !it.done(); it.next()) { |
907 it.rinfo()->template Visit<StaticVisitor>(heap); | 900 it.rinfo()->template Visit<StaticVisitor>(heap); |
908 } | 901 } |
909 } | 902 } |
910 } // namespace internal | 903 } // namespace internal |
911 } // namespace v8 | 904 } // namespace v8 |
912 | 905 |
913 #endif // V8_OBJECTS_VISITING_INL_H_ | 906 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |