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 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 return no_condition; | 2161 return no_condition; |
2162 } | 2162 } |
2163 } | 2163 } |
2164 | 2164 |
2165 | 2165 |
2166 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2166 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2167 DCHECK(ToRegister(instr->context()).is(esi)); | 2167 DCHECK(ToRegister(instr->context()).is(esi)); |
2168 DCHECK(ToRegister(instr->left()).is(edx)); | 2168 DCHECK(ToRegister(instr->left()).is(edx)); |
2169 DCHECK(ToRegister(instr->right()).is(eax)); | 2169 DCHECK(ToRegister(instr->right()).is(eax)); |
2170 | 2170 |
2171 if (Token::IsOrderedRelationalCompareOp(instr->op())) { | 2171 Handle<Code> code = CodeFactory::StringCompare(isolate(), instr->op()).code(); |
2172 Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); | 2172 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2173 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2173 __ CompareRoot(eax, Heap::kTrueValueRootIndex); |
2174 __ test(eax, eax); | 2174 EmitBranch(instr, equal); |
2175 } else { | |
2176 Handle<Code> code = CodeFactory::StringEqual(isolate()).code(); | |
2177 CallCode(code, RelocInfo::CODE_TARGET, instr); | |
2178 __ CompareRoot(eax, Heap::kTrueValueRootIndex); | |
2179 } | |
2180 | |
2181 EmitBranch(instr, ComputeCompareCondition(instr->op())); | |
2182 } | 2175 } |
2183 | 2176 |
2184 | 2177 |
2185 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2178 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
2186 InstanceType from = instr->from(); | 2179 InstanceType from = instr->from(); |
2187 InstanceType to = instr->to(); | 2180 InstanceType to = instr->to(); |
2188 if (from == FIRST_TYPE) return to; | 2181 if (from == FIRST_TYPE) return to; |
2189 DCHECK(from == to || to == LAST_TYPE); | 2182 DCHECK(from == to || to == LAST_TYPE); |
2190 return from; | 2183 return from; |
2191 } | 2184 } |
(...skipping 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5203 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5196 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
5204 } | 5197 } |
5205 | 5198 |
5206 | 5199 |
5207 #undef __ | 5200 #undef __ |
5208 | 5201 |
5209 } // namespace internal | 5202 } // namespace internal |
5210 } // namespace v8 | 5203 } // namespace v8 |
5211 | 5204 |
5212 #endif // V8_TARGET_ARCH_IA32 | 5205 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |