| OLD | NEW |
| 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 Loading... |
| 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3963 reinterpret_cast<uint64_t>( | 3888 reinterpret_cast<uint64_t>( |
| 3964 isolate->builtins()->OnStackReplacement()->entry())); | 3889 isolate->builtins()->OnStackReplacement()->entry())); |
| 3965 return ON_STACK_REPLACEMENT; | 3890 return ON_STACK_REPLACEMENT; |
| 3966 } | 3891 } |
| 3967 | 3892 |
| 3968 | 3893 |
| 3969 } // namespace internal | 3894 } // namespace internal |
| 3970 } // namespace v8 | 3895 } // namespace v8 |
| 3971 | 3896 |
| 3972 #endif // V8_TARGET_ARCH_MIPS64 | 3897 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |