Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index beed6f26b8141d95194dab75e06d249cce3cd66d..859efecd6ee6d6aae3be31511c9478e4d31a4a09 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -3789,25 +3789,25 @@ void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { |
} |
-void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { |
+void FullCodeGenerator::EmitIsDate(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK_EQ(1, args->length()); |
- VisitForAccumulatorValue(args->at(0)); // Load the object. |
+ VisitForAccumulatorValue(args->at(0)); |
- Register object = rax; |
- Register result = rax; |
- Register scratch = rcx; |
+ Label materialize_true, materialize_false; |
+ Label* if_true = nullptr; |
+ Label* if_false = nullptr; |
+ Label* fall_through = nullptr; |
+ context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
+ &if_false, &fall_through); |
- Label done, not_date_object; |
- __ JumpIfSmi(object, ¬_date_object, Label::kNear); |
- __ CmpObjectType(object, JS_DATE_TYPE, scratch); |
- __ j(equal, &done, Label::kNear); |
- __ bind(¬_date_object); |
- __ CallRuntime(Runtime::kThrowNotDateError, 0); |
+ __ JumpIfSmi(rax, if_false); |
+ __ CmpObjectType(rax, JS_DATE_TYPE, rbx); |
+ PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
+ Split(equal, if_true, if_false, fall_through); |
- __ bind(&done); |
- context()->Plug(result); |
+ context()->Plug(if_true, if_false); |
} |