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

Side by Side Diff: src/feedback-vector.h

Issue 2677163003: WIP: type profiling. (Closed)
Patch Set: Rebaseline. Created 3 years, 10 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 | « src/compiler/verifier.cc ('k') | src/feedback-vector.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_FEEDBACK_VECTOR_H_ 5 #ifndef V8_FEEDBACK_VECTOR_H_
6 #define V8_FEEDBACK_VECTOR_H_ 6 #define V8_FEEDBACK_VECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/base/logging.h" 10 #include "src/base/logging.h"
(...skipping 17 matching lines...) Expand all
28 kLoadGlobalInsideTypeof, 28 kLoadGlobalInsideTypeof,
29 kLoadKeyed, 29 kLoadKeyed,
30 kStorePropertySloppy, 30 kStorePropertySloppy,
31 kStorePropertyStrict, 31 kStorePropertyStrict,
32 kStoreKeyedSloppy, 32 kStoreKeyedSloppy,
33 kStoreKeyedStrict, 33 kStoreKeyedStrict,
34 kBinaryOp, 34 kBinaryOp,
35 kCompareOp, 35 kCompareOp,
36 kToBoolean, 36 kToBoolean,
37 kStoreDataPropertyInLiteral, 37 kStoreDataPropertyInLiteral,
38 kTypeProfile,
38 kCreateClosure, 39 kCreateClosure,
39 kLiteral, 40 kLiteral,
40 // This is a general purpose slot that occupies one feedback vector element. 41 // This is a general purpose slot that occupies one feedback vector element.
41 kGeneral, 42 kGeneral,
42 43
43 kKindsNumber // Last value indicating number of kinds. 44 kKindsNumber // Last value indicating number of kinds.
44 }; 45 };
45 46
46 inline bool IsCallICKind(FeedbackSlotKind kind) { 47 inline bool IsCallICKind(FeedbackSlotKind kind) {
47 return kind == FeedbackSlotKind::kCall; 48 return kind == FeedbackSlotKind::kCall;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 135
135 FeedbackSlot AddGeneralSlot() { return AddSlot(FeedbackSlotKind::kGeneral); } 136 FeedbackSlot AddGeneralSlot() { return AddSlot(FeedbackSlotKind::kGeneral); }
136 137
137 FeedbackSlot AddLiteralSlot() { return AddSlot(FeedbackSlotKind::kLiteral); } 138 FeedbackSlot AddLiteralSlot() { return AddSlot(FeedbackSlotKind::kLiteral); }
138 139
139 FeedbackSlot AddStoreDataPropertyInLiteralICSlot() { 140 FeedbackSlot AddStoreDataPropertyInLiteralICSlot() {
140 return AddSlot(FeedbackSlotKind::kStoreDataPropertyInLiteral); 141 return AddSlot(FeedbackSlotKind::kStoreDataPropertyInLiteral);
141 } 142 }
142 143
144 FeedbackSlot AddTypeProfileSlot() {
145 DCHECK(FLAG_type_profile);
146 return AddSlot(FeedbackSlotKind::kTypeProfile);
147 }
148
143 #ifdef OBJECT_PRINT 149 #ifdef OBJECT_PRINT
144 // For gdb debugging. 150 // For gdb debugging.
145 void Print(); 151 void Print();
146 #endif // OBJECT_PRINT 152 #endif // OBJECT_PRINT
147 153
148 DECLARE_PRINTER(FeedbackVectorSpec) 154 DECLARE_PRINTER(FeedbackVectorSpec)
149 155
150 private: 156 private:
151 inline FeedbackSlot AddSlot(FeedbackSlotKind kind); 157 inline FeedbackSlot AddSlot(FeedbackSlotKind kind);
152 158
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 int length = -1) const final { 712 int length = -1) const final {
707 return length == 0; 713 return length == 0;
708 } 714 }
709 }; 715 };
710 716
711 class StoreDataPropertyInLiteralICNexus : public FeedbackNexus { 717 class StoreDataPropertyInLiteralICNexus : public FeedbackNexus {
712 public: 718 public:
713 StoreDataPropertyInLiteralICNexus(Handle<FeedbackVector> vector, 719 StoreDataPropertyInLiteralICNexus(Handle<FeedbackVector> vector,
714 FeedbackSlot slot) 720 FeedbackSlot slot)
715 : FeedbackNexus(vector, slot) { 721 : FeedbackNexus(vector, slot) {
716 DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral, 722 // DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral,
717 vector->GetKind(slot)); 723 // vector->GetKind(slot));
718 } 724 }
719 StoreDataPropertyInLiteralICNexus(FeedbackVector* vector, FeedbackSlot slot) 725 StoreDataPropertyInLiteralICNexus(FeedbackVector* vector, FeedbackSlot slot)
720 : FeedbackNexus(vector, slot) { 726 : FeedbackNexus(vector, slot) {
721 DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral, 727 DCHECK_EQ(FeedbackSlotKind::kStoreDataPropertyInLiteral,
722 vector->GetKind(slot)); 728 vector->GetKind(slot));
723 } 729 }
724 730
725 void ConfigureMonomorphic(Handle<Name> name, Handle<Map> receiver_map); 731 void ConfigureMonomorphic(Handle<Name> name, Handle<Map> receiver_map);
726 732
727 InlineCacheState StateFromFeedback() const override; 733 InlineCacheState StateFromFeedback() const override;
728 }; 734 };
729 735
730 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); 736 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback);
731 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); 737 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback);
732 738
733 } // namespace internal 739 } // namespace internal
734 } // namespace v8 740 } // namespace v8
735 741
736 #endif // V8_FEEDBACK_VECTOR_H_ 742 #endif // V8_FEEDBACK_VECTOR_H_
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698