Commit Graph

43 Commits

Author SHA1 Message Date
mstarzinger@chromium.org
38754b4e12 Move more builtin files to strict mode.
R=rossberg@chromium.org
BUG=v8:1955
LOG=N

Review URL: https://codereview.chromium.org/279543002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-05-12 08:43:01 +00:00
bmeurer@chromium.org
d4b533d41b Bulk update of Google copyright headers in source files.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/259183002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-29 06:42:26 +00:00
ulan@chromium.org
e1e4071cbc Fix date cache in strict mode.
BUG=v8:3220
LOG=N
TEST=mjsunit/regress/regress-3220.js
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/201753002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 15:47:58 +00:00
jochen@chromium.org
00ba711658 Use a per-isolate cache for the date object JS bits
The old per-context cache made it difficult for the embedder to notify
v8 of date/time configuration changes. The embedder had to enter all
contexts for the isolate and notify v8 for each context.

With the new per-isolate cache, the embedder only needs to notify v8
once per isolate.

BUG=348856
LOG=y
R=dcarney@chromium.org, ulan@chromium.org
TEST=cctest/test-date

Review URL: https://codereview.chromium.org/189913023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-11 09:04:14 +00:00
dslomov@chromium.org
d239fbfad6 Revert "Check and clear date cache in DateCurrentTime, DateLocalTimezone and getTimezoneOffset."
This reverts commit r19711 for breaking WebKit tests.
http://build.chromium.org/p/tryserver.chromium/builders/win_rel/builds/278551/steps/content_browsertests/logs/AccessibilityMessagesQueueWhileSwappedOut

TBR=ulan@chromium.org

Review URL: https://codereview.chromium.org/192903002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-10 16:05:29 +00:00
ulan@chromium.org
31f67939cb Check and clear date cache in DateCurrentTime, DateLocalTimezone and getTimezoneOffset.
BUG=142141
LOG=Y
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/173793002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-07 10:01:00 +00:00
ulan@chromium.org
cc401095fb Initialize Date parse cache with SMI instead of double to workaround sharing mutable heap numbers in snapshot.
This is the only field in the snapshot that was tracked as double.

R=verwaest@chromium.org
TEST=mjsunit/regress/regress-280531.js
BUG=280531
LOG=Y

Review URL: https://chromiumcodereview.appspot.com/112003005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18298 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-11 13:11:44 +00:00
yangguo@chromium.org
525876350d Add ES specification reference to DateNow.
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/89353002

Patch from Victor Costan <costan@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18094 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-11-27 09:39:41 +00:00
yangguo@chromium.org
8ef4b0ca83 Cosmetic: Add macros for NaN, undefined and Infinity to native js code.
Nobody should need to use $NaN, 0/0, 1/0 and void 0.

R=mvstanton@chromium.org
BUG=

Review URL: https://codereview.chromium.org/27491002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-17 10:02:45 +00:00
mstarzinger@chromium.org
6a260c3363 Move global code for builtins into setup functions.
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/14125004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-11 12:15:25 +00:00
jkummerow@chromium.org
1c086d1202 Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps and comparisons
Review URL: https://chromiumcodereview.appspot.com/10837165

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-14 15:59:45 +00:00
yangguo@chromium.org
1a0c14f12c Add checks to runtime functions.
BUG=

Review URL: https://chromiumcodereview.appspot.com/10915062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12471 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-10 08:35:26 +00:00
ulan@chromium.org
a47d1c0714 Fix the return type of the date set methods.
Date set methods (setMinutes, setHours, etc.) should return the time value as a number instead of JSDate.

R=jkummerow@chromium.org
TEST=test/mjsunit/regress/regress-2027.js

Review URL: https://chromiumcodereview.appspot.com/9809010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-26 10:13:03 +00:00
ulan@chromium.org
1767fef60b Implement date library functions in C++.
Developed together with Andreas Rossberg based on:
  https://chromiumcodereview.appspot.com/9117034/
  https://chromiumcodereview.appspot.com/9307083/

R=rossberg@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9572008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10983 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 12:07:29 +00:00
rossberg@chromium.org
13d31b6594 Implement caching scheme for Date fields.
This is based on https://chromiumcodereview.appspot.com/9117034/

Doesn't have much impact on its own, but is the basis for Ulan's CL https://chromiumcodereview.appspot.com/9117034/, which moves the logic to C++.

R=ulan@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9307083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10982 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 11:19:55 +00:00
rossberg@chromium.org
8604da7f06 New class for Date objects: caches individual date components.
First step, cache slots not used yet.

R=ulan@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9117034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 11:11:55 +00:00
rossberg@chromium.org
1336b913d0 Make built-ins strict mode conforming, and support a --use-strict flag.
* Turned all uses of 'const' into 'var'.
* Turned all uses of local 'function' into 'var'.
* Added a couple of missing toplevel 'var' declarations.

One consequence is that the properties on the builtin object  are no longer
non-writable, and I had to adapt one test. Is that a problem?

Unfortunately, we cannot actually switch the library scripts to strict mode
by default, because that makes observable things like poisoned .caller properties
for library functions.

Also removed dead flag code in Compiler::Compile.

R=yangguo@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9415010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-20 13:48:24 +00:00
lrn@chromium.org
c7fccff9af Clean up JavaScript files to better follow coding standard.
Multiline conditionals must use braces.
Semicolons are not optional.

Review URL: http://codereview.chromium.org/8701006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-28 12:11:00 +00:00
mstarzinger@chromium.org
330cd2205c Remove hidden prototype for builtin functions.
This is a deliberate non-conformity introduced more than 2 years ago to
be compatible with JSC. The current state is that all other browsers
perform ES5 conform in that regard.

R=erik.corry@gmail.com
BUG=chromium:1717,chromium:39662
TEST=test262/15.2.3.6-4-6??,mjsunit/undeletable-functions

Review URL: http://codereview.chromium.org/8566009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-15 09:44:57 +00:00
jkummerow@chromium.org
669bfc0363 Optimize JS date implementation for smi-only arrays
Review URL: http://codereview.chromium.org/8409010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-31 14:39:21 +00:00
mstarzinger@chromium.org
cd9bc6c3a6 Fix error handling in Date.prototype.toISOString.
This fixes Date.prototyoe.toISOString to throw a RangeError exception
for invalid time values. It also includes a fix to removes the arbitrary
(and completely bogus) range limit on the date value during construction
of a Date object. Note that we still have bogus range limits on the year
and month values.

R=lrn@chromium.org
BUG=v8:1792
TEST=mjsunit/date,test262/15.9.5.43-0-*

Review URL: http://codereview.chromium.org/8392036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9829 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-28 08:45:04 +00:00
lrn@chromium.org
ffffa716c5 Lock the prototype of internal classes.
Prototypes and their properties and methods are locked down to prevent fiddling with their operation, even if the build-in object leaks.

Made some built-in functions only work during bootstrapping.

Review URL: http://codereview.chromium.org/7799027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-05 07:30:35 +00:00
lrn@chromium.org
ff9ce1abd4 Make date parser handle all ES5 Date Time Strings correctly.
This means that ES5 Date Time Strings will default to UTC if timezone is absent.
Handle as many legacy strings as possible the same way as before

BUG=v8:1498
TEST=mjsunit/date

Review URL: http://codereview.chromium.org/7291022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-01 11:41:45 +00:00
ricow@chromium.org
e0eb110130 Reapply 7763, including arm and x64 variants.
The only difference to revision 7763 is the implementation in the
builtins file for arm and x64, plus a move of Array.prototype.toString
and Array.prototype.toLocaleString from should throw on null or
undefined to the non generic test cases in the function-call test (due
to us not currently supporting generic cases with these to functions)
Review URL: http://codereview.chromium.org/6928007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-05 05:21:30 +00:00
ricow@chromium.org
4d890da191 Revert 7763, missing implementation on x64 and arm for call and apply with null or undefined.
Review URL: http://codereview.chromium.org/6913024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7764 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 13:45:19 +00:00
ricow@chromium.org
2b730c2bf6 Don't exchange null and undefined with the global object in function.prototype.{call, apply} for natives.
This makes us compatible with firefox in throwing an exception when
call is invoked on a builtin with null as the this argument.
Review URL: http://codereview.chromium.org/6902104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7763 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 13:19:04 +00:00
whesse@chromium.org
7233a930b5 X64 Crankshaft: Add test that fails on x64 Crankshaft build to list of skipped mjsunit tests. Fix comments and remove unused function from date.js.
BUG=1153
TEST=mjsunit/date-parse
Review URL: http://codereview.chromium.org/6516011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-14 13:57:15 +00:00
ager@chromium.org
f8b74a1541 Avoid using Function.prototype.call in a number of places in our
builtins files. We should always use %_CallFunction for a couple of
reasons: it cannot be overwritten and it does not wrap basic types in
wrapper objects.

Review URL: http://codereview.chromium.org/6349018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 10:33:10 +00:00
sandholm@chromium.org
37567c42da Introduce NUMBER_IS_FINITE macro to avoid ToNumber() conversion.
Review URL: http://codereview.chromium.org/5977006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6111 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-22 13:19:25 +00:00
sgjesse@chromium.org
648fcd906e Adding Date::ResetCache() API so that the cache values in the Date object
can be reset to allow DST / timezone changes to be re-cached and reflected
in the Date object.

Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/5978001


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-17 12:45:27 +00:00
ager@chromium.org
1b67320800 Perform more aggressive time to NaN conversions. Our internal date
methods rely on the time values passed in being within a certain range
- not significantly larger than the the ECMA 262 specified time
range. When creating a time, always make it NaN if there is no way
that it can be within range even after UTC conversion.

Review URL: http://codereview.chromium.org/5905003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6048 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-16 13:02:09 +00:00
lrn@chromium.org
f118f44130 Fix regression in JSON serialization of RegExps.
Tweaks to the serialization.

Review URL: http://codereview.chromium.org/5676005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 09:31:05 +00:00
ricow@chromium.org
01d7470b9b Remove trailing spaces from js files.
This is a cosmetic change only.

Review URL: http://codereview.chromium.org/3797009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5630 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-15 13:03:59 +00:00
ager@chromium.org
5ad7734a71 Decrease the DST cache increment to take into account the suspension
of DST in Egypt during Ramadan 2010.

Review URL: http://codereview.chromium.org/3122025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-18 07:01:07 +00:00
vitalyr@chromium.org
97234b4a25 Remove some extra calls in date.js.
A few hot Date.prototype functions used to be implemented as
DateGetFoo calling GetFooFrom(this), and other callers of GetFooFrom
did repeated date value extraction.  In this change GetFooFrom
functions were inlined into the functions on the prototype and the
other callers switched to using date values directly.

Review URL: http://codereview.chromium.org/2841041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-06 12:57:46 +00:00
ager@chromium.org
06a28cbe57 Fix bug in date code (issue 736) where -0 was not mapped to 0. This caused the
runtime system to throw an exception because it expected smi arguments.


Review URL: http://codereview.chromium.org/2848038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5013 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 20:09:33 +00:00
sandholm@chromium.org
67c04c8744 One element cache for localtime.
Review URL: http://codereview.chromium.org/2023005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4628 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 09:27:37 +00:00
ricow@chromium.org
6ceb02e6eb Added support for ES5 date time string format to Date.parse.
Review URL: http://codereview.chromium.org/1704016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4557 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 06:43:25 +00:00
whesse@chromium.org
388ad02863 Modify date printing to fetch time zone name before converting to local time, so that the two agree. Fix a problem in DateToTimeString() time zone calculation.
Review URL: http://codereview.chromium.org/1539009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 10:22:52 +00:00
whesse@chromium.org
9738049a65 Update the time zone offset and dst offset when time zone name changes.
Review URL: http://codereview.chromium.org/1543008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-31 12:20:32 +00:00
whesse@chromium.org
22025291da Fix time zone cache so it is not initialized when the snapshot is built.
Review URL: http://codereview.chromium.org/1576002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-30 14:29:32 +00:00
oleg@chromium.org
fe6522e80d Fix bug http://code.google.com/p/v8/issues/detail?id=659. Move the limits check for date before the time zone offset is applied.
Review URL: http://codereview.chromium.org/1075016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 14:47:02 +00:00
kasperl@chromium.org
7d6a3b433f Merge the partial_snapshots branch back into bleeding_edge. For
now, the custom call generator stuff is disabled.
Review URL: http://codereview.chromium.org/1094014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 11:40:38 +00:00