Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateInstance.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18 * USA
19 *
20 */
21
22 #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/
23 #include "DateInstance.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateInstance.h`/
24
25 #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/
26
27 #include <wtf/DateMath.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/DateMath.h`/
28 #include <wtf/MathExtras.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/MathExtras.h`/
29
30 using namespace WTFcxx . . $ `<built-in>:467:9`!;
31
32 namespace JSCcxx . . $ `<built-in>:463:9`! {
33
34 const ClassInfocxx . . $ QTJSC/ClassInfo# DateInstancecxx . . $ QTJSC/DateInstance#::infocxx . . $ QTJSC/DateInstance#info. = {"Date", 0, 0, 0};
35
36 DateInstancecxx . . $ QTJSC/DateInstance#::DateInstancecxx . . $ QTJSC/DateInstance#DateInstance(aad11863945fc14a).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure)
37 : JSWrapperObjectcxx . . $ QTJSC/JSWrapperObject#(structure)
38 {
39 setInternalValuecxx . . $ QTJSC/JSWrapperObject#setInternalValue(5c2ac18db087b3e6).(jsNaNcxx . . $ QTJSC/jsNaN(3fbe51058e39576a).(exec));
40 }
41
42 DateInstancecxx . . $ QTJSC/DateInstance#::DateInstancecxx . . $ QTJSC/DateInstance#DateInstance(33eae00a62075347).(ExecStatecxx . . $ QTJSC/ExecState#* exec, double time)
43 : JSWrapperObjectcxx . . $ QTJSC/JSWrapperObject#(exec->lexicalGlobalObjectcxx . . $ QTJSC/ExecState#lexicalGlobalObject(3d50c730b5e26899).()->dateStructurecxx . . $ QTJSC/JSGlobalObject#dateStructure(a25848528202c7a).())
44 {
45 setInternalValuecxx . . $ QTJSC/JSWrapperObject#setInternalValue(5c2ac18db087b3e6).(jsNumbercxx . . $ QTJSC/jsNumber(88e66938454912cb).(exec, timeClipcxx . . $ QTWTF/timeClip(447c67c6676f75c3).(time)));
46 }
47
48 const GregorianDateTimecxx . . $ QTJSC/GregorianDateTime#* DateInstancecxx . . $ QTJSC/DateInstance#::calculateGregorianDateTimecxx . . $ QTJSC/DateInstance#calculateGregorianDateTime(24e9d5025e7f44d0).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const
49 {
50 double milli = internalNumbercxx . . $ QTJSC/DateInstance#internalNumber(21b6c25e127938e2).();
51 if (stdcxx . . $ std/::isnan(milli))
52 return 0;
53
54 if (!m_data)
55 m_data = exec->globalData().dateInstanceCache.add(milli);
56
57 if (m_data->m_gregorianDateTimeCachedForMS != milli) {
58 msToGregorianDateTimecxx . . $ QTJSC/msToGregorianDateTime(5de9dac720d4db69).(exec, milli, false, m_data->m_cachedGregorianDateTime);
59 m_data->m_gregorianDateTimeCachedForMS = milli;
60 }
61 return &m_data->m_cachedGregorianDateTime;
62 }
63
64 const GregorianDateTimecxx . . $ QTJSC/GregorianDateTime#* DateInstancecxx . . $ QTJSC/DateInstance#::calculateGregorianDateTimeUTCcxx . . $ QTJSC/DateInstance#calculateGregorianDateTimeUTC(24e9d5025e7f44d0).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const
65 {
66 double milli = internalNumbercxx . . $ QTJSC/DateInstance#internalNumber(21b6c25e127938e2).();
67 if (stdcxx . . $ std/::isnan(milli))
68 return 0;
69
70 if (!m_data)
71 m_data = exec->globalData().dateInstanceCache.add(milli);
72
73 if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) {
74 msToGregorianDateTimecxx . . $ QTJSC/msToGregorianDateTime(5de9dac720d4db69).(exec, milli, true, m_data->m_cachedGregorianDateTimeUTC);
75 m_data->m_gregorianDateTimeUTCCachedForMS = milli;
76 }
77 return &m_data->m_cachedGregorianDateTimeUTC;
78 }
79
80 } // namespace JSC