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

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

Issue 2673383002: [ic] Encode LoadGlobalIC's typeof mode in slot kind instead of code object's flags. (Closed)
Patch Set: Addressed comments and added check to FCG 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('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 378c26a9809023b21c58e8f2ddee72ffbec41f2a..9131fe77db1418ae55eb2e8905cc096338a6c109 100644
--- a/src/type-feedback-vector.h
+++ b/src/type-feedback-vector.h
@@ -24,7 +24,8 @@ enum class FeedbackVectorSlotKind {
CALL_IC,
LOAD_IC,
- LOAD_GLOBAL_IC,
+ LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC,
+ LOAD_GLOBAL_INSIDE_TYPEOF_IC,
KEYED_LOAD_IC,
STORE_SLOPPY_IC,
STORE_STRICT_IC,
@@ -50,7 +51,8 @@ inline bool IsLoadICKind(FeedbackVectorSlotKind kind) {
}
inline bool IsLoadGlobalICKind(FeedbackVectorSlotKind kind) {
- return kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC;
+ return kind == FeedbackVectorSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC ||
+ kind == FeedbackVectorSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC;
}
inline bool IsKeyedLoadICKind(FeedbackVectorSlotKind kind) {
@@ -67,6 +69,13 @@ inline bool IsKeyedStoreICKind(FeedbackVectorSlotKind kind) {
kind == FeedbackVectorSlotKind::KEYED_STORE_STRICT_IC;
}
+inline TypeofMode GetTypeofModeFromICKind(FeedbackVectorSlotKind kind) {
+ DCHECK(IsLoadGlobalICKind(kind));
+ return (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC)
+ ? INSIDE_TYPEOF
+ : NOT_INSIDE_TYPEOF;
+}
+
inline LanguageMode GetLanguageModeFromICKind(FeedbackVectorSlotKind kind) {
DCHECK(IsStoreICKind(kind) || IsKeyedStoreICKind(kind));
return (kind == FeedbackVectorSlotKind::STORE_SLOPPY_IC ||
@@ -89,8 +98,11 @@ class FeedbackVectorSpecBase {
return AddSlot(FeedbackVectorSlotKind::LOAD_IC);
}
- FeedbackVectorSlot AddLoadGlobalICSlot() {
- return AddSlot(FeedbackVectorSlotKind::LOAD_GLOBAL_IC);
+ FeedbackVectorSlot AddLoadGlobalICSlot(TypeofMode typeof_mode) {
+ return AddSlot(
+ typeof_mode == INSIDE_TYPEOF
+ ? FeedbackVectorSlotKind::LOAD_GLOBAL_INSIDE_TYPEOF_IC
+ : FeedbackVectorSlotKind::LOAD_GLOBAL_NOT_INSIDE_TYPEOF_IC);
}
FeedbackVectorSlot AddCreateClosureSlot() {
@@ -312,6 +324,11 @@ class TypeFeedbackVector : public FixedArray {
DEFINE_SLOT_KIND_PREDICATE(IsKeyedStoreIC)
#undef DEFINE_SLOT_KIND_PREDICATE
+ // Returns typeof mode encoded into kind of given slot.
+ inline TypeofMode GetTypeofMode(FeedbackVectorSlot slot) const {
+ return GetTypeofModeFromICKind(GetKind(slot));
+ }
+
// Returns language mode encoded into kind of given slot.
inline LanguageMode GetLanguageMode(FeedbackVectorSlot slot) const {
return GetLanguageModeFromICKind(GetKind(slot));
@@ -344,10 +361,6 @@ class TypeFeedbackVector : public FixedArray {
// garbage collection (e.g., for patching the cache).
static inline Symbol* RawUninitializedSentinel(Isolate* isolate);
- static const int kDummyLoadICSlot = 0;
-
- static Handle<TypeFeedbackVector> DummyVector(Isolate* isolate);
-
private:
void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear);
@@ -529,10 +542,6 @@ class LoadICNexus : public FeedbackNexus {
: FeedbackNexus(vector, slot) {
DCHECK(vector->IsLoadIC(slot));
}
- explicit LoadICNexus(Isolate* isolate)
- : FeedbackNexus(
- TypeFeedbackVector::DummyVector(isolate),
- FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot)) {}
LoadICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK(vector->IsLoadIC(slot));
« no previous file with comments | « src/runtime/runtime.h ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698