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

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

Issue 2707873002: Collect type profile for DevTools. (Closed)
Patch Set: Use constructor name if available. 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
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_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 case FeedbackSlotKind::kLoadProperty: 60 case FeedbackSlotKind::kLoadProperty:
61 case FeedbackSlotKind::kLoadGlobalInsideTypeof: 61 case FeedbackSlotKind::kLoadGlobalInsideTypeof:
62 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof: 62 case FeedbackSlotKind::kLoadGlobalNotInsideTypeof:
63 case FeedbackSlotKind::kLoadKeyed: 63 case FeedbackSlotKind::kLoadKeyed:
64 case FeedbackSlotKind::kStoreNamedSloppy: 64 case FeedbackSlotKind::kStoreNamedSloppy:
65 case FeedbackSlotKind::kStoreNamedStrict: 65 case FeedbackSlotKind::kStoreNamedStrict:
66 case FeedbackSlotKind::kStoreOwnNamed: 66 case FeedbackSlotKind::kStoreOwnNamed:
67 case FeedbackSlotKind::kStoreKeyedSloppy: 67 case FeedbackSlotKind::kStoreKeyedSloppy:
68 case FeedbackSlotKind::kStoreKeyedStrict: 68 case FeedbackSlotKind::kStoreKeyedStrict:
69 case FeedbackSlotKind::kStoreDataPropertyInLiteral: 69 case FeedbackSlotKind::kStoreDataPropertyInLiteral:
70 case FeedbackSlotKind::kTypeProfile:
70 return 2; 71 return 2;
Yang 2017/02/22 10:39:28 Why do we need two slots for this?
Franzi 2017/02/27 11:38:01 Changed it to 1.
71 72
72 case FeedbackSlotKind::kInvalid: 73 case FeedbackSlotKind::kInvalid:
73 case FeedbackSlotKind::kKindsNumber: 74 case FeedbackSlotKind::kKindsNumber:
74 UNREACHABLE(); 75 UNREACHABLE();
75 break; 76 break;
76 } 77 }
77 return 1; 78 return 1;
78 } 79 }
79 80
80 bool FeedbackVector::is_empty() const { 81 bool FeedbackVector::is_empty() const {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « src/feedback-vector.cc ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698