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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8274 matching lines...) Expand 10 before | Expand all | Expand 10 after
8285 } else if (combined_type->Is(Type::InternalizedString()) && 8285 } else if (combined_type->Is(Type::InternalizedString()) &&
8286 Token::IsEqualityOp(op)) { 8286 Token::IsEqualityOp(op)) {
8287 BuildCheckHeapObject(left); 8287 BuildCheckHeapObject(left);
8288 AddInstruction(HCheckInstanceType::NewIsInternalizedString(left, zone())); 8288 AddInstruction(HCheckInstanceType::NewIsInternalizedString(left, zone()));
8289 BuildCheckHeapObject(right); 8289 BuildCheckHeapObject(right);
8290 AddInstruction(HCheckInstanceType::NewIsInternalizedString(right, zone())); 8290 AddInstruction(HCheckInstanceType::NewIsInternalizedString(right, zone()));
8291 HCompareObjectEqAndBranch* result = 8291 HCompareObjectEqAndBranch* result =
8292 New<HCompareObjectEqAndBranch>(left, right); 8292 New<HCompareObjectEqAndBranch>(left, right);
8293 result->set_position(expr->position()); 8293 result->set_position(expr->position());
8294 return ast_context()->ReturnControl(result, expr->id()); 8294 return ast_context()->ReturnControl(result, expr->id());
8295 } else if (combined_type->Is(Type::String())) {
8296 BuildCheckHeapObject(left);
8297 AddInstruction(HCheckInstanceType::NewIsString(left, zone()));
8298 BuildCheckHeapObject(right);
8299 AddInstruction(HCheckInstanceType::NewIsString(right, zone()));
8300 HStringCompareAndBranch* result =
8301 New<HStringCompareAndBranch>(left, right, op);
8302 result->set_position(expr->position());
8303 return ast_context()->ReturnControl(result, expr->id());
8304 } else if (combined_type->NumClasses() == 1 &&
Hannes Payer (out of office) 2013/10/02 13:33:19 fits in one line
8305 Token::IsEqualityOp(op)) {
8306 BuildCheckHeapObject(left);
8307 BuildCheckMap(left, combined_type->Classes().Current());
8308 BuildCheckHeapObject(right);
8309 BuildCheckMap(right, combined_type->Classes().Current());
8310 HCompareObjectEqAndBranch* result =
8311 New<HCompareObjectEqAndBranch>(left, right);
8312 result->set_position(expr->position());
8313 return ast_context()->ReturnInstruction(result, expr->id());
8314 } else if (combined_type->Is(Type::Receiver()) &&
Hannes Payer (out of office) 2013/10/02 13:33:19 fits in one line
8315 Token::IsEqualityOp(op)) {
8316 BuildCheckHeapObject(left);
8317 AddInstruction(HCheckInstanceType::NewIsSpecObject(left, zone()));
8318 BuildCheckHeapObject(right);
8319 AddInstruction(HCheckInstanceType::NewIsSpecObject(right, zone()));
8320 HCompareObjectEqAndBranch* result =
8321 New<HCompareObjectEqAndBranch>(left, right);
8322 result->set_position(expr->position());
8323 return ast_context()->ReturnInstruction(result, expr->id());
8295 } else { 8324 } else {
8296 if (combined_rep.IsTagged() || combined_rep.IsNone()) { 8325 if (combined_rep.IsTagged() || combined_rep.IsNone()) {
8297 HCompareGeneric* result = 8326 HCompareGeneric* result =
8298 new(zone()) HCompareGeneric(context, left, right, op); 8327 new(zone()) HCompareGeneric(context, left, right, op);
8299 result->set_observed_input_representation(1, left_rep); 8328 result->set_observed_input_representation(1, left_rep);
8300 result->set_observed_input_representation(2, right_rep); 8329 result->set_observed_input_representation(2, right_rep);
8301 result->set_position(expr->position()); 8330 result->set_position(expr->position());
8302 return ast_context()->ReturnInstruction(result, expr->id()); 8331 return ast_context()->ReturnInstruction(result, expr->id());
8303 } else { 8332 } else {
8304 HCompareNumericAndBranch* result = 8333 HCompareNumericAndBranch* result =
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
9847 if (ShouldProduceTraceOutput()) { 9876 if (ShouldProduceTraceOutput()) {
9848 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9877 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9849 } 9878 }
9850 9879
9851 #ifdef DEBUG 9880 #ifdef DEBUG
9852 graph_->Verify(false); // No full verify. 9881 graph_->Verify(false); // No full verify.
9853 #endif 9882 #endif
9854 } 9883 }
9855 9884
9856 } } // namespace v8::internal 9885 } } // namespace v8::internal
OLDNEW
« 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