Commit Graph

158 Commits

Author SHA1 Message Date
danno@chromium.org
5a9b2b3c5f Better support for 'polymorphic' JS and external arrays
Allow  keyed store/load stubs to switch between external array and fast JS arrays without forcing a state transition to the generic stub.

There CL consists of two pieces of functionality. First, code stubs for fast element arrays don't immediately transition to the MEGAMORPHIC state when there's a map mismatch. Second, two ICs are cached per map for fast elements, the MONOMORPHIC version, and a new MEGAMORPHIC version that handles two or more different maps. Currently, the only array types supported by the MEGAMORPHIC stub are fast elements for objects and JSArrays.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7917 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 17:29:13 +00:00
vitalyr@chromium.org
9af0a4e4a3 Fix windows build.
TBR=mnaganov@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 16:26:37 +00:00
vitalyr@chromium.org
a9ea3f98b0 ll_prof: Reduce profiling hooks overhead from >400% to 25%.
Switched to using binary low-level log instead of the textual log used
by the ticks processor. The binary log contains code-related events,
code object names, and their bodies. When writing to the log we ask
glibc to use a larger buffer. To avoid complex processing of the
snapshot log (which is still textual) the serializer emits final
snapshot position to code name mappings that can be quickly be read
without replaying the snapshot log. (This might be useful for the
ticks processor.)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 16:06:25 +00:00
svenpanne@chromium.org
e013d4f0a4 Type recording for unary ops
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7707 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-28 17:49:55 +00:00
fschneider@chromium.org
544a436425 Remove code from the deprecated GenericBinaryOpStub.
All platforms are now using the TypeRecordingBinaryOpStub.

I also removed the ARM IntegerModStub which was called from
the GenericBinaryOpStub.
Review URL: http://codereview.chromium.org/6826032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 09:39:21 +00:00
mikhail.naganov@gmail.com
c9904976f9 Simplify isolates access during stack iteration (WAS: Move SafeStackFrameIterator::active_count_...)
While trying to fix Mac and Windows versions for this change:
http://codereview.chromium.org/6771047/, I figured out, that we
already store an isolate in StackFrameIterator, so we can use it in
frame objects, instead of requiring it from caller.

I've changed iterators usage to the following scheme: whenever a
caller maintains an isolate pointer, it just passes it to stack
iterator, and no more worries about passing it to frame content
accessors.  If a caller uses current isolate, it can omit passing it
to iterator, in this case, an iterator will use the current isolate,
too.

There was a special case with LiveEdit, which creates
detached copies of frame objects.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-05 09:01:47 +00:00
mikhail.naganov@gmail.com
a8af96990b Add initialization for has_external_callback field.
It looks like we initialize TickSample values twice in some
situations, but I will fix this in a separate change list.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7434 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-30 13:30:52 +00:00
mikhail.naganov@gmail.com
b3cec2be9f Remove an extra comma from "tick" log records.
This fixes VM state fetching from "tick" log records.

TBR=vitalyr@chromium.org
BUG=1287
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7403 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-29 09:18:08 +00:00
vitalyr@chromium.org
1ae2ea08b9 Remove more TLS hurting Dromaeo DOM.
Patch by Dmitry Lomov.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 08:44:30 +00:00
ager@chromium.org
1bdc8031fa Introduce accessors on builtins instance and use them to avoid TLS access when getting builtins.
R=vitalyr@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 13:40:07 +00:00
ager@chromium.org
4f5de28a9b Avoid TLS access for counters.
Get rid of the COUNTERS macro and fetch the counters from a locally
stored isolate instead.

R=karlklose@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7321 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 11:13:07 +00:00
mikhail.naganov@gmail.com
cbbe713464 Change the way sampler / profiler handle external callbacks.
This should fix test-profile-generator/RecordStackTraceAtStartProfiling flakinness.

R=vitalyr@chromium.org
BUG=1261
TEST=test-profile-generator/RecordStackTraceAtStartProfiling

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7294 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 18:13:27 +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
mikhail.naganov@gmail.com
943e4f8340 Remove `sfi' abbreviations (a follow-up to r6902).
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7124 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:00:27 +00:00
mikhail.naganov@gmail.com
6eb8c9e5a0 Revert r7119..r7121
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7123 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:55:03 +00:00
mikhail.naganov@gmail.com
47a5723704 comment
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:49:07 +00:00
mikhail.naganov@gmail.com
c6d2bb18aa renamed
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:48:56 +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
mikhail.naganov@gmail.com
56788625b6 Fix CPU profiling for Crankshaft.
The main issue was due to multiple recompilations of functions.  Now
code objects are grouped by function using SFI object address.
JSFunction objects are no longer tracked, instead we track SFI object
moves. To pick a correct code version, we now sample return addresses
instead of JSFunction addresses.

tools/{linux|mac|windows}-tickprocessor scripts differentiate
between code optimization states for the same function
(using * and ~ prefixes introduced earlier).

DevTools CPU profiler treats all variants of function code as
a single function.

ll_prof treats each optimized variant as a separate entry, because
it can disassemble each one of them.

tickprocessor.py not updated -- it is deprecated and will be removed.

BUG=v8/1087,b/3178160
TEST=all existing tests pass, including Chromium layout tests

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-22 16:31:24 +00:00
sgjesse@chromium.org
c89021d162 Added labelled thread names to help with some debugging activity. Right now,
the only platform that it works on is linux (using the prctl API to set the
names of the threads). Other platforms are setup to build properly if the
flag is set, but their thread names are not currently set.

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

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 09:09:50 +00:00
mikhail.naganov@gmail.com
e521db4afa Make V8 compilable with profiling support turned off.
BUG=990

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-16 12:14:56 +00:00
mikhail.naganov@gmail.com
670aea0218 Remove log compression support.
This is no longer used in Chromium, and only pollutes code.

BUG=859

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5934 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 13:24:22 +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
646a578b3f Simplify ProfLazyMode test on Linux.
Instead of installing signal handler, count samples taken.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-25 15:54:52 +00:00
mikhail.naganov@gmail.com
7a6c7033b2 Fix reporting of impossible nested calls of DOM functions.
It turns out that having PC pointing _exactly_ at callback entry
point is quite probable.

BUG=crbug/60753

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-27 17:03:01 +00:00
erik.corry@gmail.com
0dcaac1939 Make Failure inherit from MaybeObject instead of Object.
Review URL: http://codereview.chromium.org/3970005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-25 15:22:03 +00:00
ager@chromium.org
1b410339be Use size_t for return value from fwrite.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/4033005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-25 08:26:12 +00:00
ager@chromium.org
36ed1f611b Use return value from fwrite in log.cc to please compilers.
BUG=453
Review URL: http://codereview.chromium.org/4002005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5694 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-25 08:22:23 +00:00
mikhail.naganov@gmail.com
5feede6667 CPU Profiler: postpone moved functions registration until GC completes.
An attempt to retrieve security context for a function may fail if the
destination heap space is in an incomplete state. To fix this, we only
record unknown functions discovered at GC object moves, and then
register them after GC completes.

BUG=crbug/59627

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-20 08:32:24 +00:00
vitalyr@chromium.org
e6b33bd20b Support profiling based on linux kernel performance events.
Since 2.6.31 perf_events interface has been available in the
kernel. There's a nice tool called "perf" (linux-2.6/tools/perf) that
uses this interface and provides capabilities similar to oprofile. The
simplest form of its usage is just dumping the raw log (trace) of
events generated by the kernel. In this patch I'm adding a script
(tools/ll_prof.py) to build profiles based on perf trace and our code
log. All the heavy-lifting is done by perf. Compared to oprofile agent
this approach does not require recompilation and supports code moving
garbage collections.

Expected usage is documented in the ll_prof's help. Basically one
should run V8 under perf passing --ll-prof flag and then the produced
logs can be analyzed by tools/ll_prof.py.

The new --ll-prof flag enables logging of generated code object
locations and names (like --log-code), and also of their bodies, which
can be later disassembled and annotated by the script.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 16:45:11 +00:00
kasperl@chromium.org
cabe82959f Try to simplify the semantics of the profiling code by making
sure to suspend the thread (if necessary) on mac/win32 before 
reading the VM state.

Avoid dealing with signals delivered to non-VM threads on 
linux no matter if we're profiling or not.
Review URL: http://codereview.chromium.org/3845006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5641 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-18 12:37:07 +00:00
erik.corry@gmail.com
d46fb9d454 New attempt to make the allocation routines 64 bit clean.
This one has been approved by the 64 bit compiler in MSVC
2005 so I hope it also passes the 2008 version.

The --max-new-space-size option is now in kBytes.
The --max-old-space-size option is now in MBytes.

Some issues remain with 64 bit heaps and the counters.  See
http://code.google.com/p/v8/issues/detail?id=887
Review URL: http://codereview.chromium.org/3573005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5559 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-30 07:22:53 +00:00
erik.corry@gmail.com
2d0c23bc82 Revert attempt to make heap size 32/64 clean. This change needs to
be done from Windows where the compiler is stricter about truncating
changes.
Review URL: http://codereview.chromium.org/3454035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-28 12:49:25 +00:00
erik.corry@gmail.com
d6313dbbb7 More changes to 32/64 bit correctness.
TBR=vegorov
Review URL: http://codereview.chromium.org/3412038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-28 12:18:19 +00:00
mikhail.naganov@gmail.com
8f22667805 Provide more functions to CPU profiler (fix issue 858).
The cause for missing functions is that some of them are created
from compiled code (see FastNewClosureStub), and thus not get
registered in profiler's code map.

My solution is to hook on GC visitor to provide JS functions
addresses to profiler, only if it is enabled.

BUG=858
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-24 11:45:12 +00:00
mikhail.naganov@gmail.com
187d249d92 Enhance SafeStackFrameIterator to avoid triggering assertions in debug mode.
When running profiling in debug mode, several assertions in frame
iterators that are undoubtedly useful when iterator is started from a
VM thread in a known "good" state, may fail when running over a stack
of a suspended VM thread. This patch makes SafeStackFrameIterator
to proactively check addresses and bail out from iteration early,
before an assertion will be triggered.

BUG=crbug/55565

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5467 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-16 08:23:34 +00:00
whesse@chromium.org
a18f9d1114 Remove dependence of code-stubs on codegen, the virtual frame code generator. Move some functions used by code-stubs and full-codegen from codegen to macro-assembler.
Review URL: http://codereview.chromium.org/3169049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-30 11:48:07 +00:00
lukezarko
5751d8f50c Avoid a potential null dereference wrt the CPU profiler.
GetActiveProfilerModules()/PauseProfiler()/ResumeProfiler() can be reached
from the API when the --prof runtime flag is not set, leading to null
dereferences. Verify that Logger::profiler_ is non-NULL before using it.

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:27:32 +00:00
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
antonm@chromium.org
1e744a3011 Turn some usages of NewArray with DeleteArray in the same scope into ScopedVector or SmartPointer.
That makes it easier to maintain the code---one should care less
about releasing the memory as smart pointers would take care of
this.

Switch to ScopedVector instead Vector for the same semantics in
src/builtins.cc

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4593 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 12:25:58 +00:00
mikhail.naganov@gmail.com
6f3f2f1c42 Allow new CPU profiling subsystem to coexist nicely with the old one.
This is to make possible enabling usage of the new profiling subsystem
in Chromium without much hassle. The idea is pretty simple: unless the
new profiling API is used, all works as usual, as soon as Chromium
starts to use the new API, it will work too.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-12 07:23:43 +00:00
mikhail.naganov@gmail.com
a6e6131bf7 Fix debug builds.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4363 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 14:00:51 +00:00
mikhail.naganov@gmail.com
c520e28dcb Make VM state tracking to be independent of logging and profiling.
Also pull out VMState into its own set of source files.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 13:37:39 +00:00
mikhail.naganov@gmail.com
4f5ff869d3 C++ profiles processor: align browser mode with the old implementation, sample VM state.
In browser (DevTools) mode, only non-native JS code and callbacks are reported.
Also, added "(garbage collector)" entry which accumulates samples count in GC state.
Trying to display "(compiler)" and "(external)" only brings confusion,
because it ends up in displaying scripts code under "(compiler)" node, and DOM
event handlers under "(external)" node, which looks weird.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-07 14:18:26 +00:00
mikhail.naganov@gmail.com
889f6cce74 C++ profiles processor: wire up to VM.
If 'shell' is compiled with 'cppprofilesprocessor=on' and run
with '--prof' flag, top-down and bottom-up call trees are printed
on shell exit.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4343 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 10:36:38 +00:00