OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 bool is_unsigned = | 2160 bool is_unsigned = |
2161 instr->is_double() || | 2161 instr->is_double() || |
2162 instr->hydrogen()->left()->CheckFlag(HInstruction::kUint32) || | 2162 instr->hydrogen()->left()->CheckFlag(HInstruction::kUint32) || |
2163 instr->hydrogen()->right()->CheckFlag(HInstruction::kUint32); | 2163 instr->hydrogen()->right()->CheckFlag(HInstruction::kUint32); |
2164 Condition cc = TokenToCondition(instr->op(), is_unsigned); | 2164 Condition cc = TokenToCondition(instr->op(), is_unsigned); |
2165 | 2165 |
2166 if (left->IsConstantOperand() && right->IsConstantOperand()) { | 2166 if (left->IsConstantOperand() && right->IsConstantOperand()) { |
2167 // We can statically evaluate the comparison. | 2167 // We can statically evaluate the comparison. |
2168 double left_val = ToDouble(LConstantOperand::cast(left)); | 2168 double left_val = ToDouble(LConstantOperand::cast(left)); |
2169 double right_val = ToDouble(LConstantOperand::cast(right)); | 2169 double right_val = ToDouble(LConstantOperand::cast(right)); |
2170 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2170 int next_block = Token::EvalComparison(instr->op(), left_val, right_val) |
2171 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2171 ? instr->TrueDestination(chunk_) |
| 2172 : instr->FalseDestination(chunk_); |
2172 EmitGoto(next_block); | 2173 EmitGoto(next_block); |
2173 } else { | 2174 } else { |
2174 if (instr->is_double()) { | 2175 if (instr->is_double()) { |
2175 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); | 2176 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); |
2176 // Don't base result on EFLAGS when a NaN is involved. Instead | 2177 // Don't base result on EFLAGS when a NaN is involved. Instead |
2177 // jump to the false block. | 2178 // jump to the false block. |
2178 __ j(parity_even, instr->FalseLabel(chunk_)); | 2179 __ j(parity_even, instr->FalseLabel(chunk_)); |
2179 } else { | 2180 } else { |
2180 if (right->IsConstantOperand()) { | 2181 if (right->IsConstantOperand()) { |
2181 __ cmp(ToOperand(left), | 2182 __ cmp(ToOperand(left), |
(...skipping 3286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5468 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5469 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5469 } | 5470 } |
5470 | 5471 |
5471 | 5472 |
5472 #undef __ | 5473 #undef __ |
5473 | 5474 |
5474 } // namespace internal | 5475 } // namespace internal |
5475 } // namespace v8 | 5476 } // namespace v8 |
5476 | 5477 |
5477 #endif // V8_TARGET_ARCH_IA32 | 5478 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |