OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 Immediate(1 << Map::kIsUndetectable)); | 2311 Immediate(1 << Map::kIsUndetectable)); |
2312 EmitBranch(instr, not_zero); | 2312 EmitBranch(instr, not_zero); |
2313 } | 2313 } |
2314 | 2314 |
2315 | 2315 |
2316 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2316 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2317 DCHECK(ToRegister(instr->context()).is(rsi)); | 2317 DCHECK(ToRegister(instr->context()).is(rsi)); |
2318 DCHECK(ToRegister(instr->left()).is(rdx)); | 2318 DCHECK(ToRegister(instr->left()).is(rdx)); |
2319 DCHECK(ToRegister(instr->right()).is(rax)); | 2319 DCHECK(ToRegister(instr->right()).is(rax)); |
2320 | 2320 |
2321 if (Token::IsOrderedRelationalCompareOp(instr->op())) { | 2321 Handle<Code> code = CodeFactory::StringCompare(isolate(), instr->op()).code(); |
2322 Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); | 2322 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2323 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2323 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
2324 __ testp(rax, rax); | 2324 EmitBranch(instr, equal); |
2325 } else { | |
2326 Handle<Code> code = CodeFactory::StringEqual(isolate()).code(); | |
2327 CallCode(code, RelocInfo::CODE_TARGET, instr); | |
2328 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | |
2329 } | |
2330 | |
2331 EmitBranch(instr, TokenToCondition(instr->op(), false)); | |
2332 } | 2325 } |
2333 | 2326 |
2334 | 2327 |
2335 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2328 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
2336 InstanceType from = instr->from(); | 2329 InstanceType from = instr->from(); |
2337 InstanceType to = instr->to(); | 2330 InstanceType to = instr->to(); |
2338 if (from == FIRST_TYPE) return to; | 2331 if (from == FIRST_TYPE) return to; |
2339 DCHECK(from == to || to == LAST_TYPE); | 2332 DCHECK(from == to || to == LAST_TYPE); |
2340 return from; | 2333 return from; |
2341 } | 2334 } |
(...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5521 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context); | 5514 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context); |
5522 } | 5515 } |
5523 | 5516 |
5524 | 5517 |
5525 #undef __ | 5518 #undef __ |
5526 | 5519 |
5527 } // namespace internal | 5520 } // namespace internal |
5528 } // namespace v8 | 5521 } // namespace v8 |
5529 | 5522 |
5530 #endif // V8_TARGET_ARCH_X64 | 5523 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |