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

Side by Side Diff: src/mips/lithium-codegen-mips.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/mips/interface-descriptors-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 case CodeStub::RegExpExec: { 1025 case CodeStub::RegExpExec: {
1026 RegExpExecStub stub(isolate()); 1026 RegExpExecStub stub(isolate());
1027 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1027 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1028 break; 1028 break;
1029 } 1029 }
1030 case CodeStub::SubString: { 1030 case CodeStub::SubString: {
1031 SubStringStub stub(isolate()); 1031 SubStringStub stub(isolate());
1032 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1032 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1033 break; 1033 break;
1034 } 1034 }
1035 case CodeStub::StringCompare: {
1036 StringCompareStub stub(isolate());
1037 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1038 break;
1039 }
1040 default: 1035 default:
1041 UNREACHABLE(); 1036 UNREACHABLE();
1042 } 1037 }
1043 } 1038 }
1044 1039
1045 1040
1046 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { 1041 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
1047 GenerateOsrPrologue(); 1042 GenerateOsrPrologue();
1048 } 1043 }
1049 1044
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 return ge; 2447 return ge;
2453 default: 2448 default:
2454 UNREACHABLE(); 2449 UNREACHABLE();
2455 return kNoCondition; 2450 return kNoCondition;
2456 } 2451 }
2457 } 2452 }
2458 2453
2459 2454
2460 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { 2455 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
2461 DCHECK(ToRegister(instr->context()).is(cp)); 2456 DCHECK(ToRegister(instr->context()).is(cp));
2462 Token::Value op = instr->op(); 2457 DCHECK(ToRegister(instr->left()).is(a1));
2458 DCHECK(ToRegister(instr->right()).is(a0));
2463 2459
2464 Handle<Code> ic = 2460 Handle<Code> code = CodeFactory::StringCompare(isolate()).code();
2465 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); 2461 CallCode(code, RelocInfo::CODE_TARGET, instr);
2466 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2467 2462
2468 Condition condition = ComputeCompareCondition(op); 2463 EmitBranch(instr, ComputeCompareCondition(instr->op()), v0,
2469 2464 Operand(zero_reg));
2470 EmitBranch(instr, condition, v0, Operand(zero_reg));
2471 } 2465 }
2472 2466
2473 2467
2474 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { 2468 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
2475 InstanceType from = instr->from(); 2469 InstanceType from = instr->from();
2476 InstanceType to = instr->to(); 2470 InstanceType to = instr->to();
2477 if (from == FIRST_TYPE) return to; 2471 if (from == FIRST_TYPE) return to;
2478 DCHECK(from == to || to == LAST_TYPE); 2472 DCHECK(from == to || to == LAST_TYPE);
2479 return from; 2473 return from;
2480 } 2474 }
(...skipping 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after
5906 __ Push(at, ToRegister(instr->function())); 5900 __ Push(at, ToRegister(instr->function()));
5907 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5901 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5908 RecordSafepoint(Safepoint::kNoLazyDeopt); 5902 RecordSafepoint(Safepoint::kNoLazyDeopt);
5909 } 5903 }
5910 5904
5911 5905
5912 #undef __ 5906 #undef __
5913 5907
5914 } // namespace internal 5908 } // namespace internal
5915 } // namespace v8 5909 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698