Commit Graph

680 Commits

Author SHA1 Message Date
sgjesse@chromium.org
92bb897081 Tweaks to global object inline cache code.
Remove the check for deleted properties in the global load inline cache if the property is known to be read only.

Propegate the in loop flag for the global call inline cache.

Changed the propagation of the code flags in the call stub compiler to compute these the same way for all types of call stubs and assert that the flags for the generated code is the same as those used for the cache lookup.

Addressed a few comments from previous review in test-api.cc.
Review URL: http://codereview.chromium.org/150101

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 14:07:29 +00:00
christian.plesner.hansen@gmail.com
118a2ccc8e When Error.collectStackTraces is set to true all new instances of
Error, ReferenceError, etc. are given a stack property that gives a
stack trace.  Here's an example stack trace:

ReferenceError: FAIL is not defined
    at Constraint.execute (deltablue.js:527)
    at Constraint.recalculate (deltablue.js:426)
    at Planner.addPropagate (deltablue.js:703)
    at Constraint.satisfy (deltablue.js:186)
    at Planner.incrementalAdd (deltablue.js:593)
    at Constraint.addConstraint (deltablue.js:164)
    at Constraint.BinaryConstraint (deltablue.js:348)
    at Constraint.EqualityConstraint (deltablue.js:517)
    at chainTest (deltablue.js:809)
    at deltaBlue (deltablue.js:881)
    at deltablue.js:888

If Error.prepareStackTrace holds a function this function is used to
format the stack trace, for instance allowing code generators to
customize the way stack traces are reported to make them easier to
process.

Next step: performance measurements to see if it is feasible to turn
this on by default.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 11:08:37 +00:00
sgjesse@chromium.org
a54a4ada5c Changed the global object representation.The global object is now always in dictionary (slow) mode with each of its properties stored in a cell object. A cell object has one field containing the actual value for the property. Inline caches for access to global properties which uses direct to the cell are now created for load, store and call to properties of the global object. When properties of the global object are deleted the cell for that property is kept with an indcation of that the property is deleted.Added counters to track the use of the global property inline caches.Added additional information on IC's in the disassembler.
Review URL: http://codereview.chromium.org/151019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 10:05:36 +00:00
erik.corry@gmail.com
c9e004a808 Add a compare stub on ARM.
Review URL: http://codereview.chromium.org/151003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 13:52:13 +00:00
erik.corry@gmail.com
4a30e3f58e * Add missing imul instruction on Intel.
* Fix incorrect signedness in disassembly of umull/mull on ARM.
* Fix incorrect register order in disassembly of umull/mull.
* Fix incorrect assembly of umull on ARM.
* Remove retroactively obsoleted restriction on choice of
  registers in mul instructions on ARM.
Review URL: http://codereview.chromium.org/150002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 09:32:06 +00:00
kasperl@chromium.org
3ae01ab8ef Fix issue 392 by disabling the TakeValue optimization for
access to the arguments object.
Review URL: http://codereview.chromium.org/150016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 06:20:52 +00:00
ager@chromium.org
681ab6e30c Reintroduce recording of source position that was lost on ia32 for
some reason.
Review URL: http://codereview.chromium.org/147147

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-25 12:20:15 +00:00
ager@chromium.org
a5331d6426 Fix instance type check in apply optimization.
We accidentally compared a map address with an instance type.  This
fix additionally avoids an upper bounds check that is not needed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2272 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-25 11:35:03 +00:00
ager@chromium.org
e3fa53edef Make sure that message reporting works when the builtin string and
array functions are overwritten.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-25 10:27:36 +00:00
kasperl@chromium.org
f66ea38c0b Allocate arguments object on-demand instead of at function entry.
This allows Function.prototype.apply to not allocate the objects 
and copy the arguments directly from the stack.
Review URL: http://codereview.chromium.org/147075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-24 08:01:38 +00:00
lrn@chromium.org
2dd9717c4b Fix bug in static type inference for loops.
Review URL: http://codereview.chromium.org/140058


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 12:36:01 +00:00
erik.corry@gmail.com
2b71d0a83e Fix regexp bug reported on iit.edu.
Review URL: http://codereview.chromium.org/141042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2235 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 12:29:27 +00:00
yurys@chromium.org
46165adb9a After compile event should be sent even if there is a provisional breakpoint out of its lines range.
Review URL: http://codereview.chromium.org/141041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2234 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 11:56:36 +00:00
whesse@chromium.org
74ddab9d94 Fix issue 386, a bug in JSObject::ReplaceSlowProperty with constant transitions.
Review URL: http://codereview.chromium.org/141031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 07:41:15 +00:00
erik.corry@gmail.com
e2a01ed4fb Fix regexp bug reported by Ian where [6-9] would match any digit.
Review URL: http://codereview.chromium.org/140021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2226 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-20 17:57:09 +00:00
bak@chromium.org
7dab62ee96 Changed allocation to allow large objects to be allocated in new space.
This avoids back-to-back mark-sweep collections.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2219 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-18 14:06:36 +00:00
mikhail.naganov@gmail.com
a1a962f65e Implemented processing of compressed log files.
- fixed address delta calculation;
- code creations are also compressed to be in sync with other events;
- factored out a base class from TickProcessor to reuse code in DevTools profiler.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-18 07:59:13 +00:00
sgjesse@chromium.org
2caf318dfe Fix lint error.
TBR=kasperl@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2210 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 14:14:24 +00:00
kasperl@chromium.org
50e35a30d7 More debug mode tweaks to mozilla.status.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/125251

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 14:05:00 +00:00
kasperl@chromium.org
ac19e4b29b Update Mozilla test expectations to better match the new handling
of tests that time out.
Review URL: http://codereview.chromium.org/126274

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2207 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 13:57:44 +00:00
sgjesse@chromium.org
f36c8574c9 Fix unload debugger.
Add a missing handle scope when clearing the debug message handler.

BUG=none
TEST=cctest/test-debug/DebuggerUnload 
Review URL: http://codereview.chromium.org/126271

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 13:14:51 +00:00
kasperl@chromium.org
6b096428cb Revert change to LongRunningApply, but allow the test case to time
out for now.
Review URL: http://codereview.chromium.org/125241

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 06:47:15 +00:00
kasperl@chromium.org
9cac93d73e Make test-api/ApplyInterruption less likely to time out in debug
mode and on actual ARM hardware.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/125240

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 06:18:10 +00:00
mikhail.naganov@gmail.com
02b7894f95 Fix issue 380.
Don't infer name for a function if a result of its call is assigned to a variable / property. E.g., in this case:

  a = function() { ... } ();

the function must remain anonymous because 'a' doesn't receive a function reference, but instead a result of its call.

BUG=http://code.google.com/p/v8/issues/detail?id=380
TEST=cctest/test-func-name-inference/Issue380

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 11:47:00 +00:00
erik.corry@gmail.com
824140bde0 Avoid going into runtime system for round-towards-zero operations on ARM.
Review URL: http://codereview.chromium.org/126192

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 09:49:29 +00:00
ager@chromium.org
667176d910 Another attempt at fixing sine & cosine test.
TBR=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/125129

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 15:57:06 +00:00
erik.corry@gmail.com
622e13f573 Semirandom changes in the code generated by gcc -g mean we can't iterate quite
as deep on newer VMs in debug mode.
Review URL: http://codereview.chromium.org/126125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2170 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 13:50:07 +00:00
ager@chromium.org
b898b6dfea Modify regression test.
Because of varying floating-point precision, the slow case is hard to
test with explicit values.  Instead, we check that sine and cosine do
not return the same value (the regression was that the slow case of
cosine accidentally did sine instead of cosine).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2169 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 13:18:51 +00:00
ager@chromium.org
225a6a82b0 Optimize Math.sin and Math.cos by avoiding runtime calls.
Review URL: http://codereview.chromium.org/125121

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2166 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 12:06:48 +00:00
mikhail.naganov@gmail.com
3a3a6924a1 Involve more log compression techniques.
Code addresses are now written as an offset from the previous address for ticks, code move and delete events. Employed backreference and RLE compression for code move and delete events. This gives additional 30% log size reduction for benchmarks run w/o snapshot.

Overall compression results (compared with the revision of V8 having no compression):
 - V8: 70% size reduction for benchmarks run w/o snapshot (for reference, gzip gives 87%)
 - Chromium: 65% size reduction for public html version of benchmarks (v4) (for reference, gzip gives 90%)

The one obvious opportunity for improving compression results in Chromium is to compress URLs of scripts.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 09:37:50 +00:00
ager@chromium.org
f706cfa30c Fix debugger after inlined keyed store change.
Make sure that the IC is always hit when debugging and make sure to
restore the fast case when leaving the debugger.
Review URL: http://codereview.chromium.org/125044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-12 11:24:13 +00:00
sgjesse@chromium.org
882614391f Add scope chain information to the debugger.
For each frame it is now possible to request information on the scope chain. Each scope in the chain can have one of the types local, global, with and closure. For scopes of type global and with the mirror for the actual global or with object is available. For scopes of type local and closure a plain JavaScript object with the materialized content of the scope is created and its mirror is returned. Depending on the level of possible optimization the content of the materialized local and closure scopes might only contain the names which are actually used.

To iterate the scope chain an iterator ScopeIterator have been added which can provide the type of each scope for each part of the chain. This iterator creates an artificial local scope whenever that is present as the context chain does not include the local scope.

To avoid caching the mirror objects for the materialized the local and closure scopes transient mirrors have been added. They have negative handles and cannot be retrieved by subsequent lookup calls. Their content is part of a single response.

For debugging purposes an additional runtime function DebugPrintScopes is been added.

Added commands 'scopes' and 'scope' to the developer shell and fixed the dir command.

BUG=none
TEST=test/mjsunit/debug-scopes.js
Review URL: http://codereview.chromium.org/123021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-12 10:03:25 +00:00
mikhail.naganov@gmail.com
8c16bc13bc Implement tick events compression in a log file.
Two techniques are involved:
 - compress repeated line ends (common stack beginnings) by using back references;
 - do RLE compression of repeated tick events.

This gives only 5% size reduction on benchmarks run, but this is because tick events are only comprise 10% of file size. Under Chromium winnings are bigger because long repeated samples of idleness are now compressed into a single line.

Tickprocessor will be updated in the next patch.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2147 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-11 14:08:34 +00:00
whesse@chromium.org
2de98f8e55 Add statistics operations and long calls and jumps to x64 macro assembler.
Remove unimplemented instructions from x64 assembler.  Add operand-size
suffixes to add, sub, inc, dec, and cmp.
Review URL: http://codereview.chromium.org/118380

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2139 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 15:53:46 +00:00
whesse@chromium.org
85720fc05e Make JSObjects with both indexed interceptors and indexed accessors work safely.
Review URL: http://codereview.chromium.org/118499

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 15:33:31 +00:00
kasperl@chromium.org
cbd31001ef Re-land patch r2110.
TBR=antonm@chromium.org
Review URL: http://codereview.chromium.org/118501

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 14:45:46 +00:00
kmillikin@chromium.org
35b5aab3c7 Fix a bug when shifting left by zero. Ensure that the left operand is
writable (non-aliased) so it can be used for the result in the slow
case.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2134 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 12:41:57 +00:00
whesse@chromium.org
bedff67b6e Make Array.sort safely generic on JSObject types. Fix bug 346 http://code.google.com/p/v8/issues/detail?id=346
Review URL: http://codereview.chromium.org/119357

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2133 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 11:42:22 +00:00
lrn@chromium.org
13e548af1d X64: Implement CEntryStub and JSEntryTrampoline.
Still some supporting functions missing.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 09:48:15 +00:00
sgjesse@chromium.org
dc9670bcb4 Change locationFromPosition() and locationFromLine() to use a binary search to locate line numbers from position numbers. Modify test debug-sourceinfo.js to include more tests, including error conditions.
Patch by Matt Hanselman, see http://codereview.chromium.org/118371.

BUG=213
TEST=test/mjsunit/debug-sourceinfo.js
Review URL: http://codereview.chromium.org/118425

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-09 07:03:21 +00:00
sgjesse@chromium.org
d498361c5f Add more debugging information to scripts compiled through eval.
Scripts now have a compilation type which can be host, eval or JSON. Host scripts are compiled through the API, eval scripts are compiled through call to evan and JSON scripts are compiled as a result of calling JSON.parse.

For scripts scripts compiled through eval the JavaScript function in top of the stack and the pc offset into the code is stored in the script object. This makes it possible to calculate the source position of the eval call later when requested. This information can be obtained through the script mirror object and is part of the script mirror JSON serialization for the debugger protocol.

Moved the enumeration ScripType into class Script and remamed to Type. The new compilation type enumeration is also inside the class Script.

This information is now shown when using the scripts command in he developer shell debugger.
Review URL: http://codereview.chromium.org/119108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 10:47:49 +00:00
ager@chromium.org
24d22b567a Introduce an API to force the deletion of a property ignoring
interceptors and dont-delete attributes.

Minor change to the behavior of eval: throw exception when calling
eval in a context for which the global has been detached.  This
matches the behavior of both Firefox and Safari post navigation in the
browser.
Review URL: http://codereview.chromium.org/118374

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 09:46:09 +00:00
antonm@chromium.org
1e55c82115 Revert r2110 as it introduces performance regressions.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2111 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 13:42:29 +00:00
antonm@chromium.org
b2f0dc3542 Don't do local lookup on global object as those (currently) are not JITed anyway.
Review URL: http://codereview.chromium.org/119048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 10:50:36 +00:00
kasperl@chromium.org
dfbc850ebc Revert revision 2108. This brings back the changes
submitted in revisions 2093, 2094, 2099, and 2106.
There's no evidence that supports that these changes
should be the cause of the unexplained performance
regressions on the intl2 and DHTML page cyclers. 


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 08:07:15 +00:00
kasperl@chromium.org
84c09c6de4 Experimental revert of revisions 2093, 2094, 2099, and
2106 to try to isolate a performance regression on the
page cyclers.

I'll roll the changes back in if this doesn't fix the
regression.

TBR=antonm@chromium.org
Review URL: http://codereview.chromium.org/118302

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 06:57:30 +00:00
antonm@chromium.org
0a0ede0716 Fix the issue with layout tests.
The problem was I incorrectly treated NULL result as failure to fetch
a property with a getter.  However, if getter returns zero, it is
manifested as NULL pointer (see added test case).

Good news: that gives another boost as before this CL if getter returned
0, I did another slow lookup.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-04 19:19:53 +00:00
kmillikin@chromium.org
92c17c34de Rename misnamed test file.
Review URL: http://codereview.chromium.org/119081

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2097 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-03 12:21:54 +00:00
ager@chromium.org
63a51e01ba Fix flakyness in tests: make sure to garbage collect temporary test
external strings so that they are not disposed when running other
tests that rely on only one external string being disposed during its
run.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-03 12:09:52 +00:00
antonm@chromium.org
2e49a1c03d Follow up to r2093: forgotten files and changes.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2094 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-03 12:04:53 +00:00
mikhail.naganov@gmail.com
0fcedde224 Fix determining of JS lower stack bottom used in profiler's JS stack tracer to work with Chromium.
My assumption that log initialization happens somewhere near the stack's bottom is true for V8's sample shell but isn't true for Chromium, causing many otherwise valid stack addresses to be thrown out. The solution proposed is to save stack pointer value for the outermost JS function in ThreadLocalTop similar to c_entry_fp.

Implemented only for IA-32. Currently I'm not dealing with profiling on ARM and x86-64 anyway.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2086 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-02 09:33:17 +00:00
mikhail.naganov@gmail.com
f0b3d3062d Fix wait interval calculation in ProfLazyMode test.
Also, add a small delay to be sure that all ticks are logged prior to leaving CheckThatProfilerWorks function.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2082 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 15:33:02 +00:00
whesse@chromium.org
1bb3976a14 Change RelocInfo to write 64-bit data field on x64 architecture.
Review URL: http://codereview.chromium.org/115860

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2081 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 12:14:54 +00:00
mikhail.naganov@gmail.com
48b4679396 Use uint in ProfLazyMode test when measuring time delta.
While testing ProfLazyMode stability I encountered a situation when the cycle supposed to run for 200 ms started to run "infinitely" because delta between two int64_t values became negative.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 09:33:53 +00:00
mikhail.naganov@gmail.com
6ad05a9ebd fix embedded vector copy constructor and assignment.
Thanks to Tobias Kaes, an issue with default copy constructor and assignment operator is found and fixed.

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

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 09:00:39 +00:00
sgjesse@chromium.org
a019501be2 Change the handling of the debug break stack guard. The debug break is no longer ignored when hit inside "system" JavaScript. The reason for this is twofold:
* Running "system" JavaScript with the debug break flag active leads to slow running code while waiting for the break in non "system" JavaScript (one exception to this it is to try to avoid breaks in the clear mirror cache JavaScript code called when leaving the debugger).

* If this happens while processing RegExp running in native code an infinite loop is created as the stack guard handler for RegExp does not move execution forward

Fixed a GC bug in the interrupt handling for RegExp running in native code.

Added test of debug break while in debug message handler callback and debug break while executing a RegExp.
Review URL: http://codereview.chromium.org/115262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 08:42:02 +00:00
mikhail.naganov@gmail.com
795ba99117 Handle filling up of memory buffer to make log processing in DevTools Profiler easier.
When profiler's memory buffer is filled up, profiling is stopped and it is ensured that the last record in the buffer is "profiler,\"pause\"" thus making the end of profiling session explicit. Otherwise DevTools Profiler would need to guess whether the current profiling session has been stopped.

Tested with Chromium.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 13:56:32 +00:00
whesse@chromium.org
76d5e4e06d Add immediate operands and arithmetic operations to the x64 assembler.
Review URL: http://codereview.chromium.org/115816

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2069 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 09:18:17 +00:00
mikhail.naganov@gmail.com
e48095b87c Implement a dynamically growing memory log buffer with an upper limit.
The goal of this change is to allow longer profiling sessions and preserve memory when profiler isn't started. The buffer starts with 64K and grows until it reaches the upper limit, which is currently set to 50MB --- according to my evaluations, this is enough for at least 20 minutes of GMail profiling. As we're planning to introduce compression for the profiler log, this time boundary will be significantly increased soon.

To make possible unit testing of the new component, I've factored out Logger's utility classes into a separate source file: log-utils.h/cc. Log and LogMessageBuilder are moved there from log.cc without any semantical changes.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 07:08:09 +00:00
lrn@chromium.org
2e37ebe1ed Added stack overflow check for RegExp analysis phase.
A very long regexp graph can overflow the stack with recursive calls.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2064 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-27 11:23:26 +00:00
whesse@chromium.org
88635e401e Implement memory operands for instructions in the x64 assembler.
Review URL: http://codereview.chromium.org/113841

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2062 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-27 08:15:31 +00:00
lrn@chromium.org
945245393c Fix for issue 351 - lastIndexOf.
Review URL: http://codereview.chromium.org/113838


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2060 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-26 15:42:06 +00:00
mikhail.naganov@gmail.com
e66a0831fd Run script in ProfLazyMode test longer to improve stability.
Prior to this change debug version of the test crashed 2 of 1000 times. After the change no crashes (out of 1000 runs) occured.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-26 14:28:08 +00:00
whesse@chromium.org
960a1d36c2 Add implementation of control flow and label binding to x64 assembler.
Review URL: http://codereview.chromium.org/113832

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2057 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-26 12:32:09 +00:00
whesse@chromium.org
3bd462f2eb Add a unit test for V8's 64-bit assembler.
Review URL: http://codereview.chromium.org/115707

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-26 07:58:36 +00:00
davemoore@chromium.org
62caa393b0 Changed the flags that indicate the status of running vs dead
This allows us to optimized the EnsureInitialized() function
so it doesn't require a function call when we're running

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2048 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 19:39:52 +00:00
yurys@chromium.org
6e29fadb72 When inspecting a function with a native getter return result of execution of the getter function in the client context. This is useful for debugging DOM elements.
Review URL: http://codereview.chromium.org/113821

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 15:07:21 +00:00
mikhail.naganov@gmail.com
cee54f88a1 Remove ifdef from ProfLazyMode test, instead mark it in cctest.status.
Review URL: http://codereview.chromium.org/113820


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2042 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 12:35:32 +00:00
mikhail.naganov@gmail.com
def20131a6 Disable crashing ProfLazyMode test on ARM.
Review URL: http://codereview.chromium.org/115760


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2040 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 10:28:35 +00:00
mikhail.naganov@gmail.com
91bf9e8798 Fixes for comments in http://codereview.chromium.org/113641.
Review URL: http://codereview.chromium.org/115757


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 10:27:18 +00:00
mikhail.naganov@gmail.com
30a0a7de43 Split nested namespaces declaration in two lines in accordance with C++ Style Guide.
This issue was raised by Brett Wilson while reviewing my changelist for readability. Craig Silverstein (one of C++ SG maintainers) confirmed that we should declare one namespace per line. Our way of namespaces closing seems not violating style guides (there is no clear agreement on it), so I left it intact.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 10:05:56 +00:00
mikhail.naganov@gmail.com
6d71da11fd Merge in changes from readability review.
All changes from http://codereview.chromium.org/115024, except splitting namespace declarations in two lines (will be done separately for all source files).

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 08:39:22 +00:00
mikhail.naganov@gmail.com
9f69c414eb Implement resource-saving ("lazy") mode of Profiler.
This is intended to be used with Chromium. When in resource-saving mode, profiler doesn't consume any resources (sampler and logging is off) until resumed. Then again, when profiler is paused, sampling and logging are turned off.

Tested under Linux and Windows. Also have done preliminary testing with Chromium.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 08:25:36 +00:00
yurys@chromium.org
530b86ff17 When message handler is set to NULL and there is no debugger listener the debugger is unloaded immediately unless it's entered, in which case it will be unloaded when last instance of EnterDebugger is destroyed.
Without the change the debugger may crash as Debugger::EventActive(v8::Break) called from OnDebugBreak may clear current debugger context. 

Also when compilation cache was enabled debugger could fail on second attach for the same reason(see AfterCompileMessageWhenMessageHandlerIsReset).

BUG=12404
Review URL: http://codereview.chromium.org/115709

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 07:51:04 +00:00
lrn@chromium.org
e9f1a09f9d X64: Omitted creating native builtins and using them in test-heap.
This allows test-heap to run successfully.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2034 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-22 14:01:06 +00:00
ager@chromium.org
cc619a34ef Remove list copy constructor (for which there was no corresponding
assignment operator) and add an AddAll method to lists instead.
Review URL: http://codereview.chromium.org/115705

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-22 11:52:24 +00:00
yurys@chromium.org
d6742c7fae For ScriptCollected events current context may be null. Message.GetEventContext will return an empty handle in such cases.
Review URL: http://codereview.chromium.org/113698

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2024 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-21 14:21:14 +00:00
sgjesse@chromium.org
7a10634e90 Disable compilation cache when debugger is active.
Added an option to control whether the compilation cache is enabled. Default value is true.

BUG=343
Review URL: http://codereview.chromium.org/113625

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2021 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 20:28:33 +00:00
sgjesse@chromium.org
3e76ba9a78 Propagate information on whether a non function was called as constructor or not.The Arguments object passed to the callback now has IsConstructCall set accordingly.BUG=http://crbug.com/3285
Review URL: http://codereview.chromium.org/113634

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 19:33:44 +00:00
mikhail.naganov@gmail.com
f76cb020f9 Fix test-log/EquivalenceOfLoggingAndTraversal for the snapshot case.
If was failing because with snapshot the range between minimum and maximum addresses of heap objects is very large (close to 0xf0000000). To fix this I rewrote handling of address maps in the test.

Submitting with TBR because of late time. I think, we'll need to revisit this change tomorrow.

TBR=sgjesse@chromium.org

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 16:43:46 +00:00
mikhail.naganov@gmail.com
eec57b9b13 Fix lint errors, fix Windows version.
Sorry for not testing these prior to committing.

TBR=sgjesse@chromium.org

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2015 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 12:47:30 +00:00
mikhail.naganov@gmail.com
4075179fbe Introduce Logger::LogCompiledFunctions that logs current map of compiled code.
The goal is to make possible having --prof flag always enabled in Chromium.  Currently we can't do this because --prof causes compiler and gc to log code creations / moves / deletes which aren't needed until we start profiling.  With LogCompiledFunctions it will be possible not to log anything until we start profiling.  When started, the current map of compiled functions will be logged and compiler / gc logging will be enabled to update current state.  When profling is stopped, logging will be turned off again.

Funny that testing code is actually much longer and complex than function code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 09:04:13 +00:00
ager@chromium.org
10b8928e0e Expose the calling context through the API.
In C++ callbacks, we can now get the context of the javascript code
that called the callback.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 07:44:59 +00:00
yurys@chromium.org
897ecefe1e Exposed method for finding global context by traversing context chain to API.
Review URL: http://codereview.chromium.org/112035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2005 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 07:28:42 +00:00
lrn@chromium.org
2ff3901cf7 Fix for issue 349: Make initial boundary check for BM text search.
There was a case where the BMH algorithm bailed out exactly at the end of the string, and the BM algorithm that takes over wasn't expecting this.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-19 09:01:03 +00:00
lrn@chromium.org
c27d0f7b4b X64: Fixups in heap-test.cc to make it compile in X64 mode.
Review URL: http://codereview.chromium.org/113574


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1994 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-19 08:59:23 +00:00
sgjesse@chromium.org
94879a93b0 Add a script cache to the debugger
When loaded scripts are requested this cache is filled with all the script objects in the heap. Hereafter its content is kept in sync with the active scripts in the heap through the notifications of new scripts compiled and by using weak handles to get notified when a script is collected.

Through the tracking of collected scripts the debugger event OnScriptCollected have been added to notify a debugger that a script previously returned through the scripts command is no longer in use.

Make the ComputeIntegerHash globally available.

Moved clearing of the mirror cache to when debugger is really left. Previously recursive invocations of the debugger cause the mirror cache to be cleared causing handles to become either stale or reference other objects.
Review URL: http://codereview.chromium.org/115462

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 13:14:37 +00:00
sgjesse@chromium.org
44bdc2c9a8 Make the hash map test run faster by doing less work.
It still hits all of the code and runs in seconds on tinyone.
Review URL: http://codereview.chromium.org/113459

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1970 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 13:49:00 +00:00
ager@chromium.org
a3f30f5a3a Clean up the Result class. Reduce the size of Result from four words
to one by keeping a stack of active code generators and by using
indirection to handles.

Mainly a cleanup.  No visible performance impact.
Review URL: http://codereview.chromium.org/113455

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1965 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 11:09:51 +00:00
kasperl@chromium.org
3e0f2a1532 Fix lint errors in test-hashmap.cc
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 08:33:38 +00:00
sgjesse@chromium.org
c32884d371 Fix compilation of test-hashmap.cc on Linux.
TBE=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/113448

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1959 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 07:54:33 +00:00
yurys@chromium.org
acfc50ac12 MirrorSerializer now converts mirrors to plain JS objects. This objects are serialized to json string using JSON.stringify.
Review URL: http://codereview.chromium.org/113399

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1957 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 07:35:11 +00:00
sgjesse@chromium.org
77b9c60169 Add a remove method to the hash map.
Extended the hash map test to also use a heavy collision hash function to exercise the remove code.
Review URL: http://codereview.chromium.org/113397

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1956 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 07:09:17 +00:00
kasperl@chromium.org
2d50e31438 Add multiple generations (5) to the script compilation cache
to allow scripts that are used alot to survive a number of GCs
in the compilation cache.
Review URL: http://codereview.chromium.org/113445

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1955 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 06:45:50 +00:00
yurys@chromium.org
750a8391c2 Add parameter that allows to request data for scripts by their ids. It's going to be used e.g. to request script sources by their ids.
Review URL: http://codereview.chromium.org/113335

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 06:39:47 +00:00
iposva@chromium.org
032681a057 - Update cctest.status to reflect that we cannot expect OutOfMemory exceptions
in all situations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-13 18:35:55 +00:00
whesse@chromium.org
1ae8a7da3d Fix bug 344: always keep attributes of existing properties.
Review URL: http://codereview.chromium.org/113197

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1931 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-13 10:46:28 +00:00
sgjesse@chromium.org
ada3d37219 Added support to backtrace from botton of stack to debugger protocol.
Fixed backtrace in D8 debugger and added gdb like syntax 'bt n' and 'bt -n' in addition to the already existing 'bt from to'.
Review URL: http://codereview.chromium.org/99342

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1929 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-13 08:54:50 +00:00
iposva@chromium.org
6c39aefd4f Fix for issue 339:
- Move GetHiddenProperties functionality from object.cc to handle.cc to
  be more robust in the presence of GC in the middle of the function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1924 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 22:07:10 +00:00
kmillikin@chromium.org
18f69a7171 Fix for issue 341. In the stub for instanceof, we could try to read
an object's map before we were sure it was a heap object.
Review URL: http://codereview.chromium.org/115236

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 11:40:14 +00:00