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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1994733003: Rewrite decodeURL as builtin function, remove now unused runtime functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 6 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/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 __ GetObjectType(v0, a1, a1); 2900 __ GetObjectType(v0, a1, a1);
2901 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE)); 2901 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE));
2902 2902
2903 __ ld(v0, FieldMemOperand(v0, JSValue::kValueOffset)); 2903 __ ld(v0, FieldMemOperand(v0, JSValue::kValueOffset));
2904 2904
2905 __ bind(&done); 2905 __ bind(&done);
2906 context()->Plug(v0); 2906 context()->Plug(v0);
2907 } 2907 }
2908 2908
2909 2909
2910 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2911 ZoneList<Expression*>* args = expr->arguments();
2912 DCHECK_EQ(3, args->length());
2913
2914 Register string = v0;
2915 Register index = a1;
2916 Register value = a2;
2917
2918 VisitForStackValue(args->at(0)); // index
2919 VisitForStackValue(args->at(1)); // value
2920 VisitForAccumulatorValue(args->at(2)); // string
2921 PopOperands(index, value);
2922
2923 if (FLAG_debug_code) {
2924 __ SmiTst(value, at);
2925 __ Check(eq, kNonSmiValue, at, Operand(zero_reg));
2926 __ SmiTst(index, at);
2927 __ Check(eq, kNonSmiIndex, at, Operand(zero_reg));
2928 __ SmiUntag(index, index);
2929 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2930 Register scratch = t1;
2931 __ EmitSeqStringSetCharCheck(
2932 string, index, value, scratch, one_byte_seq_type);
2933 __ SmiTag(index, index);
2934 }
2935
2936 __ SmiUntag(value, value);
2937 __ Daddu(at,
2938 string,
2939 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag));
2940 __ SmiUntag(index);
2941 __ Daddu(at, at, index);
2942 __ sb(value, MemOperand(at));
2943 context()->Plug(string);
2944 }
2945
2946
2947 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2948 ZoneList<Expression*>* args = expr->arguments();
2949 DCHECK_EQ(3, args->length());
2950
2951 Register string = v0;
2952 Register index = a1;
2953 Register value = a2;
2954
2955 VisitForStackValue(args->at(0)); // index
2956 VisitForStackValue(args->at(1)); // value
2957 VisitForAccumulatorValue(args->at(2)); // string
2958 PopOperands(index, value);
2959
2960 if (FLAG_debug_code) {
2961 __ SmiTst(value, at);
2962 __ Check(eq, kNonSmiValue, at, Operand(zero_reg));
2963 __ SmiTst(index, at);
2964 __ Check(eq, kNonSmiIndex, at, Operand(zero_reg));
2965 __ SmiUntag(index, index);
2966 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2967 Register scratch = t1;
2968 __ EmitSeqStringSetCharCheck(
2969 string, index, value, scratch, two_byte_seq_type);
2970 __ SmiTag(index, index);
2971 }
2972
2973 __ SmiUntag(value, value);
2974 __ Daddu(at,
2975 string,
2976 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
2977 __ dsra(index, index, 32 - 1);
2978 __ Daddu(at, at, index);
2979 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
2980 __ sh(value, MemOperand(at));
2981 context()->Plug(string);
2982 }
2983
2984
2985 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2910 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2986 ZoneList<Expression*>* args = expr->arguments(); 2911 ZoneList<Expression*>* args = expr->arguments();
2987 DCHECK(args->length() == 1); 2912 DCHECK(args->length() == 1);
2988 2913
2989 VisitForAccumulatorValue(args->at(0)); 2914 VisitForAccumulatorValue(args->at(0));
2990 2915
2991 Label done; 2916 Label done;
2992 StringCharFromCodeGenerator generator(v0, a1); 2917 StringCharFromCodeGenerator generator(v0, a1);
2993 generator.GenerateFast(masm_); 2918 generator.GenerateFast(masm_);
2994 __ jmp(&done); 2919 __ jmp(&done);
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3914 reinterpret_cast<uint64_t>( 3839 reinterpret_cast<uint64_t>(
3915 isolate->builtins()->OnStackReplacement()->entry())); 3840 isolate->builtins()->OnStackReplacement()->entry()));
3916 return ON_STACK_REPLACEMENT; 3841 return ON_STACK_REPLACEMENT;
3917 } 3842 }
3918 3843
3919 3844
3920 } // namespace internal 3845 } // namespace internal
3921 } // namespace v8 3846 } // namespace v8
3922 3847
3923 #endif // V8_TARGET_ARCH_MIPS64 3848 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698