Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 85e94f29649dacf999f1fbf7afd4415a6f48bfb0..b2f629b26c4cbca143eb491ed1c746d7eb4ea798 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -3134,20 +3134,19 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
VisitForAccumulatorValue(args->at(0)); // Load the object. |
- Label runtime, done; |
+ Label runtime, done, not_date_object; |
Register object = r0; |
Register result = r0; |
Register scratch0 = r9; |
Register scratch1 = r1; |
-#ifdef DEBUG |
- __ AbortIfSmi(object); |
+ __ JumpIfSmi(object, ¬_date_object); |
__ CompareObjectType(object, scratch1, scratch1, JS_DATE_TYPE); |
- __ Assert(eq, "Trying to get date field from non-date."); |
-#endif |
+ __ b(ne, ¬_date_object); |
if (index->value() == 0) { |
__ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); |
+ __ jmp(&done); |
} else { |
if (index->value() < JSDate::kFirstUncachedField) { |
ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
@@ -3164,8 +3163,12 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
__ PrepareCallCFunction(2, scratch1); |
__ mov(r1, Operand(index)); |
__ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
- __ bind(&done); |
+ __ jmp(&done); |
} |
+ |
+ __ bind(¬_date_object); |
+ __ CallRuntime(Runtime::kThrowNotDateError, 0); |
+ __ bind(&done); |
context()->Plug(r0); |
} |
@@ -3580,9 +3583,8 @@ void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { |
ASSERT(args->length() == 1); |
VisitForAccumulatorValue(args->at(0)); |
- if (generate_debug_code_) { |
- __ AbortIfNotString(r0); |
- } |
+ __ AbortIfNotString(r0); |
+ |
__ ldr(r0, FieldMemOperand(r0, String::kHashFieldOffset)); |
__ IndexFromHash(r0, r0); |