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

Side by Side Diff: src/mips64/code-stubs-mips64.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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 __ Daddu(scratch3, left, index); 3000 __ Daddu(scratch3, left, index);
3001 __ lbu(scratch1, MemOperand(scratch3)); 3001 __ lbu(scratch1, MemOperand(scratch3));
3002 __ Daddu(scratch3, right, index); 3002 __ Daddu(scratch3, right, index);
3003 __ lbu(scratch2, MemOperand(scratch3)); 3003 __ lbu(scratch2, MemOperand(scratch3));
3004 __ Branch(chars_not_equal, ne, scratch1, Operand(scratch2)); 3004 __ Branch(chars_not_equal, ne, scratch1, Operand(scratch2));
3005 __ Daddu(index, index, 1); 3005 __ Daddu(index, index, 1);
3006 __ Branch(&loop, ne, index, Operand(zero_reg)); 3006 __ Branch(&loop, ne, index, Operand(zero_reg));
3007 } 3007 }
3008 3008
3009 3009
3010 void StringCompareStub::Generate(MacroAssembler* masm) {
3011 // ----------- S t a t e -------------
3012 // -- a1 : left
3013 // -- a0 : right
3014 // -- ra : return address
3015 // -----------------------------------
3016 __ AssertString(a1);
3017 __ AssertString(a0);
3018
3019 Label not_same;
3020 __ Branch(&not_same, ne, a0, Operand(a1));
3021 __ li(v0, Operand(Smi::FromInt(EQUAL)));
3022 __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, a1,
3023 a2);
3024 __ Ret();
3025
3026 __ bind(&not_same);
3027
3028 // Check that both objects are sequential one-byte strings.
3029 Label runtime;
3030 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime);
3031
3032 // Compare flat ASCII strings natively.
3033 __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, a2,
3034 a3);
3035 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1);
3036
3037 __ bind(&runtime);
3038 __ Push(a1, a0);
3039 __ TailCallRuntime(Runtime::kStringCompare);
3040 }
3041
3042
3043 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { 3010 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
3044 // ----------- S t a t e ------------- 3011 // ----------- S t a t e -------------
3045 // -- a1 : left 3012 // -- a1 : left
3046 // -- a0 : right 3013 // -- a0 : right
3047 // -- ra : return address 3014 // -- ra : return address
3048 // ----------------------------------- 3015 // -----------------------------------
3049 3016
3050 // Load a2 with the allocation site. We stick an undefined dummy value here 3017 // Load a2 with the allocation site. We stick an undefined dummy value here
3051 // and replace it with the real allocation site later when we instantiate this 3018 // and replace it with the real allocation site later when we instantiate this
3052 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate(). 3019 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate().
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after
5830 return_value_operand, NULL); 5797 return_value_operand, NULL);
5831 } 5798 }
5832 5799
5833 5800
5834 #undef __ 5801 #undef __
5835 5802
5836 } // namespace internal 5803 } // namespace internal
5837 } // namespace v8 5804 } // namespace v8
5838 5805
5839 #endif // V8_TARGET_ARCH_MIPS64 5806 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698