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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 return no_condition; | 2445 return no_condition; |
2446 } | 2446 } |
2447 } | 2447 } |
2448 | 2448 |
2449 | 2449 |
2450 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2450 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2451 DCHECK(ToRegister(instr->context()).is(esi)); | 2451 DCHECK(ToRegister(instr->context()).is(esi)); |
2452 DCHECK(ToRegister(instr->left()).is(edx)); | 2452 DCHECK(ToRegister(instr->left()).is(edx)); |
2453 DCHECK(ToRegister(instr->right()).is(eax)); | 2453 DCHECK(ToRegister(instr->right()).is(eax)); |
2454 | 2454 |
2455 if (Token::IsOrderedRelationalCompareOp(instr->op())) { | 2455 Handle<Code> code = CodeFactory::StringCompare(isolate(), instr->op()).code(); |
2456 Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); | 2456 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2457 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2457 __ CompareRoot(eax, Heap::kTrueValueRootIndex); |
2458 __ test(eax, eax); | 2458 EmitBranch(instr, equal); |
2459 } else { | |
2460 Handle<Code> code = CodeFactory::StringEqual(isolate()).code(); | |
2461 CallCode(code, RelocInfo::CODE_TARGET, instr); | |
2462 __ CompareRoot(eax, Heap::kTrueValueRootIndex); | |
2463 } | |
2464 | |
2465 EmitBranch(instr, ComputeCompareCondition(instr->op())); | |
2466 } | 2459 } |
2467 | 2460 |
2468 | 2461 |
2469 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2462 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
2470 InstanceType from = instr->from(); | 2463 InstanceType from = instr->from(); |
2471 InstanceType to = instr->to(); | 2464 InstanceType to = instr->to(); |
2472 if (from == FIRST_TYPE) return to; | 2465 if (from == FIRST_TYPE) return to; |
2473 DCHECK(from == to || to == LAST_TYPE); | 2466 DCHECK(from == to || to == LAST_TYPE); |
2474 return from; | 2467 return from; |
2475 } | 2468 } |
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5766 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5759 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
5767 } | 5760 } |
5768 | 5761 |
5769 | 5762 |
5770 #undef __ | 5763 #undef __ |
5771 | 5764 |
5772 } // namespace internal | 5765 } // namespace internal |
5773 } // namespace v8 | 5766 } // namespace v8 |
5774 | 5767 |
5775 #endif // V8_TARGET_ARCH_X87 | 5768 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |