Commit Graph

37 Commits

Author SHA1 Message Date
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
yangguo@chromium.org
215ba8cfc9 Combine %_SubString and %_StringCharAt.
R=ulan@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-20 14:29:40 +00:00
yangguo@chromium.org
d7999dc42e Remove wrong uses of InternalPackedArray.
R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13679 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 16:21:03 +00:00
yangguo@chromium.org
01f4cb0951 Introduce InternalPackedArray.
R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 15:20:05 +00:00
yangguo@chromium.org
e26012e771 Fix JSON.stringify wrt harmony proxies.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12851 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 10:53:56 +00:00
yangguo@chromium.org
e8d91b424c Handle edge cases in basic JSON.stringify.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-02 14:46:57 +00:00
yangguo@chromium.org
e50ee08ad6 Reland JSON.stringify reimplementation.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-22 14:22:58 +00:00
yangguo@chromium.org
e41250a390 Revert r12760 (JSON.stringify).
R=verwaest@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12783 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-22 11:11:22 +00:00
yangguo@chromium.org
7a653c1675 Reimplement a simpler version of JSON.stringify.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-18 14:42:26 +00:00
verwaest@chromium.org
53dd910bba Directly use %ObjectKeys in json stringify.
BUG=2312

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-03 08:37:47 +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
rossberg@chromium.org
e645597aa7 Implement function proxies (except for their use as constructors).
Introduce new %Apply native.

Extend Execution::Call to optionally handle receiver rewriting (needed for %Apply).

Fix Function.prototype.bind for functions that have .apply modified.

R=kmillikin@chromium.org
BUG=v8:1543
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-13 11:42:57 +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
ricow@chromium.org
025c05dc25 Remove trailing whitespaces from *.js files.
This is a whitespace removal only change
Review URL: http://codereview.chromium.org/7687001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-19 05:24:39 +00:00
sandholm@chromium.org
a8921c4681 Inctroduce NewStrictSubstring to avoid check for SubString(str, 0, str.length). Cleanup JsonParser.
Review URL: http://codereview.chromium.org/7230006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8369 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-22 14:20:23 +00:00
sandholm@chromium.org
ba229754ea Fix JSON issue with arrays.
Review URL: http://codereview.chromium.org/7089003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-30 10:47:38 +00:00
sandholm@chromium.org
1feea6bbaa Minor JSON cleanup. Also added comment requested for r8086.
Review URL: http://codereview.chromium.org/7086026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-30 09:23:17 +00:00
sandholm@chromium.org
331e6102e6 JSON.stringify improvement. Fast case in C++ for string arrays.
Review URL: http://codereview.chromium.org/7077004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8081 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 13:58:48 +00:00
lrn@chromium.org
4707d7ac08 Stop using plain Arrays internally in built-in functions.
In built-in code we use arrays for internal computations.
This makes it possible to affect the built-in code by putting getters
or setters on the Array prototype chain.
This adds a new internal Array constructor that creates Arrays with
a very simplistic prototype chain that doesn't include any publicly
visible objects. These Arrays shoudl ofcourse never leak outside the
builtins, since that would expose the prototype object.
The prototype object contains only the array functions that we use:
push, pop and join (and not even a toString, so it doesn't stringify
well).

Also change uses of .call to %_CallFunction.

BUG=1206

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7040 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-03 11:49:03 +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
dd242e3fe1 Optimize JSON stringify by allowing QuoteJSONString to prefix with a comma.
Review URL: http://codereview.chromium.org/6335004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6337 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-16 21:29:32 +00:00
sandholm@chromium.org
5be396cb30 Optimize JSON stringify for arrays.
Review URL: http://codereview.chromium.org/6164004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6286 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-12 14:16:19 +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
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
sandholm@chromium.org
b36e346a08 Use the PushIfAbsent function for the JSON stringify stack.
Optimize ConvertToString.
Review URL: http://codereview.chromium.org/5614004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-08 09:10:36 +00:00
sandholm@chromium.org
209eb1c219 Improved JSON stringify.
Review URL: http://codereview.chromium.org/5578004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-06 15:41:07 +00:00
sandholm@chromium.org
26c05120b6 JSON stringify collects substrings in one builder array rather than using regular
string cons. 
Review URL: http://codereview.chromium.org/5567005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-06 11:44:16 +00:00
sandholm@chromium.org
fb93e5bc36 Simplify JSON stringify and add special case for default replacer and space.
Review URL: http://codereview.chromium.org/5551002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5916 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-03 11:12:02 +00:00
lrn@chromium.org
c2febfbfaf Move quoting of a JSON string to a specialized runtime function.
Previously used string replace regexp with function replacement.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5909 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-01 10:04:34 +00:00
lrn@chromium.org
938d88e193 Separate JSON parsing from the JavaScript parser.
Switch JSON parsing to creating the value directly instead of createing
code to create the value.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-27 09:19:43 +00:00
lrn@chromium.org
fce2fad17e Fix bug in JSON character quote table.
Review URL: http://codereview.chromium.org/3349006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5399 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-02 07:35:35 +00:00
lrn@chromium.org
6670c0ad38 Make JSON.stringify not quote non-ASCII characters. Fix bug 855.
Review URL: http://codereview.chromium.org/3336001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-02 07:09:28 +00:00
ager@chromium.org
0f4a330508 Fix JSON.parse typo which causes the input not to be string converted.
Review URL: http://codereview.chromium.org/2981004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 10:57:45 +00:00
ricow@chromium.org
eff34b9952 Update JSON.stringify to floor the space parameter (fixes issue 753).
Review URL: http://codereview.chromium.org/2877004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-29 07:22:40 +00:00
ager@chromium.org
b71fe5b61e Fix bug in JSON.stringify where Boolean objects are incorrectly
unwrapped.

This fixes issue 752.
Review URL: http://codereview.chromium.org/2845023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-25 07:45:52 +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