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

Unified Diff: src/type-info.cc

Issue 14367018: Add monomorphic CompareNilICs and Crankshaft support (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 8 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/type-info.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index 39a01f59e8d826c41f027133af064d8289a4ca55..3bc509a6189a93068ee2f50b6f0a90d9aeffef67 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -218,6 +218,17 @@ Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType(
}
+Handle<Map> TypeFeedbackOracle::CompareNilMonomorphicReceiverType(
+ TypeFeedbackId id) {
+ Handle<Object> maybe_code = GetInfo(id);
+ if (maybe_code->IsCode()) {
+ Map* first_map = Handle<Code>::cast(maybe_code)->FindFirstMap();
+ if (first_map != NULL) return Handle<Map>(first_map);
+ }
+ return Handle<Map>();
+}
+
+
KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode(
TypeFeedbackId ast_id) {
Handle<Object> map_or_code = GetInfo(ast_id);
@@ -625,12 +636,23 @@ void TypeFeedbackOracle::CollectKeyedReceiverTypes(TypeFeedbackId ast_id,
}
-byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId ast_id) {
- Handle<Object> object = GetInfo(ast_id);
+byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
+ Handle<Object> object = GetInfo(id);
return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0;
}
+byte TypeFeedbackOracle::CompareNilTypes(TypeFeedbackId id) {
+ Handle<Object> object = GetInfo(id);
+ if (object->IsCode() &&
+ Handle<Code>::cast(object)->is_compare_nil_ic_stub()) {
+ return Handle<Code>::cast(object)->compare_nil_state();
+ } else {
+ return CompareNilICStub::kFullCompare;
+ }
+}
+
+
// Things are a bit tricky here: The iterator for the RelocInfos and the infos
// themselves are not GC-safe, so we first get all infos, then we create the
// dictionary (possibly triggering GC), and finally we relocate the collected
@@ -724,6 +746,7 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
case Code::BINARY_OP_IC:
case Code::COMPARE_IC:
case Code::TO_BOOLEAN_IC:
+ case Code::COMPARE_NIL_IC:
SetInfo(ast_id, target);
break;
« no previous file with comments | « src/type-info.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698