summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/DateInstance.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/DateInstance.h')
-rw-r--r--JavaScriptCore/runtime/DateInstance.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/JavaScriptCore/runtime/DateInstance.h b/JavaScriptCore/runtime/DateInstance.h
index 38b321c..44b7521 100644
--- a/JavaScriptCore/runtime/DateInstance.h
+++ b/JavaScriptCore/runtime/DateInstance.h
@@ -38,7 +38,19 @@ namespace JSC {
static JS_EXPORTDATA const ClassInfo info;
- bool getGregorianDateTime(ExecState*, bool outputIsUTC, WTF::GregorianDateTime&) const;
+ const GregorianDateTime* gregorianDateTime(ExecState* exec) const
+ {
+ if (m_data && m_data->m_gregorianDateTimeCachedForMS == internalNumber())
+ return &m_data->m_cachedGregorianDateTime;
+ return calculateGregorianDateTime(exec);
+ }
+
+ const GregorianDateTime* gregorianDateTimeUTC(ExecState* exec) const
+ {
+ if (m_data && m_data->m_gregorianDateTimeUTCCachedForMS == internalNumber())
+ return &m_data->m_cachedGregorianDateTimeUTC;
+ return calculateGregorianDateTimeUTC(exec);
+ }
static PassRefPtr<Structure> createStructure(JSValue prototype)
{
@@ -49,6 +61,8 @@ namespace JSC {
static const unsigned StructureFlags = OverridesMarkChildren | JSWrapperObject::StructureFlags;
private:
+ const GregorianDateTime* calculateGregorianDateTime(ExecState*) const;
+ const GregorianDateTime* calculateGregorianDateTimeUTC(ExecState*) const;
virtual const ClassInfo* classInfo() const { return &info; }
mutable RefPtr<DateInstanceData> m_data;