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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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 // 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 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2901 __ GetObjectType(v0, a1, a1); 2901 __ GetObjectType(v0, a1, a1);
2902 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE)); 2902 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE));
2903 2903
2904 __ lw(v0, FieldMemOperand(v0, JSValue::kValueOffset)); 2904 __ lw(v0, FieldMemOperand(v0, JSValue::kValueOffset));
2905 2905
2906 __ bind(&done); 2906 __ bind(&done);
2907 context()->Plug(v0); 2907 context()->Plug(v0);
2908 } 2908 }
2909 2909
2910 2910
2911 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2912 ZoneList<Expression*>* args = expr->arguments();
2913 DCHECK_EQ(3, args->length());
2914
2915 Register string = v0;
2916 Register index = a1;
2917 Register value = a2;
2918
2919 VisitForStackValue(args->at(0)); // index
2920 VisitForStackValue(args->at(1)); // value
2921 VisitForAccumulatorValue(args->at(2)); // string
2922 PopOperands(index, value);
2923
2924 if (FLAG_debug_code) {
2925 __ SmiTst(value, at);
2926 __ Check(eq, kNonSmiValue, at, Operand(zero_reg));
2927 __ SmiTst(index, at);
2928 __ Check(eq, kNonSmiIndex, at, Operand(zero_reg));
2929 __ SmiUntag(index, index);
2930 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2931 Register scratch = t5;
2932 __ EmitSeqStringSetCharCheck(
2933 string, index, value, scratch, one_byte_seq_type);
2934 __ SmiTag(index, index);
2935 }
2936
2937 __ SmiUntag(value, value);
2938 __ Addu(at,
2939 string,
2940 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag));
2941 __ SmiUntag(index);
2942 __ Addu(at, at, index);
2943 __ sb(value, MemOperand(at));
2944 context()->Plug(string);
2945 }
2946
2947
2948 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2949 ZoneList<Expression*>* args = expr->arguments();
2950 DCHECK_EQ(3, args->length());
2951
2952 Register string = v0;
2953 Register index = a1;
2954 Register value = a2;
2955
2956 VisitForStackValue(args->at(0)); // index
2957 VisitForStackValue(args->at(1)); // value
2958 VisitForAccumulatorValue(args->at(2)); // string
2959 PopOperands(index, value);
2960
2961 if (FLAG_debug_code) {
2962 __ SmiTst(value, at);
2963 __ Check(eq, kNonSmiValue, at, Operand(zero_reg));
2964 __ SmiTst(index, at);
2965 __ Check(eq, kNonSmiIndex, at, Operand(zero_reg));
2966 __ SmiUntag(index, index);
2967 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2968 Register scratch = t5;
2969 __ EmitSeqStringSetCharCheck(
2970 string, index, value, scratch, two_byte_seq_type);
2971 __ SmiTag(index, index);
2972 }
2973
2974 __ SmiUntag(value, value);
2975 __ Addu(at,
2976 string,
2977 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
2978 __ Addu(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) { 2911 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2986 ZoneList<Expression*>* args = expr->arguments(); 2912 ZoneList<Expression*>* args = expr->arguments();
2987 DCHECK(args->length() == 1); 2913 DCHECK(args->length() == 1);
2988 2914
2989 VisitForAccumulatorValue(args->at(0)); 2915 VisitForAccumulatorValue(args->at(0));
2990 2916
2991 Label done; 2917 Label done;
2992 StringCharFromCodeGenerator generator(v0, a1); 2918 StringCharFromCodeGenerator generator(v0, a1);
2993 generator.GenerateFast(masm_); 2919 generator.GenerateFast(masm_);
2994 __ jmp(&done); 2920 __ jmp(&done);
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
3906 reinterpret_cast<uint32_t>( 3832 reinterpret_cast<uint32_t>(
3907 isolate->builtins()->OnStackReplacement()->entry())); 3833 isolate->builtins()->OnStackReplacement()->entry()));
3908 return ON_STACK_REPLACEMENT; 3834 return ON_STACK_REPLACEMENT;
3909 } 3835 }
3910 3836
3911 3837
3912 } // namespace internal 3838 } // namespace internal
3913 } // namespace v8 3839 } // namespace v8
3914 3840
3915 #endif // V8_TARGET_ARCH_MIPS 3841 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698