OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 } | 2048 } |
2049 } | 2049 } |
2050 } | 2050 } |
2051 EmitBranch(true_block, false_block, cc); | 2051 EmitBranch(true_block, false_block, cc); |
2052 } | 2052 } |
2053 } | 2053 } |
2054 | 2054 |
2055 | 2055 |
2056 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { | 2056 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
2057 Register left = ToRegister(instr->left()); | 2057 Register left = ToRegister(instr->left()); |
2058 Register right = ToRegister(instr->right()); | |
2059 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 2058 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
2060 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 2059 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
2061 | 2060 |
2062 __ cmpq(left, right); | 2061 if (instr->right()->IsConstantOperand()) { |
| 2062 __ Cmp(left, ToHandle(LConstantOperand::cast(instr->right()))); |
| 2063 } else { |
| 2064 __ cmpq(left, ToRegister(instr->right())); |
| 2065 } |
2063 EmitBranch(true_block, false_block, equal); | 2066 EmitBranch(true_block, false_block, equal); |
2064 } | 2067 } |
2065 | 2068 |
2066 | 2069 |
2067 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { | 2070 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { |
2068 Register left = ToRegister(instr->left()); | 2071 Register left = ToRegister(instr->left()); |
2069 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 2072 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
2070 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 2073 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
2071 | 2074 |
2072 __ cmpq(left, Immediate(instr->hydrogen()->right())); | 2075 __ cmpq(left, Immediate(instr->hydrogen()->right())); |
(...skipping 3587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5660 FixedArray::kHeaderSize - kPointerSize)); | 5663 FixedArray::kHeaderSize - kPointerSize)); |
5661 __ bind(&done); | 5664 __ bind(&done); |
5662 } | 5665 } |
5663 | 5666 |
5664 | 5667 |
5665 #undef __ | 5668 #undef __ |
5666 | 5669 |
5667 } } // namespace v8::internal | 5670 } } // namespace v8::internal |
5668 | 5671 |
5669 #endif // V8_TARGET_ARCH_X64 | 5672 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |