Commit Graph

209 Commits

Author SHA1 Message Date
vitalyr@chromium.org
04537cb227 Use v8::internal threading support in samples/shell.cc.
We need this for isolates testing. To make it work I had to extend the
internal Thread constructor with an option to set the stack size (see
the comment in shell.cc).

BUG=1264

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 15:04:17 +00:00
vitalyr@chromium.org
7976ca2cbc Merge isolates to bleeding_edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832 Revert r7268: it borked the history.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
mmaly@chromium.org
1d040083b0 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

Revert "Revert "Assignment to read only properties throws in strict mode.""

This reverts commit aefcd82e1d36d458dd071ebf4777340f08aa67b1.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-02 04:53:43 +00:00
mmaly@chromium.org
749b69853a Revert "Assignment to read only properties throws in strict mode."
This reverts commit 503f2a501e504f330821f247074e731aa649b1f0.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 06:10:41 +00:00
mmaly@chromium.org
98aea3c353 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 01:42:37 +00:00
mmaly@chromium.org
e0be3072b5 Implement assignment to undefined reference in ES5 Strict Mode.
Strict mode assignment to undefined reference.
Simple assignments (x = <value>) use CODE_TARGET_CONTEXT.
StoreIC stores its own strictness in extra_ic_state.
The strcitness is propagated as further ic stubs are generated.

Details:
* ReferenceError on assignment to non-resolvable reference in strict mode.
* Fix es5conform test expectation file.
* Add es5conform test suite into .gitignore.
* Fix Xcode project.
* Change implemented in virtual frame code generator, as well as full-codegen
  for all architectures.
* Fix debugger test.
* Fix comment for CODE_TARGET_CONTEXT
* Implement remaining StoreIC stubs to be strict mode aware.
* Trace extra_ic_state() for ic code stubs.

Code Review URL: http://codereview.chromium.org/6474026/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-13 16:19:53 +00:00
mmaly@chromium.org
3f4701df7f Revert r6756. Check failed on V8 arm - debug - crankshaft.
Need to investigate.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-11 23:25:07 +00:00
mmaly@chromium.org
fd6338bdda Implement assignment to undefined reference in ES5 Strict Mode.
Strict mode assignment to undefined reference.
Simple assignments (x = <value>) use CODE_TARGET_CONTEXT.
StoreIC stores its own strictness in extra_ic_state.
The strcitness is propagated as further ic stubs are generated.

Details:
* ReferenceError on assignment to non-resolvable reference in strict mode.
* Fix es5conform test expectation file.
* Add es5conform test suite into .gitignore.
* Fix Xcode project.
* Change implemented in virtual frame code generator, as well as full-codegen
  for all architectures.
* Fix debugger test.
* Fix comment for CODE_TARGET_CONTEXT
* Implement remaining StoreIC stubs to be strict mode aware.
* Trace extra_ic_state() for ic code stubs.

Code Review URL: http://codereview.chromium.org/6474026/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-11 21:39:59 +00:00
sgjesse@chromium.org
2957881a26 Misc debugger enhancements and bug fixes.
1. Added gdb style debugger commands (and their shortcuts) for d8.
These include:
- s[tep] : step into the current statement.
- s[tep]i[n]: step into the current statement with the minimum step.
- n[ext] : step to the next statement.
- fin[ish] : step out of the current function.
- cond : setting conditions on breakpoints.
- d[elete] : deletes breakpoints.
- en[able]|dis[able]: enables/disables breakpoints including
exception breakpoints.
- ignore : ignores a breakpoint for a specified period.
- inf[o] ar[gs] : info on arguments of the current function.
- inf[o] lo[cals] : info on local vars of the current function.
- inf[o] br[eakpoints] : info on breakpoints.
- l[ist] : similar to source, but allows the user to continually
dump subsequent lines of source code either in the
forward or backward direction.
- quit / exit / disconnect : terminates the remote debugger
session.

NOTE: Active breakpoints will automatically be disabled when
the remote debugger detaches. This allows v8 to continue to
run without worrying about a loss of a debugger session.

2. Added support for breaking the debugger by simply typing ENTER.
The break command is now optional.

3. Once the debugger is broken, the user can now just type ENTER
to repeat the last command. This is useful to functionality that
needs to be invoked repeatedly e.g. step, list.

4. Added more verbose descriptions in d8's help.

5. Fixed a line and column number offset bug in the listing of breakpoint
line and column numbers.

6. Added a gc command to allow GCs to be requested from the debugger
interface. The plumbing for requesting different types of GCs is
there, but the underlying implementation currently only triggers a
full mark-compact GC. The command also returns the before and after
sizes of the heap.

7. Added trace json, and flags commands that are not published in help.
trace json is used for tracing the debugger packets send from and
received by d8. flags is for setting v8 flags. These are useful for
people debugging v8 itself, but not necessarily users of v8.

8. Added the ability to enable and disable break on all / uncaught
exceptions in to d8.

9. Added a fix to prevent the Debugger Agent from being re-instantiated
if one already exists.

10. Added the ability to filter results of the script command by matching
text or numbers on the results.

11. Added v8 flags to enable/disable the sending of debugger BeforeCompile,
AfterCompile, and ScriptCollected events.

12. Fixed some undefined value bugs that resulted in v8 or the debugger
failing.

13. Added a few minor WEBOS__ customizations (analogous to ANDROID
customizations).

Patch by Mark Lam from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/5980006
Review URL: http://codereview.chromium.org/6086010


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 13:14:32 +00:00
kasperl@chromium.org
90b3370374 Update V8 to version 3.0 (re-land r5920).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:31:57 +00:00
kasperl@chromium.org
51b494d096 Revert r5920. Will re-land shortly.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:01:02 +00:00
kasperl@chromium.org
e5860bd6a8 Update V8 to version 3.0.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 09:11:56 +00:00
sgjesse@chromium.org
af466d80a6 Add more tests of breaks in infinite loops
Move stack check in do while loops to before the continue target to enable breaks even if continue was always used in the loop.
Review URL: http://codereview.chromium.org/5184007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-19 12:08:52 +00:00
sgjesse@chromium.org
d8c22d9dc1 Add a test for debug break while running in an infinite loop
Fixed a bug where execution termination could get lost while leaving the debugger.
Review URL: http://codereview.chromium.org/4405003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5771 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 15:43:12 +00:00
antonm@chromium.org
9673ee5d59 Get rid of requested size in RetryAfterGC.
This was only used by Heap::CollectGarbage to check if after GC
available space is bigger than was requested, but nobody checked
the value returned by Heap::CollectGarbage, so requested size
was efficiently unused.

However, it may trigger spurious out of memory exceptions if requested
size is big enough.

BUG=http://code.google.com/p/chromium/issues/detail?id=54580

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5642 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-18 12:58:56 +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
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
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
sgjesse@chromium.org
1c1f416158 Fix breakpoints on inlined named stores in code from the optimizing compiler
Review URL: http://codereview.chromium.org/3164018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-17 11:06:12 +00:00
vegorov@chromium.org
bed254fac9 Do not apply JS_RETURN and DEBUG_BREAK_SLOT relocations on x64.
Improve tests for debug API to check behavior of JS_RETURN and DEBUG_BREAK_SLOT relocations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 13:38:27 +00:00
vegorov@chromium.org
2ba27d2201 Add RelocInfo::DEBUG_BREAK_SLOT to RelocInfo::kApplyMask on ia32/x64 to ensure that debug break slots get relocated correctly during compacting GC.
Review URL: http://codereview.chromium.org/3058048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5178 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 11:39:01 +00:00
podivilov@chromium.org
52762e4c59 Breakpoint position should be inside function body.
Review URL: http://codereview.chromium.org/2883042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5145 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-28 13:02:03 +00:00
mikhail.naganov@gmail.com
84ffa5610b Debugger: introduce parametrized debug break, the parameter is passed
back to EventListener to be able to dynamically specify behavior
on asynchronously enforced VM breakouts.

Review URL: http://codereview.chromium.org/2962007/show

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5063 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-14 08:23:35 +00:00
podivilov@chromium.org
9added5953 Clear function breakpoints in Debug::HandleWeakDebugInfo callback.
When removing debug_info from SharedFunctionInfo, clear all breakpoints associated with that debug_info.
This is needed because function will live in heap until next gc, and therefore can be found
by Runtime::FindSharedFunctionInfoInScript.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4997 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-01 11:48:45 +00:00
sgjesse@chromium.org
685cae6021 API: Resolve linker issues with using V8 as a DLL
This changes the way the constants kJSObjectType, kFirstNonstringType and kProxyType are made available to the inlined part of the V8 API. This change to fixed constants resolves linker this linker error Windows

error LNK2001: unresolved external symbol "public: static int v8::internal::Internals::kJSObjectType" (?kJSObjectType@Internals@internal@v8@@2HA)

when linking against a V8 DLL.

This change also makes it possible to build all the C++ tests with ENABLE_DEBUGGER_SUPPORT not defined. Now C++ tests run ENABLE_DEBUGGER_SUPPORT not defined, and only the JavaScript tests which tests the debugger fails when ENABLE_DEBUGGER_SUPPORT is not defined.
Review URL: http://codereview.chromium.org/2820016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4898 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-18 10:52:59 +00:00
podivilov@chromium.org
7808d45af5 Fix a bug when top level break points fall into the last function in script.
Review URL: http://codereview.chromium.org/2824007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 12:47:08 +00:00
podivilov@chromium.org
f5fdef253b Save actual break point location to script break point object.
Review URL: http://codereview.chromium.org/2864003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 14:50:07 +00:00
antonm@chromium.org
52975ae407 Remove old named property query API.
Review URL: http://codereview.chromium.org/2742007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 17:01:02 +00:00
sgjesse@chromium.org
634fb9152c More precise break points and stepping when debugging
Added support for more precise break points when debugging and stepping. To achieve that additional nop instructions are inserted where breaking would otherwise be impossible. The number of nop instructions inserted are sufficient to make place for patching with a call to a debug break code stub. On Intel that is 5 nop's for 32-bit and 13 for 64-bit. Om ARM 3 nop instructions (12 bytes) are required.

In order to avoid inserting nop's in to many places a simple ast checker have been added to check whether there are breakable code in a statement or expression. If it is possible to break in an expression no additional break enabeling code is inserted.

Added break locations to the true and false part of a conditional expression.

Added stepping tests to cover more constructs.

These changes are only in the full compiler.

Changed the default value for the option --debugger in teh d8 shell from true to false. The reason for this is that with --debugger turned on the full compiler will be used for all code in when running d8, which can be unexpeceted.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:04:49 +00:00
kaznacheev@chromium.org
ff61618c4b Extend CallIC to support non-constant names.
This speeds up constructs like this: 
var zz='replace'; '123'[zz]('3','4');

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:27:32 +00:00
antonm@chromium.org
12f6306420 First phase of migration to new named property query callbacks.
Eventually named property query callbacks will return attributes
(as an integer) or an empty handle if property is not intercepted.

To gradually migrate to this new API, USE_NEW_QUERY_CALLBACK
macro would control if old or new style API is used.

So the migration plan is:

1) introduce new API which should be explictily enabled;
2) switch to new API defining USE_NEW_QUERY_CALLBACK before
  include of <v8.h> (that would require changes to client code as well)
3) remove old API from v8
4) remove #define USE_NEW_QUERY_CALLBACK from clients.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4797 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 11:49:44 +00:00
yurys@chromium.org
f6a2ccf6b4 Provide debug event listener with access to the debuggee context. Also introduce new event listener setter that allows to set a callback that accepts single parameter encapsulating all debug event details so that additional information can later be passed to the listener without breaking compatibility with existing clients.
Review URL: http://codereview.chromium.org/2108024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4693 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 17:15:46 +00:00
serya@chromium.org
eaa95c523b Inlined load of string.length and array.length.
http://compute1.aar:9013/golem/r4583-v8-serya-length-inlined-vs-4583-v8.html

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 10:50:22 +00:00
yurys@chromium.org
cf63fc5b9e Ensure v8 is initialized before initializing debug context
Review URL: http://codereview.chromium.org/1756018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 11:59:43 +00:00
yurys@chromium.org
9223815b6e Temporarily disable DebugContextIsPreservedBetweenAccesses which fails when snapshot=on
TBR=sgjesse
Review URL: http://codereview.chromium.org/1723018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 10:09:20 +00:00
yurys@chromium.org
9a9a268756 Fix test-debug: make sure debugger is unloaded before running next test
Review URL: http://codereview.chromium.org/1704015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4527 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 09:18:53 +00:00
yurys@chromium.org
0908fdc2f8 Don't unload debug context after it was requested through public API
Review URL: http://codereview.chromium.org/1731011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 08:23:20 +00:00
erik.corry@gmail.com
e1b3b92a2c Make not sucking at regexp the default
(remove V8_NATIVE_REGEXP flag, add
V8_INTERPRETED_REGEXP flag).
Review URL: http://codereview.chromium.org/1635001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-19 19:30:11 +00:00
pfeldman@chromium.org
54f0a5b221 Expose debug context into the native code. This change is doing several things:
1) Exposes Local<Context> v8::Debug::GetDebugContext().
Rationale: We can already get debugger context instance using various workarounds,
so exposing it explicitly in the API only makes things more clear.

2) Removes debugger.HasJavaScriptFrames() requirement for entering debugger context.
Rationale: Sometimes we'd like to call into debugger from the external native code.

3) Makes Debugger v8::Debug::Call execute on debugger context's global object.
Rationale: This is somewhat arguable, but temporary measure. We've agreed that we
should introduce a DebugAPI object that would expose necessary API in the debug-delay.
The problem is that it would take some time to define this API and it is not really
convenient to do that on the v8 land given the difference in v8 / host lifecycle.
The plan is to compose this API as a Debug.* wrapper outside v8 by means of exposing
debugger context's global object here, and once API settles down, upstream it to v8 and
start making Debug::Calls on this new DebugAPI object instead.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-24 13:09:02 +00:00
serya@chromium.org
b1e705aa8c Typo fixed.
Review URL: http://codereview.chromium.org/650047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3933 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-23 12:52:29 +00:00
mikhail.naganov@gmail.com
dcef87af66 Enable passing of script data via script creation methods.
Patch by Andrey Kosyakov <caseq@chromium.org>
Original issue http://codereview.chromium.org/606053

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:15:31 +00:00
antonm@chromium.org
a9664cbd0d Making lint happy.
Review URL: http://codereview.chromium.org/593014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 11:48:53 +00:00
serya@chromium.org
9239bbdd91 Removing redundant stub for runtime native calls.
Review URL: http://codereview.chromium.org/543207

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 12:41:11 +00:00
sgjesse@chromium.org
30b4bff49b Fix building on 64-bit Windows
Review URL: http://codereview.chromium.org/546147

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 08:44:50 +00:00
antonm@chromium.org
29af9c54a4 Merge ObjectIterator::has_next and ObjectIterator::next methods.
This reduces chances of improper usage, see http://code.google.com/p/v8/issues/detail?id=586
for more details.

BUG=586

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 22:53:18 +00:00
peter.rybin@gmail.com
fceef5b798 Fix lint errors
Review URL: http://codereview.chromium.org/543154

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3676 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 19:28:13 +00:00
peter.rybin@gmail.com
b400427e10 Fix disable_break parameter
Review URL: http://codereview.chromium.org/552068

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 17:41:17 +00:00
peter.rybin@gmail.com
812eff2802 Fix EVEN number of bugs in already passing test
Review URL: http://codereview.chromium.org/552043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 17:37:28 +00:00
peter.rybin@gmail.com
b21bc9ed1a Fix lint error with strtol in test
Review URL: http://codereview.chromium.org/549111

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-20 18:27:44 +00:00
peter.rybin@gmail.com
265d2d970c Support backtrace debug command when stack is empty
Review URL: http://codereview.chromium.org/536089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-20 16:56:49 +00:00
peter.rybin@gmail.com
c8db42a351 Re-Fix DebugEvaluateWithoutStack test on Windows
Review URL: http://codereview.chromium.org/545118

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3654 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 15:40:42 +00:00
peter.rybin@gmail.com
23b42007c9 Fix DebugEvaluateWithoutStack test on Windows
Review URL: http://codereview.chromium.org/543115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3653 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 15:12:43 +00:00
ager@chromium.org
00b6a335b0 Fix Windows build by using OS::StrNCpy.
Fix lint issue in lineprocessor.cc.

TBR=peter.rybin
Review URL: http://codereview.chromium.org/549081

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3641 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 08:03:26 +00:00
peter.rybin@gmail.com
ba68b7770e Add another test on debug global evaluate
Review URL: http://codereview.chromium.org/553009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3639 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 19:14:27 +00:00
peter.rybin@gmail.com
6d7ce68102 Make debugger unloading deferred operation
This CL should make debugger handler setting an asynchronous operation for real.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 22:40:57 +00:00
peter.rybin@gmail.com
ec86bea132 Implement issue 554 Add "ProcessDebuggerRequests" call to Debug Agent API
Review URL: http://codereview.chromium.org/549057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3623 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 21:14:56 +00:00
yurys@chromium.org
bb0431b097 Fix presubmit error: remove whitespace
TBR=sgjesse
Review URL: http://codereview.chromium.org/504012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3466 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-15 09:34:00 +00:00
yurys@chromium.org
e88df5b792 Ignore debug break events when bootstrapper is active. Collecting debug data when the context is not yet setup may lead to subtle errors like in the following Chromium bug: http://crbug.com/28933
Review URL: http://codereview.chromium.org/497006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3465 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-15 09:17:15 +00:00
sgjesse@chromium.org
6d163d9fd0 Remove usage of JSArray in Script object
Storing a JSArray in the Script object could cause an indirect reference from the compilation cache to a global object to be created. Now the line ends are only stored as a FixedArrya and when that is needed in JavaScript a JSArray copy is created. Changed some of the JavaScript code to cache the line ends in a local variable for better performance.

BUG=http://code.google.com/p/v8/issues/detail?id=528
TEST=test/test-api/Bug528
Review URL: http://codereview.chromium.org/434117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-27 14:10:48 +00:00
sgjesse@chromium.org
d55d3ce89a Add DebugMessageDispatchHandler
A callback on the debugger thread when a message is received. Allows the 
embedding application to wake up the main thread in order to handle the 
message. Useful when the embedding application is idle and sitting in a 
select() call.

Patch by Ryan Dahl <coldredlemur@gmail.com>

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 08:59:28 +00:00
yurys@chromium.org
b6ce7ce8a3 Fix some presubmit errors.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/400001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 16:58:09 +00:00
yurys@chromium.org
0a384a708d Skip debugger frames when looking for calling context.
BUG=509

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 14:41:55 +00:00
yurys@chromium.org
5f3bdbe5a6 Remove trailing whitespace.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/384121

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 15:05:50 +00:00
yurys@chromium.org
b67d8f125a Test that pause can be set in script and won't lead to crash when execution is resumed.
The test currently fails on v8 trunk if the new compiler is used. The issue seems to be fixed on bleeding_edge so there is no changes to src, just test.

Cromium bug: http://crbug.com/26686
Review URL: http://codereview.chromium.org/384120

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3305 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 14:04:08 +00:00
lrn@chromium.org
d53f05e3e2 Fix warnings on Win64.
Set warning level to /W3 and change implicit conversions from size_t
to int. Most "fixes" are simply manifesting the implicit casts or using
a special strlen replacement that returns int.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:50:06 +00:00
yurys@chromium.org
0c6dc2c5cb Remove trailing whitespace in test-debug.cc to make flexo happy.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/388005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 17:39:54 +00:00
yurys@chromium.org
cd9660f77c All hidden properties of an object are stored in a value of a regular property with empty name. This property may confuse user if returned among regular properties. It should not be exposed directly by ObjectMirror. Should we want an access to these properties from debugger we need to implement an explicit method for that.
Current patch filters the hidden_symbol from property names returned to ObjectMirror.

See http://crbug.com/26491

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 16:13:21 +00:00
sgjesse@chromium.org
41d6cae46d Fix issue 493: Infinite loop when debug break is set when entering function.apply.
In the generated code for function.apply there was a loop checking the stack limit for interruption. This loop would call into the runtime system to handle interuption and keep running until there was no interruption. However if the interuption was debug break the runtime system would never clear the interruption as debug break is prevented in builtins are prevented and the assumption here was that returning with the debug break flag set would move execution forward.

Renamed initial_jslimit and initial_climit to real_jslimit and real_climit. Renamed a few external references related to the stack limit as well.

Exposed the real stack limit to generated code to make the stack check when entering function.apply use the real stack limit and not the stack limit which is changed to signal interruption.

Added the real stack limit to the roots array.

BUG=http://code.google.com/p/v8/issues/detail?id=493
TEST=cctest/test-debug/DebugBreakFunctionApply
Review URL: http://codereview.chromium.org/345048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 13:59:40 +00:00
christian.plesner.hansen@gmail.com
a1b2f47600 Reverting 3174. Aka reapplying 3150, 3151 and 3159. Aka api accessor
ics.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 08:51:48 +00:00
sgjesse@chromium.org
be769f6a24 Reverting 3159, 3151 and 3150
TBR=christian.plesner.hansen@gmail.com
Review URL: http://codereview.chromium.org/343035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 13:17:11 +00:00
christian.plesner.hansen@gmail.com
895f1d22e5 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.


Committed: http://code.google.com/p/v8/source/detail?r=3130
Review URL: http://codereview.chromium.org/330017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 15:38:49 +00:00
christian.plesner.hansen@gmail.com
2880be71ea Reverted 3130-3131 since they don't work on mac.
Review URL: http://codereview.chromium.org/335027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3133 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 15:16:42 +00:00
christian.plesner.hansen@gmail.com
53b93464d1 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 13:54:47 +00:00
whesse@chromium.org
3aaa04a1c2 Change sscanf to atoi in test-debug.cc to make lint happy.
Review URL: http://codereview.chromium.org/264033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3049 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-12 13:55:06 +00:00
peter.rybin@gmail.com
de3e260e38 Make cctest test-debug.cc more accurate
Review URL: http://codereview.chromium.org/243036


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-09 16:27:47 +00:00
ager@chromium.org
e9acdc7a00 Follow the spec in disallowing function declarations without a name. We
used to allow these for compatibility, but both Safari and Firefox now
disallow them.
Review URL: http://codereview.chromium.org/242124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 12:47:15 +00:00
christian.plesner.hansen@gmail.com
319097f255 Fixed some cctest flakiness on mac.
Review URL: http://codereview.chromium.org/242003


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2968 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-25 10:36:00 +00:00
sgjesse@chromium.org
34d6ff7606 Implemented missing pieces of the debugger for ARM.
The main piece of this change was to add support for break on return for ARM. On ARM the normal js function return consist of the following code sequence.

  mov sp, fp
  ldmia sp!, {fp, lr}
  add sp, sp, #4
  bx lr

to a call to the debug break return entry code using the following code sequence

  mov lr, pc
  ldr pc, [pc, #-4]
  <debug break return entry code entry point address>
  bktp 0

The values of Assembler::kPatchReturnSequenceLength and Assembler::kPatchReturnSequenceLength are somewhat misleading, but they fit the current use in the debugger. Also Assembler::kPatchReturnSequenceLength is used in the IC code as well (for something which is not related to return sequences at all). I will change that in a separate changelist.

For the debugger to work also added recording of the return sequence in the relocation info and handling of source position recording when a function ends with a return statement.

Used the constant kInstrSize instead of sizeof(Instr).

Passes all debugger tests on both simulator and hardware (only release mode tested on hardware).
Review URL: http://codereview.chromium.org/199075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-14 06:57:24 +00:00
sgjesse@chromium.org
e26c1c8d52 Use more socket ports in debugger agent test.
This is an attempth to address the flakiness of the test cctest/test-debug/DebuggerAgent on the Mac build-bot.
Review URL: http://codereview.chromium.org/200037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-07 13:24:43 +00:00
mike@belshe.com
f736ed3ff8 Forgot to change API signature for V8 tests.
BUG=none
TEST=none

TBR=ager

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-25 03:18:40 +00:00
lrn@chromium.org
fdf31f7f5e X64: Implement debugger hooks.
Debugger is now fully functional.
Fix difference in emitting statement positions to match ia32.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 10:18:30 +00:00
christian.plesner.hansen@gmail.com
e64bf9ad6c Added API for getting object mirrors
Added Debug::GetMirror call to get a mirror for a given object.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-17 14:26:48 +00:00
yurys@chromium.org
080ebefb15 Remove trailing whitespace in test-debug.cc
Review URL: http://codereview.chromium.org/160095

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2533 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-24 07:39:53 +00:00
yurys@chromium.org
161d38c614 Debugger should not stop in its own code and in code of built-in functions since it may confuse user.Debug break handler checks whether current function is a built-in or a debugger one and just resumes execution if it is.
CallCheckStackGuardState is no longer called in loop in the RegExp code as it hangs if debug break flag is not reset after calling Execution::HandleStackGuardInterrupt.
Review URL: http://codereview.chromium.org/160001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-24 06:14:23 +00:00
lrn@chromium.org
72de7ab74e Separate native and interpreted regexp by compile time flag, not runtime.
Clean-up of RegExp code.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-07 08:11:19 +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
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
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
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
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
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
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
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
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
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