Commit Graph

591 Commits

Author SHA1 Message Date
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