Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 7308fb2bc3ca4792c319b5c4648d3c55857e424f..78e8458cfc21c634d0a7a5c9e546d9c286ea1a17 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -595,6 +595,7 @@ TYPE_CHECKER(Oddball, ODDBALL_TYPE) |
TYPE_CHECKER(JSGlobalPropertyCell, JS_GLOBAL_PROPERTY_CELL_TYPE) |
TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) |
TYPE_CHECKER(JSValue, JS_VALUE_TYPE) |
+TYPE_CHECKER(JSDate, JS_DATE_TYPE) |
TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) |
@@ -1390,6 +1391,8 @@ int JSObject::GetHeaderSize() { |
return JSFunction::kSize; |
case JS_VALUE_TYPE: |
return JSValue::kSize; |
+ case JS_DATE_TYPE: |
+ return JSDate::kSize; |
case JS_ARRAY_TYPE: |
return JSArray::kSize; |
case JS_WEAK_MAP_TYPE: |
@@ -4022,6 +4025,23 @@ JSValue* JSValue::cast(Object* obj) { |
} |
+ACCESSORS(JSDate, value, Object, kValueOffset) |
+ACCESSORS(JSDate, year, Object, kYearOffset) |
+ACCESSORS(JSDate, month, Object, kMonthOffset) |
+ACCESSORS(JSDate, day, Object, kDayOffset) |
+ACCESSORS(JSDate, hour, Object, kHourOffset) |
+ACCESSORS(JSDate, min, Object, kMinOffset) |
+ACCESSORS(JSDate, sec, Object, kSecOffset) |
+ACCESSORS(JSDate, ms, Object, kMsOffset) |
+ |
+ |
+JSDate* JSDate::cast(Object* obj) { |
+ ASSERT(obj->IsJSDate()); |
+ ASSERT(HeapObject::cast(obj)->Size() == JSDate::kSize); |
+ return reinterpret_cast<JSDate*>(obj); |
+} |
+ |
+ |
ACCESSORS(JSMessageObject, type, String, kTypeOffset) |
ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset) |
ACCESSORS(JSMessageObject, script, Object, kScriptOffset) |