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/x64/lithium-codegen-x64.cc

Issue 7000021: Support symbol comparison in crankshaft. (Closed)
Patch Set: Review fixes Created 9 years, 7 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
« no previous file with comments | « src/type-info.cc ('k') | src/x64/lithium-x64.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 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 Register left = ToRegister(instr->InputAt(0)); 1545 Register left = ToRegister(instr->InputAt(0));
1546 Register right = ToRegister(instr->InputAt(1)); 1546 Register right = ToRegister(instr->InputAt(1));
1547 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1547 int false_block = chunk_->LookupDestination(instr->false_block_id());
1548 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1548 int true_block = chunk_->LookupDestination(instr->true_block_id());
1549 1549
1550 __ cmpq(left, right); 1550 __ cmpq(left, right);
1551 EmitBranch(true_block, false_block, equal); 1551 EmitBranch(true_block, false_block, equal);
1552 } 1552 }
1553 1553
1554 1554
1555 void LCodeGen::DoCmpSymbolEq(LCmpSymbolEq* instr) {
1556 Register left = ToRegister(instr->InputAt(0));
1557 Register right = ToRegister(instr->InputAt(1));
1558 Register result = ToRegister(instr->result());
1559
1560 Label done;
1561 __ cmpq(left, right);
1562 __ LoadRoot(result, Heap::kFalseValueRootIndex);
1563 __ j(not_equal, &done, Label::kNear);
1564 __ LoadRoot(result, Heap::kTrueValueRootIndex);
1565 __ bind(&done);
1566 }
1567
1568
1569 void LCodeGen::DoCmpSymbolEqAndBranch(LCmpSymbolEqAndBranch* instr) {
1570 Register left = ToRegister(instr->InputAt(0));
1571 Register right = ToRegister(instr->InputAt(1));
1572 int false_block = chunk_->LookupDestination(instr->false_block_id());
1573 int true_block = chunk_->LookupDestination(instr->true_block_id());
1574
1575 __ cmpq(left, right);
1576 EmitBranch(true_block, false_block, equal);
1577 }
1578
1579
1555 void LCodeGen::DoIsNull(LIsNull* instr) { 1580 void LCodeGen::DoIsNull(LIsNull* instr) {
1556 Register reg = ToRegister(instr->InputAt(0)); 1581 Register reg = ToRegister(instr->InputAt(0));
1557 Register result = ToRegister(instr->result()); 1582 Register result = ToRegister(instr->result());
1558 1583
1559 // If the expression is known to be a smi, then it's 1584 // If the expression is known to be a smi, then it's
1560 // definitely not null. Materialize false. 1585 // definitely not null. Materialize false.
1561 // Consider adding other type and representation tests too. 1586 // Consider adding other type and representation tests too.
1562 if (instr->hydrogen()->value()->type().IsSmi()) { 1587 if (instr->hydrogen()->value()->type().IsSmi()) {
1563 __ LoadRoot(result, Heap::kFalseValueRootIndex); 1588 __ LoadRoot(result, Heap::kFalseValueRootIndex);
1564 return; 1589 return;
(...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 RegisterEnvironmentForDeoptimization(environment); 4161 RegisterEnvironmentForDeoptimization(environment);
4137 ASSERT(osr_pc_offset_ == -1); 4162 ASSERT(osr_pc_offset_ == -1);
4138 osr_pc_offset_ = masm()->pc_offset(); 4163 osr_pc_offset_ = masm()->pc_offset();
4139 } 4164 }
4140 4165
4141 #undef __ 4166 #undef __
4142 4167
4143 } } // namespace v8::internal 4168 } } // namespace v8::internal
4144 4169
4145 #endif // V8_TARGET_ARCH_X64 4170 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/type-info.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698