| Index: src/x87/full-codegen-x87.cc
|
| diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
|
| index 2cb448ae2beb7f7284dadbf257c1b938e3b09c9d..7390de3ee1b956d5579bd234da120a3d79d66b36 100644
|
| --- a/src/x87/full-codegen-x87.cc
|
| +++ b/src/x87/full-codegen-x87.cc
|
| @@ -3776,6 +3776,28 @@ void FullCodeGenerator::EmitValueOf(CallRuntime* expr) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) {
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK_EQ(1, args->length());
|
| +
|
| + VisitForAccumulatorValue(args->at(0)); // Load the object.
|
| +
|
| + Label done, not_date_object;
|
| + Register object = eax;
|
| + Register result = eax;
|
| + Register scratch = ecx;
|
| +
|
| + __ JumpIfSmi(object, ¬_date_object, Label::kNear);
|
| + __ CmpObjectType(object, JS_DATE_TYPE, scratch);
|
| + __ j(equal, &done, Label::kNear);
|
| + __ bind(¬_date_object);
|
| + __ CallRuntime(Runtime::kThrowNotDateError, 0);
|
| +
|
| + __ bind(&done);
|
| + context()->Plug(result);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| DCHECK(args->length() == 2);
|
| @@ -3784,19 +3806,14 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
|
|
| VisitForAccumulatorValue(args->at(0)); // Load the object.
|
|
|
| - Label runtime, done, not_date_object;
|
| Register object = eax;
|
| Register result = eax;
|
| Register scratch = ecx;
|
|
|
| - __ JumpIfSmi(object, ¬_date_object);
|
| - __ CmpObjectType(object, JS_DATE_TYPE, scratch);
|
| - __ j(not_equal, ¬_date_object);
|
| -
|
| if (index->value() == 0) {
|
| __ mov(result, FieldOperand(object, JSDate::kValueOffset));
|
| - __ jmp(&done);
|
| } else {
|
| + Label runtime, done;
|
| if (index->value() < JSDate::kFirstUncachedField) {
|
| ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
|
| __ mov(scratch, Operand::StaticVariable(stamp));
|
| @@ -3804,19 +3821,16 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
| __ j(not_equal, &runtime, Label::kNear);
|
| __ mov(result, FieldOperand(object, JSDate::kValueOffset +
|
| kPointerSize * index->value()));
|
| - __ jmp(&done);
|
| + __ jmp(&done, Label::kNear);
|
| }
|
| __ bind(&runtime);
|
| __ PrepareCallCFunction(2, scratch);
|
| __ mov(Operand(esp, 0), object);
|
| __ mov(Operand(esp, 1 * kPointerSize), Immediate(index));
|
| __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
|
| - __ jmp(&done);
|
| + __ bind(&done);
|
| }
|
|
|
| - __ bind(¬_date_object);
|
| - __ CallRuntime(Runtime::kThrowNotDateError, 0);
|
| - __ bind(&done);
|
| context()->Plug(result);
|
| }
|
|
|
|
|