Commit Graph

594 Commits

Author SHA1 Message Date
mvstanton@chromium.org
529f801fde Adapt Danno's Track Allocation Info idea to fast literals. When allocating a literal array,
we store an AllocationSiteInfo object right after the JSArray, with a pointer to the
boilerplate object. Later, if the array transitions we check for the continued existence
of the temporary AllocationSiteInfo object (has no roots). If found, we'll use it to
transition the boilerplate array as well.

Danno's original changeset: https://codereview.chromium.org/10615002/

Review URL: https://codereview.chromium.org/11663005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-08 09:03:16 +00:00
rossberg@chromium.org
b25c040c2c Extend API to allow setting length property for function templates.
R=yangguo@chromium.org
BUG=125308

Review URL: https://codereview.chromium.org/11631002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13240 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-19 10:28:36 +00:00
yangguo@chromium.org
7597d5011e include: fix String::New() comment
Review URL: https://chromiumcodereview.appspot.com/11446035
Patch from Ben Noordhuis <ben@c9.io>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-18 09:22:25 +00:00
yangguo@chromium.org
e24b98312b Revert r13218 due to windows test failures.
R=verwaest@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11568014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13219 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-13 17:21:15 +00:00
yangguo@chromium.org
4cd41edcd9 Add methods to allow resuming execution after calling TerminateExecution().
Two new methods are added to allow embedders to determine that execution
should be resumed at a particular point in the stack without being forced
to unwind all JS frames.

* V8::ResumeExecution() -- When execution is terminated via a call to
  V8::TerminateExecution(), this method can be called to clear the
  termination exception so that the engine can continue to be used.

* TryCatch::HasTerminated() -- When a TryCatch has caught a termination
  exception, HasTerminated() will return true to indicate it is valid to
  call V8::ResumeExecution() if desired.

A test case is added to cctest/test-thread-termination.cc.

BUG=v8:2361

Patch from Andrew Paprocki <andrew@ishiboo.com>.

Review URL: https://chromiumcodereview.appspot.com/11142013
Patch from Andrew Paprocki <andrew@ishiboo.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-13 16:38:49 +00:00
svenpanne@chromium.org
608bce5023 Remove SlidingStateWindow and related code.
Review URL: https://codereview.chromium.org/11441034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13172 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-07 13:47:42 +00:00
mstarzinger@chromium.org
e46b251324 Pass Isolate to MakeWeak(), IsWeak(), and AddObjectGroup().
BUG=
TEST=cctest/test-api/ApiObjectGroupsCycle

Review URL: https://codereview.chromium.org/11360082
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13139 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-05 10:14:10 +00:00
mstarzinger@chromium.org
0e3fece02d Pass Isolate to Local<T>::New()
Our profiling revealed that Local<T>::New() is one of bottlenecks of DOM bindings.

BUG=
TEST=cctest/test-api/LocalHandle

Review URL: https://codereview.chromium.org/11316331
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-05 09:13:53 +00:00
yurys@chromium.org
cec0745aa2 Introduce callback for resolving global object name while taking heap snapshot
Heap profiler currently gets "document" of global objects while taking snapshot (to later retrieve its "URL"). This is unsafe as there may be no current v8 context when the property is requested while corresponding property accessor may make some assumptions about the context stack during its invokation. Several crashes were reported due to this problem:
https://bugs.webkit.org/show_bug.cgi?id=103076
https://crbug.com/162121
https://crbug.com/132727

This patch adds a callback for resolving global object names and avoid the crashes.
Review URL: https://codereview.chromium.org/11415203

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-04 17:17:55 +00:00
svenpanne@chromium.org
1d716ec259 Force inlining for hot interface functions.
Review URL: https://codereview.chromium.org/11411355

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-04 13:54:22 +00:00
mstarzinger@chromium.org
76dfa8ed60 Enforce stack allocation of TryCatch blocks.
R=svenpanne@chromium.org
BUG=v8:2166,chromium:152389

Review URL: https://codereview.chromium.org/11411353

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-04 12:14:19 +00:00
svenpanne@chromium.org
c8bc4db52f Enable deprecations.
In addition, use a more common style in the preprocessor condition, making
e.g. '-DV8_ENABLE_DEPRECATIONS=0' do the expected thing. Removed a useles

Review URL: https://codereview.chromium.org/11413113

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13024 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-21 10:16:07 +00:00
svenpanne@chromium.org
673924413f Re-land rev. 12849 and 12868 (Heavy cleanup of the external pointer API + related fix).
Review URL: https://codereview.chromium.org/11365224

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-13 12:27:03 +00:00
svenpanne@chromium.org
09666b60b8 Rollback of r12868, r12849 on bleeding_edge.
Fixed visibility attribute for GetPointerFromInternalField

Heavy cleanup of the external pointer API.

Review URL: https://codereview.chromium.org/11359125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-09 10:07:54 +00:00
mstarzinger@chromium.org
a65e166aa7 Implement MarkIndependent(Isolate*) and MarkPartiallyDependent(Isolate*)
BUG=
TEST=cctest/test-api/IndependentWeakHandle

Review URL: https://codereview.chromium.org/11369131
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12904 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-08 15:01:26 +00:00
mstarzinger@chromium.org
762c36b6fb Allow collection of DOM objects in minor GC cycles.
A design document: https://docs.google.com/a/google.com/document/d/16DeHrzkm3cO9XCPT1aK3Y5qgUxXB3RFmueqQWYmN2rI/edit

Performance & memory results: https://docs.google.com/a/google.com/document/d/1h0-EsHu7T0sSMuZm5eE0r1e8sCAzY3weLvsDUpOSngE/edit

The WebKit side patch: https://bugs.webkit.org/show_bug.cgi?id=98725

At present no one is using the V8 APIs this patch is going to add. After this patch is landed, the WebKit side patch will use it.

BUG=

Review URL: https://codereview.chromium.org/11085015
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12874 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-06 17:32:15 +00:00
mstarzinger@chromium.org
c54fc70f13 Store Object.observe state per-isolate rather than per-context
This requires adding a new JSObject to the strong root list and populating it from
object-observe.js. The main other change is that we now directly use ObjectHashTable
from JS rather than using WeakMap, since using the latter would end up leaking whichever
Context initialized that observation state.

Added a test via the API showing that different contexts all end up working on the same state.

Review URL: https://codereview.chromium.org/11274014
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-06 16:47:15 +00:00
svenpanne@chromium.org
b22aacc68e Fixed visibility attribute for GetPointerFromInternalField
TBR=verwaest@chromium.org

Review URL: https://codereview.chromium.org/11312099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-06 13:07:06 +00:00
mstarzinger@chromium.org
b77e629f1a Implement IsIndependent(Isolate*)
BUG=
TEST=cctest/test-api/IndependentWeakHandle

Committed: https://code.google.com/p/v8/source/detail?r=12852

Review URL: https://codereview.chromium.org/11368053
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 13:20:45 +00:00
mstarzinger@chromium.org
ea00c51e24 Implement IsIndependent(Isolate*)
BUG=
TEST=cctest/test-api/IndependentWeakHandle

Review URL: https://codereview.chromium.org/11368053
Patch from Kentaro Hara <haraken@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12852 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 12:35:51 +00:00
svenpanne@chromium.org
f3807ca17b Heavy cleanup of the external pointer API.
Added highly efficient Object::SetAlignedPointerInInternalField and
Object::GetAlignedPointerFromInternalField functions for 2-byte-aligned
pointers. Their non-aligned counterparts Object::GetPointerFromInternalField and
Object::SetPointerInInternalField are now deprecated utility functions.

External is now a true Value again, with New/Value/Cast using a JSObject with an
internal field containing a Foreign. External::Wrap, and External::Unwrap are now
deprecated utility functions.

Added Context::GetEmbedderData and Context::SetEmbedderData. Deprecated
Context::GetData and Context::SetData, these are now only wrappers to access
internal field 0.

Added highly efficient Context::SetAlignedPointerInEmbedderData and
Context::GetAlignedPointerFromEmbedderData functions for 2-byte-aligned
pointers.

Review URL: https://codereview.chromium.org/11190050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 10:25:32 +00:00
yangguo@chromium.org
64793b3f0d Correctly visit all external strings.
BUG=

Review URL: https://chromiumcodereview.appspot.com/11340010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-02 12:45:00 +00:00
mstarzinger@chromium.org
37759f4d64 Implement committed physical memory stats for Linux.
The patch introduces CommittedPhysicalMemory function to
the Heap class that reports committed *physical* memory acquired
for the heap from the OS.
It is important because some OSes may defer actual committment on e.g.
first access to the region.
So reporting just plain committed size led to various weird artifacts
like showing V8 allocated memory higher than the whole process
private size.

BUG=v8:2191

Review URL: https://codereview.chromium.org/11066118
Patch from Alexei Filippov <alph@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-22 16:33:10 +00:00
danno@chromium.org
063609280e Add a faster API for creating v8::Integer objects
In WebKit, we have a small integer cache because calling v8::Integer::New is
slow. This patch adds a faster API for creating integers that requires the
caller to supply the v8::Isolate, saving us the work of looking up the isolate
in thread-local storage.

BUG=

Review URL: https://codereview.chromium.org/11212004
Patch from Adam Barth <abarth@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-19 11:15:04 +00:00
yangguo@chromium.org
5fa8f2f485 Pass pending exception to the message listener.
BUG=

Review URL: https://chromiumcodereview.appspot.com/11014017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-19 08:45:24 +00:00
svenpanne@chromium.org
9dc2c5b83d Add an API for enumerating persistent handles
This API lets the embedder enumerate handles that have class ids. WebKit will
use this feature during garbage collection to compute object groups for DOM
nodes. Previously, we kept a list of DOM nodes on the WebKit side, but that
list is redundant with the global handles list in V8.

Review URL: https://codereview.chromium.org/11190011
Patch from Adam Barth <abarth@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-18 06:52:37 +00:00
rossberg@chromium.org
329cf12363 Make sure that names of temporaries do not clash with real variables.
R=mstarzinger@chromium.org
BUG=v8:2322

Review URL: https://codereview.chromium.org/11035054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12668 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-05 12:47:34 +00:00
mstarzinger@chromium.org
5b64362706 Revert r12625 due to sandbox incompatibility.
Original message: Implement committed physical memory stats for Linux.
This had to be reverted because it crashes when compiled into Chromium
due to the sandbox not allowing the mincore call.

R=verwaest@chromium.org
BUG=v8:2191

Review URL: https://codereview.chromium.org/11023010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12640 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-01 12:11:06 +00:00
mstarzinger@chromium.org
974a2268bb Implement committed physical memory stats for Linux.
The patch introduces CommittedPhysicalMemory function to the Heap class
that reports committed *physical* memory acquired from the OS.
It is important because some OSes may postpone actual commitment on e.g.
first access to the previously committed region.
So reporting just plain committed size led to various weird artifacts
like DevTools showing V8 allocated memory higher than the whole process
private size.

BUG=v8:2191

Review URL: https://codereview.chromium.org/10961042
Patch from Alexei Filippov <alph@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12625 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-27 13:27:50 +00:00
ulan@chromium.org
4bd4fb1aa4 Throw a more descriptive exception when blocking 'eval' via CSP.
BUG=140191

R=svenpanne@chromium.org,mkwst@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10837358

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-17 09:58:22 +00:00
danno@chromium.org
48d327d0b4 Let the embedder store arbitrary Values via Context::SetData
In WebKit, we would like to store a void* to a data structure that contains
lots of exciting per-context data. The current API restricts us to storing only
Strings, which is less useful.

I've also cleaned up the implementation of GetData to be less convoluted.

Review URL: https://codereview.chromium.org/10907189
Patch from Adam Barth <abarth@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-14 16:13:23 +00:00
yangguo@chromium.org
6a9e4048aa Introduce new API to expose external string resource regardless of encoding.
BUG=

Review URL: https://chromiumcodereview.appspot.com/10917211

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-12 11:29:50 +00:00
yangguo@chromium.org
bf229e93eb Enable/disable LiveEdit using the (C++) debug API.
BUG=

Review URL: https://chromiumcodereview.appspot.com/10875072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12472 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-10 09:24:17 +00:00
svenpanne@chromium.org
7af6883098 Fixed deoptimization of inlined getters.
It is necessary to explicitly handle the internal frame lying between the caller
of the getter and the getter itself in the deoptimizer: When the getter is
inlined, leaving the internal frame restores the correct context.

BUG=http://crbug/134609
TEST=mjsunit/regress/regress-crbug-134609

Review URL: https://chromiumcodereview.appspot.com/10910110

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12470 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-07 09:01:54 +00:00
yangguo@chromium.org
5ac2a5d22e Revert r12430, r12432, r12433 (basic support for Latin1).
BUG=

Review URL: https://chromiumcodereview.appspot.com/10905075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12438 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-04 12:23:22 +00:00
yangguo@chromium.org
74f06b1f99 Add basic support for Latin1 to the API.
BUG=

Review URL: https://chromiumcodereview.appspot.com/10857030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-03 15:06:36 +00:00
yangguo@chromium.org
5dd51bafef Cache results in SearchRegExpMultiple.
BUG=

Review URL: https://chromiumcodereview.appspot.com/10837290

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12416 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-31 09:28:01 +00:00
loislo@chromium.org
5cd4e83bbc Remove obsolete method declarations from HeapEntry class.
BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10892033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12410 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-29 16:12:23 +00:00
yangguo@chromium.org
4e2027bbc2 Revert r12379 (Add checks to external string API).
R=ulan@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/10897027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-29 15:23:48 +00:00
jkummerow@chromium.org
f9d4856289 Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers.
BUG=None
TEST=Included in CL.

Committed: https://code.google.com/p/v8/source/detail?r=12389

Review URL: https://chromiumcodereview.appspot.com/10795074
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-28 14:43:28 +00:00
verwaest@chromium.org
a713f82aa6 Revert "Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers."
This reverts commit r12389.

TBR=jkummerow@chromium.org, CC=siggi@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10870108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12390 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-27 19:47:02 +00:00
jkummerow@chromium.org
0a6493b5a8 Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers.
BUG=None
TEST=Included in CL.

Review URL: https://chromiumcodereview.appspot.com/10795074
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-27 18:03:38 +00:00
rossberg@chromium.org
cd585f26ab Introduce global contexts to represent lexical global scope(s).
They are yet unused; actual allocation of global lexical bindings in these contexts is implemented in a separate follow-up CL.

R=svenpanne@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/10876067

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-27 09:40:26 +00:00
yangguo@chromium.org
89cd0677dc Add check to external string resource.
Extensions are a source of external strings where we don't perform check yet.

R=ulan@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/10878025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-24 13:01:52 +00:00
svenpanne@chromium.org
b10d5d7f08 Deoptimization support for accessors.
Highlights of this CL:

 * Introduced a new opcode in the deoptimizer for a setter stub frame.

 * Added a global setter stub for returning after deoptimizing a setter.

 * We do not need special deopt support for getters, although the getter stub creates an internal frame. The normal machinery works just right for this case, although we generate a stack that can never occur during normal fullcode execution. If this hurts us one day, we can parameterize and reuse the setter deopt machinery.

Review URL: https://chromiumcodereview.appspot.com/10855098

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-17 10:43:32 +00:00
yangguo@chromium.org
4d1d1eb53e Fix building with GCC 3.x
R=yangguo@chromium.org
BUG=v8:2016, v8:2017
TEST=

Review URL: https://chromiumcodereview.appspot.com/10823034
Patch from James Pike <g00gle@chilon.net>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-26 09:18:09 +00:00
yangguo@chromium.org
6b489d9753 Improve String::WriteAscii and add PRESERVE_ASCII_NULL option.
The PRESERVE_ASCII_NULL option prevents WriteAscii from converting
\0 to white space.

R=verwaest@chromium.org
BUG=v8:2252
TEST=test-api/StringWrite

Review URL: https://chromiumcodereview.appspot.com/10810056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-23 14:22:46 +00:00
danno@chromium.org
43d0ed048d Implements a new API to set a function entry hook for profiling.
Exposes a new API; V8::SetFunctionEntryHook.
If a non-NULL function entry hook is set, the code generator(s) will invoke on the entry hook at the very start of each generated function.

Committed: https://code.google.com/p/v8/source/detail?r=12069

Committed: https://code.google.com/p/v8/source/detail?r=12083

Review URL: https://chromiumcodereview.appspot.com/10706002
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12107 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-17 15:18:15 +00:00
danno@chromium.org
b1530257ab Revert 12083: Implements a new API to set a function entry hook for profiling.
TBR=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10695206

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12084 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-13 16:33:27 +00:00
danno@chromium.org
5c8c4bec46 Implements a new API to set a function entry hook for profiling.
Exposes a new API; V8::SetFunctionEntryHook.
If a non-NULL function entry hook is set, the code generator(s) will invoke on the entry hook at the very start of each generated function.

Committed: https://code.google.com/p/v8/source/detail?r=12069

Review URL: https://chromiumcodereview.appspot.com/10706002
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-13 16:18:37 +00:00
danno@chromium.org
30569cba9b Revert 12069: Implements a new API to set a function entry hook for profiling
Reverted due to waterfall failures

TBR=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10704189

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 15:59:50 +00:00
danno@chromium.org
d6edbdd436 Implements a new API to set a function entry hook for profiling.
Exposes a new API; V8::SetFunctionEntryHook.
If a non-NULL function entry hook is set, the code generator(s) will invoke on the entry hook at the very start of each generated function.

Review URL: https://chromiumcodereview.appspot.com/10706002
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12069 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 15:42:39 +00:00
yangguo@chromium.org
791632cf06 Fix compilation when disabling debugger support.
Based on a patch by Remi Duraffort <remi.duraffort@st.com>: http://codereview.chromium.org/10702093/

R=mstarzinger@chromium.org
BUG=
TEST=build with debuggersupport=off

Review URL: https://chromiumcodereview.appspot.com/10697085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-05 16:23:14 +00:00
rossberg@chromium.org
680797234c Further extend TypedArray support in d8:
- Add copy constructors.
- Add subarray methods.
- Make instanceof and constructor property work.
- Rename PixelArray to Uint8ClampedArray.

Also fix broken definition of assertInstanceof in MJSUnit test harness.

R=mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10558005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11949 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-28 16:29:53 +00:00
alexeif@chromium.org
c1944660f5 Implement heap profiler memory usage reporting.
Review URL: https://chromiumcodereview.appspot.com/10535096

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-13 11:02:24 +00:00
mstarzinger@chromium.org
81e8aa0016 Implement implicit instance checks for API accessors.
This allows to specify a constructor against which an implicit instance
check is performed for API accessors. If the receiver is incompatible,
an implicit TypeError is thrown and no callback is invoked.

R=svenpanne@chromium.org
BUG=v8:2075
TEST=cctest/test-api/InstanceCheckOn[*]

Review URL: https://chromiumcodereview.appspot.com/10442129

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-08 07:45:11 +00:00
loislo@chromium.org
463a6ffdd4 Expose last seen heap object id via v8 public api.
BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10444137

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11702 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-01 16:10:52 +00:00
yangguo@chromium.org
70408d49b1 Define V8_EXPORT to nothing for clients of v8.
This is to make sure that inline functions are only exported by
libv8.so and not also by all clients. This is the v8 version of
https://chromiumcodereview.appspot.com/10386108/

This CL depends on http://codereview.chromium.org/10310156/ landing
first.

BUG=chromium:90078

Review URL: https://chromiumcodereview.appspot.com/10399036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11590 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-18 09:52:09 +00:00
mstarzinger@chromium.org
6aeed46180 Make String::Empty inlineable.
R=svenpanne@chromium.org
TEST=cctest/test-api/StringEmpty

Review URL: https://chromiumcodereview.appspot.com/10199019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-25 08:45:45 +00:00
mstarzinger@chromium.org
c25a92d76b Make Isolate::GetData and Isolate::SetData inlineable.
R=svenpanne@chromium.org
TEST=cctest/test-api/IsolateEmbedderData

Review URL: https://chromiumcodereview.appspot.com/10196013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-24 14:37:53 +00:00
mstarzinger@chromium.org
5113cc1bbc Make static API getters inlineable again.
This relands r11376 with minor fixes for Windows where offsets are
slightly different from Linux for unaligned fields.

R=svenpanne@chromium.org
TEST=cctest/test-api/StaticGetters

Review URL: https://chromiumcodereview.appspot.com/10176004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-23 15:09:59 +00:00
mstarzinger@chromium.org
0f590eb45f Revert r11376 and r11379 due to compile failures on Windows.
TBR=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10116030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 17:49:53 +00:00
mstarzinger@chromium.org
841158fb6a Fix presubmit failure in r11376.
R=jkummerow@chromium.org
TEST=cctest/test-api/StaticGetters[AfterDeath]

Review URL: https://chromiumcodereview.appspot.com/10021057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 17:18:56 +00:00
mstarzinger@chromium.org
3b3e701a27 Make static API getters inlineable.
R=danno@chromium.org
TEST=cctest/test-api/StaticGetters[AfterDeath]

Review URL: https://chromiumcodereview.appspot.com/10116024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11376 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 16:07:08 +00:00
mstarzinger@chromium.org
a13e41f328 Make Value::IsUndefined and Value::IsNull inlineable.
R=danno@chromium.org
TEST=cctest/test-api

Review URL: https://chromiumcodereview.appspot.com/10091035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 15:51:34 +00:00
loislo@chromium.org
b2024c531c Push heap stats as HeapStatsUpdate struct instead of raw array of uint32_t values.
We are pushing stats data as a raw array of uint32_t values at the moment.
It makes tricky the process of updating the API between v8 and WebKit.

BUG=none
TEST=HeapSnapshotObjectsStats

Review URL: https://chromiumcodereview.appspot.com/10110001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11355 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-17 13:10:17 +00:00
yurys@chromium.org
1ce7d5d0d4 Add method for resolving SnapshotObjectId by given object
Review URL: https://chromiumcodereview.appspot.com/10094011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11339 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 15:36:19 +00:00
loislo@chromium.org
17632e447c Add size metric into Heap Stats.
The stats data have only count field at the moment.
A constantly growing array of integers also can be a reason of a leak.
Ans we have to have a way to detect such kind of leaks.

Drive by fix:
FindObject and AddEntry were replaced with FindEntry/FindOrAddEntry pair.

BUG=none
TEST=HeapSnapshotObjectsStats

Review URL: https://chromiumcodereview.appspot.com/10086004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 09:44:42 +00:00
alexeif@chromium.org
48777a7f5b Split nodes and edges into separate arrays in heap snapshot serialization.
Review URL: https://chromiumcodereview.appspot.com/10037004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 12:50:48 +00:00
jkummerow@chromium.org
f0ea13846d Provide empty default implementation of OutputStream::WriteUint32Chunk to make Webkit V8 bindings compile
Review URL: https://chromiumcodereview.appspot.com/10084001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 10:57:17 +00:00
mstarzinger@chromium.org
20777bf0c5 Fix several ancient presubmit failures.
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10038046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 09:58:29 +00:00
mstarzinger@chromium.org
2f732c2728 Add isolate accessor to AccessorInfo and Arguments.
This passes the isolate through to API callback functions so that it is
available through AccessorInfo and Arguments. This allows bindings to
avoid unnecessary TLS lookups to retrieve the current isolate.

R=danno@chromium.org
TEST=cctest/test-api,cctest/test-accessors

Review URL: https://chromiumcodereview.appspot.com/10069050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 09:38:00 +00:00
loislo@chromium.org
d1f83dd95a This patch is introducing a way to grab heap stats.
The idea is to monitor the heap regulary and track each object in the heap.
With this data we will be able do draw heap usage diagram.
Where X is time and Y is the number of objects.

BUG=none
TEST=HeapSnapshotObjectsStats

Review URL: https://chromiumcodereview.appspot.com/10049002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 08:52:25 +00:00
erik.corry@gmail.com
a3629daa2c Fix external allocated memory accounting to use 64 bit values on
64 bit architectures.
Review URL: https://chromiumcodereview.appspot.com/10020032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-11 09:23:57 +00:00
loislo@chromium.org
b84b44d86c This value is required for showing the heap snapshot delta in Summary view of DevTools.Profiler.
At the moment it is evaluating on the front-end side and this is cost us 2 * (load time + parse time + traverse via snapshot) because I need this value for two previous snapshots.

BUG=none
TEST=test-heap-profiler

Review URL: https://chromiumcodereview.appspot.com/9858016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11161 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-27 11:54:47 +00:00
loislo@chromium.org
9b9e458a43 Revert "This value is required for showing the heap snapshot delta in Summary view of DevTools.Profiler."
This reverts commit 634864d65ebe820a967f6162d8e226cf4a73e51a.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9861018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-27 11:12:31 +00:00
loislo@chromium.org
410f3a3375 This value is required for showing the heap snapshot delta in Summary view of DevTools.Profiler.
At the moment it is evaluating on the front-end side and this is cost us 2 * (load time + parse time + traverse via snapshot) because I need this value for two previous snapshots.

BUG=none
TEST=test-heap-profiler

Review URL: https://chromiumcodereview.appspot.com/9858016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-27 08:52:00 +00:00
loislo@chromium.org
b414adb1f3 Complete switch to SnapshotObjectId.
BUG=none
TEST=test-heap-profiler

Review URL: https://chromiumcodereview.appspot.com/9858010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11145 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-26 13:47:37 +00:00
erik.corry@gmail.com
bcd0fd00e3 Add API call that identifies strings that are guaranteed
only to contain ASCII characters.
Review URL: https://chromiumcodereview.appspot.com/9724022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11079 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 09:51:36 +00:00
rossberg@chromium.org
8604da7f06 New class for Date objects: caches individual date components.
First step, cache slots not used yet.

R=ulan@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9117034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 11:11:55 +00:00
vegorov@chromium.org
47b6027c37 Add HeapProfiler::GetPersistentHandleCount to be able to track the number of persistent handles
It turns out that an increasing number of persistent handles is a good signal for bugs in the bindings layer

BUG=none
TEST=cctest/test-heap-profiler/PersistentHandleCount

Review URL: https://chromiumcodereview.appspot.com/9620007
Patch from Jochen Eisinger <jochen@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10960 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-07 17:38:50 +00:00
mikhail.naganov@gmail.com
2350d11dac Remove now unused CalculateExactRetainedSize function & co.
This patch changes the signature of the v8::HeapGraphNode::GetRetainedSize method, but it's not used in Chromium, and it should be easy for other clients (if any) to adjust to this change.

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/9466014
Patch from Alexei Filippov <alexeif@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10846 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-27 15:42:36 +00:00
vegorov@chromium.org
c112fdc398 Adds a new API where the host can supply a callback function. The callback function can resolve the location of a return address on stack to the location where a return-address rewriting profiler stashed the original return address.
Review URL: https://chromiumcodereview.appspot.com/9401019
Patch from Sigurður Ásgeirsson <siggi@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10845 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-27 15:15:53 +00:00
mstarzinger@chromium.org
36a91e30f7 Fix redefining of attributes on aliased arguments.
This allows elements of the non-strict arguments object to be redefined
with custom attributes and still maintain an alias into the context.
Such a slow alias is maintained by placing a special marker into the
dictionary backing store of the arguments object.

R=rossberg@chromium.org
BUG=v8:1772
TEST=test262,mjsunit/object-define-property

Review URL: https://chromiumcodereview.appspot.com/9460004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-24 14:34:01 +00:00
rossberg@chromium.org
1336b913d0 Make built-ins strict mode conforming, and support a --use-strict flag.
* Turned all uses of 'const' into 'var'.
* Turned all uses of local 'function' into 'var'.
* Added a couple of missing toplevel 'var' declarations.

One consequence is that the properties on the builtin object  are no longer
non-writable, and I had to adapt one test. Is that a problem?

Unfortunately, we cannot actually switch the library scripts to strict mode
by default, because that makes observable things like poisoned .caller properties
for library functions.

Also removed dead flag code in Compiler::Compile.

R=yangguo@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9415010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-20 13:48:24 +00:00
jkummerow@chromium.org
0177aa62da Count ICs that have type information.
Hidden behind --type-info-threshold=X flag, usage dependent on experimental profiler.

Review URL: https://chromiumcodereview.appspot.com/9403009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-20 12:57:23 +00:00
loislo@chromium.org
dc3f16a321 I will apply it to the nodes that can't be mapped to Heap object or Native object.
As example there are 'Detached DOM Tree' nodes in WebKit. It is very useful to be able to see all such
nodes grouped together. It can be done with help of some post processing but I did this explicitly
on v8 side because it is much faster. At the moment this kind of nodes has kNative type.
I'd like to hide these nodes from the Retainment View but I can filter them only by name.

BUG=none
TEST=HeapSnapshotRetainedObjectInfo

Review URL: https://chromiumcodereview.appspot.com/9323064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-07 05:21:00 +00:00
yurys@chromium.org
882ede3053 Add a getter for value set with AllowCodeGenerationFromStrings
Review URL: https://chromiumcodereview.appspot.com/9223016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10578 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-01 12:58:34 +00:00
loislo@chromium.org
07d720ec41 Detailed heap snapshot usability improvement.
The detailed heap snapshot has two groups of nodes. The first one
is the group for v8 heap nodes and the second one is the group for
native objects. At the moment we have two different sets of native
objects. There are 'Detached DOM trees' and 'Document DOM trees' type of objects.

I think it'd be nice to replace one group containing all native objects with
separate groups for different types of native objects.

BUG=none
TEST=HeapSnapshotRetainedObjectInfo

Review URL: https://chromiumcodereview.appspot.com/9223009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-27 12:02:57 +00:00
yurys@chromium.org
09ff5c4c44 Provide access to function inferred name in v8 public API
Review URL: https://chromiumcodereview.appspot.com/9146039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-25 12:45:54 +00:00
kmillikin@chromium.org
12f982cf6a Include what you use in accessors.{h,cc}.
R=fschneider@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9113041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-25 00:16:07 +00:00
erik.corry@gmail.com
b0607b7127 Fix bug 542, misleading documentation of v8::Locker.
Review URL: https://chromiumcodereview.appspot.com/9160028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-24 13:07:21 +00:00
yurys@chromium.org
ebb75c23a1 Provide a way for iterating through all external strings referenced from the JS heap
Review URL: http://codereview.chromium.org/9139018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-13 15:14:45 +00:00
svenpanne@chromium.org
6997dbe13e Fixed AccessorPair handling
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10372 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-10 16:12:16 +00:00
yangguo@chromium.org
d9f7cf819c Implement callback when script finishes running in V8 API.
TEST=test-api/LeaveScriptCallback

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-04 08:48:35 +00:00
mikhail.naganov@gmail.com
dae713f0ad Reapply r10158: Distinguish weak references in heap snapshots, group GC roots.
[Fixed the bug revealed by the Win32 bot]

Several changes to better organize snapshot data:

1. Provide information about weak references.
2. Group (GC roots) children.
3. Prettify debug snapshot printing.

BUG=v8:1832
TEST=cctest/test-heap-profiler/*Weak*
TBR=vitalyr@chromium.org

Initial CL: http://codereview.chromium.org/8716009

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 17:41:47 +00:00
mikhail.naganov@gmail.com
a0c8ea00db Revert r10158 "Distinguish weak references in heap snapshots, group GC roots."
Heap profiler tests fail on Win32, need to investigate.

This reverts commit b5374ebd92c11ac4aae16b4e31e54166d406e490.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-05 17:21:55 +00:00
mikhail.naganov@gmail.com
857aa09772 Distinguish weak references in heap snapshots, group GC roots.
Several changes to better organize snapshot data:

1. Provide information about weak references.
2. Group (GC roots) children.
3. Prettify debug snapshot printing.

BUG=v8:1832
TEST=cctest/test-heap-profiler/*Weak*

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-05 16:35:57 +00:00
ulan@chromium.org
8dc728126e Start incremental marking on idle notification.
BUG=v8:1458
TEST=cctest/test-api/IdleNotification*

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-30 11:13:36 +00:00
kmillikin@chromium.org
0a7010458a Remove the static qualifier from functions in header files.
This shaves 416+ KB, just under 1% off the size of the debug d8 executable
on Linux (mostly because the CheckHelper functions for assertions were
getting separate copies for each compilation unit).  The difference in
release builds is negligible---a size reduction of 0.1%.

Also, change namespace-level 'static const' variables to remove the static
storage class as it's the default.

R=danno@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-29 10:56:11 +00:00
yurys@chromium.org
8b7bcc4e80 Add getters for column number and script id to v8::Function
Review URL: http://codereview.chromium.org/8508008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-09 14:18:30 +00:00
jkummerow@chromium.org
2b54dd5e8f Make MSVS happy with ExternalAsciiStringResourceImpl
TEST=MSVS 2008 no longer generates warning C4251 for ExternalAsciiStringResourceImpl

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-28 11:01:17 +00:00
mikhail.naganov@gmail.com
c05354ecc4 Add v8::HeapGraphNode::GetHeapValue method.
This allows getting a heap object by a heap snapshot node for further
inspection. Very useful for objects from bindings that mostly have
getter-provided fields.

R=vegorov@google.com
BUG=webkit/61179
TEST=test-heap-profiler/GetHeapValue,GetHeapValueForDeletedObject

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-26 14:38:29 +00:00
rossberg@chromium.org
fdade92c20 Reorganize object type enum, such that proxies are no longer in the middle
of the range of proper JS objects.

Unfortunately, callable types no longer form a range now. However, there
are only two anyway. We put them at either end of the range of JS object
types so that certain compares can be combined.

R=erik.corry@gmail.com,kmillikin@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-21 14:46:54 +00:00
fschneider@chromium.org
fdaadb78d6 Landing for miket@chromium.org: Add an optional source length field to the Extension constructor.
Original code review: http://codereview.chromium.org/7889046/
Review URL: http://codereview.chromium.org/7978028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-21 13:28:09 +00:00
yangguo@chromium.org
731a70ce13 API: Added Debug::DisableAgent to match existing Debug::EnableAgent
BUG=v8:1573
TEST=cctest test-debug/TestDebuggerAgent

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-21 11:34:05 +00:00
vegorov@chromium.org
ac36cb4504 Merge experimental/gc branch to the bleeding_edge.
Review URL: http://codereview.chromium.org/7945009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-19 18:36:47 +00:00
erik.corry@gmail.com
44d931c9d5 Add asserts to ensure that we:
1) Don't make a call to C without having a valid frame on the stack.
2) Don't generate a call to a stub while generating a stub, unless we can be
sure that the stub we are calling has already been generated (the stub
generation code is not reentrant wrt. GC).
Review URL: http://codereview.chromium.org/7891042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9297 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-15 11:30:45 +00:00
lrn@chromium.org
e292eddf90 Cleanup of include comments
Review URL: http://codereview.chromium.org/7892025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9276 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-14 12:23:52 +00:00
yangguo@chromium.org
86a62d0da3 Added check for trailing whitespaces and corrected existing violations.
Review URL: http://codereview.chromium.org/7826007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9094 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-01 11:28:10 +00:00
yangguo@chromium.org
2d538fe6a6 removed executable bit in those files.
Review URL: http://codereview.chromium.org/7710019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9003 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-23 13:57:37 +00:00
yangguo@chromium.org
011b136ee0 Slight API change enabling opting out from null termination in String::Write*().
BUG=v8:1537
TEST=cctest test-api/StringWrite

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8996 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-23 11:11:12 +00:00
yangguo@chromium.org
891b0eb919 Added forgotten V8EXPORT attributes for v8::Array::CheckCast and v8::Number::CheckCast.
BUG=v8:1618

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-22 13:01:25 +00:00
mikhail.naganov@gmail.com
7904a85592 Remove some unnecessary namespace alias definitions.
We can pick the namespace alias 'i' from v8.h which is already included
in those files.

BUG=None
TEST=None

R=mnaganov@chromium.org

Signed-off-by: Thiago Farina <tfarina@chromium.org>

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

--------------

Inline the implementation of Handle default ctor.

BUG=None
TEST=None

R=mnaganov@chromium.org

Signed-off-by: Thiago Farina <tfarina@chromium.org>

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-17 10:29:05 +00:00
yangguo@chromium.org
76aad1a07b Fixed a known issue in D8 (read file), enabled D8 shared library build on Windows.
Review URL: http://codereview.chromium.org/7586001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-08 09:34:18 +00:00
jkummerow@chromium.org
0aab25fabf Fix: FunctionTemplate::SetPrototypeAttributes broke prototype object
BUG=v8:1539
TEST=cctest test-api/SetPrototypeAttributes

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-25 15:01:45 +00:00
ager@chromium.org
645bb1b1ba Add GetPropertyAttribute method for Object in the API
Patch by Peter Varga.

BUG=none
TEST=cctest/test-api/PropertyAttributes

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8679 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-18 17:44:57 +00:00
ager@chromium.org
78f173c47b Introduce a random entropy source which can optionally be provided at initialization.
BUG=89462

Review URL: http://codereview.chromium.org/7395012
Patch from Chris Neckar <cdn@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-17 09:16:28 +00:00
vegorov@chromium.org
615add8463 Expose APIs for detecting boxed primitives, native errors and Math.
While implementing structured clone I found that I need support
for detecting and creating objects using the builtin Number, String
and Boolean constructors; this CL adds this support. I also need
to be able to detect entities of "native object type (e.g., Error)",
hence the new IsNativeError() calls.

(ref: http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#safe-passing-of-structured-data)

Patch by Luke Zarko.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8653 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-14 11:00:04 +00:00
mikhail.naganov@gmail.com
5c57d0d643 Remove support for logging into a memory buffer.
The only usage of it was in logging tests, I've switched them for
using a file.

I've left out support for "--logfile=*" for now, as Chromium uses it.
Will be removed after the next V8 roll.

R=sgjesse@chromium.org
BUG=859
TEST=mjsunit/log-*

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8629 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-13 11:31:22 +00:00
mikhail.naganov@gmail.com
33177880c8 Remove "modules" and "tags" of the logging CPU profiler.
Modules now makes a little sense, as there is only one module.
Tags was a simplistic attempt of supporting nested profiles.

R=sgjesse@chromium.org
BUG=859

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-01 09:35:16 +00:00
mikhail.naganov@gmail.com
f4bf8f8fee Remove obsolete aggregating and non-working producers heap profilers.
2000 LOC are gone!

R=sgjesse@chromium.org
BUG=1481

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-24 11:38:47 +00:00
jkummerow@chromium.org
1e1387f12c Add possibility to configure 'prototype' property via FunctionTemplate
BUG=v8:1479
TEST=test-api/SetPrototypeProperties

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-22 12:39:45 +00:00
mikhail.naganov@gmail.com
bf9b2f8c2c Heap profiler: add an ability to iterate over snapshot's nodes.
This is a preparation for removing aggregated heap snapshots.
W/o this API, counting object instances in a snapshot is very hard.

R=sgjesse@chromium.org
BUG=1481
TEST=cctest/test-heap-profiler/NodesIteration

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-21 08:02:34 +00:00
ager@chromium.org
b7a93d417d Add GetOwnPropertyNames method for Object in the API
Patch by Peter Varga.

BUG=none
TEST=cctest/test-api/PropertyEnumeration

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 12:33:55 +00:00
mikhail.naganov@gmail.com
508b22c436 "Deiceolate" Thread classes.
Thread class was receiving an isolate parameter by default.
This approact violates the assumption that only VM threads
can have an associated isolate, and can lead to troubles,
because accessing the same isolate from different threads
leads to race conditions.

This was found by investigating mysterious failures of the
CPU profiler layout test on Linux Chromium. As almost all
threads were associated with some isolate, the sampler was
trying to sample them.

As a side effect, we have also fixed the DebuggerAgent test.

Thanks to Vitaly for help in fixing isolates handling!

R=vitalyr@chromium.org
BUG=none
TEST=none

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:54:04 +00:00
mikhail.naganov@gmail.com
47248cc5fe Revert accidental r8254..r8256
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:42:08 +00:00
mikhail.naganov@gmail.com
e1db94c0cb trying to fix test
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:36:35 +00:00
danno@chromium.org
4de3bb500c Implement core support for FixedDoubleArrays.
Under a flag without IC or Crankshaft support.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 10:03:35 +00:00
vitalyr@chromium.org
7ff41d4322 Reduce TLS overhead in v8::TryCatch.
R=vegorov@chromium.org
BUG=v8:1426

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-07 15:01:52 +00:00
mikhail.naganov@gmail.com
3b2470d296 Fix presubmit errors catched by a more recent version of cpplint.py.
Mainly, there were errors concerning blank lines before and after class access
control sections [whitespace/blank_line].

BEFORE an access control section (e.g. public:, private:) there should be a
blank line (except for the section right after the class declaration).

AFTER an access control section there should be no blank line.

TBR=ager@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-07 07:17:46 +00:00
mikhail.naganov@gmail.com
2373771d2e Fix presubmit after r8189
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8190 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 20:58:25 +00:00
mikhail.naganov@gmail.com
f1309b0417 Compress sources of JS libraries in addition to the snapshot.
This saves ~170K on current sources.

R=sgjesse@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 20:47:30 +00:00
jkummerow@chromium.org
c0a0c82b70 Per-Isolate cache for polymorphic stubs
BUG=1385
TEST=Existing tests still pass; running d8 with --dump-counters shows fewer polymorphic stubs being compiled

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8183 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 13:15:11 +00:00
rossberg@chromium.org
670f947a5c Implement set trap for proxies, and revamp class hierarchy in preparation:
- Introduce a class JSReceiver, that is a common superclass of JSObject and
  JSProxy. Use JSReceiver where appropriate (probably lots of places that we
  still have to migrate, but we will find those later with proxy test suite).

- Move appropriate methods to JSReceiver class (SetProperty,
  GetPropertyAttribute, Get/SetPrototype, Lookup, and so on).

- Introduce new JSFunctionProxy subclass of JSProxy. Currently only a stub.

- Overhaul enum InstanceType:
  * Introduce FIRST/LAST_SPEC_OBJECT_TYPE that ranges over all types that
    represent JS objects, and use that consistently to check language types.
  * Rename FIRST/LAST_JS_OBJECT_TYPE and FIRST/LAST_FUNCTION_CLASS_TYPE
    to FIRST/LAST_[NON]CALLABLE_SPEC_OBJECT_TYPE for clarity.
  * Eliminate the overlap over JS_REGEXP_TYPE.
  * Also replace FIRST_JS_OBJECT with FIRST_JS_RECEIVER, but only use it where
    we exclusively talk about the internal representation type.
  * Insert JS_PROXY and JS_FUNCTION_PROXY in the appropriate places.

- Fix all checks concerning classification, especially for functions, to
  use the CALLABLE_SPEC_OBJECT range (that includes funciton proxies).

- Handle proxies in SetProperty (that was the easiest part :) ).

- A few simple test cases.

R=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 16:38:40 +00:00
erik.corry@gmail.com
7a1a72c701 Revert 8122 (stub call asserts) while test failures are investigated.
Review URL: http://codereview.chromium.org/7050039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 15:21:25 +00:00
erik.corry@gmail.com
c5fc4b9099 Add asserts and state tracking to ensure that we do not call
into C++ without having a valid stack frame that can be
traversed at GC.
Also add asserts to track that we do not try to generate a stub
while we are generating a stub, since the stub creation code is
not GC safe.
Review URL: http://codereview.chromium.org/7084032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 12:38:45 +00:00
rossberg@chromium.org
abd77ad439 Rename Proxy class to Foreign, to avoid confusion with Harmony proxies.
Also fix grokdump, which was off by one after intro of JSProxy type.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7959 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-19 11:47:34 +00:00
dslomov@chromium.org
c5c57d722a Put 7942 "Per-isolate embedder-specific data" back
TBR=

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7947 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 23:26:38 +00:00
dslomov@chromium.org
3d5d169275 Revert "Per-isolate embedder-specific data"
This reverts commit 42f5dc01fb9adbf55242da9f6515e9a37132217b.

Checking if this helps webkit-tests

TBR=dslomov@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 22:35:41 +00:00
dslomov@chromium.org
469c55f058 Per-isolate embedder-specific data
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7942 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 16:20:45 +00:00
vegorov@chromium.org
925107046e Extend Handle API with MarkIndependent.
Garbage collector is free to ignore object groups for independent handles and can collect then in minor collections.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 12:18:19 +00:00
mikhail.naganov@gmail.com
c5ff1f2155 Fix typos in include/*.h inline documentation.
Patch by Nicolas Kaiser <nikai@nikai.net>

R=sgjesse@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-16 06:36:43 +00:00
rossberg@chromium.org
e14402b1df A first skeleton for introducing Harmony proxies.
1) Add new type JSProxy for representing proxy objects.
   Currently devoid of functionality, i.e., all properties are undefined.

2) Some rudimentary global $Proxy functions to create proxies.

Next step: Hook up getProperty and getOwnProperty handlers. Will probably
require introducing a new LookupResult type, which is a mixture of
INTERCEPTOR (handles any property) and CALLBACK (calls back to JS).
Can we unify this somehow?

TODO: Should probably rename existing Proxy type to something like
"Foreign", to avoid confusion.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7887 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-13 10:58:25 +00:00
ager@chromium.org
8033be880e Add IsCallable method for Object in the API
Patch by Peter Varga.

BUG=none
TEST=cctest/test-api/CallableObject

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-09 15:24:48 +00:00
lrn@chromium.org
1a169aa3f0 Strict mode detection in preparser.
Handle octal escapes in everything but RegExps.
Extend preparser test suite to test whether the preparser reports
exceptions to throw.

TEST=preparser/*

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 11:41:15 +00:00
ager@chromium.org
cf19179266 Implement CallAsConstructor method for Object in the API
Patch by Peter Varga.

BUG=v8:1348
TEST=cctest/test-api/ConstructorForObject

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 11:07:52 +00:00
dslomov@chromium.org
2500f14868 This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

Committed: http://code.google.com/p/v8/source/detail?r=7734

Committed: http://code.google.com/p/v8/source/detail?r=7784

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7797 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-05 18:55:31 +00:00
dslomov@chromium.org
6e4629a81c Revert "This implements per-isolate locking and unlocking, including tests"
This reverts commit 1aa40d0c278e195e9e69dcf8b29a212aa1817c0b.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7785 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 22:35:42 +00:00
dslomov@chromium.org
d54fe47fad This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

Committed: http://code.google.com/p/v8/source/detail?r=7734

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 21:04:32 +00:00
ager@chromium.org
82a04c7fdc Add CallAsFunction method to the Object class in the API
Patch by Peter Varga.

BUG=v8:1336
TEST=cctest/test-api/CallAsFunction

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 13:03:08 +00:00
ager@chromium.org
24f19608d4 Actually revert "Add Call method to the Object class in the API"
Tests are failing in debug mode.

This also reapplies the change "Make Date and RegExp inherit from
Object in the API" that I accidentally reverted.

R=sgjesse@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 11:07:09 +00:00
ager@chromium.org
26c775da94 Revert "Make Date and RegExp inherit from Object in the API."
Tests are failing in debug mode.

R=sgjesse@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 10:51:07 +00:00
ager@chromium.org
b8cdecb517 Add Call method to the Object class in the API
Patch by Peter Varga.

BUG=v8:1336
TEST=cctest/test-api/CallAsFunction

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 10:03:49 +00:00
ager@chromium.org
87f225936f Make Date and RegExp inherit from Object in the API.
They are objects and the API inheritance hierarchy should reflect that.

R=sgjesse@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 07:28:27 +00:00
ager@chromium.org
8aeaa5e90a Implement API to disallow code generation from strings for a context.
R=sgjesse@chromium.org
BUG=v8:1258
TEST=test-api/AllowCodeGenFromStrings

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 05:40:47 +00:00
dslomov@chromium.org
7088aea3eb Revert "This implements per-isolate locking and unlocking, including tests"
This reverts commit 76c78febb70e75b18214f5fe45de95c7fb515386.

This change has broken test-thread-termination/TerminateMultipleV8Threads

TBR=vitalyr

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7735 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 22:16:45 +00:00
dslomov@chromium.org
f4c120d615 This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 21:26:03 +00:00
mikhail.naganov@gmail.com
ec58c05f4e Add support for startup data (snapshot) compression.
This is for mobile platforms where application footprint size is
important. To avoid including compression libraries into V8, we assume
that the host machine have them (true for Linux), and rely on embedder
to provide decompressed data.

Currently, only snapshot data can be comressed. It is also possible to
compress libraries sources, but it is more involved and will be
addressed in another CL.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7724 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 12:08:33 +00:00
karlklose@chromium.org
32732fbc86 Expose hasOwnProperty() through API.
BUG=http://code.google.com/p/v8/issues/detail?id=1342
TEST=test-api/HasOwnProperty

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7699 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-28 09:27:40 +00:00
jkummerow@chromium.org
bc8f6943bb Support Float64Arrays
BUG=None
TEST=mjsunit/external-arrays.js; updated cctest; existing unit tests

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-21 07:15:43 +00:00
mikhail.naganov@gmail.com
690093effe Mark single-argument inline constructors as 'explicit'.
There is currently a bug in cpplint.py hiding this problem.

R=sgjesse@chromium.org
BUG=1304
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 11:38:34 +00:00
lrn@chromium.org
c7c57227dd Make preparser api be exported in shared libraries.
Adds missing V8EXPORT declarations to types in v8-preparser.h.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 08:41:37 +00:00
antonm@chromium.org
56b53dd5dc Introduce v8::Object::CreationContext method.
That allows to find out a global context in which the object
was created.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 12:17:20 +00:00
lrn@chromium.org
4e502c5e5a PreParser build fix
Patch from Peter Varga <pvarga@inf.u-szeged.hu>.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-30 10:13:11 +00:00
mikhail.naganov@gmail.com
2d95ed4b25 Remove snapshots-related code that is implemented in DevTools heap profiler.
Diffs and retaining paths are implemented on JS side. There is no need
to maintain native implementation.

R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7412 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-29 12:52:07 +00:00
podivilov@chromium.org
41f30cac90 Fix crash in Debug::SendCommand.
R=vitalyr@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 18:02:23 +00:00
mikhail.naganov@gmail.com
b2b5d2777e Add support for CPU and heap profiles deletion.
R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 16:10:01 +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
ager@chromium.org
4f7fe371b2 Fix Array::New(length) in the API to return an array with the provided length.
The internal factory method initializes the elements but does not set
the length property of the array.

Add array api test case for length.

R=antonm@chromium.org
BUG=v8:1256
TEST=cctest/test-api/Array

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7210 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 19:55:31 +00:00
antonm@chromium.org
a7bb1d5278 Introduce one way dependencies into object grouping.
Those are necessary to properly manage relationship between objects in cases
when they don't form proper tree structure.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 12:02:28 +00:00
sgjesse@chromium.org
bc9ddf20bb ARM: Port r7089 to ARM
Ensure that there is always enough bytes between consequtive calls in optimized code to write a call instruction at the return points without overlapping.

Add a call to deoptimize all functions after running tests with --stress-opt. This will catch some issues with functions which cannot be forcefully deoptimized. Some of the tests failed on ARM with that change without the rest of the changes in this change.
Review URL: http://codereview.chromium.org/6661022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 13:58:20 +00:00
mikhail.naganov@gmail.com
dee9c00267 Add an interface for an embedder to provide information about native
objects retained by object groups and global handles.

This information is then used during heap snapshot generation
to provide a more complete memory picture.

This patch will be needed to fix https://bugs.webkit.org/show_bug.cgi?id=53659.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:05:31 +00:00
danno@chromium.org
9cca7d2733 Combine typed and pixel arrays.
Worth mentioning:
- Specialized versions of pixel array and store/loads inside the generic stubs have been removed, since to have parity for all external arrays, 8 different versions would have to be inlined/checked.
- There's a new constant in v8.h for external arrays with pixel array elements.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 15:01:16 +00:00
ager@chromium.org
d5851dcde0 x64: Enable inline smi code patching to reenable the inlined code in
the code generated by the full code generator after my previous
change.

The generated code is the same as on ia32 and so is the patching.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 14:51:38 +00:00
ager@chromium.org
73a4ecfae1 A MessageObject is a purely internal object to hold information about
an error message that needs to be generated and reported. This change
hides all of the error information from JavaScript code so user
callbacks cannot get hold of it.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 13:31:52 +00:00
antonm@chromium.org
3d4c4951aa Clarify some details of global objects implementation.
Review URL: http://codereview.chromium.org/6386011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 13:41:19 +00:00
antonm@chromium.org
b0abe13ed2 Using unsigned shifts and masks when dealing with 64-bit addresses.
BUG=v8:1037

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6388 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 11:16:23 +00:00
antonm@chromium.org
8805509f28 Wrap external pointers more carefully.
On 32-bit platforms any pointer with 0 as LSB can be wrapped into Smi.  However, on 64-bit
platforms it's currently not the case as x64 Smis must have 0s in lower 32 bit word.
Even worse, macroassembler Move instruction will try to fetch integer value from Smi
and will shift by 32 bits to the right rendering stored pointer incorrect.

BUG=v8:1037

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6301 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-13 15:56:33 +00:00
mikhail.naganov@gmail.com
6f72caf92d Add reporting of JS heap size limit to GetHeapStatistics.
I found it useful to know inside the heap profiler to avoid
crashes due to heap overflow.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:36:09 +00:00
ager@chromium.org
58782c556a Export external array data accessors.
BUG=v8:1016
Review URL: http://codereview.chromium.org/6013011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 09:27:46 +00:00
ager@chromium.org
218944fe6a Add more documentation to Context::New in the API header file.
Review URL: http://codereview.chromium.org/6043005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-03 10:17:08 +00:00
sgjesse@chromium.org
648fcd906e Adding Date::ResetCache() API so that the cache values in the Date object
can be reset to allow DST / timezone changes to be re-cached and reflected
in the Date object.

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

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-17 12:45:27 +00:00
erik.corry@gmail.com
5b55e1ad9a API: Correct documentation of String::WriteUtf8, String::Write
and String::WriteAscii and add test.  Correct implementation of
String::Write, fixing bug 975 (the patch in that bug was not
used, however).
Review URL: http://codereview.chromium.org/5718005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6011 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-14 13:21:46 +00:00
mikhail.naganov@gmail.com
5cf643aa42 New heap profiler: add support for progress reporting and control.
As taking a snapshot of a large heap takes noticeable time, it's
good to be able to monitor and control it.

The change itself is small, big code deletes and additions are in
fact moves. The only significant change is simplification of
approximated retained sizes calculation algorithm.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 10:42:06 +00:00
lrn@chromium.org
095a71e99d Changed interface to preparser to not require pushback support.
Changed implementation of pushback in preparer character stream.
Removed assert that isn't satisfied by in test-cases, but only by the real code.
Make preparser compile again.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-08 10:06:40 +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
mikhail.naganov@gmail.com
dd1a7fa2b3 New Heap Profiler: add API method for finding a graph node by id.
TEST=cctest/test-heap-profiler/HeapSnapshotGetNodeById

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-02 15:38:51 +00:00
lrn@chromium.org
84f2f5ee90 Preparser extracted into separate files that can be compiled to a library.
No scons target yet.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5899 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-29 13:24:37 +00:00
yurys@chromium.org
9137e4a8c9 Expose a method for getting JSObject constructor name
Review URL: http://codereview.chromium.org/5256004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-25 08:04:12 +00:00
mikhail.naganov@gmail.com
1cfc63cf8a New heap profiler: implement fast retaining sizes approximation.
Approximation is done by building a dominators tree for the heap graph.
Dominator nodes and retained sizes are serialized into JSON.

Removed:
 - reachable size (it is useless, after all);
 - HeapEntryCalculatedData (size is now stored in the node, retaining
   paths in a hash map);

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-22 14:00:40 +00:00
mikhail.naganov@gmail.com
5418f64e1e A follow-up to r5849 -- fix Chromium build.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5851 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-18 10:49:34 +00:00
mikhail.naganov@gmail.com
051f314a99 New heap profiler: include all heap objects and refs into snapshot.
Otherwise, retaned memory sizes are not precise. This increases size
of heap snapshot, I will deal with this later. Heap objects and
references previously missing in snapshot are now marked as 'hidden'.
That means, they not shown to user, but participate in sizes
calculation.

Other small changes:
 - added 'shortcut' graph edges: e.g. to pin global objects on top
   level;
 - meta-information in JSON snapshot is no more double encoded.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-18 10:38:25 +00:00
lrn@chromium.org
af7b6fecfe Split globals.h into two parts, where only one depends on V8.
Made allocation.{h,cc} independent of V8, allowing utils.h to allocate
vectors and collectors.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-15 13:23:30 +00:00
ager@chromium.org
17573d771a Landing for Justin Schuh.
Add 128MB limit for executable pages.

BUG=http://code.google.com/p/v8/issues/detail?id=925
TEST=None.
TBR=jschuh@chromium.org
Review URL: http://codereview.chromium.org/4634003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-10 08:38:42 +00:00
lrn@chromium.org
455cfe5932 Make presubmit lint the "include" dir.
Make include dir content pass lint.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 10:27:39 +00:00
lrn@chromium.org
efe74b695d Extract essential type declarations into separate file.
Review URL: http://codereview.chromium.org/4320004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 08:52:49 +00:00
serya@chromium.org
fbdcbdf748 Refactoring of v8:Arguments similary we did with v8::AccessorInfo (http://codereview.chromium.org/242050). GC-controlled values moved to a separate array.
Review URL: http://codereview.chromium.org/4117010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-01 10:51:44 +00:00
serya@chromium.org
0ea6c1e09f Optimizing HandleScope. Also fixed HandleScope destruction when API getter throws an exception.
Review URL: http://codereview.chromium.org/3792003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5689 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-21 14:21:00 +00:00
mikhail.naganov@gmail.com
d4bc8e1585 New Heap profiler: add dumping HeapNumbers and InternalFields to snapshot.
HeapNumbers do consume memory, so it's worth dumping them. However, we
don't dump their values, as they are not as self-descriptive as values
of strings, and they will increase snapshot size. Storing heap numbers
values can be added if we will feel a sufficient demand for that.

InternalFields are used, e.g. for storing references to DOM nodes
event handlers.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-18 09:15:38 +00:00
mikhail.naganov@gmail.com
788c5e344d Better align heap snapshots contents with debugger info.
I created a heap snapshot in Chromium, and then started comparing
it side-by-side with representations of objects provided by
the debugger, fixing discrepancies.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-13 14:57:00 +00:00
vitalyr@chromium.org
2ffa84ad4d Fix typo in the spec reference.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-05 12:01:46 +00:00
vitalyr@chromium.org
91b9a92336 Addressing Mads' comments from http://codereview.chromium.org/3585010/show.
Review URL: http://codereview.chromium.org/3613009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5588 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-05 11:51:41 +00:00
yurys@chromium.org
eb24a86e1b StackTrace should provide access to //@ sourceURL=... value
Review URL: http://codereview.chromium.org/3602013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5586 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-05 08:53:51 +00:00
vitalyr@chromium.org
b999ae3cbd API: expose RegExp.
Review URL: http://codereview.chromium.org/3585010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-04 15:04:16 +00:00
podivilov@chromium.org
0012576e2b Add Debug::CancelDebugBreak method to api
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-27 15:09:55 +00:00
mikhail.naganov@gmail.com
228d56bd8e Add support for abortion in v8::OutputStream.
It's a good idea to allow receiver to interrupt data transmission.

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

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

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 11:49:06 +00:00
sgjesse@chromium.org
d3e457303e Add API callback for tracking allocated memory
Allows the host application to provide a mechanism for notification and custom logging through a callback (set through the API V8::AddMemoryAllocationCallback and removed through V8::RemoveMemoryAllocationCallback), when V8 allocates ro frees memory. 

This replaces the current histogram data "V8.ExecutableMemoryMax" by allowing usage data to be logged by the application as required rather than always through V8. 

BUG=http://crbug.com/54222
TEST=Set the callback function with the API and cause V8 to allocate memory.

Patch by Paul Mehta <pmehta@chromium.org>

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5403 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-03 11:31:58 +00:00
antonm@chromium.org
40788b57c9 Remove unused typedef.
Review URL: http://codereview.chromium.org/3164022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-18 13:29:20 +00:00
mikhail.naganov@gmail.com
e839a1ca58 Heap profiler: allow returning aggregated snapshots via the new API.
This is intended for smoother migration to the new API in Chromium.
Also, aggregated heap snapshots can be used for cheaply obtaining
heap statistics, e.g. in tests.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5297 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-18 08:19:29 +00:00
antonm@chromium.org
0d8ec2a8d8 Remove temporary support for two indexed property query APIs.
Review URL: http://codereview.chromium.org/3143015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 11:53:52 +00:00
antonm@chromium.org
57769489d5 First phase of migration to new indexed property query callbacks.
Eventually indexed 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.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 10:05:18 +00:00
antonm@chromium.org
59645c6a19 Add v8::Value::IsRegExp method.
Patch by Vlad Burlik.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 09:53:56 +00:00
mikhail.naganov@gmail.com
1695003bb9 Heap profiler: reduce heap snapshots size.
The size of a snapshot is now 65-80% of the JS heap size (tested on
GMail and Wave), previously it was >200%.

BUG=783

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 11:37:24 +00:00
antonm@chromium.org
793d0a92b9 Add a check that weak object handle is not in NEAR_DEATH state after weak callback invocation.
If object enters NEAR_DEATH state, it must be explicitly cleared and/or disposed, otherwise
it would retain JS object forever.  Note as well that parameter is reset to NULL on first
invocation so weak handle callback would be in hard situation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-19 13:26:25 +00:00
ager@chromium.org
35a80e1624 Landing for hans@chromium.org.
TYPE_CHECK in v8.h should assign to volatile qualified null-pointer.

Unless the pointer is volatile qualified, Clang will warn that LLVM
removes the assignment during optimization. This is not a problem as
that code should never execute, but the warning is treated as an error
when building Chromium, and thus stops the build.

Code review URL: http://codereview.chromium.org/3005010/show

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-19 09:51:33 +00:00
mikhail.naganov@gmail.com
c98ac6e82c Heap profiler: implement diffing of snapshots.
To trace objects between snapshots, an external map of object tags is
maintained. After the first heap snapshot has been taken, the map is
updated by reporting object moves from the GC. If no snapshots were
taken, there is no overhead (except for flag checking).

I considered graph comparison algorithms that doesn't require using
object tags, but they are all of a high computational complexity, and
will still fail to detect object moves properly, even for trivial
cases, so using tags looks like unavoidable.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 13:21:50 +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
yurys@chromium.org
abaf8347a5 Allow to capture stack trace for uncaught exceptions
Review URL: http://codereview.chromium.org/2961003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-12 13:17:27 +00:00
ager@chromium.org
a835641dee Landing for victorw@chromium.org.
Fix issues so v8 could be built as a DLL.

-. get rid of all the compiler warning by moving dllexport/dllimport
to the individual members for classes which have inline members.

-. update v8 gyp to build v8.dll for chromium multi-dll version (win
and component==shared_library)

Note: most of the code are contributed by sjesse.

Code review URL: http://codereview.chromium.org/2882009/show

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 07:39:42 +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
mikhail.naganov@gmail.com
93387f272e Heap profiler: add a missing link between a function closure and shared function info.
Review URL: http://codereview.chromium.org/2846012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 12:56:55 +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
mikhail.naganov@gmail.com
f213b096bc Heap profiler: publish API and add test.
Review URL: http://codereview.chromium.org/2822009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 11:44:07 +00:00
sgjesse@chromium.org
76e24831a6 API: Added functions to retreive information on indexed properties managed by the embedding layer
BUG=737
TEST=test-api/PixelArrayInfo, test-api/ExternalArrayInfo
Review URL: http://codereview.chromium.org/2818003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 13:09:27 +00:00
sgjesse@chromium.org
c7ab2b6aa3 Remove the SetExternalStringDiposeCallback API
Changed the disposal of external string resources to call a virtual Dispose method on the resource. The default inplementation of Dispose deletes the object and will capture the delete operator matching the new operator used to allocate the object.
Review URL: http://codereview.chromium.org/2658008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 09:35:47 +00:00
ager@chromium.org
6dc72b690c Add an overloaded PreCompile method that takes a Handle<String>.
Code review URL: http://codereview.chromium.org/2633004/show


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 06:20:49 +00:00
sgjesse@chromium.org
09acdc8446 Add an API to control the disposal of external string resources
A new callback have been added which - if set - will be called to dispose of external string resources passed from the embedder to the V8 engine.
Review URL: http://codereview.chromium.org/2645004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4805 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:49:07 +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
dimich@chromium.org
ed90d5648b Remove unused tpedef.
Review URL: http://codereview.chromium.org/2560002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 07:53:40 +00:00
vitalyr@chromium.org
26be30912d Fix generated code for String.charCodeAt.
Review URL: http://codereview.chromium.org/2468001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 14:08:19 +00:00
ager@chromium.org
a7bba921c4 Update comment in the API to explicitly state that the handle returned
from Context::New is persistent and has to be disposed at some point
in order to allow garbage collecting the context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4727 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 11:28:14 +00:00
antonm@chromium.org
897f7dedc1 Allow to define accessors on objects.
Currently one can only define accessors on object templates.  This patch
allows to create accessors on the fly.

These accessors could control access to elements as well.  This element
support is somewhat rudimentary and may require future work (for example,
we probably don't want to convert index into a string.)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4714 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 12:14:49 +00:00
ager@chromium.org
ab6055d85d Landing patch by tonyg@chromium.org:
Changing ScriptData API to serialize its internal representation to a
const char* array.

This decouples the API from the internal representation and avoids the need for
callers to serialize themselves.

As a side-effect, ScriptData::New() no longer assumes ownership of its input.
This shouldn't matter as typical usage patterns for the old API would have
required a copy prior to calling ScriptData::New().

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4710 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 06:38:19 +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
mikhail.naganov@gmail.com
3d7ce8ac19 CPU profiler: add secure profiles by filtering out functions using security tokens.
As several pages can run in a single V8 instance, it is possible to
have functions from different security contexts intermixed in a single
CPU profile.  To avoid exposing function names from one page to
another, filtering is introduced.

The basic idea is that instead of capturing return addresses from
stack, we're now capturing JSFunction addresses (as we anyway work
only with JS stack frames.)  Each JSFunction can reach out for
context's security token. When providing a profile to a page, the
profile is filtered using the security token of caller page. Any
functions with different security tokens are filtered out (yes, we
only do fast path check for now) and their ticks are attributed to
their parents.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 14:19:33 +00:00
ager@chromium.org
e2014fb1a3 Export SetResourceConstraints so it can be used with
visibility=hidden.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 06:24:18 +00:00
sgjesse@chromium.org
f5b5edf2a3 Adds C++ API for retrieving a stack trace without running JavaScript
This API is extensible, and parameterized with flags so that callers can specify what subset of information they want to capture for each stack frame. 

Patch by jaimeyap, see http://codereview.chromium.org/1694011 for details.
Review URL: http://codereview.chromium.org/2028001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4597 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 07:32:44 +00:00
serya@chromium.org
16d3811d50 Changing string length field type from int to SMI. It will make it be a regular field. Code generated in EmitNamedLoad could be patched for faster access to string.length.
Review URL: http://codereview.chromium.org/1706013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 14:49:50 +00:00
antonm@chromium.org
0676163f52 Fix copy paste: IsUint32() checks if value is unsigned, not signed.
Review URL: http://codereview.chromium.org/1762008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 13:02:23 +00:00
antonm@chromium.org
97f6a6a7f7 Update document to descirbe semantics of hints.
Review URL: http://codereview.chromium.org/1658002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 15:57:27 +00:00
antonm@chromium.org
6e8c85dc84 Expose a hint which communicates that string might be written many times.
Review URL: http://codereview.chromium.org/1609021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-13 17:00:33 +00:00
antonm@chromium.org
c898c7ae03 Landing http://codereview.chromium.org/1594017 for Ryan.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 18:23:10 +00:00
antonm@chromium.org
d73f9f0f33 Update doc as well.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4353 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 18:04:45 +00:00
antonm@chromium.org
e116cce61b Landing http://codereview.chromium.org/1539013 for ry@tinyclouds.org.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 17:58:43 +00:00