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

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

Issue 1594443003: [parsing] Move EvalComparison out of the assembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-source-position
Patch Set: Drop one more include. Created 4 years, 11 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698