| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 } | 563 } |
| 564 | 564 |
| 565 | 565 |
| 566 template <typename StaticVisitor> | 566 template <typename StaticVisitor> |
| 567 bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(Heap* heap, | 567 bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(Heap* heap, |
| 568 JSFunction* function) { | 568 JSFunction* function) { |
| 569 SharedFunctionInfo* shared_info = function->shared(); | 569 SharedFunctionInfo* shared_info = function->shared(); |
| 570 | 570 |
| 571 // Code is either on stack, in compilation cache or referenced | 571 // Code is either on stack, in compilation cache or referenced |
| 572 // by optimized version of function. | 572 // by optimized version of function. |
| 573 MarkBit code_mark = Marking::MarkBitFrom(function->code()); | 573 MarkBit code_mark = ObjectMarking::MarkBitFrom(function->code()); |
| 574 if (Marking::IsBlackOrGrey(code_mark)) { | 574 if (Marking::IsBlackOrGrey(code_mark)) { |
| 575 return false; | 575 return false; |
| 576 } | 576 } |
| 577 | 577 |
| 578 // We do not (yet) flush code for optimized functions. | 578 // We do not (yet) flush code for optimized functions. |
| 579 if (function->code() != shared_info->code()) { | 579 if (function->code() != shared_info->code()) { |
| 580 return false; | 580 return false; |
| 581 } | 581 } |
| 582 | 582 |
| 583 // Check age of optimized code. | 583 // Check age of optimized code. |
| 584 if (FLAG_age_code && !function->code()->IsOld()) { | 584 if (FLAG_age_code && !function->code()->IsOld()) { |
| 585 return false; | 585 return false; |
| 586 } | 586 } |
| 587 | 587 |
| 588 return IsFlushable(heap, shared_info); | 588 return IsFlushable(heap, shared_info); |
| 589 } | 589 } |
| 590 | 590 |
| 591 | 591 |
| 592 template <typename StaticVisitor> | 592 template <typename StaticVisitor> |
| 593 bool StaticMarkingVisitor<StaticVisitor>::IsFlushable( | 593 bool StaticMarkingVisitor<StaticVisitor>::IsFlushable( |
| 594 Heap* heap, SharedFunctionInfo* shared_info) { | 594 Heap* heap, SharedFunctionInfo* shared_info) { |
| 595 // Code is either on stack, in compilation cache or referenced | 595 // Code is either on stack, in compilation cache or referenced |
| 596 // by optimized version of function. | 596 // by optimized version of function. |
| 597 MarkBit code_mark = Marking::MarkBitFrom(shared_info->code()); | 597 MarkBit code_mark = ObjectMarking::MarkBitFrom(shared_info->code()); |
| 598 if (Marking::IsBlackOrGrey(code_mark)) { | 598 if (Marking::IsBlackOrGrey(code_mark)) { |
| 599 return false; | 599 return false; |
| 600 } | 600 } |
| 601 | 601 |
| 602 // The function must be compiled and have the source code available, | 602 // The function must be compiled and have the source code available, |
| 603 // to be able to recompile it in case we need the function again. | 603 // to be able to recompile it in case we need the function again. |
| 604 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { | 604 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { |
| 605 return false; | 605 return false; |
| 606 } | 606 } |
| 607 | 607 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 705 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
| 706 void> JSFunctionWeakCodeBodyVisitor; | 706 void> JSFunctionWeakCodeBodyVisitor; |
| 707 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 707 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
| 708 } | 708 } |
| 709 | 709 |
| 710 | 710 |
| 711 } // namespace internal | 711 } // namespace internal |
| 712 } // namespace v8 | 712 } // namespace v8 |
| 713 | 713 |
| 714 #endif // V8_OBJECTS_VISITING_INL_H_ | 714 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |