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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.cc

Issue 1765823002: [compiler] Introduce code stubs for string relational comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
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/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
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/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 return kNoCondition; 2359 return kNoCondition;
2360 } 2360 }
2361 } 2361 }
2362 2362
2363 2363
2364 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { 2364 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
2365 DCHECK(ToRegister(instr->context()).is(cp)); 2365 DCHECK(ToRegister(instr->context()).is(cp));
2366 DCHECK(ToRegister(instr->left()).is(r1)); 2366 DCHECK(ToRegister(instr->left()).is(r1));
2367 DCHECK(ToRegister(instr->right()).is(r0)); 2367 DCHECK(ToRegister(instr->right()).is(r0));
2368 2368
2369 if (Token::IsOrderedRelationalCompareOp(instr->op())) { 2369 Handle<Code> code = CodeFactory::StringCompare(isolate(), instr->op()).code();
2370 Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); 2370 CallCode(code, RelocInfo::CODE_TARGET, instr);
2371 CallCode(code, RelocInfo::CODE_TARGET, instr); 2371 __ CompareRoot(r0, Heap::kTrueValueRootIndex);
2372 __ cmp(r0, Operand::Zero()); 2372 EmitBranch(instr, eq);
2373 } else {
2374 Handle<Code> code = CodeFactory::StringEqual(isolate()).code();
2375 CallCode(code, RelocInfo::CODE_TARGET, instr);
2376 __ CompareRoot(r0, Heap::kTrueValueRootIndex);
2377 }
2378
2379 EmitBranch(instr, ComputeCompareCondition(instr->op()));
2380 } 2373 }
2381 2374
2382 2375
2383 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { 2376 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) {
2384 InstanceType from = instr->from(); 2377 InstanceType from = instr->from();
2385 InstanceType to = instr->to(); 2378 InstanceType to = instr->to();
2386 if (from == FIRST_TYPE) return to; 2379 if (from == FIRST_TYPE) return to;
2387 DCHECK(from == to || to == LAST_TYPE); 2380 DCHECK(from == to || to == LAST_TYPE);
2388 return from; 2381 return from;
2389 } 2382 }
(...skipping 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after
5477 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5470 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5478 Register context = ToRegister(instr->context()); 5471 Register context = ToRegister(instr->context());
5479 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5472 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5480 } 5473 }
5481 5474
5482 5475
5483 #undef __ 5476 #undef __
5484 5477
5485 } // namespace internal 5478 } // namespace internal
5486 } // namespace v8 5479 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698