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 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3607 __ JumpIfSmi(x0, &done); | 3607 __ JumpIfSmi(x0, &done); |
3608 // If the object is not a value type, return the object. | 3608 // If the object is not a value type, return the object. |
3609 __ JumpIfNotObjectType(x0, x10, x11, JS_VALUE_TYPE, &done); | 3609 __ JumpIfNotObjectType(x0, x10, x11, JS_VALUE_TYPE, &done); |
3610 __ Ldr(x0, FieldMemOperand(x0, JSValue::kValueOffset)); | 3610 __ Ldr(x0, FieldMemOperand(x0, JSValue::kValueOffset)); |
3611 | 3611 |
3612 __ Bind(&done); | 3612 __ Bind(&done); |
3613 context()->Plug(x0); | 3613 context()->Plug(x0); |
3614 } | 3614 } |
3615 | 3615 |
3616 | 3616 |
3617 void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { | 3617 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) { |
3618 ZoneList<Expression*>* args = expr->arguments(); | 3618 ZoneList<Expression*>* args = expr->arguments(); |
3619 DCHECK_EQ(1, args->length()); | 3619 DCHECK_EQ(1, args->length()); |
3620 | 3620 |
3621 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3621 VisitForAccumulatorValue(args->at(0)); |
3622 | 3622 |
3623 Label done, not_date_object; | 3623 Label materialize_true, materialize_false; |
3624 Register object = x0; | 3624 Label* if_true = nullptr; |
3625 Register result = x0; | 3625 Label* if_false = nullptr; |
| 3626 Label* fall_through = nullptr; |
| 3627 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3628 &if_false, &fall_through); |
3626 | 3629 |
3627 __ JumpIfSmi(object, ¬_date_object); | 3630 __ JumpIfSmi(x0, if_false); |
3628 __ JumpIfObjectType(object, x10, x10, JS_DATE_TYPE, &done); | 3631 __ CompareObjectType(x0, x10, x11, JS_DATE_TYPE); |
3629 __ Bind(¬_date_object); | 3632 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3630 __ CallRuntime(Runtime::kThrowNotDateError, 0); | 3633 Split(eq, if_true, if_false, fall_through); |
3631 | 3634 |
3632 __ Bind(&done); | 3635 context()->Plug(if_true, if_false); |
3633 context()->Plug(result); | |
3634 } | 3636 } |
3635 | 3637 |
3636 | 3638 |
3637 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | 3639 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
3638 ZoneList<Expression*>* args = expr->arguments(); | 3640 ZoneList<Expression*>* args = expr->arguments(); |
3639 DCHECK(args->length() == 2); | 3641 DCHECK(args->length() == 2); |
3640 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); | 3642 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); |
3641 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); | 3643 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); |
3642 | 3644 |
3643 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3645 VisitForAccumulatorValue(args->at(0)); // Load the object. |
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5578 } | 5580 } |
5579 | 5581 |
5580 return INTERRUPT; | 5582 return INTERRUPT; |
5581 } | 5583 } |
5582 | 5584 |
5583 | 5585 |
5584 } // namespace internal | 5586 } // namespace internal |
5585 } // namespace v8 | 5587 } // namespace v8 |
5586 | 5588 |
5587 #endif // V8_TARGET_ARCH_ARM64 | 5589 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |