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

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 13728002: Add an IC for CompareNil operations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix SunSpider regression Created 7 years, 8 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/ia32/lithium-ia32.h ('k') | src/ic.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { 224 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) {
225 stream->Add("if "); 225 stream->Add("if ");
226 left()->PrintTo(stream); 226 left()->PrintTo(stream);
227 stream->Add(" %s ", Token::String(op())); 227 stream->Add(" %s ", Token::String(op()));
228 right()->PrintTo(stream); 228 right()->PrintTo(stream);
229 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); 229 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
230 } 230 }
231 231
232 232
233 void LIsNilAndBranch::PrintDataTo(StringStream* stream) {
234 stream->Add("if ");
235 value()->PrintTo(stream);
236 stream->Add(kind() == kStrictEquality ? " === " : " == ");
237 stream->Add(nil() == kNullValue ? "null" : "undefined");
238 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
239 }
240
241
242 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { 233 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
243 stream->Add("if is_object("); 234 stream->Add("if is_object(");
244 value()->PrintTo(stream); 235 value()->PrintTo(stream);
245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); 236 stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
246 } 237 }
247 238
248 239
249 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { 240 void LIsStringAndBranch::PrintDataTo(StringStream* stream) {
250 stream->Add("if is_string("); 241 stream->Add("if is_string(");
251 value()->PrintTo(stream); 242 value()->PrintTo(stream);
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 } 1695 }
1705 1696
1706 1697
1707 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( 1698 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
1708 HCompareConstantEqAndBranch* instr) { 1699 HCompareConstantEqAndBranch* instr) {
1709 return new(zone()) LCmpConstantEqAndBranch( 1700 return new(zone()) LCmpConstantEqAndBranch(
1710 UseRegisterAtStart(instr->value())); 1701 UseRegisterAtStart(instr->value()));
1711 } 1702 }
1712 1703
1713 1704
1714 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) {
1715 // We only need a temp register for non-strict compare.
1716 LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister();
1717 return new(zone()) LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp);
1718 }
1719
1720
1721 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { 1705 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1722 ASSERT(instr->value()->representation().IsTagged()); 1706 ASSERT(instr->value()->representation().IsTagged());
1723 LOperand* temp = TempRegister(); 1707 LOperand* temp = TempRegister();
1724 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp); 1708 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp);
1725 } 1709 }
1726 1710
1727 1711
1728 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { 1712 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
1729 ASSERT(instr->value()->representation().IsTagged()); 1713 ASSERT(instr->value()->representation().IsTagged());
1730 LOperand* temp = TempRegister(); 1714 LOperand* temp = TempRegister();
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2715 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2732 LOperand* object = UseRegister(instr->object()); 2716 LOperand* object = UseRegister(instr->object());
2733 LOperand* index = UseTempRegister(instr->index()); 2717 LOperand* index = UseTempRegister(instr->index());
2734 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2718 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2735 } 2719 }
2736 2720
2737 2721
2738 } } // namespace v8::internal 2722 } } // namespace v8::internal
2739 2723
2740 #endif // V8_TARGET_ARCH_IA32 2724 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698