Commit Graph

182 Commits

Author SHA1 Message Date
olehougaard
9149e4c8db Fixed some memory leaks in unit tests.
Review URL: http://codereview.chromium.org/46103

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1516 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-16 07:53:20 +00:00
sgjesse@chromium.org
17b498c957 A new stack guard break flag DEBUGCOMMAND has been introduced. This is used to signal debug break due to debugger commands available in the queue for processing. If a stack guard break happens with this flag and not the DEBUGBREAK flag the no debug break event is generated and execution is resumed automatically when all debugger commands in the queue has been processed.
This makes it possible to remote debuggers to just add commands to the queue without having to request a break as well. As soon as any JavaScript executes the debugger commands will be processed and the response send to the remote debugger.

Currently hide this behind a flag (--debugger-auto-break) as the current command line debugger in Chrome is not designed for this new behaviour, whereas the new Chrome developer tools will use it.
Review URL: http://codereview.chromium.org/42173

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1508 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 13:26:21 +00:00
sgjesse@chromium.org
79aae815dd During the refactoring in r1461 and adding of script ids in r1468 the propagation of a boolean flag was missing. This caused the line numbers retreived through ScriptMirror objects to ignore the resource line offset information in the script.
Added an explicit false parameter where the parameter was previously left out.

Added a test case for this.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 14:03:05 +00:00
ager@chromium.org
04cc9cfffd Revert the exception propagation fix. It leads to crashes because
Top::external_caught_exception_ and Top::try_catch_handler_ are no
longer in sync.  Pulling it out until I have the time to fix it.
Review URL: http://codereview.chromium.org/42117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1497 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 12:29:17 +00:00
ager@chromium.org
6eb3030479 Temporarily disable tests that no longer work on the ARM simulator.
Exclude the tests from the threaded tests because I don't want to
disable those on ARM.

The issue is that the simulator keeps the C++ and the JavaScript stack
separated.  This is not a problem on the real hardware and the tests
pass on our ARM box.
Review URL: http://codereview.chromium.org/42069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 14:29:21 +00:00
ager@chromium.org
90093ea868 Fix exception propagation problem where undefined was returned instead
of an empty handle in case of an exception.  This problem can break
C++ programs that are not interested in catching exceptions and just
want to propagate them out by testing for empty handles.

The issue is that exceptions are not rescheduled if they are
externally caught.  Externally caught exceptions have to be
rescheduled if there is a JavaScript frame on the way to the C++ frame
that holds the external handler.
Review URL: http://codereview.chromium.org/43070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 11:13:15 +00:00
kasperl@chromium.org
1a9dc2d002 Move InitLineEnds and GetLineNumber to handles.cc to avoid
issues with a raw this pointer and GC.

Fix issue with FlattenString where we may keep a StringShape
alive across a GC.
Review URL: http://codereview.chromium.org/43020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1481 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 15:08:45 +00:00
christian.plesner.hansen@gmail.com
c1c5a09ebd Made the Error prototype into an error. Allow \c at the end of
regexps.  Throw a type error when calling regexp methods on
non-regexps.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 11:32:19 +00:00
sgjesse@chromium.org
9d17b0d4c8 Whenever a script object is created it is assigned a unique id. Currently this id is assigned from an 32 bit integer counter.
Changed the script break points to be able to handle both break points based on script names and script ids. When break points are set through a script id the position is relative to the script itself. This is different from the script break points set through script names where the line/coulmn offset is taken into account.

This has the side effect that function break points are not converted into script break points for named scripts.

Show the script id in the D8 shell debugger when listing all scripts using the 'scripts' command.
Review URL: http://codereview.chromium.org/40317

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 08:10:50 +00:00
ager@chromium.org
9f6adefa55 Fix test for building on 64-bit Linux.
TBR=sgjesse
Review URL: http://codereview.chromium.org/41007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 19:48:25 +00:00
sgjesse@chromium.org
994ea00dfe Changed a function in the internal debugger JavaScript to return the full source location instead of only the position.
Added an optional parameter to exclude/include the source line offset in source location.

Extended a message test to include a test with source offset.
Review URL: http://codereview.chromium.org/39342

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 17:59:25 +00:00
mikhail.naganov@gmail.com
cd71a2792c Get rid or heap allocation in stack sampler to avoid deadlocks.
Review URL: http://codereview.chromium.org/40219

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-06 13:07:57 +00:00
sgjesse@chromium.org
9ea5fe3d9e Fix lint errors
TBR=christian.plesner.hansen@gmail.com
Review URL: http://codereview.chromium.org/39253

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1438 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-06 12:08:55 +00:00
sgjesse@chromium.org
22d6605f2f All preemption requests are now ignored while in the debugger. This ensures that no change of V8 thread happenes while in the debugger. The only thing that happens is that a flag is set to indicate that preemption happened. When the debugger is left preemption is requested if it occourred while in the debugger.
Moved the debugger related global variables from Top to thread local in Debug.
Review URL: http://codereview.chromium.org/39124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-06 11:03:14 +00:00
kmillikin@chromium.org
86254f6ad9 Add a test for inserting a preexisting list element to a list, at the
point where the backing buffer will have to grow.
Review URL: http://codereview.chromium.org/39180

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1425 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 09:39:19 +00:00
sgjesse@chromium.org
f87d1530e6 The SendAll method on Socket was a helper method that did not really belong in platform.
Review URL: http://codereview.chromium.org/40104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-04 10:33:00 +00:00
mikhail.naganov@gmail.com
3db607a3c4 Dump more stack frames to perf log when executing a C++ function.
JavaScriptFrameIterator is templatized on the iterator type and renamed to JavaScriptFrameIteratorTemp.
The original JSFI is now a typedef for JavaScriptFrameIteratorTemp<StackFrameIterator>. Because of templatizing, JSFI code is moved to frames-inl.h

StackTraceFrameIterator moved to frames.*

Implemented SafeStackFrameIterator which wraps StackFrameIterator and have the same interface. It performs additional checks of stack addresses prior to delegating to StackFrameIterator. SafeSFI is used in an another specialization of JavaScriptFrameIteratorTemp template to perform safe JS frames iteration on sampler ticks.

I haven't took an advantage of having multiple stack frames in tickprocessor yet.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-03 11:56:44 +00:00
sgjesse@chromium.org
0dee6cbab4 Fix lint errors.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/27208

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1378 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 14:30:30 +00:00
sgjesse@chromium.org
be011678f9 Make test-log-ia32.cc compile even if ENABLE_LOGGING_AND_PROFILING is not defined.
Review URL: http://codereview.chromium.org/28182

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1377 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 13:45:11 +00:00
sgjesse@chromium.org
7a83e2c0f6 Skip flaky (occasionally crashes) test on ARM until issue has been resolved.
BUG=240
Review URL: http://codereview.chromium.org/28183

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1376 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 13:32:44 +00:00
ager@chromium.org
411b7d18f6 Fix lint issues found by tools/presubmit.py.
TBR=mikhail.naganov
Review URL: http://codereview.chromium.org/28178

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 07:05:53 +00:00
iposva@chromium.org
c093e94546 - Pass the knowledge whether the old GC is compacting to the GC prologue and epilogue. This allows us to skip frame cooking and uncooking when doing a mark-sweep GC.
- Add the ability for the code to refer to its code object by adding a handle to the code object in the MacroAssembler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:52:15 +00:00
kasperl@chromium.org
d8c56a7fc4 Fix ARM build.
TBR=olehougaard@chromium.org
Review URL: http://codereview.chromium.org/28115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:13:57 +00:00
mikhail.naganov@gmail.com
632d4e4f3d Adding unit tests for profiler's stack tracer.
The testing is a bit tricky because we need to obtain a frame
pointer (EBP on IA-32) from inside of a function. This is especially
interesting in case of a compiled JavaScript function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:00:21 +00:00
kasperl@chromium.org
1e42e70021 Use SSE3 instructions - if available - for faster To(U)Int32
conversion in bit operation stubs. Disable serialization
support by default to allow us to use SSE3 instructions and
faster write barrier code when running without snapshot.
Review URL: http://codereview.chromium.org/27046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 14:57:46 +00:00
sgjesse@chromium.org
ad7ad5cfe0 Fixed lint errors.
The previous commit (r1349) resulted in a number of lint errors - extra whitespace and a missing explicit on a constructor in the test. These has been fixed.

TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/27089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-24 14:22:42 +00:00
mikhail.naganov@gmail.com
1d843bfa3d Fixed regression http://code.google.com/p/v8/issues/detail?id=236.
The problem was that the case of 'undefined' script source wasn't
handled in Script::InitLineEnds.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-24 13:33:49 +00:00
sgjesse@chromium.org
be059966c1 Add socket support to platform code.
The new Socket class is an encapsulation of the standard BSD socket API. As it depends on platform specific include files and have some slight platform variations it is part of the platform code.

On Mac OS only the option SO_REUSEADDR is set to true for server sockets. Running the test required it as the bound listener socket would sometimes end up in TIME_WAIT. On Windows and Linux this has never been observed (given the client end of the socket is closed before the server end).

The code has been tested on Windows, Linux and Mac OS. The FreeBSD version is a copy of the Linux version but has not been compiled nor tested.

Missing Xcode project updates.
Review URL: http://codereview.chromium.org/27085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-24 13:32:01 +00:00
lrn@chromium.org
f8051275e0 Add test for GC during RegExp.
Fix bug found by test.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-20 13:03:54 +00:00
sgjesse@chromium.org
bdaf8320e4 Fixed Linux build.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/20493

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-19 14:29:48 +00:00
sgjesse@chromium.org
44b83d3e77 Add host callback for debug break.
Add the ability to have the host embedding V8 receive a callback in the V8 thread while V8 is processing a debug callback. When V8 is processing a debug callback the thread where V8 is executing is sitting in a tight loop processing debug commands until the continue command has been executed. In some embedding situations it is beneficial to be able to call back into the embedding host from the thread where V8 is sitting. The might have functions which needs to be called to complement the JavaScript debugging.

Using the uint16_t array to pass a void* is a temporary hack.
Review URL: http://codereview.chromium.org/20491

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-19 14:02:42 +00:00
sgjesse@chromium.org
a0aa0309a2 Fix lint errors and compile erors on Linux.
TBR=ager
Review URL: http://codereview.chromium.org/21349

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-13 12:50:47 +00:00
sgjesse@chromium.org
ceef7cb854 Make the debugger completely unload when the debug event listener is unregistered.
Added a number of handle scopes to the debugger code to keep handles local to the function using them.

Fixed SetDebugEventListener to actually unregister when passed a NULL pointer. Previously this NULL pointer was wrapped in a Proxy.

BUG=1242702
Review URL: http://codereview.chromium.org/21347

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-13 12:36:58 +00:00
iposva@chromium.org
be6b490fb0 Remove experimental ExternalSymbolCallback feature. This is not needed
since we can now transform String objects to be external when needed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-12 16:58:55 +00:00
iposva@chromium.org
1bf2c7405e Allow the morphing of strings to external strings to avoid having to
create copies in the embedding code (aka WebKit V8 bindings) on every
external use.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-11 23:52:52 +00:00
olehougaard
1a3cdf3fc1 Differentiating the file names between different serialization tests to avoid conflict when testing in parallel.
Review URL: http://codereview.chromium.org/20079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-05 10:06:55 +00:00
olehougaard
e9a496a5fe Fix lint error.
Review URL: http://codereview.chromium.org/21011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 09:00:43 +00:00
olehougaard
da4fdea61a Fixing the flakiness of the serialization tests by assuring that serialization is run before every deserialization test.
Review URL: http://codereview.chromium.org/19541

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 08:35:03 +00:00
sgjesse@chromium.org
c5964cb7ad File missing from http://codereview.chromium.org/19753.
TBR=ager
Review URL: http://codereview.chromium.org/21010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 08:21:30 +00:00
olehougaard
978c62a42d Placing the snapshot in local directory for serialization test to avoid problems with permissions and multiple processes using same file.
Review URL: http://codereview.chromium.org/19503

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-30 13:21:29 +00:00
lrn@chromium.org
6e13e8ce37 Parsing a RegExp decimal escape could overflow, making an otherwise too large
decimal escape be accepted as a capture index.
We introduce a limit on the nubmer of allowed captures in a regexp, and break off
parsing of the decimal escape at that point.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-30 10:38:25 +00:00
ager@chromium.org
db1896c253 Make sure that the prototype of the initial map is created in the
right context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1157 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 15:09:44 +00:00
olehougaard
baac94254f Reintroduced a fix for an alignment issue on ARM. I had reverted it by mistake. This fixes the serialization test suite on ARM.
Review URL: http://codereview.chromium.org/18751

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 13:21:49 +00:00
olehougaard
1efdae68a5 Fixing alignment issue allowing serialization to run on ARM.
Review URL: http://codereview.chromium.org/18746

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 11:33:12 +00:00
sgjesse@chromium.org
0dab442be9 Added handling of hidden prototype objects when collecting local properties for an object mirror. The property names provided by an object mirror now includes all properties from the object and any hidden prototypes merged together.
Changed the name of Runtime_GetPrototype to Runtime_DebugGetPrototype to indicate that it is a debugger related function and changed its implementation to do the correct __proto__ lookup.

Added some more information to the Map debug print.
Review URL: http://codereview.chromium.org/18658

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-22 13:20:31 +00:00
sgjesse@chromium.org
f5f1cd2921 Changes to the V8 debugger support which otherwise caused problems with Chrome.
Added quoting of the name of the ref property using {"ref":1} instead of {ref:1}. The Chrome C++ JSON parser implementation requires quoted property names.

Changed the JSON format for non finite numbers. The previous formatting using NaN, Infinite and -Infinite caused the Chrome C++ JSON parser implementation to fail. Values "NaN", "Infinite" and "-Infinite" (incuding quotes) are now used.

Reverted changes to DebugLookupResultValue (runtime.cc) from http://codereview.chromium.org/17377. The change caused callback into Chrome with the current V8 context expected to have a DOM Window global object. This is not the case when the debugger context is the active context. This causes properties from interceptors and accessors to be reported as undefined in the debugger.
Review URL: http://codereview.chromium.org/18194

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-19 15:21:41 +00:00
ager@chromium.org
47d1298236 Change the handling of catch blocks to use context extension objects
instead of normal JSObjects.

This ensures that __proto__ and accessors on the Object prototype do
not interfere with catch scopes.  Also, it fixes the bug that catch
variables were not DontDelete (issue 74).

Next step is to create special lookup routines for context extension
objects and remove the special handling of context extension objects
from the general javascript object lookup routines.
Review URL: http://codereview.chromium.org/18143

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1091 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-16 09:42:08 +00:00
feng@chromium.org
de06f3092c Avoid using sprintf_s, which is windows-only.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 19:42:51 +00:00
feng@chromium.org
2cb36759ba Fix issue 6264 with a test case.
The problem is that Disable/EnableAccessCheck on an object may chnage its constructor's behavior
if object's map is the same as constructor's initial map. By copying maps, the constructor's
initial map is not changed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 17:39:23 +00:00
christian.plesner.hansen@gmail.com
37a50a8059 Fixed test failure caused by being more conservative in estimating the
length of expressions containing backreferences.  Bad plesner for
forgetting to run the tests before submitting!


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-14 11:48:52 +00:00