Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 1c7b75443f80bef4bd9c8baeb334fdbe7fb5bc85..9c09e31aee855b8aa1c96506458f775f9a0bd340 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -3798,25 +3798,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)); |
- Label done, not_date_object; |
- Register object = eax; |
- Register result = eax; |
- Register scratch = ecx; |
+ 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); |
- __ 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(eax, if_false); |
+ __ CmpObjectType(eax, JS_DATE_TYPE, ebx); |
+ 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); |
} |