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

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

Issue 1217943004: Vector ICs: Introduce an InstanceType for the type feedback vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improved printer. Created 5 years, 5 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 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_TYPE_FEEDBACK_VECTOR_H_ 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_
6 #define V8_TYPE_FEEDBACK_VECTOR_H_ 6 #define V8_TYPE_FEEDBACK_VECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/checks.h" 10 #include "src/checks.h"
11 #include "src/elements-kind.h" 11 #include "src/elements-kind.h"
12 #include "src/heap/heap.h" 12 // #include "src/heap/heap.h"
Benedikt Meurer 2015/06/30 09:43:43 Nit: Nuke unused includes. No need to leave them a
mvstanton 2015/06/30 15:00:46 Done.
13 #include "src/isolate.h" 13 #include "src/isolate.h"
14 #include "src/objects.h" 14 #include "src/objects.h"
15 #include "src/zone-containers.h" 15 #include "src/zone-containers.h"
16 16
17 namespace v8 { 17 namespace v8 {
18 namespace internal { 18 namespace internal {
19 19
20 class FeedbackVectorSpec { 20 class FeedbackVectorSpec {
21 public: 21 public:
22 FeedbackVectorSpec() : slots_(0), has_ic_slot_(false) {} 22 FeedbackVectorSpec() : slots_(0), has_ic_slot_(false) {}
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 Object* Get(FeedbackVectorICSlot slot) const { return get(GetIndex(slot)); } 179 Object* Get(FeedbackVectorICSlot slot) const { return get(GetIndex(slot)); }
180 void Set(FeedbackVectorICSlot slot, Object* value, 180 void Set(FeedbackVectorICSlot slot, Object* value,
181 WriteBarrierMode mode = UPDATE_WRITE_BARRIER) { 181 WriteBarrierMode mode = UPDATE_WRITE_BARRIER) {
182 set(GetIndex(slot), value, mode); 182 set(GetIndex(slot), value, mode);
183 } 183 }
184 184
185 // IC slots need metadata to recognize the type of IC. 185 // IC slots need metadata to recognize the type of IC.
186 Code::Kind GetKind(FeedbackVectorICSlot slot) const; 186 Code::Kind GetKind(FeedbackVectorICSlot slot) const;
187 187
188 template <typename Spec> 188 template <typename Spec>
189 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, 189 static int SizeFor(const Spec* spec);
190 const Spec* spec); 190
191 template <typename Spec>
192 void Init(Isolate* isolate, const Spec* spec);
191 193
192 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, 194 static Handle<TypeFeedbackVector> Copy(Isolate* isolate,
193 Handle<TypeFeedbackVector> vector); 195 Handle<TypeFeedbackVector> vector);
194 196
197 DECLARE_PRINTER(TypeFeedbackVector)
198
199 // TODO(Mvstanton): why doesn't this macro work?
200 // DECLARE_VERIFIER(TypeFeedbackVector)
201 void TypeFeedbackVectorVerify();
202
195 // Clears the vector slots and the vector ic slots. 203 // Clears the vector slots and the vector ic slots.
196 void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); } 204 void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); }
197 void ClearSlotsAtGCTime(SharedFunctionInfo* shared) { 205 void ClearSlotsAtGCTime(SharedFunctionInfo* shared) {
198 ClearSlotsImpl(shared, false); 206 ClearSlotsImpl(shared, false);
199 } 207 }
200 208
201 void ClearICSlots(SharedFunctionInfo* shared) { 209 void ClearICSlots(SharedFunctionInfo* shared) {
202 ClearICSlotsImpl(shared, true); 210 ClearICSlotsImpl(shared, true);
203 } 211 }
204 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) { 212 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps, 425 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps,
418 CodeHandleList* handlers); 426 CodeHandleList* handlers);
419 427
420 InlineCacheState StateFromFeedback() const override; 428 InlineCacheState StateFromFeedback() const override;
421 Name* FindFirstName() const override; 429 Name* FindFirstName() const override;
422 }; 430 };
423 } 431 }
424 } // namespace v8::internal 432 } // namespace v8::internal
425 433
426 #endif // V8_TRANSITIONS_H_ 434 #endif // V8_TRANSITIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698