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

Side by Side Diff: src/ast/ast.h

Issue 2426693002: [ic] Unify CallIC feedback collection and handling. (Closed)
Patch Set: Also simplify BytecodeGraphBuilder::ComputeCallFrequency Created 4 years, 2 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 | src/ast/ast.cc » ('j') | 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_AST_AST_H_ 5 #ifndef V8_AST_AST_H_
6 #define V8_AST_AST_H_ 6 #define V8_AST_AST_H_
7 7
8 #include "src/ast/ast-types.h" 8 #include "src/ast/ast-types.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 public: 1832 public:
1833 Expression* expression() const { return expression_; } 1833 Expression* expression() const { return expression_; }
1834 ZoneList<Expression*>* arguments() const { return arguments_; } 1834 ZoneList<Expression*>* arguments() const { return arguments_; }
1835 1835
1836 void set_expression(Expression* e) { expression_ = e; } 1836 void set_expression(Expression* e) { expression_ = e; }
1837 1837
1838 // Type feedback information. 1838 // Type feedback information.
1839 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 1839 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
1840 FeedbackVectorSlotCache* cache); 1840 FeedbackVectorSlotCache* cache);
1841 1841
1842 FeedbackVectorSlot CallFeedbackSlot() const { return stub_slot_; }
1843
1844 FeedbackVectorSlot CallFeedbackICSlot() const { return ic_slot_; } 1842 FeedbackVectorSlot CallFeedbackICSlot() const { return ic_slot_; }
1845 1843
1846 SmallMapList* GetReceiverTypes() { 1844 SmallMapList* GetReceiverTypes() {
1847 if (expression()->IsProperty()) { 1845 if (expression()->IsProperty()) {
1848 return expression()->AsProperty()->GetReceiverTypes(); 1846 return expression()->AsProperty()->GetReceiverTypes();
1849 } 1847 }
1850 return nullptr; 1848 return nullptr;
1851 } 1849 }
1852 1850
1853 bool IsMonomorphic() const { 1851 bool IsMonomorphic() const {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 OTHER_CALL 1903 OTHER_CALL
1906 }; 1904 };
1907 1905
1908 enum PossiblyEval { 1906 enum PossiblyEval {
1909 IS_POSSIBLY_EVAL, 1907 IS_POSSIBLY_EVAL,
1910 NOT_EVAL, 1908 NOT_EVAL,
1911 }; 1909 };
1912 1910
1913 // Helpers to determine how to handle the call. 1911 // Helpers to determine how to handle the call.
1914 CallType GetCallType() const; 1912 CallType GetCallType() const;
1915 bool IsUsingCallFeedbackSlot() const;
1916 bool IsUsingCallFeedbackICSlot() const;
1917 1913
1918 #ifdef DEBUG 1914 #ifdef DEBUG
1919 // Used to assert that the FullCodeGenerator records the return site. 1915 // Used to assert that the FullCodeGenerator records the return site.
1920 bool return_is_recorded_; 1916 bool return_is_recorded_;
1921 #endif 1917 #endif
1922 1918
1923 private: 1919 private:
1924 friend class AstNodeFactory; 1920 friend class AstNodeFactory;
1925 1921
1926 Call(Expression* expression, ZoneList<Expression*>* arguments, int pos, 1922 Call(Expression* expression, ZoneList<Expression*>* arguments, int pos,
(...skipping 12 matching lines...) Expand all
1939 1935
1940 static int parent_num_ids() { return Expression::num_ids(); } 1936 static int parent_num_ids() { return Expression::num_ids(); }
1941 int local_id(int n) const { return base_id() + parent_num_ids() + n; } 1937 int local_id(int n) const { return base_id() + parent_num_ids() + n; }
1942 1938
1943 class IsUninitializedField 1939 class IsUninitializedField
1944 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; 1940 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {};
1945 class IsTailField : public BitField<bool, IsUninitializedField::kNext, 1> {}; 1941 class IsTailField : public BitField<bool, IsUninitializedField::kNext, 1> {};
1946 class IsPossiblyEvalField : public BitField<bool, IsTailField::kNext, 1> {}; 1942 class IsPossiblyEvalField : public BitField<bool, IsTailField::kNext, 1> {};
1947 1943
1948 FeedbackVectorSlot ic_slot_; 1944 FeedbackVectorSlot ic_slot_;
1949 FeedbackVectorSlot stub_slot_;
1950 Expression* expression_; 1945 Expression* expression_;
1951 ZoneList<Expression*>* arguments_; 1946 ZoneList<Expression*>* arguments_;
1952 Handle<JSFunction> target_; 1947 Handle<JSFunction> target_;
1953 Handle<AllocationSite> allocation_site_; 1948 Handle<AllocationSite> allocation_site_;
1954 }; 1949 };
1955 1950
1956 1951
1957 class CallNew final : public Expression { 1952 class CallNew final : public Expression {
1958 public: 1953 public:
1959 Expression* expression() const { return expression_; } 1954 Expression* expression() const { return expression_; }
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
3598 : NULL; \ 3593 : NULL; \
3599 } 3594 }
3600 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) 3595 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
3601 #undef DECLARE_NODE_FUNCTIONS 3596 #undef DECLARE_NODE_FUNCTIONS
3602 3597
3603 3598
3604 } // namespace internal 3599 } // namespace internal
3605 } // namespace v8 3600 } // namespace v8
3606 3601
3607 #endif // V8_AST_AST_H_ 3602 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698