| 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_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 Loading... |
| 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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4001 DCHECK(interrupt_address == | 3934 DCHECK(interrupt_address == |
| 4002 isolate->builtins()->OnStackReplacement()->entry()); | 3935 isolate->builtins()->OnStackReplacement()->entry()); |
| 4003 return ON_STACK_REPLACEMENT; | 3936 return ON_STACK_REPLACEMENT; |
| 4004 } | 3937 } |
| 4005 | 3938 |
| 4006 | 3939 |
| 4007 } // namespace internal | 3940 } // namespace internal |
| 4008 } // namespace v8 | 3941 } // namespace v8 |
| 4009 | 3942 |
| 4010 #endif // V8_TARGET_ARCH_ARM | 3943 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |