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_FEEDBACK_VECTOR_INL_H_ | 5 #ifndef V8_FEEDBACK_VECTOR_INL_H_ |
6 #define V8_FEEDBACK_VECTOR_INL_H_ | 6 #define V8_FEEDBACK_VECTOR_INL_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/feedback-vector.h" | 9 #include "src/feedback-vector.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 int FeedbackMetadata::GetSlotSize(FeedbackSlotKind kind) { | 49 int FeedbackMetadata::GetSlotSize(FeedbackSlotKind kind) { |
50 switch (kind) { | 50 switch (kind) { |
51 case FeedbackSlotKind::kGeneral: | 51 case FeedbackSlotKind::kGeneral: |
52 case FeedbackSlotKind::kCompareOp: | 52 case FeedbackSlotKind::kCompareOp: |
53 case FeedbackSlotKind::kBinaryOp: | 53 case FeedbackSlotKind::kBinaryOp: |
54 case FeedbackSlotKind::kToBoolean: | 54 case FeedbackSlotKind::kToBoolean: |
55 case FeedbackSlotKind::kLiteral: | 55 case FeedbackSlotKind::kLiteral: |
56 case FeedbackSlotKind::kCreateClosure: | 56 case FeedbackSlotKind::kCreateClosure: |
| 57 case FeedbackSlotKind::kTypeProfile: |
57 return 1; | 58 return 1; |
58 | 59 |
59 case FeedbackSlotKind::kCall: | 60 case FeedbackSlotKind::kCall: |
60 case FeedbackSlotKind::kLoadProperty: | 61 case FeedbackSlotKind::kLoadProperty: |
61 case FeedbackSlotKind::kLoadGlobalInsideTypeof: | 62 case FeedbackSlotKind::kLoadGlobalInsideTypeof: |
62 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: | 63 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: |
63 case FeedbackSlotKind::kLoadKeyed: | 64 case FeedbackSlotKind::kLoadKeyed: |
64 case FeedbackSlotKind::kStoreNamedSloppy: | 65 case FeedbackSlotKind::kStoreNamedSloppy: |
65 case FeedbackSlotKind::kStoreNamedStrict: | 66 case FeedbackSlotKind::kStoreNamedStrict: |
66 case FeedbackSlotKind::kStoreOwnNamed: | 67 case FeedbackSlotKind::kStoreOwnNamed: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 case FeedbackSlotKind::kCall: | 180 case FeedbackSlotKind::kCall: |
180 case FeedbackSlotKind::kLoadProperty: | 181 case FeedbackSlotKind::kLoadProperty: |
181 case FeedbackSlotKind::kLoadGlobalInsideTypeof: | 182 case FeedbackSlotKind::kLoadGlobalInsideTypeof: |
182 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: | 183 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: |
183 case FeedbackSlotKind::kLoadKeyed: | 184 case FeedbackSlotKind::kLoadKeyed: |
184 case FeedbackSlotKind::kStoreNamedSloppy: | 185 case FeedbackSlotKind::kStoreNamedSloppy: |
185 case FeedbackSlotKind::kStoreNamedStrict: | 186 case FeedbackSlotKind::kStoreNamedStrict: |
186 case FeedbackSlotKind::kStoreOwnNamed: | 187 case FeedbackSlotKind::kStoreOwnNamed: |
187 case FeedbackSlotKind::kStoreKeyedSloppy: | 188 case FeedbackSlotKind::kStoreKeyedSloppy: |
188 case FeedbackSlotKind::kStoreKeyedStrict: | 189 case FeedbackSlotKind::kStoreKeyedStrict: |
189 case FeedbackSlotKind::kStoreDataPropertyInLiteral: { | 190 case FeedbackSlotKind::kStoreDataPropertyInLiteral: |
| 191 case FeedbackSlotKind::kTypeProfile: { |
190 if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) { | 192 if (obj->IsWeakCell() || obj->IsFixedArray() || obj->IsString()) { |
191 with++; | 193 with++; |
192 } else if (obj == megamorphic_sentinel) { | 194 } else if (obj == megamorphic_sentinel) { |
193 gen++; | 195 gen++; |
194 if (code_is_interpreted) with++; | 196 if (code_is_interpreted) with++; |
195 } | 197 } |
196 total++; | 198 total++; |
197 break; | 199 break; |
198 } | 200 } |
199 case FeedbackSlotKind::kBinaryOp: | 201 case FeedbackSlotKind::kBinaryOp: |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 #endif | 306 #endif |
305 int index = vector()->GetIndex(slot()) + 1; | 307 int index = vector()->GetIndex(slot()) + 1; |
306 vector()->set(index, feedback_extra, mode); | 308 vector()->set(index, feedback_extra, mode); |
307 } | 309 } |
308 | 310 |
309 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 311 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
310 } // namespace internal | 312 } // namespace internal |
311 } // namespace v8 | 313 } // namespace v8 |
312 | 314 |
313 #endif // V8_FEEDBACK_VECTOR_INL_H_ | 315 #endif // V8_FEEDBACK_VECTOR_INL_H_ |
OLD | NEW |