| OLD | NEW |
| 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 Loading... |
| 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3911 | 3847 |
| 3912 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3848 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3913 | 3849 |
| 3914 DCHECK(interrupt_address == | 3850 DCHECK(interrupt_address == |
| 3915 isolate->builtins()->OnStackReplacement()->entry()); | 3851 isolate->builtins()->OnStackReplacement()->entry()); |
| 3916 return ON_STACK_REPLACEMENT; | 3852 return ON_STACK_REPLACEMENT; |
| 3917 } | 3853 } |
| 3918 } // namespace internal | 3854 } // namespace internal |
| 3919 } // namespace v8 | 3855 } // namespace v8 |
| 3920 #endif // V8_TARGET_ARCH_PPC | 3856 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |