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

Unified Diff: src/type-info.cc

Issue 17468003: Use AST's type field and merge types for unary, binary & compare ICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments Created 7 years, 6 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/types.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 c5bdc9bec9dc3f11bf86e878e17fa2589115af90..ec52b188a2331e84d13b78a6af77b270330d48c9 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -341,13 +341,11 @@ bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) {
}
-void TypeFeedbackOracle::CompareTypes(TypeFeedbackId id,
- Handle<Type>* left_type,
- Handle<Type>* right_type,
- Handle<Type>* overall_type,
- Handle<Type>* compare_nil_type) {
- *left_type = *right_type = *overall_type = *compare_nil_type =
- handle(Type::Any(), isolate_);
+void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
+ Handle<Type>* left_type,
+ Handle<Type>* right_type,
+ Handle<Type>* combined_type) {
+ *left_type = *right_type = *combined_type = handle(Type::Any(), isolate_);
Handle<Object> info = GetInfo(id);
if (!info->IsCode()) return;
Handle<Code> code = Handle<Code>::cast(info);
@@ -364,10 +362,14 @@ void TypeFeedbackOracle::CompareTypes(TypeFeedbackId id,
if (code->is_compare_ic_stub()) {
int stub_minor_key = code->stub_info();
CompareIC::StubInfoToType(
- stub_minor_key, left_type, right_type, overall_type, map, isolate());
+ stub_minor_key, left_type, right_type, combined_type, map, isolate());
} else if (code->is_compare_nil_ic_stub()) {
CompareNilICStub::State state(code->compare_nil_state());
- *compare_nil_type = CompareNilICStub::StateToType(isolate_, state, map);
+ *combined_type = CompareNilICStub::StateToType(isolate_, state, map);
+ Handle<Type> nil_type = handle(code->compare_nil_value() == kNullValue
+ ? Type::Null() : Type::Undefined(), isolate_);
+ *left_type = *right_type =
+ handle(Type::Union(*combined_type, nil_type), isolate_);
}
}
@@ -386,8 +388,7 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
Handle<Type>* left,
Handle<Type>* right,
Handle<Type>* result,
- bool* has_fixed_right_arg,
- int* fixed_right_arg_value) {
+ Maybe<int>* fixed_right_arg) {
Handle<Object> object = GetInfo(id);
*left = *right = *result = handle(Type::Any(), isolate_);
if (!object->IsCode()) return;
@@ -396,10 +397,8 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
int minor_key = code->stub_info();
BinaryOpIC::StubInfoToType(minor_key, left, right, result, isolate());
- *has_fixed_right_arg =
- BinaryOpStub::decode_has_fixed_right_arg_from_minor_key(minor_key);
- *fixed_right_arg_value =
- BinaryOpStub::decode_fixed_right_arg_value_from_minor_key(minor_key);
+ *fixed_right_arg =
+ BinaryOpStub::decode_fixed_right_arg_from_minor_key(minor_key);
}
« no previous file with comments | « src/type-info.h ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698