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

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

Issue 7206040: Remove redundant hydrogen- and lithium instruction for symbol comparison. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 __ j(parity_even, chunk_->GetAssemblyLabel(false_block)); 1541 __ j(parity_even, chunk_->GetAssemblyLabel(false_block));
1542 } else { 1542 } else {
1543 EmitCmpI(left, right); 1543 EmitCmpI(left, right);
1544 } 1544 }
1545 1545
1546 Condition cc = TokenToCondition(instr->op(), instr->is_double()); 1546 Condition cc = TokenToCondition(instr->op(), instr->is_double());
1547 EmitBranch(true_block, false_block, cc); 1547 EmitBranch(true_block, false_block, cc);
1548 } 1548 }
1549 1549
1550 1550
1551 void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) { 1551 void LCodeGen::DoCmpObjectEq(LCmpObjectEq* instr) {
1552 Register left = ToRegister(instr->InputAt(0)); 1552 Register left = ToRegister(instr->InputAt(0));
1553 Register right = ToRegister(instr->InputAt(1)); 1553 Register right = ToRegister(instr->InputAt(1));
1554 Register result = ToRegister(instr->result()); 1554 Register result = ToRegister(instr->result());
1555 1555
1556 __ cmp(left, Operand(right)); 1556 __ cmp(left, Operand(right));
1557 __ mov(result, factory()->true_value()); 1557 __ mov(result, factory()->true_value());
1558 Label done; 1558 Label done;
1559 __ j(equal, &done, Label::kNear); 1559 __ j(equal, &done, Label::kNear);
1560 __ mov(result, factory()->false_value()); 1560 __ mov(result, factory()->false_value());
1561 __ bind(&done); 1561 __ bind(&done);
1562 } 1562 }
1563 1563
1564 1564
1565 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { 1565 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
1566 Register left = ToRegister(instr->InputAt(0)); 1566 Register left = ToRegister(instr->InputAt(0));
1567 Register right = ToRegister(instr->InputAt(1)); 1567 Register right = ToRegister(instr->InputAt(1));
1568 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1568 int false_block = chunk_->LookupDestination(instr->false_block_id());
1569 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1569 int true_block = chunk_->LookupDestination(instr->true_block_id());
1570 1570
1571 __ cmp(left, Operand(right)); 1571 __ cmp(left, Operand(right));
1572 EmitBranch(true_block, false_block, equal); 1572 EmitBranch(true_block, false_block, equal);
1573 } 1573 }
1574 1574
1575 1575
1576 void LCodeGen::DoCmpSymbolEq(LCmpSymbolEq* instr) {
1577 Register left = ToRegister(instr->InputAt(0));
1578 Register right = ToRegister(instr->InputAt(1));
1579 Register result = ToRegister(instr->result());
1580
1581 Label done;
1582 __ cmp(left, Operand(right));
1583 __ mov(result, factory()->false_value());
1584 __ j(not_equal, &done, Label::kNear);
1585 __ mov(result, factory()->true_value());
1586 __ bind(&done);
1587 }
1588
1589
1590 void LCodeGen::DoCmpSymbolEqAndBranch(LCmpSymbolEqAndBranch* instr) {
1591 Register left = ToRegister(instr->InputAt(0));
1592 Register right = ToRegister(instr->InputAt(1));
1593 int false_block = chunk_->LookupDestination(instr->false_block_id());
1594 int true_block = chunk_->LookupDestination(instr->true_block_id());
1595
1596 __ cmp(left, Operand(right));
1597 EmitBranch(true_block, false_block, equal);
1598 }
1599
1600
1601 void LCodeGen::DoCmpConstantEq(LCmpConstantEq* instr) { 1576 void LCodeGen::DoCmpConstantEq(LCmpConstantEq* instr) {
1602 Register left = ToRegister(instr->InputAt(0)); 1577 Register left = ToRegister(instr->InputAt(0));
1603 Register result = ToRegister(instr->result()); 1578 Register result = ToRegister(instr->result());
1604 1579
1605 Label done; 1580 Label done;
1606 __ cmp(left, instr->hydrogen()->right()); 1581 __ cmp(left, instr->hydrogen()->right());
1607 __ mov(result, factory()->true_value()); 1582 __ mov(result, factory()->true_value());
1608 __ j(equal, &done, Label::kNear); 1583 __ j(equal, &done, Label::kNear);
1609 __ mov(result, factory()->false_value()); 1584 __ mov(result, factory()->false_value());
1610 __ bind(&done); 1585 __ bind(&done);
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after
4493 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 4468 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4494 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4469 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4495 } 4470 }
4496 4471
4497 4472
4498 #undef __ 4473 #undef __
4499 4474
4500 } } // namespace v8::internal 4475 } } // namespace v8::internal
4501 4476
4502 #endif // V8_TARGET_ARCH_IA32 4477 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698