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

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: Fix for failing test. 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"
13 #include "src/isolate.h" 12 #include "src/isolate.h"
14 #include "src/objects.h" 13 #include "src/objects.h"
15 #include "src/zone-containers.h" 14 #include "src/zone-containers.h"
16 15
17 namespace v8 { 16 namespace v8 {
18 namespace internal { 17 namespace internal {
19 18
20 class FeedbackVectorSpec { 19 class FeedbackVectorSpec {
21 public: 20 public:
22 FeedbackVectorSpec() : slots_(0), has_ic_slot_(false) {} 21 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)); } 178 Object* Get(FeedbackVectorICSlot slot) const { return get(GetIndex(slot)); }
180 void Set(FeedbackVectorICSlot slot, Object* value, 179 void Set(FeedbackVectorICSlot slot, Object* value,
181 WriteBarrierMode mode = UPDATE_WRITE_BARRIER) { 180 WriteBarrierMode mode = UPDATE_WRITE_BARRIER) {
182 set(GetIndex(slot), value, mode); 181 set(GetIndex(slot), value, mode);
183 } 182 }
184 183
185 // IC slots need metadata to recognize the type of IC. 184 // IC slots need metadata to recognize the type of IC.
186 Code::Kind GetKind(FeedbackVectorICSlot slot) const; 185 Code::Kind GetKind(FeedbackVectorICSlot slot) const;
187 186
188 template <typename Spec> 187 template <typename Spec>
189 static Handle<TypeFeedbackVector> Allocate(Isolate* isolate, 188 static int SizeFor(const Spec* spec);
190 const Spec* spec); 189
190 template <typename Spec>
191 void Init(Isolate* isolate, const Spec* spec);
191 192
192 static Handle<TypeFeedbackVector> Copy(Isolate* isolate, 193 static Handle<TypeFeedbackVector> Copy(Isolate* isolate,
193 Handle<TypeFeedbackVector> vector); 194 Handle<TypeFeedbackVector> vector);
194 195
196 DECLARE_PRINTER(TypeFeedbackVector)
197
198 void TypeFeedbackVectorVerify();
199
195 // Clears the vector slots and the vector ic slots. 200 // Clears the vector slots and the vector ic slots.
196 void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); } 201 void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); }
197 void ClearSlotsAtGCTime(SharedFunctionInfo* shared) { 202 void ClearSlotsAtGCTime(SharedFunctionInfo* shared) {
198 ClearSlotsImpl(shared, false); 203 ClearSlotsImpl(shared, false);
199 } 204 }
200 205
201 void ClearICSlots(SharedFunctionInfo* shared) { 206 void ClearICSlots(SharedFunctionInfo* shared) {
202 ClearICSlotsImpl(shared, true); 207 ClearICSlotsImpl(shared, true);
203 } 208 }
204 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) { 209 void ClearICSlotsAtGCTime(SharedFunctionInfo* shared) {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps, 466 void ConfigurePolymorphic(Handle<Name> name, MapHandleList* maps,
462 CodeHandleList* handlers); 467 CodeHandleList* handlers);
463 468
464 InlineCacheState StateFromFeedback() const override; 469 InlineCacheState StateFromFeedback() const override;
465 Name* FindFirstName() const override; 470 Name* FindFirstName() const override;
466 }; 471 };
467 } 472 }
468 } // namespace v8::internal 473 } // namespace v8::internal
469 474
470 #endif // V8_TRANSITIONS_H_ 475 #endif // V8_TRANSITIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698