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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 // If the object is not a value type, return the object. 2891 // If the object is not a value type, return the object.
2892 __ CompareObjectType(r3, r4, r4, JS_VALUE_TYPE); 2892 __ CompareObjectType(r3, r4, r4, JS_VALUE_TYPE);
2893 __ bne(&done); 2893 __ bne(&done);
2894 __ LoadP(r3, FieldMemOperand(r3, JSValue::kValueOffset)); 2894 __ LoadP(r3, FieldMemOperand(r3, JSValue::kValueOffset));
2895 2895
2896 __ bind(&done); 2896 __ bind(&done);
2897 context()->Plug(r3); 2897 context()->Plug(r3);
2898 } 2898 }
2899 2899
2900 2900
2901 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2902 ZoneList<Expression*>* args = expr->arguments();
2903 DCHECK_EQ(3, args->length());
2904
2905 Register string = r3;
2906 Register index = r4;
2907 Register value = r5;
2908
2909 VisitForStackValue(args->at(0)); // index
2910 VisitForStackValue(args->at(1)); // value
2911 VisitForAccumulatorValue(args->at(2)); // string
2912 PopOperands(index, value);
2913
2914 if (FLAG_debug_code) {
2915 __ TestIfSmi(value, r0);
2916 __ Check(eq, kNonSmiValue, cr0);
2917 __ TestIfSmi(index, r0);
2918 __ Check(eq, kNonSmiIndex, cr0);
2919 __ SmiUntag(index, index);
2920 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2921 __ EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
2922 __ SmiTag(index, index);
2923 }
2924
2925 __ SmiUntag(value);
2926 __ addi(ip, string, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag));
2927 __ SmiToByteArrayOffset(r0, index);
2928 __ stbx(value, MemOperand(ip, r0));
2929 context()->Plug(string);
2930 }
2931
2932
2933 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2934 ZoneList<Expression*>* args = expr->arguments();
2935 DCHECK_EQ(3, args->length());
2936
2937 Register string = r3;
2938 Register index = r4;
2939 Register value = r5;
2940
2941 VisitForStackValue(args->at(0)); // index
2942 VisitForStackValue(args->at(1)); // value
2943 VisitForAccumulatorValue(args->at(2)); // string
2944 PopOperands(index, value);
2945
2946 if (FLAG_debug_code) {
2947 __ TestIfSmi(value, r0);
2948 __ Check(eq, kNonSmiValue, cr0);
2949 __ TestIfSmi(index, r0);
2950 __ Check(eq, kNonSmiIndex, cr0);
2951 __ SmiUntag(index, index);
2952 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2953 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
2954 __ SmiTag(index, index);
2955 }
2956
2957 __ SmiUntag(value);
2958 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
2959 __ SmiToShortArrayOffset(r0, index);
2960 __ sthx(value, MemOperand(ip, r0));
2961 context()->Plug(string);
2962 }
2963
2964
2965 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2901 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2966 ZoneList<Expression*>* args = expr->arguments(); 2902 ZoneList<Expression*>* args = expr->arguments();
2967 DCHECK(args->length() == 1); 2903 DCHECK(args->length() == 1);
2968 VisitForAccumulatorValue(args->at(0)); 2904 VisitForAccumulatorValue(args->at(0));
2969 2905
2970 Label done; 2906 Label done;
2971 StringCharFromCodeGenerator generator(r3, r4); 2907 StringCharFromCodeGenerator generator(r3, r4);
2972 generator.GenerateFast(masm_); 2908 generator.GenerateFast(masm_);
2973 __ b(&done); 2909 __ b(&done);
2974 2910
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 3805
3870 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); 3806 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address)));
3871 3807
3872 DCHECK(interrupt_address == 3808 DCHECK(interrupt_address ==
3873 isolate->builtins()->OnStackReplacement()->entry()); 3809 isolate->builtins()->OnStackReplacement()->entry());
3874 return ON_STACK_REPLACEMENT; 3810 return ON_STACK_REPLACEMENT;
3875 } 3811 }
3876 } // namespace internal 3812 } // namespace internal
3877 } // namespace v8 3813 } // namespace v8
3878 #endif // V8_TARGET_ARCH_PPC 3814 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/s390/full-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698