| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3124 | 3124 |
| 3125 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | 3125 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
| 3126 ZoneList<Expression*>* args = expr->arguments(); | 3126 ZoneList<Expression*>* args = expr->arguments(); |
| 3127 DCHECK_EQ(3, args->length()); | 3127 DCHECK_EQ(3, args->length()); |
| 3128 | 3128 |
| 3129 Register string = x0; | 3129 Register string = x0; |
| 3130 Register index = x1; | 3130 Register index = x1; |
| 3131 Register value = x2; | 3131 Register value = x2; |
| 3132 Register scratch = x10; | 3132 Register scratch = x10; |
| 3133 | 3133 |
| 3134 VisitForStackValue(args->at(1)); // index | 3134 VisitForStackValue(args->at(0)); // index |
| 3135 VisitForStackValue(args->at(2)); // value | 3135 VisitForStackValue(args->at(1)); // value |
| 3136 VisitForAccumulatorValue(args->at(0)); // string | 3136 VisitForAccumulatorValue(args->at(2)); // string |
| 3137 __ Pop(value, index); | 3137 __ Pop(value, index); |
| 3138 | 3138 |
| 3139 if (FLAG_debug_code) { | 3139 if (FLAG_debug_code) { |
| 3140 __ AssertSmi(value, kNonSmiValue); | 3140 __ AssertSmi(value, kNonSmiValue); |
| 3141 __ AssertSmi(index, kNonSmiIndex); | 3141 __ AssertSmi(index, kNonSmiIndex); |
| 3142 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; | 3142 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
| 3143 __ EmitSeqStringSetCharCheck(string, index, kIndexIsSmi, scratch, | 3143 __ EmitSeqStringSetCharCheck(string, index, kIndexIsSmi, scratch, |
| 3144 one_byte_seq_type); | 3144 one_byte_seq_type); |
| 3145 } | 3145 } |
| 3146 | 3146 |
| 3147 __ Add(scratch, string, SeqOneByteString::kHeaderSize - kHeapObjectTag); | 3147 __ Add(scratch, string, SeqOneByteString::kHeaderSize - kHeapObjectTag); |
| 3148 __ SmiUntag(value); | 3148 __ SmiUntag(value); |
| 3149 __ SmiUntag(index); | 3149 __ SmiUntag(index); |
| 3150 __ Strb(value, MemOperand(scratch, index)); | 3150 __ Strb(value, MemOperand(scratch, index)); |
| 3151 context()->Plug(string); | 3151 context()->Plug(string); |
| 3152 } | 3152 } |
| 3153 | 3153 |
| 3154 | 3154 |
| 3155 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { | 3155 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { |
| 3156 ZoneList<Expression*>* args = expr->arguments(); | 3156 ZoneList<Expression*>* args = expr->arguments(); |
| 3157 DCHECK_EQ(3, args->length()); | 3157 DCHECK_EQ(3, args->length()); |
| 3158 | 3158 |
| 3159 Register string = x0; | 3159 Register string = x0; |
| 3160 Register index = x1; | 3160 Register index = x1; |
| 3161 Register value = x2; | 3161 Register value = x2; |
| 3162 Register scratch = x10; | 3162 Register scratch = x10; |
| 3163 | 3163 |
| 3164 VisitForStackValue(args->at(1)); // index | 3164 VisitForStackValue(args->at(0)); // index |
| 3165 VisitForStackValue(args->at(2)); // value | 3165 VisitForStackValue(args->at(1)); // value |
| 3166 VisitForAccumulatorValue(args->at(0)); // string | 3166 VisitForAccumulatorValue(args->at(2)); // string |
| 3167 __ Pop(value, index); | 3167 __ Pop(value, index); |
| 3168 | 3168 |
| 3169 if (FLAG_debug_code) { | 3169 if (FLAG_debug_code) { |
| 3170 __ AssertSmi(value, kNonSmiValue); | 3170 __ AssertSmi(value, kNonSmiValue); |
| 3171 __ AssertSmi(index, kNonSmiIndex); | 3171 __ AssertSmi(index, kNonSmiIndex); |
| 3172 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; | 3172 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
| 3173 __ EmitSeqStringSetCharCheck(string, index, kIndexIsSmi, scratch, | 3173 __ EmitSeqStringSetCharCheck(string, index, kIndexIsSmi, scratch, |
| 3174 two_byte_seq_type); | 3174 two_byte_seq_type); |
| 3175 } | 3175 } |
| 3176 | 3176 |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4909 return previous_; | 4909 return previous_; |
| 4910 } | 4910 } |
| 4911 | 4911 |
| 4912 | 4912 |
| 4913 #undef __ | 4913 #undef __ |
| 4914 | 4914 |
| 4915 | 4915 |
| 4916 } } // namespace v8::internal | 4916 } } // namespace v8::internal |
| 4917 | 4917 |
| 4918 #endif // V8_TARGET_ARCH_ARM64 | 4918 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |