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

Side by Side Diff: src/mips/code-stubs-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 __ Addu(scratch3, left, index); 2996 __ Addu(scratch3, left, index);
2997 __ lbu(scratch1, MemOperand(scratch3)); 2997 __ lbu(scratch1, MemOperand(scratch3));
2998 __ Addu(scratch3, right, index); 2998 __ Addu(scratch3, right, index);
2999 __ lbu(scratch2, MemOperand(scratch3)); 2999 __ lbu(scratch2, MemOperand(scratch3));
3000 __ Branch(chars_not_equal, ne, scratch1, Operand(scratch2)); 3000 __ Branch(chars_not_equal, ne, scratch1, Operand(scratch2));
3001 __ Addu(index, index, 1); 3001 __ Addu(index, index, 1);
3002 __ Branch(&loop, ne, index, Operand(zero_reg)); 3002 __ Branch(&loop, ne, index, Operand(zero_reg));
3003 } 3003 }
3004 3004
3005 3005
3006 void StringCompareStub::Generate(MacroAssembler* masm) {
3007 // ----------- S t a t e -------------
3008 // -- a1 : left
3009 // -- a0 : right
3010 // -- ra : return address
3011 // -----------------------------------
3012 __ AssertString(a1);
3013 __ AssertString(a0);
3014
3015 Label not_same;
3016 __ Branch(&not_same, ne, a0, Operand(a1));
3017 __ li(v0, Operand(Smi::FromInt(EQUAL)));
3018 __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, a1,
3019 a2);
3020 __ Ret();
3021
3022 __ bind(&not_same);
3023
3024 // Check that both objects are sequential one-byte strings.
3025 Label runtime;
3026 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime);
3027
3028 // Compare flat ASCII strings natively.
3029 __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, a2,
3030 a3);
3031 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1);
3032
3033 __ bind(&runtime);
3034 __ Push(a1, a0);
3035 __ TailCallRuntime(Runtime::kStringCompare);
3036 }
3037
3038
3039 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { 3006 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
3040 // ----------- S t a t e ------------- 3007 // ----------- S t a t e -------------
3041 // -- a1 : left 3008 // -- a1 : left
3042 // -- a0 : right 3009 // -- a0 : right
3043 // -- ra : return address 3010 // -- ra : return address
3044 // ----------------------------------- 3011 // -----------------------------------
3045 3012
3046 // Load a2 with the allocation site. We stick an undefined dummy value here 3013 // Load a2 with the allocation site. We stick an undefined dummy value here
3047 // and replace it with the real allocation site later when we instantiate this 3014 // and replace it with the real allocation site later when we instantiate this
3048 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate(). 3015 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate().
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
5802 return_value_operand, NULL); 5769 return_value_operand, NULL);
5803 } 5770 }
5804 5771
5805 5772
5806 #undef __ 5773 #undef __
5807 5774
5808 } // namespace internal 5775 } // namespace internal
5809 } // namespace v8 5776 } // namespace v8
5810 5777
5811 #endif // V8_TARGET_ARCH_MIPS 5778 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698