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

Side by Side Diff: src/mips64/lithium-codegen-mips64.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/mips64/interface-descriptors-mips64.cc ('k') | src/x64/code-stubs-x64.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. 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 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/hydrogen-osr.h" 8 #include "src/hydrogen-osr.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/stub-cache.h" 10 #include "src/ic/stub-cache.h"
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 case CodeStub::RegExpExec: { 1014 case CodeStub::RegExpExec: {
1015 RegExpExecStub stub(isolate()); 1015 RegExpExecStub stub(isolate());
1016 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1016 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1017 break; 1017 break;
1018 } 1018 }
1019 case CodeStub::SubString: { 1019 case CodeStub::SubString: {
1020 SubStringStub stub(isolate()); 1020 SubStringStub stub(isolate());
1021 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 1021 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1022 break; 1022 break;
1023 } 1023 }
1024 case CodeStub::StringCompare: {
1025 StringCompareStub stub(isolate());
1026 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
1027 break;
1028 }
1029 default: 1024 default:
1030 UNREACHABLE(); 1025 UNREACHABLE();
1031 } 1026 }
1032 } 1027 }
1033 1028
1034 1029
1035 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { 1030 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
1036 GenerateOsrPrologue(); 1031 GenerateOsrPrologue();
1037 } 1032 }
1038 1033
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 return ge; 2551 return ge;
2557 default: 2552 default:
2558 UNREACHABLE(); 2553 UNREACHABLE();
2559 return kNoCondition; 2554 return kNoCondition;
2560 } 2555 }
2561 } 2556 }
2562 2557
2563 2558
2564 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { 2559 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
2565 DCHECK(ToRegister(instr->context()).is(cp)); 2560 DCHECK(ToRegister(instr->context()).is(cp));
2566 Token::Value op = instr->op(); 2561 DCHECK(ToRegister(instr->left()).is(a1));
2562 DCHECK(ToRegister(instr->right()).is(a0));
2567 2563
2568 Handle<Code> ic = 2564 Handle<Code> code = CodeFactory::StringCompare(isolate()).code();
2569 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); 2565 CallCode(code, RelocInfo::CODE_TARGET, instr);
2570 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2571 2566
2572 Condition condition = ComputeCompareCondition(op); 2567 EmitBranch(instr, ComputeCompareCondition(instr->op()), v0,
2573 2568 Operand(zero_reg));
2574 EmitBranch(instr, condition, v0, Operand(zero_reg));
2575 } 2569 }
2576 2570
2577 2571
2578 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { 2572 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
2579 InstanceType from = instr->from(); 2573 InstanceType from = instr->from();
2580 InstanceType to = instr->to(); 2574 InstanceType to = instr->to();
2581 if (from == FIRST_TYPE) return to; 2575 if (from == FIRST_TYPE) return to;
2582 DCHECK(from == to || to == LAST_TYPE); 2576 DCHECK(from == to || to == LAST_TYPE);
2583 return from; 2577 return from;
2584 } 2578 }
(...skipping 3506 matching lines...) Expand 10 before | Expand all | Expand 10 after
6091 __ Push(at, ToRegister(instr->function())); 6085 __ Push(at, ToRegister(instr->function()));
6092 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6086 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6093 RecordSafepoint(Safepoint::kNoLazyDeopt); 6087 RecordSafepoint(Safepoint::kNoLazyDeopt);
6094 } 6088 }
6095 6089
6096 6090
6097 #undef __ 6091 #undef __
6098 6092
6099 } // namespace internal 6093 } // namespace internal
6100 } // namespace v8 6094 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips64/interface-descriptors-mips64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698