| Index: src/full-codegen/arm64/full-codegen-arm64.cc
|
| diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc
|
| index 4c1ce8ed0e18624919f17bae319b6d4df6c360a2..32d6b3056c42be573e8220863fdc829697321985 100644
|
| --- a/src/full-codegen/arm64/full-codegen-arm64.cc
|
| +++ b/src/full-codegen/arm64/full-codegen-arm64.cc
|
| @@ -3142,6 +3142,45 @@
|
| Split(eq, if_true, if_false, fall_through);
|
|
|
| context()->Plug(if_true, if_false);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK(args->length() == 2);
|
| + DCHECK_NOT_NULL(args->at(1)->AsLiteral());
|
| + Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
|
| +
|
| + VisitForAccumulatorValue(args->at(0)); // Load the object.
|
| +
|
| + Register object = x0;
|
| + Register result = x0;
|
| + Register stamp_addr = x10;
|
| + Register stamp_cache = x11;
|
| +
|
| + if (index->value() == 0) {
|
| + __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
|
| + } else {
|
| + Label runtime, done;
|
| + if (index->value() < JSDate::kFirstUncachedField) {
|
| + ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
|
| + __ Mov(stamp_addr, stamp);
|
| + __ Ldr(stamp_addr, MemOperand(stamp_addr));
|
| + __ Ldr(stamp_cache, FieldMemOperand(object, JSDate::kCacheStampOffset));
|
| + __ Cmp(stamp_addr, stamp_cache);
|
| + __ B(ne, &runtime);
|
| + __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset +
|
| + kPointerSize * index->value()));
|
| + __ B(&done);
|
| + }
|
| +
|
| + __ Bind(&runtime);
|
| + __ Mov(x1, index);
|
| + __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
|
| + __ Bind(&done);
|
| + }
|
| +
|
| + context()->Plug(result);
|
| }
|
|
|
|
|
|
|