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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-x64.h ('k') | no next file » | 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { 208 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) {
209 stream->Add("if "); 209 stream->Add("if ");
210 left()->PrintTo(stream); 210 left()->PrintTo(stream);
211 stream->Add(" %s ", Token::String(op())); 211 stream->Add(" %s ", Token::String(op()));
212 right()->PrintTo(stream); 212 right()->PrintTo(stream);
213 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); 213 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
214 } 214 }
215 215
216 216
217 void LIsNilAndBranch::PrintDataTo(StringStream* stream) {
218 stream->Add("if ");
219 value()->PrintTo(stream);
220 stream->Add(kind() == kStrictEquality ? " === " : " == ");
221 stream->Add(nil() == kNullValue ? "null" : "undefined");
222 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
223 }
224
225
226 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { 217 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
227 stream->Add("if is_object("); 218 stream->Add("if is_object(");
228 value()->PrintTo(stream); 219 value()->PrintTo(stream);
229 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); 220 stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
230 } 221 }
231 222
232 223
233 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { 224 void LIsStringAndBranch::PrintDataTo(StringStream* stream) {
234 stream->Add("if is_string("); 225 stream->Add("if is_string(");
235 value()->PrintTo(stream); 226 value()->PrintTo(stream);
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 } 1612 }
1622 1613
1623 1614
1624 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( 1615 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
1625 HCompareConstantEqAndBranch* instr) { 1616 HCompareConstantEqAndBranch* instr) {
1626 LOperand* value = UseRegisterAtStart(instr->value()); 1617 LOperand* value = UseRegisterAtStart(instr->value());
1627 return new(zone()) LCmpConstantEqAndBranch(value); 1618 return new(zone()) LCmpConstantEqAndBranch(value);
1628 } 1619 }
1629 1620
1630 1621
1631 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) {
1632 ASSERT(instr->value()->representation().IsTagged());
1633 LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister();
1634 return new(zone()) LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp);
1635 }
1636
1637
1638 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { 1622 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1639 ASSERT(instr->value()->representation().IsTagged()); 1623 ASSERT(instr->value()->representation().IsTagged());
1640 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); 1624 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()));
1641 } 1625 }
1642 1626
1643 1627
1644 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { 1628 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
1645 ASSERT(instr->value()->representation().IsTagged()); 1629 ASSERT(instr->value()->representation().IsTagged());
1646 LOperand* value = UseRegisterAtStart(instr->value()); 1630 LOperand* value = UseRegisterAtStart(instr->value());
1647 LOperand* temp = TempRegister(); 1631 LOperand* temp = TempRegister();
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2511 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2528 LOperand* object = UseRegister(instr->object()); 2512 LOperand* object = UseRegister(instr->object());
2529 LOperand* index = UseTempRegister(instr->index()); 2513 LOperand* index = UseTempRegister(instr->index());
2530 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2514 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2531 } 2515 }
2532 2516
2533 2517
2534 } } // namespace v8::internal 2518 } } // namespace v8::internal
2535 2519
2536 #endif // V8_TARGET_ARCH_X64 2520 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698