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

Side by Side Diff: src/hydrogen.cc

Issue 7232010: Version 3.4.6 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 5219 matching lines...) Expand 10 before | Expand all | Expand 10 after
5230 ASSERT(has_side_effects); // Stores always have side effects. 5230 ASSERT(has_side_effects); // Stores always have side effects.
5231 AddSimulate(expr->AssignmentId()); 5231 AddSimulate(expr->AssignmentId());
5232 } 5232 }
5233 } 5233 }
5234 5234
5235 Drop(returns_original_input ? 2 : 1); 5235 Drop(returns_original_input ? 2 : 1);
5236 ast_context()->ReturnValue(expr->is_postfix() ? input : after); 5236 ast_context()->ReturnValue(expr->is_postfix() ? input : after);
5237 } 5237 }
5238 5238
5239 5239
5240 HCompareSymbolEq* HGraphBuilder::BuildSymbolCompare(HValue* left,
5241 HValue* right,
5242 Token::Value op) {
5243 ASSERT(op == Token::EQ || op == Token::EQ_STRICT);
5244 AddInstruction(new(zone()) HCheckNonSmi(left));
5245 AddInstruction(HCheckInstanceType::NewIsSymbol(left));
5246 AddInstruction(new(zone()) HCheckNonSmi(right));
5247 AddInstruction(HCheckInstanceType::NewIsSymbol(right));
5248 return new(zone()) HCompareSymbolEq(left, right, op);
5249 }
5250
5251
5252 HStringCharCodeAt* HGraphBuilder::BuildStringCharCodeAt(HValue* string, 5240 HStringCharCodeAt* HGraphBuilder::BuildStringCharCodeAt(HValue* string,
5253 HValue* index) { 5241 HValue* index) {
5254 AddInstruction(new(zone()) HCheckNonSmi(string)); 5242 AddInstruction(new(zone()) HCheckNonSmi(string));
5255 AddInstruction(HCheckInstanceType::NewIsString(string)); 5243 AddInstruction(HCheckInstanceType::NewIsString(string));
5256 HStringLength* length = new(zone()) HStringLength(string); 5244 HStringLength* length = new(zone()) HStringLength(string);
5257 AddInstruction(length); 5245 AddInstruction(length);
5258 HInstruction* checked_index = 5246 HInstruction* checked_index =
5259 AddInstruction(new(zone()) HBoundsCheck(index, length)); 5247 AddInstruction(new(zone()) HBoundsCheck(index, length));
5260 return new(zone()) HStringCharCodeAt(string, checked_index); 5248 return new(zone()) HStringCharCodeAt(string, checked_index);
5261 } 5249 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
5587 } else if (op == Token::IN) { 5575 } else if (op == Token::IN) {
5588 instr = new(zone()) HIn(left, right); 5576 instr = new(zone()) HIn(left, right);
5589 } else if (type_info.IsNonPrimitive()) { 5577 } else if (type_info.IsNonPrimitive()) {
5590 switch (op) { 5578 switch (op) {
5591 case Token::EQ: 5579 case Token::EQ:
5592 case Token::EQ_STRICT: { 5580 case Token::EQ_STRICT: {
5593 AddInstruction(new(zone()) HCheckNonSmi(left)); 5581 AddInstruction(new(zone()) HCheckNonSmi(left));
5594 AddInstruction(HCheckInstanceType::NewIsSpecObject(left)); 5582 AddInstruction(HCheckInstanceType::NewIsSpecObject(left));
5595 AddInstruction(new(zone()) HCheckNonSmi(right)); 5583 AddInstruction(new(zone()) HCheckNonSmi(right));
5596 AddInstruction(HCheckInstanceType::NewIsSpecObject(right)); 5584 AddInstruction(HCheckInstanceType::NewIsSpecObject(right));
5597 instr = new(zone()) HCompareJSObjectEq(left, right); 5585 instr = new(zone()) HCompareObjectEq(left, right);
5598 break; 5586 break;
5599 } 5587 }
5600 default: 5588 default:
5601 return Bailout("Unsupported non-primitive compare"); 5589 return Bailout("Unsupported non-primitive compare");
5602 break; 5590 break;
5603 } 5591 }
5604 } else if (type_info.IsString() && oracle()->IsSymbolCompare(expr) && 5592 } else if (type_info.IsString() && oracle()->IsSymbolCompare(expr) &&
5605 (op == Token::EQ || op == Token::EQ_STRICT)) { 5593 (op == Token::EQ || op == Token::EQ_STRICT)) {
5606 instr = BuildSymbolCompare(left, right, op); 5594 AddInstruction(new(zone()) HCheckNonSmi(left));
5595 AddInstruction(HCheckInstanceType::NewIsSymbol(left));
5596 AddInstruction(new(zone()) HCheckNonSmi(right));
5597 AddInstruction(HCheckInstanceType::NewIsSymbol(right));
5598 instr = new(zone()) HCompareObjectEq(left, right);
5607 } else { 5599 } else {
5608 HCompare* compare = new(zone()) HCompare(left, right, op); 5600 HCompare* compare = new(zone()) HCompare(left, right, op);
5609 Representation r = ToRepresentation(type_info); 5601 Representation r = ToRepresentation(type_info);
5610 compare->SetInputRepresentation(r); 5602 compare->SetInputRepresentation(r);
5611 instr = compare; 5603 instr = compare;
5612 } 5604 }
5613 instr->set_position(expr->position()); 5605 instr->set_position(expr->position());
5614 ast_context()->ReturnInstruction(instr, expr->id()); 5606 ast_context()->ReturnInstruction(instr, expr->id());
5615 } 5607 }
5616 5608
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
5842 } 5834 }
5843 5835
5844 5836
5845 // Fast support for object equality testing. 5837 // Fast support for object equality testing.
5846 void HGraphBuilder::GenerateObjectEquals(CallRuntime* call) { 5838 void HGraphBuilder::GenerateObjectEquals(CallRuntime* call) {
5847 ASSERT(call->arguments()->length() == 2); 5839 ASSERT(call->arguments()->length() == 2);
5848 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 5840 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
5849 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); 5841 CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
5850 HValue* right = Pop(); 5842 HValue* right = Pop();
5851 HValue* left = Pop(); 5843 HValue* left = Pop();
5852 HCompareJSObjectEq* result = new(zone()) HCompareJSObjectEq(left, right); 5844 HCompareObjectEq* result = new(zone()) HCompareObjectEq(left, right);
5853 ast_context()->ReturnInstruction(result, call->id()); 5845 ast_context()->ReturnInstruction(result, call->id());
5854 } 5846 }
5855 5847
5856 5848
5857 void HGraphBuilder::GenerateLog(CallRuntime* call) { 5849 void HGraphBuilder::GenerateLog(CallRuntime* call) {
5858 // %_Log is ignored in optimized code. 5850 // %_Log is ignored in optimized code.
5859 ast_context()->ReturnValue(graph()->GetConstantUndefined()); 5851 ast_context()->ReturnValue(graph()->GetConstantUndefined());
5860 } 5852 }
5861 5853
5862 5854
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
6574 } 6566 }
6575 } 6567 }
6576 6568
6577 #ifdef DEBUG 6569 #ifdef DEBUG
6578 if (graph_ != NULL) graph_->Verify(); 6570 if (graph_ != NULL) graph_->Verify();
6579 if (allocator_ != NULL) allocator_->Verify(); 6571 if (allocator_ != NULL) allocator_->Verify();
6580 #endif 6572 #endif
6581 } 6573 }
6582 6574
6583 } } // namespace v8::internal 6575 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698