| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3138 | 3138 |
| 3139 __ JumpIfSmi(x0, if_false); | 3139 __ JumpIfSmi(x0, if_false); |
| 3140 __ CompareObjectType(x0, x10, x11, JS_DATE_TYPE); | 3140 __ CompareObjectType(x0, x10, x11, JS_DATE_TYPE); |
| 3141 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3141 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3142 Split(eq, if_true, if_false, fall_through); | 3142 Split(eq, if_true, if_false, fall_through); |
| 3143 | 3143 |
| 3144 context()->Plug(if_true, if_false); | 3144 context()->Plug(if_true, if_false); |
| 3145 } | 3145 } |
| 3146 | 3146 |
| 3147 | 3147 |
| 3148 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | |
| 3149 ZoneList<Expression*>* args = expr->arguments(); | |
| 3150 DCHECK(args->length() == 2); | |
| 3151 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); | |
| 3152 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); | |
| 3153 | |
| 3154 VisitForAccumulatorValue(args->at(0)); // Load the object. | |
| 3155 | |
| 3156 Register object = x0; | |
| 3157 Register result = x0; | |
| 3158 Register stamp_addr = x10; | |
| 3159 Register stamp_cache = x11; | |
| 3160 | |
| 3161 if (index->value() == 0) { | |
| 3162 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); | |
| 3163 } else { | |
| 3164 Label runtime, done; | |
| 3165 if (index->value() < JSDate::kFirstUncachedField) { | |
| 3166 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | |
| 3167 __ Mov(stamp_addr, stamp); | |
| 3168 __ Ldr(stamp_addr, MemOperand(stamp_addr)); | |
| 3169 __ Ldr(stamp_cache, FieldMemOperand(object, JSDate::kCacheStampOffset)); | |
| 3170 __ Cmp(stamp_addr, stamp_cache); | |
| 3171 __ B(ne, &runtime); | |
| 3172 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset + | |
| 3173 kPointerSize * index->value())); | |
| 3174 __ B(&done); | |
| 3175 } | |
| 3176 | |
| 3177 __ Bind(&runtime); | |
| 3178 __ Mov(x1, index); | |
| 3179 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | |
| 3180 __ Bind(&done); | |
| 3181 } | |
| 3182 | |
| 3183 context()->Plug(result); | |
| 3184 } | |
| 3185 | |
| 3186 | |
| 3187 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | 3148 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
| 3188 ZoneList<Expression*>* args = expr->arguments(); | 3149 ZoneList<Expression*>* args = expr->arguments(); |
| 3189 DCHECK_EQ(3, args->length()); | 3150 DCHECK_EQ(3, args->length()); |
| 3190 | 3151 |
| 3191 Register string = x0; | 3152 Register string = x0; |
| 3192 Register index = x1; | 3153 Register index = x1; |
| 3193 Register value = x2; | 3154 Register value = x2; |
| 3194 Register scratch = x10; | 3155 Register scratch = x10; |
| 3195 | 3156 |
| 3196 VisitForStackValue(args->at(0)); // index | 3157 VisitForStackValue(args->at(0)); // index |
| (...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4897 } | 4858 } |
| 4898 | 4859 |
| 4899 return INTERRUPT; | 4860 return INTERRUPT; |
| 4900 } | 4861 } |
| 4901 | 4862 |
| 4902 | 4863 |
| 4903 } // namespace internal | 4864 } // namespace internal |
| 4904 } // namespace v8 | 4865 } // namespace v8 |
| 4905 | 4866 |
| 4906 #endif // V8_TARGET_ARCH_ARM64 | 4867 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |