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

Unified Diff: src/crankshaft/typing.cc

Issue 2361043002: [Ignition] Use binary operation feedback from Ignition to Crankshaft. (Closed)
Patch Set: Created 4 years, 3 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
Index: src/crankshaft/typing.cc
diff --git a/src/crankshaft/typing.cc b/src/crankshaft/typing.cc
index bf2c8037ea5ed2e7521caf051da3540122989a62..70d77084d5b6a4364ec49b5f90934d0f4c4f6c36 100644
--- a/src/crankshaft/typing.cc
+++ b/src/crankshaft/typing.cc
@@ -17,7 +17,8 @@ namespace internal {
AstTyper::AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
DeclarationScope* scope, BailoutId osr_ast_id,
- FunctionLiteral* root, AstTypeBounds* bounds)
+ FunctionLiteral* root, AstTypeBounds* bounds,
+ bool ignition_feedback)
: isolate_(isolate),
zone_(zone),
closure_(closure),
@@ -28,7 +29,8 @@ AstTyper::AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
handle(closure->feedback_vector()),
handle(closure->context()->native_context())),
store_(zone),
- bounds_(bounds) {
+ bounds_(bounds),
+ ignition_feedback_(ignition_feedback) {
InitializeAstVisitor(isolate);
}
@@ -211,7 +213,8 @@ void AstTyper::VisitSwitchStatement(SwitchStatement* stmt) {
AstType* label_type;
AstType* combined_type;
oracle()->CompareType(clause->CompareId(),
- &tag_type, &label_type, &combined_type);
+ clause->CompareOperationFeedbackSlot(), &tag_type,
+ &label_type, &combined_type, ignition_feedback_);
NarrowLowerType(stmt->tag(), tag_type);
NarrowLowerType(label, label_type);
clause->set_compare_type(combined_type);
@@ -614,7 +617,9 @@ void AstTyper::VisitCountOperation(CountOperation* expr) {
oracle()->CountReceiverTypes(slot, expr->GetReceiverTypes());
expr->set_store_mode(store_mode);
expr->set_key_type(key_type);
- expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId()));
+ expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId(),
+ expr->CountBinaryOpFeedbackSlot(),
+ ignition_feedback_));
// TODO(rossberg): merge the count type with the generic expression type.
RECURSE(Visit(expr->expression()));
@@ -627,7 +632,6 @@ void AstTyper::VisitCountOperation(CountOperation* expr) {
}
}
-
void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
// Collect type feedback.
AstType* type;
@@ -636,8 +640,10 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
Maybe<int> fixed_right_arg = Nothing<int>();
Handle<AllocationSite> allocation_site;
oracle()->BinaryType(expr->BinaryOperationFeedbackId(),
- &left_type, &right_type, &type, &fixed_right_arg,
- &allocation_site, expr->op());
+ expr->BinaryOperationFeedbackSlot(), &left_type,
+ &right_type, &type, &fixed_right_arg, &allocation_site,
+ expr->op(), ignition_feedback_);
+
NarrowLowerType(expr, type);
NarrowLowerType(expr->left(), left_type);
NarrowLowerType(expr->right(), right_type);
@@ -739,7 +745,8 @@ void AstTyper::VisitCompareOperation(CompareOperation* expr) {
AstType* right_type;
AstType* combined_type;
oracle()->CompareType(expr->CompareOperationFeedbackId(),
- &left_type, &right_type, &combined_type);
+ expr->CompareOperationFeedbackSlot(), &left_type,
+ &right_type, &combined_type, ignition_feedback_);
NarrowLowerType(expr->left(), left_type);
NarrowLowerType(expr->right(), right_type);
expr->set_combined_type(combined_type);

Powered by Google App Engine
This is Rietveld 408576698