[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
ggaren at apple.com
ggaren at apple.com
Wed Apr 7 23:09:44 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 6cea0c72cf972ad4be2cd0e232374375ca7bdeb0
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 27 22:01:41 2009 +0000
JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=30800
Cache recently computed date data.
Patch by Geoffrey Garen <ggaren at apple.com> on 2009-10-27
Reviewed by Darin Adler and Oliver Hunt.
SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.
* GNUmakefile.am:
* JavaScriptCore.gypi:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj: Added new file.
* runtime/DateInstance.cpp:
(JSC::DateInstance::DateInstance):
(JSC::DateInstance::getGregorianDateTime): Use the shared cache.
* runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion
of a "cache cache".
* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate):
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
can access the DateInstanceCache.
* runtime/JSGlobalData.h: Keep a DateInstanceCache.
JavaScriptGlue: Updated for JavaScriptCore export changes.
Patch by Geoffrey Garen <ggaren at apple.com> on 2009-10-27
Reviewed by Oliver Hunt.
* ForwardingHeaders/wtf/DateMath.h: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 9473e28..c534753 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,55 @@
+2009-10-27 Geoffrey Garen <ggaren at apple.com>
+
+ Reviewed by Darin Adler and Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30800
+ Cache recently computed date data.
+
+ SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj: Added new file.
+
+ * runtime/DateInstance.cpp:
+ (JSC::DateInstance::DateInstance):
+ (JSC::DateInstance::getGregorianDateTime): Use the shared cache.
+
+ * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion
+ of a "cache cache".
+
+ * runtime/DatePrototype.cpp:
+ (JSC::formatLocaleDate):
+ (JSC::dateProtoFuncToString):
+ (JSC::dateProtoFuncToUTCString):
+ (JSC::dateProtoFuncToISOString):
+ (JSC::dateProtoFuncToDateString):
+ (JSC::dateProtoFuncToTimeString):
+ (JSC::dateProtoFuncGetFullYear):
+ (JSC::dateProtoFuncGetUTCFullYear):
+ (JSC::dateProtoFuncToGMTString):
+ (JSC::dateProtoFuncGetMonth):
+ (JSC::dateProtoFuncGetUTCMonth):
+ (JSC::dateProtoFuncGetDate):
+ (JSC::dateProtoFuncGetUTCDate):
+ (JSC::dateProtoFuncGetDay):
+ (JSC::dateProtoFuncGetUTCDay):
+ (JSC::dateProtoFuncGetHours):
+ (JSC::dateProtoFuncGetUTCHours):
+ (JSC::dateProtoFuncGetMinutes):
+ (JSC::dateProtoFuncGetUTCMinutes):
+ (JSC::dateProtoFuncGetSeconds):
+ (JSC::dateProtoFuncGetUTCSeconds):
+ (JSC::dateProtoFuncGetTimezoneOffset):
+ (JSC::setNewValueFromTimeArgs):
+ (JSC::setNewValueFromDateArgs):
+ (JSC::dateProtoFuncSetYear):
+ (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
+ can access the DateInstanceCache.
+
+ * runtime/JSGlobalData.h: Keep a DateInstanceCache.
+
2009-10-27 James Robinson <jamesr at chromium.org>
Reviewed by Darin Fisher.
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 81f5e64..5e50ba7 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -390,6 +390,7 @@ javascriptcore_sources += \
JavaScriptCore/runtime/DateConversion.h \
JavaScriptCore/runtime/DateInstance.cpp \
JavaScriptCore/runtime/DateInstance.h \
+ JavaScriptCore/runtime/DateInstanceCache.h \
JavaScriptCore/runtime/DatePrototype.cpp \
JavaScriptCore/runtime/DatePrototype.h \
JavaScriptCore/runtime/Error.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index 4b316c8..03c23c3 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -194,6 +194,7 @@
'runtime/DateConversion.h',
'runtime/DateInstance.cpp',
'runtime/DateInstance.h',
+ 'runtime/DateInstanceCache.h',
'runtime/DatePrototype.cpp',
'runtime/DatePrototype.h',
'runtime/Error.cpp',
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 6cdf906..bf25a85 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -665,6 +665,10 @@
>
</File>
<File
+ RelativePath="..\..\runtime\DateInstanceCache.h"
+ >
+ </File>
+ <File
RelativePath="..\..\runtime\DatePrototype.cpp"
>
</File>
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 2779d04..c908296 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -157,6 +157,7 @@
148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86D0255597D01FF60F7 /* Nodes.cpp */; };
148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; };
149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; };
+ 14A1563210966365006FA260 /* DateInstanceCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A1563010966365006FA260 /* DateInstanceCache.h */; };
14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */; };
14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */; };
14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -615,6 +616,7 @@
148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContextRefPrivate.h; sourceTree = "<group>"; };
149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebuggerCallFrame.cpp; sourceTree = "<group>"; };
149B24FF0D8AF6D1009CB8C7 /* Register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Register.h; sourceTree = "<group>"; };
+ 14A1563010966365006FA260 /* DateInstanceCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateInstanceCache.h; sourceTree = "<group>"; };
14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITStubs.cpp; sourceTree = "<group>"; };
14A396A60CD2933100B5B4FF /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeoutChecker.cpp; sourceTree = "<group>"; };
@@ -1416,7 +1418,6 @@
7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
isa = PBXGroup;
children = (
- A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
BCF605110E203EF800B9A64D /* ArgList.cpp */,
BCF605120E203EF800B9A64D /* ArgList.h */,
BC257DE50E1F51C50016B6C9 /* Arguments.cpp */,
@@ -1450,6 +1451,7 @@
D21202290AD4310C00ED79B6 /* DateConversion.h */,
BC1166000E1997B1008066DD /* DateInstance.cpp */,
BC1166010E1997B1008066DD /* DateInstance.h */,
+ 14A1563010966365006FA260 /* DateInstanceCache.h */,
BCD203470E17135E002C7E82 /* DatePrototype.cpp */,
BCD203480E17135E002C7E82 /* DatePrototype.h */,
BC337BEA0E1B00CB0076918A /* Error.cpp */,
@@ -1513,6 +1515,7 @@
BC02E9B60E1842FA000F9297 /* JSString.cpp */,
F692A8620255597D01FF60F7 /* JSString.h */,
14ABB454099C2A0F00E2A24F /* JSType.h */,
+ 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */,
F692A8870255597D01FF60F7 /* JSValue.cpp */,
14ABB36E099C076400E2A24F /* JSValue.h */,
BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */,
@@ -1523,6 +1526,9 @@
A7E2EA690FB460CF00601F06 /* LiteralParser.h */,
F692A8680255597D01FF60F7 /* Lookup.cpp */,
F692A8690255597D01FF60F7 /* Lookup.h */,
+ A74B3498102A5F8E0032AB98 /* MarkStack.cpp */,
+ A779558F101A74D500114E55 /* MarkStack.h */,
+ A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */,
F692A86A0255597D01FF60F7 /* MathObject.cpp */,
F692A86B0255597D01FF60F7 /* MathObject.h */,
BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */,
@@ -1543,6 +1549,8 @@
BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */,
F692A8770255597D01FF60F7 /* Operations.cpp */,
F692A8780255597D01FF60F7 /* Operations.h */,
+ A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
+ A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */,
65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */,
65400C100A69BAF200509887 /* PropertyNameArray.h */,
@@ -1583,13 +1591,8 @@
14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */,
5D53726D0E1C546B0021E549 /* Tracing.d */,
5D53726E0E1C54880021E549 /* Tracing.h */,
- 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */,
F692A8850255597D01FF60F7 /* UString.cpp */,
F692A8860255597D01FF60F7 /* UString.h */,
- A779558F101A74D500114E55 /* MarkStack.h */,
- A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */,
- A74B3498102A5F8E0032AB98 /* MarkStack.cpp */,
- A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
);
path = runtime;
sourceTree = "<group>";
@@ -1998,6 +2001,7 @@
A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */,
148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */,
+ 14A1563210966365006FA260 /* DateInstanceCache.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/JavaScriptCore/runtime/DateInstance.cpp b/JavaScriptCore/runtime/DateInstance.cpp
index c41b3e1..1a9bad0 100644
--- a/JavaScriptCore/runtime/DateInstance.cpp
+++ b/JavaScriptCore/runtime/DateInstance.cpp
@@ -32,59 +32,42 @@ using namespace WTF;
namespace JSC {
-struct DateInstance::Cache {
- double m_gregorianDateTimeCachedForMS;
- GregorianDateTime m_cachedGregorianDateTime;
- double m_gregorianDateTimeUTCCachedForMS;
- GregorianDateTime m_cachedGregorianDateTimeUTC;
-};
-
const ClassInfo DateInstance::info = {"Date", 0, 0, 0};
DateInstance::DateInstance(NonNullPassRefPtr<Structure> structure)
: JSWrapperObject(structure)
- , m_cache(0)
{
}
DateInstance::DateInstance(ExecState* exec, double time)
: JSWrapperObject(exec->lexicalGlobalObject()->dateStructure())
- , m_cache(0)
{
setInternalValue(jsNumber(exec, timeClip(time)));
}
-DateInstance::~DateInstance()
+bool DateInstance::getGregorianDateTime(ExecState* exec, bool outputIsUTC, GregorianDateTime& t) const
{
- delete m_cache;
-}
-
-bool DateInstance::getGregorianDateTime(bool outputIsUTC, GregorianDateTime& t) const
-{
- if (!m_cache) {
- m_cache = new Cache;
- m_cache->m_gregorianDateTimeCachedForMS = NaN;
- m_cache->m_gregorianDateTimeUTCCachedForMS = NaN;
- }
-
double milli = internalNumber();
if (isnan(milli))
return false;
+ if (!m_data)
+ m_data = exec->globalData().dateInstanceCache.add(milli);
+
if (outputIsUTC) {
- if (m_cache->m_gregorianDateTimeUTCCachedForMS != milli) {
- WTF::msToGregorianDateTime(internalNumber(), true, m_cache->m_cachedGregorianDateTimeUTC);
- m_cache->m_gregorianDateTimeUTCCachedForMS = milli;
+ if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) {
+ WTF::msToGregorianDateTime(internalNumber(), true, m_data->m_cachedGregorianDateTimeUTC);
+ m_data->m_gregorianDateTimeUTCCachedForMS = milli;
}
- t.copyFrom(m_cache->m_cachedGregorianDateTimeUTC);
+ t.copyFrom(m_data->m_cachedGregorianDateTimeUTC);
} else {
- if (m_cache->m_gregorianDateTimeCachedForMS != milli) {
- WTF::msToGregorianDateTime(internalNumber(), false, m_cache->m_cachedGregorianDateTime);
- m_cache->m_gregorianDateTimeCachedForMS = milli;
+ if (m_data->m_gregorianDateTimeCachedForMS != milli) {
+ WTF::msToGregorianDateTime(internalNumber(), false, m_data->m_cachedGregorianDateTime);
+ m_data->m_gregorianDateTimeCachedForMS = milli;
}
- t.copyFrom(m_cache->m_cachedGregorianDateTime);
+ t.copyFrom(m_data->m_cachedGregorianDateTime);
}
-
+
return true;
}
diff --git a/JavaScriptCore/runtime/DateInstance.h b/JavaScriptCore/runtime/DateInstance.h
index 0af8451..63642f2 100644
--- a/JavaScriptCore/runtime/DateInstance.h
+++ b/JavaScriptCore/runtime/DateInstance.h
@@ -33,7 +33,6 @@ namespace JSC {
public:
DateInstance(ExecState*, double);
explicit DateInstance(NonNullPassRefPtr<Structure>);
- virtual ~DateInstance();
double internalNumber() const { return internalValue().uncheckedGetNumber(); }
@@ -44,7 +43,7 @@ namespace JSC {
static JS_EXPORTDATA const ClassInfo info;
- bool getGregorianDateTime(bool outputIsUTC, WTF::GregorianDateTime&) const;
+ bool getGregorianDateTime(ExecState*, bool outputIsUTC, WTF::GregorianDateTime&) const;
static PassRefPtr<Structure> createStructure(JSValue prototype)
{
@@ -57,9 +56,7 @@ namespace JSC {
private:
virtual const ClassInfo* classInfo() const { return &info; }
-
- struct Cache;
- mutable Cache* m_cache;
+ mutable RefPtr<DateInstanceData> m_data;
};
DateInstance* asDateInstance(JSValue);
diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp
index 18561d2..754ff1c 100644
--- a/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/JavaScriptCore/runtime/DatePrototype.cpp
@@ -255,7 +255,7 @@ static JSCell* formatLocaleDate(ExecState* exec, DateInstance* dateObject, doubl
{
GregorianDateTime gregorianDateTime;
const bool outputIsUTC = false;
- if (!dateObject->getGregorianDateTime(outputIsUTC, gregorianDateTime))
+ if (!dateObject->getGregorianDateTime(exec, outputIsUTC, gregorianDateTime))
return jsNontrivialString(exec, "Invalid Date");
return formatLocaleDate(exec, gregorianDateTime, format);
}
@@ -426,7 +426,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec, JSObject*, JSValue
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
return jsNontrivialString(exec, formatDate(t) + " " + formatTime(t, outputIsUTC));
}
@@ -441,7 +441,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, outputIsUTC));
}
@@ -456,7 +456,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
// Maximum amount of space we need in buffer: 6 (max. digits in year) + 2 * 5 (2 characters each for month, day, hour, minute, second) + 4 (. + 3 digits for milliseconds)
// 6 for formatting and one for null termination = 27. We add one extra character to allow us to force null termination.
@@ -476,7 +476,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToDateString(ExecState* exec, JSObject*, JSVa
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
return jsNontrivialString(exec, formatDate(t));
}
@@ -491,7 +491,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSVa
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
return jsNontrivialString(exec, formatTime(t, outputIsUTC));
}
@@ -541,7 +541,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, 1900 + t.year);
}
@@ -556,7 +556,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JS
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, 1900 + t.year);
}
@@ -571,7 +571,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNontrivialString(exec, "Invalid Date");
return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, outputIsUTC));
}
@@ -586,7 +586,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.month);
}
@@ -601,7 +601,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.month);
}
@@ -616,7 +616,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue t
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.monthDay);
}
@@ -631,7 +631,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValu
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.monthDay);
}
@@ -646,7 +646,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue th
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.weekDay);
}
@@ -661,7 +661,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.weekDay);
}
@@ -676,7 +676,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.hour);
}
@@ -691,7 +691,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSVal
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.hour);
}
@@ -706,7 +706,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValu
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.minute);
}
@@ -721,7 +721,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSV
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.minute);
}
@@ -736,7 +736,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValu
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.second);
}
@@ -751,7 +751,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSV
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, t.second);
}
@@ -796,7 +796,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*,
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
return jsNumber(exec, -gmtoffset(t) / minutesPerHour);
}
@@ -832,7 +832,7 @@ static JSValue setNewValueFromTimeArgs(ExecState* exec, JSValue thisValue, const
double ms = milli - secs * msPerSecond;
GregorianDateTime t;
- thisDateObj->getGregorianDateTime(inputIsUTC, t);
+ thisDateObj->getGregorianDateTime(exec, inputIsUTC, t);
if (!fillStructuresUsingTimeArgs(exec, args, numArgsToUse, &ms, &t)) {
JSValue result = jsNaN(exec);
@@ -868,7 +868,7 @@ static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const
else {
double secs = floor(milli / msPerSecond);
ms = milli - secs * msPerSecond;
- thisDateObj->getGregorianDateTime(inputIsUTC, t);
+ thisDateObj->getGregorianDateTime(exec, inputIsUTC, t);
}
if (!fillStructuresUsingDateArgs(exec, args, numArgsToUse, &ms, &t)) {
@@ -991,7 +991,7 @@ JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue t
else {
double secs = floor(milli / msPerSecond);
ms = milli - secs * msPerSecond;
- thisDateObj->getGregorianDateTime(outputIsUTC, t);
+ thisDateObj->getGregorianDateTime(exec, outputIsUTC, t);
}
bool ok = true;
@@ -1018,7 +1018,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue t
DateInstance* thisDateObj = asDateInstance(thisValue);
GregorianDateTime t;
- if (!thisDateObj->getGregorianDateTime(outputIsUTC, t))
+ if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t))
return jsNaN(exec);
// NOTE: IE returns the full year even in getYear.
diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h
index 3ad90ad..d2aa2da 100644
--- a/JavaScriptCore/runtime/JSGlobalData.h
+++ b/JavaScriptCore/runtime/JSGlobalData.h
@@ -30,6 +30,7 @@
#define JSGlobalData_h
#include "Collector.h"
+#include "DateInstanceCache.h"
#include "ExecutableAllocator.h"
#include "JITStubs.h"
#include "JSValue.h"
@@ -116,7 +117,8 @@ namespace JSC {
const MarkedArgumentBuffer* emptyList; // Lists are supposed to be allocated on the stack to have their elements properly marked, which is not the case here - but this list has nothing to mark.
SmallStrings smallStrings;
NumericStrings numericStrings;
-
+ DateInstanceCache dateInstanceCache;
+
#if ENABLE(ASSEMBLER)
ExecutableAllocator executableAllocator;
#endif
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 006881f..c97363c 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-27 Geoffrey Garen <ggaren at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Updated for JavaScriptCore export changes.
+
+ * ForwardingHeaders/wtf/DateMath.h: Added.
+
2009-10-27 Dan Bernstein <mitz at apple.com>
Reviewed by Darin Adler.
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/DateMath.h b/JavaScriptGlue/ForwardingHeaders/wtf/DateMath.h
new file mode 100644
index 0000000..becafe1
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/DateMath.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/DateMath.h>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list