Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 1878183002: [heap] Use safer predicate for API functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698