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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.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/codegen.h" 10 #include "src/codegen.h"
(...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 __ JumpIfSmi(r0, &done); 2894 __ JumpIfSmi(r0, &done);
2895 // If the object is not a value type, return the object. 2895 // If the object is not a value type, return the object.
2896 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); 2896 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE);
2897 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq); 2897 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq);
2898 2898
2899 __ bind(&done); 2899 __ bind(&done);
2900 context()->Plug(r0); 2900 context()->Plug(r0);
2901 } 2901 }
2902 2902
2903 2903
2904 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2905 ZoneList<Expression*>* args = expr->arguments();
2906 DCHECK_EQ(3, args->length());
2907
2908 Register string = r0;
2909 Register index = r1;
2910 Register value = r2;
2911
2912 VisitForStackValue(args->at(0)); // index
2913 VisitForStackValue(args->at(1)); // value
2914 VisitForAccumulatorValue(args->at(2)); // string
2915 PopOperands(index, value);
2916
2917 if (FLAG_debug_code) {
2918 __ SmiTst(value);
2919 __ Check(eq, kNonSmiValue);
2920 __ SmiTst(index);
2921 __ Check(eq, kNonSmiIndex);
2922 __ SmiUntag(index, index);
2923 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2924 __ EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
2925 __ SmiTag(index, index);
2926 }
2927
2928 __ SmiUntag(value, value);
2929 __ add(ip,
2930 string,
2931 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag));
2932 __ strb(value, MemOperand(ip, index, LSR, kSmiTagSize));
2933 context()->Plug(string);
2934 }
2935
2936
2937 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2938 ZoneList<Expression*>* args = expr->arguments();
2939 DCHECK_EQ(3, args->length());
2940
2941 Register string = r0;
2942 Register index = r1;
2943 Register value = r2;
2944
2945 VisitForStackValue(args->at(0)); // index
2946 VisitForStackValue(args->at(1)); // value
2947 VisitForAccumulatorValue(args->at(2)); // string
2948 PopOperands(index, value);
2949
2950 if (FLAG_debug_code) {
2951 __ SmiTst(value);
2952 __ Check(eq, kNonSmiValue);
2953 __ SmiTst(index);
2954 __ Check(eq, kNonSmiIndex);
2955 __ SmiUntag(index, index);
2956 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2957 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
2958 __ SmiTag(index, index);
2959 }
2960
2961 __ SmiUntag(value, value);
2962 __ add(ip,
2963 string,
2964 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
2965 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
2966 __ strh(value, MemOperand(ip, index));
2967 context()->Plug(string);
2968 }
2969
2970
2971 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2904 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2972 ZoneList<Expression*>* args = expr->arguments(); 2905 ZoneList<Expression*>* args = expr->arguments();
2973 DCHECK(args->length() == 1); 2906 DCHECK(args->length() == 1);
2974 VisitForAccumulatorValue(args->at(0)); 2907 VisitForAccumulatorValue(args->at(0));
2975 2908
2976 Label done; 2909 Label done;
2977 StringCharFromCodeGenerator generator(r0, r1); 2910 StringCharFromCodeGenerator generator(r0, r1);
2978 generator.GenerateFast(masm_); 2911 generator.GenerateFast(masm_);
2979 __ jmp(&done); 2912 __ jmp(&done);
2980 2913
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
3954 DCHECK(interrupt_address == 3887 DCHECK(interrupt_address ==
3955 isolate->builtins()->OnStackReplacement()->entry()); 3888 isolate->builtins()->OnStackReplacement()->entry());
3956 return ON_STACK_REPLACEMENT; 3889 return ON_STACK_REPLACEMENT;
3957 } 3890 }
3958 3891
3959 3892
3960 } // namespace internal 3893 } // namespace internal
3961 } // namespace v8 3894 } // namespace v8
3962 3895
3963 #endif // V8_TARGET_ARCH_ARM 3896 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698