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

Unified Diff: src/hydrogen.cc

Issue 25009003: Inline some more compare operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add tests Created 7 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
« no previous file with comments | « no previous file | test/mjsunit/compare-known-objects.js » ('j') | test/mjsunit/compare-objects-fast.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 57ea17313b2533e9cda72621789279b39aba428f..a6326f09841cae0e4361190619166438bc16038b 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8292,6 +8292,35 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
New<HCompareObjectEqAndBranch>(left, right);
result->set_position(expr->position());
return ast_context()->ReturnControl(result, expr->id());
+ } else if (combined_type->Is(Type::String())) {
+ BuildCheckHeapObject(left);
+ AddInstruction(HCheckInstanceType::NewIsString(left, zone()));
+ BuildCheckHeapObject(right);
+ AddInstruction(HCheckInstanceType::NewIsString(right, zone()));
+ HStringCompareAndBranch* result =
+ New<HStringCompareAndBranch>(left, right, op);
+ result->set_position(expr->position());
+ return ast_context()->ReturnControl(result, expr->id());
+ } else if (combined_type->NumClasses() == 1 &&
Hannes Payer (out of office) 2013/10/02 13:33:19 fits in one line
+ Token::IsEqualityOp(op)) {
+ BuildCheckHeapObject(left);
+ BuildCheckMap(left, combined_type->Classes().Current());
+ BuildCheckHeapObject(right);
+ BuildCheckMap(right, combined_type->Classes().Current());
+ HCompareObjectEqAndBranch* result =
+ New<HCompareObjectEqAndBranch>(left, right);
+ result->set_position(expr->position());
+ return ast_context()->ReturnInstruction(result, expr->id());
+ } else if (combined_type->Is(Type::Receiver()) &&
Hannes Payer (out of office) 2013/10/02 13:33:19 fits in one line
+ Token::IsEqualityOp(op)) {
+ BuildCheckHeapObject(left);
+ AddInstruction(HCheckInstanceType::NewIsSpecObject(left, zone()));
+ BuildCheckHeapObject(right);
+ AddInstruction(HCheckInstanceType::NewIsSpecObject(right, zone()));
+ HCompareObjectEqAndBranch* result =
+ New<HCompareObjectEqAndBranch>(left, right);
+ result->set_position(expr->position());
+ return ast_context()->ReturnInstruction(result, expr->id());
} else {
if (combined_rep.IsTagged() || combined_rep.IsNone()) {
HCompareGeneric* result =
« no previous file with comments | « no previous file | test/mjsunit/compare-known-objects.js » ('j') | test/mjsunit/compare-objects-fast.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698