Commit Graph

1467 Commits

Author SHA1 Message Date
kaznacheev@chromium.org
cfbc1eed9c Prevent modification of cached normalized maps.
Finally sovles the problem that r5342 attempted to solve.
When adding a stub to a map's code cache we need to make
sure that this map is not used by object that do not need
this stub.

Existing solution had 2 flaws:
1. It checked that the map is cached by asking the current context.
If the object escaped into another context then NormalizedMapCache::Contains
returns false negative.

2. If a map gets evicted from the cache we should not try to modify it
even though Contains returns false.

This patch implements much less fragile solution of the same problem:
A map now has a flag (is_shared) that is set once the map is added
to a cache, stays set even after the cache eviction, and is cleared
if the object goes back to fast mode.

Added a regression test.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-24 08:18:33 +00:00
kaznacheev@chromium.org
5e572e4622 Support dec_b instruction in ia32 and x64 disassembler.
Review URL: http://codereview.chromium.org/3412028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5515 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-23 19:01:56 +00:00
vitalyr@chromium.org
48fd3dcaf9 Fix copy-on-write assert by setting the new array map early.
BUG=876

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-23 12:23:35 +00:00
vegorov@chromium.org
622351fedd Fix getOwnPropertyDescriptor() support for index properties.
Add support for index properties with getters, setters or indexed interceptors.

For indexed interceptor case only fix crashes, do not guarantee any semantic soundness. Separate issue opened for this http://code.google.com/p/v8/issues/detail?id=877

BUG=http://code.google.com/p/v8/issues/detail?id=874

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5512 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-23 11:25:01 +00:00
kaznacheev@chromium.org
06c867404b Dynamically determine optimal instance size.
The number of inobject properties used to be derived from the number
of this property assignments in the constructor (and increased by 2 to
allow for properties added later). This very often leads to wasted inobject 
slots.

This patch reclaims some of the unused inobject space by the following method:
 - for each constructor function the first several objects are allocated using the initial 
   ("generous) instance size estimation (this is called 'tracking phase').
 - during the tracking phase map transitions are tracked and actual property counts are collected.
 - at the end of the tracking phase instance sizes in the maps are decreased if necessary
   (starting with the function's initial map and traversing the transition tree).
 - all further allocation use more realistic instance size estimation.

Shrinking generously allocated objects without costly heap traversal is made possible 
by initializing their inobject properties with one_pointer_filler_map (instead of undefined). 

The initial slack for the generous allocation is increased from 2 to 6 which really helps some tests.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-23 09:15:26 +00:00
antonm@chromium.org
31284c01f8 Fix a build for Win64 with VS2008.
It complaints of type conversions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-22 13:57:00 +00:00
antonm@chromium.org
88eb06098e Fix Win64 build with VS2008.
strlen returns size_t and VS2008 is now pretty picky about that.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-22 13:24:14 +00:00
lrn@chromium.org
0dece535d9 RegExp: Fix caching to correctly set lastIndex.
BUG: 52801

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-22 11:22:57 +00:00
vitalyr@chromium.org
a6bbe9820e Custom call IC for Math.floor.
Review URL: http://codereview.chromium.org/3327022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-21 12:54:12 +00:00
yurys@chromium.org
b2f444f6e6 Use //@ sourceURL when formatting stack trace
BUG=672
Review URL: http://codereview.chromium.org/3444011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5498 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-20 15:55:28 +00:00
mikhail.naganov@gmail.com
290f142a7a Fix ProfileNodeFindOrAddChildForSameFunction test on Win32 debug.
Test was failing is due to a fact that MSVC in debug mode uses
separate instances for identical string literals.

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-20 12:25:45 +00:00
mikhail.naganov@gmail.com
c1903ce332 Show RegExp calls in the profile.
It turns out they were filtered out. But when I unfiltered them, I
discovered another issue: when DevTools run, regexp literals get
recompiled each time they called (looks like this is concerned with
switching to full compiler), so I ended up having multiple entries for
the same regexp. To fix this, I changed the way of how code entries
equivalence is considered.

BUG=crbug/55999
TEST=cctest/test-profile-generator/ProfileNodeFindOrAddChildForSameFunction
(the test isn't for the whole issue, but rather for equivalence testing)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-20 09:29:12 +00:00
floitschV8@gmail.com
fc9915b770 Added precision mode to fast-dtoa.
Review URL: http://codereview.chromium.org/2000004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-20 09:18:00 +00:00
vitalyr@chromium.org
c6c55a69a9 Fix direct loading of global function prototypes:
We must also check the current context has not changed.

The bug reported by Florian.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5483 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-17 09:56:47 +00:00
lrn@chromium.org
3b8235b306 Make some runtime arguments checks be RUNTIME_ASSERT, not ASSERT.
Review URL: http://codereview.chromium.org/3411013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5482 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-17 08:34:53 +00:00
kaznacheev@chromium.org
eef3bd7c04 Prevent inline constructor generation when duplicate properties are present in the constructor.
Currenly the constructor like this:
function f() {
  this.a = 0;
  this.a = 1;
  this.a = 2;
}
creates a map with duplicate desciptors which is bad in many ways.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-16 10:55:37 +00:00
fschneider@chromium.org
e91a352d02 Fix a regression in character-at stub when doing a keyed load on a string.
Loading from out-of-range has to go to the runtime system to check if there
exists a property with that index in the prototype.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5471 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-16 09:18:08 +00:00
mikhail.naganov@gmail.com
187d249d92 Enhance SafeStackFrameIterator to avoid triggering assertions in debug mode.
When running profiling in debug mode, several assertions in frame
iterators that are undoubtedly useful when iterator is started from a
VM thread in a known "good" state, may fail when running over a stack
of a suspended VM thread. This patch makes SafeStackFrameIterator
to proactively check addresses and bail out from iteration early,
before an assertion will be triggered.

BUG=crbug/55565

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5467 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-16 08:23:34 +00:00
mikhail.naganov@gmail.com
228d56bd8e Add support for abortion in v8::OutputStream.
It's a good idea to allow receiver to interrupt data transmission.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 15:11:24 +00:00
mikhail.naganov@gmail.com
2388079051 Implement heap snapshots serialization into JSON. API is designed
to avoid storing serialized snapshot on VM, instead it is emitted
using output stream interface.

The size of JSON emitted is roughly equal to used heap size
(when stored as an ASCII string).

Now a whole heap snapshot can be serialized and transmitted outside
VM. This makes possible:
  - implementing non-async UI for heap snapshots inspection;
  - storing heap snapshots for further inspection;
  - remote profiling (we can even implement a snapshotting mode
    where a snapshot isn't even stored in VM, only transmitted --
    good for mobile devices);
  - creating tools for outside heap snapshots processing, e.g.
    converting to HPROF.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 11:49:06 +00:00
lrn@chromium.org
84d8115ecf Fix bug in Array.prototype.indexOf/lastIndexOf when called on non-sparse non-arrays.
Review URL: http://codereview.chromium.org/3358025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-10 08:21:01 +00:00
lrn@chromium.org
ac2ae05f85 make Date.parse properly handle TZ offsets
This makes, e.g., Date.parse("2010-08-31T22:35:36-09:00") work as
expected. Without this change, the "-9:00" timezone-offset portion
causes V8 to fail to properly parse that string into a date.
BUG=http://code.google.com/p/v8/issues/detail?id=857
TEST=Try Date.parse("2010-08-31T22:35:36-09:00") and make sure
that it gets parsed without errors and does not return NaN.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-10 07:00:28 +00:00
vitalyr@chromium.org
624b13a804 Custom call IC for String.fromCharCode.
Review URL: http://codereview.chromium.org/3291015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-09 13:38:01 +00:00
lrn@chromium.org
d1a674f7c1 Add sparse array handling to Array.protoype.indexOf/lastIndexOf.
Review URL: http://codereview.chromium.org/3132046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5432 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-09 12:57:32 +00:00
podivilov@chromium.org
8c595da419 Move stack check below while statement.
Call to Runtime_StackGuard should be generated after loop body.
Otherwise, break position will be the previous position before
loop statement.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5423 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 15:34:16 +00:00
kaznacheev@chromium.org
73c02394bf Avoid pushing arguments twice in GenericBinaryOpStub.
Under some conditions (ADD, non-number arguments passed in registers)
GenerateRegisterArgumentsPush was called twice and the stack broke.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 13:33:40 +00:00
lrn@chromium.org
7d3711ef75 Avoid (some) symbol lookups at parse time if preparse data is available.
Review URL: http://codereview.chromium.org/3308010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 12:52:16 +00:00
serya@chromium.org
e54ad9ee86 Removing a wrong check.
A strings which represents an array index with length 8 and 9 digits do not pass this check. However generated hash is valid.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 11:32:20 +00:00
whesse@chromium.org
7368ce808e Fix the ambigous Operand(0) for newer C++ compilers.
Review URL: http://codereview.chromium.org/3351010/show
Committed for Thiago Farina <tfarina@chromium.org>


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5419 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 11:09:45 +00:00
whesse@chromium.org
119f630b67 Add test for calls to native runtime functions in extensions.
Review URL: http://codereview.chromium.org/3356007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-06 12:54:41 +00:00
erik.corry@gmail.com
d59bb82f1f Add and use AsciiAlphaToLower. Move RemoveLast test. Add Clear test. This is a commit of http://codereview.chromium.org/3307003/show http://codereview.chromium.org/3312007/show and http://codereview.chromium.org/3341002/show for tfarina
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5409 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-03 12:59:52 +00:00
vitalyr@chromium.org
62f7cd8500 Handle argument conversion in StringAddStub.
In case one of the arguments is known to be a string we emit a few
fast conversion attempts for the other.  This allows using the
StringAddStub instead of STRING_ADD_{LEFT,RIGHT} builtins.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-03 12:10:44 +00:00
lrn@chromium.org
5628d3c482 Fix parsing of /**/--> on first line of input.
BUG=53548
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-02 07:36:30 +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
whesse@chromium.org
990992a857 Remove CodeGenerator::PatchInlineRuntimeEntry and replace its single use in test-log-stack-tracer.cc with an alternative implementation.
Review URL: http://codereview.chromium.org/3311002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5392 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-01 13:13:31 +00:00
mikhail.naganov@gmail.com
e82081a506 CPU profiler: limit the number of simultaneously collected profiles.
This is related to Chromium issue 51919

BUG=51919
TEST=test-profile-generator/Issue51919

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-31 14:16:01 +00:00
erik.corry@gmail.com
663f378da5 Get gcc to check that we don't ignore return values of functions that can
fail to allocate because we need a GC.
Review URL: http://codereview.chromium.org/3274008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-31 08:05:42 +00:00
ricow@chromium.org
f19d6133f2 Fix mozilla and debug check failures.
This removes the expected failure of a mozilla test that we now pass
(an empty array is returned if Array.splice is called with no
arguments) and fixes debug check failure by allocating a new empty
array using AllocateEmptyArray if splice is called with zero arguments
(makes sure we can always create a handle).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5377 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-31 07:31:25 +00:00
ager@chromium.org
d955b212b5 Follow Safari and Firefox in returning empty array from array splice
with no arguments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-30 18:08:50 +00:00
vegorov@chromium.org
3d60cc34af Fix regress-851.js to use assertNull instead of assertFalse.
Review URL: http://codereview.chromium.org/3232002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 13:23:14 +00:00
vegorov@chromium.org
f059093562 Check result of JSObject::NormalizeElements() in JSObject::PreventExtensions().
Normalization requires allocation so Failure object can be returned.

BUG=http://code.google.com/p/v8/issues/detail?id=851
TEST=test/mjsunit/regress/regress-851.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 13:06:50 +00:00
serya@chromium.org
71548e969b Using array index hash code for string-to-number conversion.
Review URL: http://codereview.chromium.org/3141022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 11:47:12 +00:00
lrn@chromium.org
7b89a5f2b8 Reordered function entries in PreParse data to be ordered by start position.
Also add skip to entry, to skip pre-data for the body of the function.
Preparser data is now only accessed linearly, in the same order it was created.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 08:26:29 +00:00
sgjesse@chromium.org
be5763fc4d Cleanup the way the debugger stores live registers when entering at a break
The live registers are now only stored to the expression stack with the non pointer values being stored as smis (on the 32-bit platforms these values are assumed to be 31-bit max).

This makes the CEntryStub entry/exit code much simpler, and there is no longer any need for a mode (debug or normal) on it.

Fix a missing live register when breaking at ARM keyed load.
Review URL: http://codereview.chromium.org/3141047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5358 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 07:08:03 +00:00
ricow@chromium.org
fd2fcac430 Temporarily disable test-heap-profiler/HeapSnapshotsDiff until the test is fixed (issue 848)
Review URL: http://codereview.chromium.org/3209005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5353 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-26 09:27:14 +00:00
erik.corry@gmail.com
66d13be5f9 Fix incorrect encoding of single and double precision registers for some VFP instructions. Also fix incorrect disassembling of vldr/vstr. This is a commit of http://codereview.chromium.org/3107027 for Rodolph Perfetta.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-26 08:53:00 +00:00
ricow@chromium.org
7672338bc9 Fixes bug in Object.freeze and Object.seal causing them to misbehave when Array.prototype has changed.
Object.freeze and Object.seal uses GetOwnPropertyNames which
returns an array with local property names. This array will also have
the additional properties defined on Array.prototype or
Object.prototype.

Note that, the implementation of GetOwnPropertyNames (when used as
Object.getOwnPropertyNames) is correct, since the spec says to create
a new Array (which would also have these properties).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-26 08:35:49 +00:00
sgjesse@chromium.org
feb20d30f8 Change code contains function to allow a return address just after the last instruction
Then patching the return sequence for debugger break at return a call is placed at the very end of the instruction stream causing the return address to be just after the actual instruction in the code object.
Review URL: http://codereview.chromium.org/3151037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-25 12:51:27 +00:00
sgjesse@chromium.org
e38f89be6b Hide test failure be being less GC agressive in the test
This is a temporary fix until the root cause is resolved.

TBR=kasperl@chromium.org
Review URL: http://codereview.chromium.org/3122038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-25 07:26:12 +00:00
sgjesse@chromium.org
d7fa6b7a21 Fix a bug in the handling of debug break in CallIC
The change of calling convention in the CallIC was not reflected in the debug break code. Without the change to the debug break code the added test crashed.
Review URL: http://codereview.chromium.org/3167037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5333 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-25 05:57:02 +00:00