| Index: src/ppc/full-codegen-ppc.cc
|
| diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
|
| index 78132a06ccfc0050543db143d1e9a9d2b29a05b8..21345e406786aa030028cf39b3bdf7b1dd87385c 100644
|
| --- a/src/ppc/full-codegen-ppc.cc
|
| +++ b/src/ppc/full-codegen-ppc.cc
|
| @@ -3897,6 +3897,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 = r3;
|
| + Register result = r3;
|
| + Register scratch0 = r4;
|
| +
|
| + __ JumpIfSmi(object, ¬_date_object);
|
| + __ CompareObjectType(object, scratch0, scratch0, JS_DATE_TYPE);
|
| + __ beq(&done);
|
| + __ 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);
|
| @@ -3905,20 +3927,15 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
|
|
| VisitForAccumulatorValue(args->at(0)); // Load the object.
|
|
|
| - Label runtime, done, not_date_object;
|
| Register object = r3;
|
| Register result = r3;
|
| Register scratch0 = r11;
|
| Register scratch1 = r4;
|
|
|
| - __ JumpIfSmi(object, ¬_date_object);
|
| - __ CompareObjectType(object, scratch1, scratch1, JS_DATE_TYPE);
|
| - __ bne(¬_date_object);
|
| -
|
| if (index->value() == 0) {
|
| __ LoadP(result, FieldMemOperand(object, JSDate::kValueOffset));
|
| - __ b(&done);
|
| } else {
|
| + Label runtime, done;
|
| if (index->value() < JSDate::kFirstUncachedField) {
|
| ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
|
| __ mov(scratch1, Operand(stamp));
|
| @@ -3936,13 +3953,10 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
|
| __ PrepareCallCFunction(2, scratch1);
|
| __ LoadSmiLiteral(r4, index);
|
| __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
|
| - __ b(&done);
|
| + __ bind(&done);
|
| }
|
|
|
| - __ bind(¬_date_object);
|
| - __ CallRuntime(Runtime::kThrowNotDateError, 0);
|
| - __ bind(&done);
|
| - context()->Plug(r3);
|
| + context()->Plug(result);
|
| }
|
|
|
|
|
|
|