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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 return false; | 618 return false; |
619 } | 619 } |
620 | 620 |
621 // The function must be compiled and have the source code available, | 621 // The function must be compiled and have the source code available, |
622 // to be able to recompile it in case we need the function again. | 622 // to be able to recompile it in case we need the function again. |
623 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { | 623 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { |
624 return false; | 624 return false; |
625 } | 625 } |
626 | 626 |
627 // We never flush code for API functions. | 627 // We never flush code for API functions. |
628 Object* function_data = shared_info->function_data(); | 628 if (shared_info->IsApiFunction()) { |
629 if (function_data->IsFunctionTemplateInfo()) { | |
630 return false; | 629 return false; |
631 } | 630 } |
632 | 631 |
633 // Only flush code for functions. | 632 // Only flush code for functions. |
634 if (shared_info->code()->kind() != Code::FUNCTION) { | 633 if (shared_info->code()->kind() != Code::FUNCTION) { |
635 return false; | 634 return false; |
636 } | 635 } |
637 | 636 |
638 // Function must be lazy compilable. | 637 // Function must be lazy compilable. |
639 if (!shared_info->allows_lazy_compilation()) { | 638 if (!shared_info->allows_lazy_compilation()) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 723 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
725 void> JSFunctionWeakCodeBodyVisitor; | 724 void> JSFunctionWeakCodeBodyVisitor; |
726 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 725 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
727 } | 726 } |
728 | 727 |
729 | 728 |
730 } // namespace internal | 729 } // namespace internal |
731 } // namespace v8 | 730 } // namespace v8 |
732 | 731 |
733 #endif // V8_OBJECTS_VISITING_INL_H_ | 732 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |