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

Unified Diff: src/type-feedback-vector.h

Issue 1268783004: VectorICs: refactoring to eliminate "for queries only" vector ic mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation error. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.h
diff --git a/src/type-feedback-vector.h b/src/type-feedback-vector.h
index 2a6e4f3654af41855d5fd5e01d17b0c39a3033de..6a7d6663ae9e08a536246dfe55ba4b7306754679 100644
--- a/src/type-feedback-vector.h
+++ b/src/type-feedback-vector.h
@@ -19,24 +19,25 @@ namespace internal {
class FeedbackVectorSpec {
public:
- FeedbackVectorSpec() : slots_(0), has_ic_slot_(false) {}
- explicit FeedbackVectorSpec(int slots) : slots_(slots), has_ic_slot_(false) {}
- FeedbackVectorSpec(int slots, Code::Kind ic_slot_kind)
- : slots_(slots), has_ic_slot_(true), ic_kind_(ic_slot_kind) {}
+ FeedbackVectorSpec() : slots_(0), ic_slots_(0), ic_kinds_(NULL) {}
+ explicit FeedbackVectorSpec(int slots)
+ : slots_(slots), ic_slots_(0), ic_kinds_(NULL) {}
+ FeedbackVectorSpec(int slots, int ic_slots, Code::Kind* ic_slot_kinds)
+ : slots_(slots), ic_slots_(ic_slots), ic_kinds_(ic_slot_kinds) {}
int slots() const { return slots_; }
- int ic_slots() const { return has_ic_slot_ ? 1 : 0; }
+ int ic_slots() const { return ic_slots_; }
Code::Kind GetKind(int ic_slot) const {
- DCHECK(has_ic_slot_ && ic_slot == 0);
- return ic_kind_;
+ DCHECK(ic_slots_ > 0 && ic_slot < ic_slots_);
+ return ic_kinds_[ic_slot];
}
private:
int slots_;
- bool has_ic_slot_;
- Code::Kind ic_kind_;
+ int ic_slots_;
+ Code::Kind* ic_kinds_;
};
@@ -225,6 +226,17 @@ class TypeFeedbackVector : public FixedArray {
// garbage collection (e.g., for patching the cache).
static inline Object* RawUninitializedSentinel(Heap* heap);
+ static const int kDummyLoadICSlot = 0;
+ static const int kDummyKeyedLoadICSlot = 1;
+ static const int kDummyStoreICSlot = 2;
+ static const int kDummyKeyedStoreICSlot = 3;
+
+ static Handle<TypeFeedbackVector> DummyVector(Isolate* isolate);
+ static FeedbackVectorICSlot DummySlot(int dummyIndex) {
+ DCHECK(dummyIndex >= 0 && dummyIndex <= kDummyKeyedStoreICSlot);
+ return FeedbackVectorICSlot(dummyIndex);
+ }
+
private:
enum VectorICKind {
KindUnused = 0x0,
@@ -386,6 +398,10 @@ class LoadICNexus : public FeedbackNexus {
: FeedbackNexus(vector, slot) {
DCHECK(vector->GetKind(slot) == Code::LOAD_IC);
}
+ explicit LoadICNexus(Isolate* isolate)
+ : FeedbackNexus(TypeFeedbackVector::DummyVector(isolate),
+ TypeFeedbackVector::DummySlot(
+ TypeFeedbackVector::kDummyLoadICSlot)) {}
LoadICNexus(TypeFeedbackVector* vector, FeedbackVectorICSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK(vector->GetKind(slot) == Code::LOAD_IC);
@@ -432,6 +448,10 @@ class StoreICNexus : public FeedbackNexus {
: FeedbackNexus(vector, slot) {
DCHECK(vector->GetKind(slot) == Code::STORE_IC);
}
+ explicit StoreICNexus(Isolate* isolate)
+ : FeedbackNexus(TypeFeedbackVector::DummyVector(isolate),
+ TypeFeedbackVector::DummySlot(
+ TypeFeedbackVector::kDummyStoreICSlot)) {}
StoreICNexus(TypeFeedbackVector* vector, FeedbackVectorICSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK(vector->GetKind(slot) == Code::STORE_IC);
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698