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

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

Issue 1347913003: [stubs] Refactor StringCompareStub and use it for HStringCompareAndBranch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 case CodeStub::RegExpExec: { 1064 case CodeStub::RegExpExec: {
1065 RegExpExecStub stub(isolate()); 1065 RegExpExecStub stub(isolate());
1066 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1066 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1067 break; 1067 break;
1068 } 1068 }
1069 case CodeStub::SubString: { 1069 case CodeStub::SubString: {
1070 SubStringStub stub(isolate()); 1070 SubStringStub stub(isolate());
1071 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1071 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1072 break; 1072 break;
1073 } 1073 }
1074 case CodeStub::StringCompare: {
1075 StringCompareStub stub(isolate());
1076 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1077 break;
1078 }
1079 default: 1074 default:
1080 UNREACHABLE(); 1075 UNREACHABLE();
1081 } 1076 }
1082 } 1077 }
1083 1078
1084 1079
1085 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { 1080 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
1086 GenerateOsrPrologue(); 1081 GenerateOsrPrologue();
1087 } 1082 }
1088 1083
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 case Token::GTE: 2429 case Token::GTE:
2435 return greater_equal; 2430 return greater_equal;
2436 default: 2431 default:
2437 UNREACHABLE(); 2432 UNREACHABLE();
2438 return no_condition; 2433 return no_condition;
2439 } 2434 }
2440 } 2435 }
2441 2436
2442 2437
2443 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { 2438 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
2444 Token::Value op = instr->op(); 2439 DCHECK(ToRegister(instr->context()).is(esi));
2440 DCHECK(ToRegister(instr->left()).is(edx));
2441 DCHECK(ToRegister(instr->right()).is(eax));
2445 2442
2446 Handle<Code> ic = 2443 Handle<Code> code = CodeFactory::StringCompare(isolate()).code();
2447 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); 2444 CallCode(code, RelocInfo::CODE_TARGET, instr);
2448 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2445 __ test(eax, eax);
2449 2446
2450 Condition condition = ComputeCompareCondition(op); 2447 EmitBranch(instr, ComputeCompareCondition(instr->op()));
2451 __ test(eax, Operand(eax));
2452
2453 EmitBranch(instr, condition);
2454 } 2448 }
2455 2449
2456 2450
2457 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { 2451 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
2458 InstanceType from = instr->from(); 2452 InstanceType from = instr->from();
2459 InstanceType to = instr->to(); 2453 InstanceType to = instr->to();
2460 if (from == FIRST_TYPE) return to; 2454 if (from == FIRST_TYPE) return to;
2461 DCHECK(from == to || to == LAST_TYPE); 2455 DCHECK(from == to || to == LAST_TYPE);
2462 return from; 2456 return from;
2463 } 2457 }
(...skipping 3265 matching lines...) Expand 10 before | Expand all | Expand 10 after
5729 RecordSafepoint(Safepoint::kNoLazyDeopt); 5723 RecordSafepoint(Safepoint::kNoLazyDeopt);
5730 } 5724 }
5731 5725
5732 5726
5733 #undef __ 5727 #undef __
5734 5728
5735 } // namespace internal 5729 } // namespace internal
5736 } // namespace v8 5730 } // namespace v8
5737 5731
5738 #endif // V8_TARGET_ARCH_IA32 5732 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698