Commit Graph

2596 Commits

Author SHA1 Message Date
mstarzinger@chromium.org
83d912f0e4 Make heap size estimation more accurate.
This improves the heap size estimation by not counting lazy swept pages
as completely allocated but use their live bytes counter instead.

R=vegorov@chromium.org
BUG=v8:1893
TEST=cctest/test-heap/TestSizeOfObjects

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10383 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-11 10:33:34 +00:00
vegorov@chromium.org
c92a3949ea Fix build failure introduced by r10380
TBR=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10381 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-11 09:49:47 +00:00
vegorov@chromium.org
74ef753067 Change inlined cache of intanceof stub to use indirection through cell.
The stub was directly patching caller's code without issuing write barrier which violated incremental marking invariants.

R=mstarzinger@chromium.org
BUG=http://crbug.com/109448
TEST=cctest/test-heap/InstanceOfStubWriteBarrier

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-11 09:39:37 +00:00
erik.corry@gmail.com
dc9910f4a4 Minor cleanups of numeric seeded hashing patch.
Review URL: http://codereview.chromium.org/9155010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-10 13:24:18 +00:00
erik.corry@gmail.com
6178a8d42c Add seed to hash of numeric keyed properties. This is a commit of http://codereview.chromium.org/9148006/ for Fedor Indutny.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-10 12:58:41 +00:00
danno@chromium.org
df8b359f41 Fix handling of -0.0 in IsInt32/IsUInt32
R=ager@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-10 10:05:45 +00:00
erik.corry@gmail.com
4bea3b5c54 Fix test-hashing after recent changes to string hashing.
Acriave test-hashing in SCons and buildbot runs.
Small cleanups in root register handling on ARM and MIPS.
Review URL: http://codereview.chromium.org/9110029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-06 11:33:20 +00:00
vegorov@chromium.org
c4d3a110a2 Adjust position recorded for call expressions.
For calls of the form ident(...) record position of the identifier as the position of the call. For other calls record positions of the opening parenthesis.

This guarantees that for expressions of the form function(){}() call position will not intersect with positions recorded for function literal which is used by the debugger for scope chain resolution.

R=kmillikin@chromium.org
BUG=http://crbug.com/109195
TEST=test/mjsunit/regress/regress-109195.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-06 10:26:17 +00:00
ulan@chromium.org
746ef93362 Move handlified functions from handles.cc to objects.cc
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-05 17:16:19 +00:00
erik.corry@gmail.com
9de3992837 Fix broken test that assumes that no GC can clear the regexp
cache (GC can happen at any time due to Crankshaft).
Review URL: http://codereview.chromium.org/9113012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10343 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-05 13:16:15 +00:00
mstarzinger@chromium.org
e79274abe6 Fix handling of bogus receivers for Harmony collections.
R=rossberg@chromium.org
BUG=v8:1884
TEST=mjsunit/harmony/collections

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-05 12:55:06 +00:00
erik.corry@gmail.com
81a0271004 Randomize the seed used for string hashing. This helps guard against
CPU-eating DOS attacks against node.js servers.  Based on code from
Bert Belder.  This version only solves the issue for those that compile
V8 themselves or those that do not use snapshots.  A snapshot-based
precompiled V8 will still have predictable string hash codes.
Review URL: http://codereview.chromium.org/9086006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-04 15:12:15 +00:00
yangguo@chromium.org
f953e7fcea Fix windows build.
Review URL: http://codereview.chromium.org/8983014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-04 09:58:21 +00:00
yangguo@chromium.org
d9f7cf819c Implement callback when script finishes running in V8 API.
TEST=test-api/LeaveScriptCallback

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-04 08:48:35 +00:00
danno@chromium.org
f648626eb9 Reland 10309: Ensure large Smi-only arrays don't transition to FAST_DOUBLE_ARRAY
TBR=jkummerow@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-30 14:28:14 +00:00
danno@chromium.org
5d85a04472 Rollback 10309
TBR=jkummerow@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-30 13:42:21 +00:00
danno@chromium.org
dff0e36d2d Ensure large Smi-only arrays don't transition to FAST_DOUBLE_ARRAY
BUG=v8:1849
TEST=test/mjsunit/regress/regress-1849.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10309 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-30 12:54:23 +00:00
danno@chromium.org
aa38094bf0 Ensure that InternalArrays remain InternalArrays regardless of how they are constructed.
R=whesse@chromium.org
BUG=v8:1878
TEST=test/mjsunit/regress/regress-1878.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-27 15:12:12 +00:00
vegorov@chromium.org
3947056c03 Avoid embedding new space objects into code objects in the lithium gap resolver.
R=danno@chromium.org
BUG=http://crbug.com/108296
TEST=test/mjsunit/regress/regress-108296.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10301 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-23 10:39:01 +00:00
mstarzinger@chromium.org
aae7033ba1 Fix JavaScript accessors on objects with interceptors.
This fixes how Object.defineProperty() defines JavaScript accessors on
objects with installed API interceptors. The definition itself does not
cause any interceptors to be called, whereas any subsequent accesses on
said object will still fire the interceptor. This behavior is in sync
with API accessors.

R=rossberg@chromium.org
BUG=v8:1651,chromium:94666
TEST=cctest/test-api

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-21 16:14:38 +00:00
mstarzinger@chromium.org
04f0e33229 Fix handling of foreign callbacks in DefineOwnProperty.
We use foreign callbacks to make some properties shadow internal values
but still behave as data properties from within JavaScript. This means
when a value is passed to Object.defineProperty() on such a property,
it should update the internal value instead of redefinind the property
and destroying the shadowing.

R=rossberg@chromium.org
BUG=v8:1530
TEST=mjsunit/regress/regress-1530,test262/S15.3.3.1_A4

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-20 08:49:51 +00:00
fschneider@chromium.org
6c0a4f5d45 Fix bug with filtering of foreign context maps in the type feedback.
The first attempt did not properly handle keyed loads/stores and
did not check the constructors of the objects in the prototype
chain.

Added two more tests to handle the fixed cases.

BUG=v8:1823
TEST=LeakGlobalObjectViaMapKeyed,LeakGlobalContextViaMapProto
Review URL: http://codereview.chromium.org/8974009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10277 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-19 12:39:52 +00:00
mstarzinger@chromium.org
8450a9b88d Fix Test262 command line in test harness.
This just simplifies the command line used to run test cases, allowing
to copy them from the test harness output without editing. The passed
expression is obsolete by now.

R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-16 13:37:20 +00:00
mstarzinger@chromium.org
03a2fc23b6 Remove bogus writability check in DefineGetterSetter.
R=rossberg@chromium.org
TEST=test262

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-16 12:54:08 +00:00
yangguo@chromium.org
538fb2b8b4 Fix cctest/test-hashing on MIPS.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-15 14:24:07 +00:00
fschneider@chromium.org
d1e762d782 Temporarily disable new test until no-snapshot version is fixed.
Review URL: http://codereview.chromium.org/8957004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-15 10:08:25 +00:00
mstarzinger@chromium.org
d22b86a583 Mark Test262 test cases for known issue 1475.
R=rossberg@chromium.org
BUG=v8:1475
TEST=test262/15.2.3.6-4-4??

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 14:55:16 +00:00
fschneider@chromium.org
b6b4af9d89 Filter out maps from different global context when collecting type feedback.
This avoid leaking memory because optimized code may hold on to maps
from different tabs otherwise.

BUG=v8:1823, 102895
Review URL: http://codereview.chromium.org/8892002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 14:01:54 +00:00
jkummerow@chromium.org
0438c76185 Fix outdated test expectations for array literal crankshafting
TEST=nosnap builder green

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 13:32:34 +00:00
jkummerow@chromium.org
106973c3d2 Create missing boilerplate for array literals instead of deoptimizing
BUG=107370
TEST=new additions to mjsunit/array-literal-transitions

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 13:01:27 +00:00
mstarzinger@chromium.org
502039a6bd Fix invalid usage of StoreIC_ArrayLength optimization.
This introduces an additional check into the StoreIC_ArrayLength builtin
checking that the array still has fast properties. Redifinitions of the
length property that would cause it's type or attributes to change, will
switch to slow properties, thereby invalidating said optimization.

R=svenpanne@chromium.org
BUG=v8:1756
TEST=test262

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 12:46:32 +00:00
yangguo@chromium.org
4cd99d7cb9 Handle external strings in generated code when concatenating short strings.
TEST=string-external-cached.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 10:32:22 +00:00
fschneider@chromium.org
cf8e2b01e4 Landing forgotten mjsunit test file from previous CL.
Patch by Fedor Indutny <fedor.indutny@gmail.com>.

Original code review: http://codereview.chromium.org/8857001/
Review URL: http://codereview.chromium.org/8935006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10245 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-13 17:13:47 +00:00
jkummerow@chromium.org
91efb313eb Fix crash in d8 when external array ctor hits stack overflow
BUG=100859
TEST=mjsunit/regress/regress-crbug-100859

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-13 13:51:58 +00:00
vegorov@chromium.org
a2159a6bb9 Fix GCC 4.7 warnings, which are related to char being signed in GCC
("narrowing conversion ... inside { } is ill-formed in C++11").

* src/mksnapshot.cc: Cast "char" to "unsigned char" when outputting snapshot.
* test/cctest/test-regexp.cc: Use static_cast to uc16 as the char
literal is signed.

Review URL: http://codereview.chromium.org/8825003
Patch from Tobias Burnus <burnus@net-b.de>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10241 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-13 13:02:08 +00:00
yangguo@chromium.org
94f9aa3a0d Avoid using an invalid working directory in mjsunit/d8-os.
This test deleted its working directory and then tried to run several
shell commands which caused a failure on nfs.

Changes:
-TEST_DIR is only removed at the very end of the test
-the working directory is changed to /tmp at the beginning so that
 every iteration (when running with --stress-opt) has a valid working directory

BUG=
TEST=

Review URL: http://codereview.chromium.org/8936004
Patch from Daniel Kalmar <kalmard@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10240 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-13 12:57:33 +00:00
mstarzinger@chromium.org
4dd5bb2892 Fix another corner case for DefineOwnProperty on arrays.
R=rossberg@chromium.org
BUG=v8:1756
TEST=test262

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-12 10:20:46 +00:00
yangguo@chromium.org
a7f0c72e2d Fixing bug introduced in r10210 that crashes v8 raytrace benchmark.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10226 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-09 12:11:56 +00:00
yangguo@chromium.org
ce86c1bfb1 Avoid bailing out to runtime for short substrings.
This significantly improves the speed for creating short substrings (less than 13 characters) from slices, flat cons strings and external strings.

TEST=string-external-cached.js, string-slices.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-09 10:04:58 +00:00
keuchel@chromium.org
f1649cf39c Hydrogen support for context allocated harmony bindings.
This CL adds support for loading from and storing to context slots
belonging to harmony let or const bound variables. Checks for the
hole value are performed and the function is deoptimized if they fail.
The full-codegen generated code will take care of properly throwing
a reference error in these cases.

TEST=mjsunit/harmony/block-let-crankshaft.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-09 09:50:30 +00:00
danno@chromium.org
ef54f5690f Support Smi->Double->HeapObject transitions in constructed Arrays.
Also several bugs with Smi/double elements handling and make Ensure* routines more flexible.

BUG=none
TEST=test/mjsunit/array-construct-transition.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-09 08:50:19 +00:00
vegorov@chromium.org
a457040ca6 Ensure that non-optimized code objects are not flushed for inlined functions.
Collector was flushing them if optimized code was reachable only through the stack (not through the JSFunction object) which happens when you have a pending lazy deoptimization.

Also prevent v8::Script::New from leaking internal objects allocated by the compiler into outer HandleScope.

R=kmillikin@chromium.org
BUG=http://crbug.com/97116
TEST=test/mjsunit/regress/regress-97116.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-08 16:07:07 +00:00
ulan@chromium.org
0fd7350595 Relax test condition to make it less brittle.
BUG=
TEST=cctest/test-api/IdleNotificationWithHint

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-07 16:08:09 +00:00
keuchel@chromium.org
410219c8f3 Sync parser and preparser on do-while and return statements.
This CL fixes the preparser to have the same liberal automatic semicolon
insertion behaviour as the parser. In the case of a return statement in
global code we throw a syntax error at runtime rather than an early error
due to compatibility with KJS. However that hack allowed the following
syntactically incorrect program in global code in the parser but not in
the preparser:
  if (false) return else {}
while the slightly saner version with the obligatory semicolon
  if (false) return; else {}
was disallowed in the parser, but the preparser allowed it. This CL also
fixes that issue.

BUG=v8:1856
TEST=cctest/test-parsing.cc

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-07 16:03:29 +00:00
fschneider@chromium.org
c1662a199b Fix a bug with register use in optimized Math.round.
We're not allowed to modify the input register and have to
use a temporary instead, otherwise the result of expressions
containing Math.round can be wrong.

BUG=106351
TEST=test/mjsunit/compiler/regress-106351.js
Review URL: http://codereview.chromium.org/8833007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10190 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-07 10:13:46 +00:00
danno@chromium.org
b5b91b5add Fix nosnap build test failures.
TBR=jkummerow@chromium.org
BUG=none
TEST=less waterfall redness

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 22:27:15 +00:00
mikhail.naganov@gmail.com
dae713f0ad Reapply r10158: Distinguish weak references in heap snapshots, group GC roots.
[Fixed the bug revealed by the Win32 bot]

Several changes to better organize snapshot data:

1. Provide information about weak references.
2. Group (GC roots) children.
3. Prettify debug snapshot printing.

BUG=v8:1832
TEST=cctest/test-heap-profiler/*Weak*
TBR=vitalyr@chromium.org

Initial CL: http://codereview.chromium.org/8716009

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 17:41:47 +00:00
ulan@chromium.org
cda5b1a53f Use the old handler for low frequency idle notifications.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 14:30:21 +00:00
yangguo@chromium.org
e9688608cd Fix presubmit.
Review URL: http://codereview.chromium.org/8821016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10178 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 13:30:22 +00:00
yangguo@chromium.org
72827079ac Fixing mozilla test failures regarding Math.pow.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10177 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 13:14:46 +00:00