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

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

Issue 2412043003: [ic] Support non-code handlers in megamorphic stub cache. (Closed)
Patch Set: Addressing comments Created 4 years, 2 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/ic/stub-cache.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 45308fc79b04e28c02cdd067399d03ceae8e7851..ea675804cf14460717853c4ce0285679a91b5750 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -5,7 +5,7 @@
#include "src/type-feedback-vector.h"
#include "src/code-stubs.h"
-#include "src/ic/ic.h"
+#include "src/ic/ic-inl.h"
#include "src/ic/ic-state.h"
#include "src/objects.h"
#include "src/type-feedback-vector-inl.h"
@@ -851,17 +851,10 @@ int GetStepSize(FixedArray* array, Isolate* isolate) {
DCHECK(array->length() >= 2);
Object* second = array->get(1);
if (second->IsWeakCell() || second->IsUndefined(isolate)) return 3;
- DCHECK(second->IsCode() || second->IsSmi());
+ DCHECK(IC::IsHandler(second));
return 2;
}
-#ifdef DEBUG // Only used by DCHECKs below.
-bool IsHandler(Object* object) {
- return object->IsSmi() ||
- (object->IsCode() && Code::cast(object)->is_handler());
-}
-#endif
-
} // namespace
int FeedbackNexus::ExtractMaps(MapHandleList* maps) const {
@@ -914,7 +907,7 @@ MaybeHandle<Object> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const {
Map* array_map = Map::cast(cell->value());
if (array_map == *map) {
Object* code = array->get(i + increment - 1);
- DCHECK(IsHandler(code));
+ DCHECK(IC::IsHandler(code));
return handle(code, isolate);
}
}
@@ -925,7 +918,7 @@ MaybeHandle<Object> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const {
Map* cell_map = Map::cast(cell->value());
if (cell_map == *map) {
Object* code = GetFeedbackExtra();
- DCHECK(IsHandler(code));
+ DCHECK(IC::IsHandler(code));
return handle(code, isolate);
}
}
@@ -952,7 +945,7 @@ bool FeedbackNexus::FindHandlers(List<Handle<Object>>* code_list,
// Be sure to skip handlers whose maps have been cleared.
if (!cell->cleared()) {
Object* code = array->get(i + increment - 1);
- DCHECK(IsHandler(code));
+ DCHECK(IC::IsHandler(code));
code_list->Add(handle(code, isolate));
count++;
}
@@ -961,7 +954,7 @@ bool FeedbackNexus::FindHandlers(List<Handle<Object>>* code_list,
WeakCell* cell = WeakCell::cast(feedback);
if (!cell->cleared()) {
Object* code = GetFeedbackExtra();
- DCHECK(IsHandler(code));
+ DCHECK(IC::IsHandler(code));
code_list->Add(handle(code, isolate));
count++;
}
« no previous file with comments | « src/ic/stub-cache.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698