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

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

Issue 7918012: Unify the handling of comparinsons against null and undefined. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« src/v8.h ('K') | « 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 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 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 InputAt(0)->PrintTo(stream); 210 InputAt(0)->PrintTo(stream);
211 stream->Add(" %s ", Token::String(op())); 211 stream->Add(" %s ", Token::String(op()));
212 InputAt(1)->PrintTo(stream); 212 InputAt(1)->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 LIsNullAndBranch::PrintDataTo(StringStream* stream) { 217 void LIsNilAndBranch::PrintDataTo(StringStream* stream) {
218 stream->Add("if "); 218 stream->Add("if ");
219 InputAt(0)->PrintTo(stream); 219 InputAt(0)->PrintTo(stream);
220 stream->Add(is_strict() ? " === null" : " == null"); 220 stream->Add(kind() == kStrictEquality ? " === " : " == ");
221 stream->Add(nil() == kNullValue ? "null" : "undefined");
221 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); 222 stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
222 } 223 }
223 224
224 225
225 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { 226 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
226 stream->Add("if is_object("); 227 stream->Add("if is_object(");
227 InputAt(0)->PrintTo(stream); 228 InputAt(0)->PrintTo(stream);
228 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());
229 } 230 }
230 231
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 return new LCmpObjectEqAndBranch(left, right); 1430 return new LCmpObjectEqAndBranch(left, right);
1430 } 1431 }
1431 1432
1432 1433
1433 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( 1434 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
1434 HCompareConstantEqAndBranch* instr) { 1435 HCompareConstantEqAndBranch* instr) {
1435 return new LCmpConstantEqAndBranch(UseRegisterAtStart(instr->value())); 1436 return new LCmpConstantEqAndBranch(UseRegisterAtStart(instr->value()));
1436 } 1437 }
1437 1438
1438 1439
1439 LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) { 1440 LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) {
1440 ASSERT(instr->value()->representation().IsTagged()); 1441 ASSERT(instr->value()->representation().IsTagged());
1441 LOperand* temp = instr->is_strict() ? NULL : TempRegister(); 1442 LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister();
1442 return new LIsNullAndBranch(UseRegisterAtStart(instr->value()), temp); 1443 return new LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp);
1443 } 1444 }
1444 1445
1445 1446
1446 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { 1447 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1447 ASSERT(instr->value()->representation().IsTagged()); 1448 ASSERT(instr->value()->representation().IsTagged());
1448 return new LIsObjectAndBranch(UseRegisterAtStart(instr->value())); 1449 return new LIsObjectAndBranch(UseRegisterAtStart(instr->value()));
1449 } 1450 }
1450 1451
1451 1452
1452 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) { 1453 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 LOperand* key = UseOrConstantAtStart(instr->key()); 2170 LOperand* key = UseOrConstantAtStart(instr->key());
2170 LOperand* object = UseOrConstantAtStart(instr->object()); 2171 LOperand* object = UseOrConstantAtStart(instr->object());
2171 LIn* result = new LIn(key, object); 2172 LIn* result = new LIn(key, object);
2172 return MarkAsCall(DefineFixed(result, rax), instr); 2173 return MarkAsCall(DefineFixed(result, rax), instr);
2173 } 2174 }
2174 2175
2175 2176
2176 } } // namespace v8::internal 2177 } } // namespace v8::internal
2177 2178
2178 #endif // V8_TARGET_ARCH_X64 2179 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/v8.h ('K') | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698