Commit Graph

42 Commits

Author SHA1 Message Date
mikhail.naganov@gmail.com
d7cccf6b8d Add log compression ability.
This is a trivial per-row compression:
- short aliases are introduced for events and code creation tags;
- in tick events, offsets are used instead of absolute addresses;
- removed 'code-allocation' event, as it seems not used.

The first two options are depend on the new flag: 'compress-log', which is off by default.

On benchmarks run w/o snapshot, this gives 45% log size reduction.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 13:39:48 +00:00
mikhail.naganov@gmail.com
0fcedde224 Fix determining of JS lower stack bottom used in profiler's JS stack tracer to work with Chromium.
My assumption that log initialization happens somewhere near the stack's bottom is true for V8's sample shell but isn't true for Chromium, causing many otherwise valid stack addresses to be thrown out. The solution proposed is to save stack pointer value for the outermost JS function in ThreadLocalTop similar to c_entry_fp.

Implemented only for IA-32. Currently I'm not dealing with profiling on ARM and x86-64 anyway.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2086 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-02 09:33:17 +00:00
mikhail.naganov@gmail.com
10cd3ad48c Two simple profiler changes: 1) log sampling rate, 2) check current state before pausing & resuming.
Review URL: http://codereview.chromium.org/113961


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-29 06:56:23 +00:00
mikhail.naganov@gmail.com
795ba99117 Handle filling up of memory buffer to make log processing in DevTools Profiler easier.
When profiler's memory buffer is filled up, profiling is stopped and it is ensured that the last record in the buffer is "profiler,\"pause\"" thus making the end of profiling session explicit. Otherwise DevTools Profiler would need to guess whether the current profiling session has been stopped.

Tested with Chromium.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 13:56:32 +00:00
mikhail.naganov@gmail.com
30a0a7de43 Split nested namespaces declaration in two lines in accordance with C++ Style Guide.
This issue was raised by Brett Wilson while reviewing my changelist for readability. Craig Silverstein (one of C++ SG maintainers) confirmed that we should declare one namespace per line. Our way of namespaces closing seems not violating style guides (there is no clear agreement on it), so I left it intact.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 10:05:56 +00:00
mikhail.naganov@gmail.com
6d71da11fd Merge in changes from readability review.
All changes from http://codereview.chromium.org/115024, except splitting namespace declarations in two lines (will be done separately for all source files).

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 08:39:22 +00:00
mikhail.naganov@gmail.com
9f69c414eb Implement resource-saving ("lazy") mode of Profiler.
This is intended to be used with Chromium. When in resource-saving mode, profiler doesn't consume any resources (sampler and logging is off) until resumed. Then again, when profiler is paused, sampling and logging are turned off.

Tested under Linux and Windows. Also have done preliminary testing with Chromium.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 08:25:36 +00:00
mikhail.naganov@gmail.com
4075179fbe Introduce Logger::LogCompiledFunctions that logs current map of compiled code.
The goal is to make possible having --prof flag always enabled in Chromium.  Currently we can't do this because --prof causes compiler and gc to log code creations / moves / deletes which aren't needed until we start profiling.  With LogCompiledFunctions it will be possible not to log anything until we start profiling.  When started, the current map of compiled functions will be logged and compiler / gc logging will be enabled to update current state.  When profling is stopped, logging will be turned off again.

Funny that testing code is actually much longer and complex than function code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 09:04:13 +00:00
lrn@chromium.org
8d57bc5ac4 X64: Changed 0x%x formats in log.cc to 0x%p and omitted reinterpretting pointers.
Review URL: http://codereview.chromium.org/114010


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1893 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-07 09:27:42 +00:00
mikhail.naganov@gmail.com
bf63b8f173 Introduce internal Log class that handles writing log messages, enable logging to memory buffer.
This will enable reading profiler log in Chrome. The current implementation of memory buffer is trivial (fixed size buffer, no memory recycling) but enough to start end-to-end DevTools Profiler implementation. Later it will be enhanced.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 15:57:47 +00:00
mikhail.naganov@gmail.com
4ff39b7a7d Remove unused CodeRegion class and corresponding logging functions.
Review URL: http://codereview.chromium.org/67221

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 17:30:27 +00:00
mikhail.naganov@gmail.com
e88d1e475e Fixed numerous issues that were causing errors in profiler log processing
on a real web application loaded in the test shell.

Also implemented output of JSON-encoded call stacks for profiler
prototype.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 09:06:37 +00:00
christian.plesner.hansen@gmail.com
9142c42df2 Fixed a bunch of memory leaks in tests, including:
- String traversal test data (now in a zone)
 - Debug message thread (now joined on exit)
 - Threading test threads (now joined on exit)
 - Changed message tests framework to cope with valgrind
Also, fixed a bug where we'd try to delete stack-allocated objects
when tearing down v8.  Good times.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 00:24:49 +00:00
mikhail.naganov@gmail.com
3bd4c93d07 Support profiler stack sampling in any situation. After this change, almost all profiler ticks (except GC ones) have a stack sample data associated.
Tested under Linux, OS X, and Windows.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-06 13:07:57 +00:00
mikhail.naganov@gmail.com
c013397399 Adding support for reporting addresses of JIT compiled code to OProfile.
Please be warned that current gHardy versions have OProfile 0.9.3
which doesn't have JIT API. You need to install OProfile 0.9.4
with a 32-bit version of opagent library. Instructions are on the
internal Wiki page: http://wiki/Main/V8UsingOProfile

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


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

StackTraceFrameIterator moved to frames.*

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

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

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

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:00:21 +00:00
sgjesse@chromium.org
98208125cb Include all the code in code creation log events. The code object header size is now added to the size Before ticks the last instructions of a JavaScript functions ended up as unaccounted in the profile.Include ticks in the the last created code object in the profile.Show the unaccounted ticks in the profile as a percentage together with the rest. Added an option to ignore unaccounted ticks in the percentage calculation.
Review URL: http://codereview.chromium.org/21410

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-18 10:29:56 +00:00
sgjesse@chromium.org
969d43e785 Changed all log messages to be handled through the LogMessageBuilder instead of through fprintf directly to the log file.
Added a flag for the runtime %Log call and fixed its arguments checking. Use of %Log is only for debugging.
Review URL: http://codereview.chromium.org/21406

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1290 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-17 12:49:35 +00:00
sgjesse@chromium.org
577741308b First step in refactoring the logging system to allow the logging messages to have other destinations than an open file.
This change introduces a log message builder which builds the log message in a static string buffer instead of formatting the log message through fprintf. Currently this message can only be written to a file afterwards.

Changed the code related events to use the log message builder.
Review URL: http://codereview.chromium.org/20406

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1284 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-17 08:21:24 +00:00
olehougaard
e7150a8d8a Fixing a few bugs to make the --log-state-change option work.
Review URL: http://codereview.chromium.org/20220

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-11 07:38:31 +00:00
mikhail.naganov@gmail.com
3835e915c4 Adding src_file_name:line_number into perf log entries for compiled JS functions.
Thus, instead of the following profiler records:
   1.5%    1.5%   LazyCompile: <anonymous>
we'll now have these:
   1.5%    1.5%   LazyCompile: <anonymous> richards.js:309

Basically, I translated two functions from messages.js into C++.
In the next CL I will update messages.js to use added native functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 10:52:02 +00:00
mike@belshe.com
75037cbd6e Enable programmatic access to Profile pause/resume
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-29 19:47:00 +00:00
christian.plesner.hansen@gmail.com
4e78736900 Fixed build with no ENABLE_LOGGING_AND_PROFILING
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-07 14:24:08 +00:00
christian.plesner.hansen@gmail.com
afcc36a417 Added runtime call to the logging infrastructure. Made some changes
to the way regexps are being logged.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-06 13:24:52 +00:00
christian.plesner.hansen@gmail.com
d7c933e7ae Added support in the profiler for creating 'regions' that cover part
of the generated code.  These can be used by the profiler to
categorize the ticks that occur within generated code and thereby show
more detailed information about where time is spent in generated code.
For instance, this is what the profiler displayed for a simple regexp
benchmark with irregexp-native before:

[JavaScript]:
   total  nonlib   name
   87.2%   87.2%   RegExp: (?:\w*\W+)*

This is what we can display now:

[JavaScript]:
   total  nonlib   name
   87.2%   87.2%   RegExp: (?:\w*\W+)*
                   -  53.0%  56.7% BranchOrBacktrack
                   -  14.9%  59.8% CheckCharacterLT
                   -  13.7%  20.4% CheckStackLimit
                   -   6.7%   6.7% SafeCall
                   -   2.7%   7.0% CheckCharacterGT
                   -   2.4%   2.4% SafeReturn
                   -   2.1%   2.1% LoadCurrentCharacter
                   -   1.8%   1.8% PushRegister
                   -   0.9%   0.9% PopRegister
                   -   0.9%   0.9% AdvanceRegister
                   -   0.3%   0.3% PopCurrentPosition
                   -   0.3%   0.3% CheckGreedyLoop
                   -   0.0%  20.4% PushBacktrack
                   -   0.0%  22.3% CheckCharacter
                   -   0.0%   2.4% IfRegisterLT


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-19 13:12:43 +00:00
deanm@chromium.org
fa04fa8a19 Make Logger::SuspectReadEvent extract the class name from the object. This makes the lone caller cleaner, and also avoids a tiny bit of work in the default case of not running with --log-suspect.
Review URL: http://codereview.chromium.org/13655

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-09 09:19:02 +00:00
olehougaard
31520bc34a Removed a comment that is no longer valid.
Review URL: http://codereview.chromium.org/8960

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@693 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-05 08:43:22 +00:00
olehougaard
867d504395 Fixing profiling when using snapshot.
Review URL: http://codereview.chromium.org/8655

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@621 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-28 09:53:52 +00:00
christian.plesner.hansen@gmail.com
9d9f608a38 - Added caching of regexp data in the compilation cache.
- Changed the structure of regexp objects from having two internal
  fields to having a single field containing a fixed array, since it's
  easier to store the whole fixed array in the cache.
- Move printing of the command to after printing std{err,out} in the
  compact progress indicators in the test framework.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 08:40:02 +00:00
christian.plesner.hansen@gmail.com
85251f756c - Changed regexp logging to include the string being matched and to
escape commas.
- Fixed issue with block-comparing unaligned strings on arm.
- Added short documentation to one of the Persistent constructors.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 12:00:19 +00:00
christian.plesner.hansen@gmail.com
6d47b29765 - Added new object type, RegExp, for regular expressions.
- Renamed some ::kSizes to ::kHeaderSizes to avoid confusion.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-23 11:45:43 +00:00
ager@chromium.org
888abb1bfd Fix bug in function context slot lookup. There were two problems: we
read at the wrong index in the scope information and we forgot to add
Context::MIN_CONTEXT_SLOTS to the index.

This fixes issue 24.
Review URL: http://codereview.chromium.org/1938

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 13:00:30 +00:00
lrn@chromium.org
9d3557ef99 Formatting fixes (e.g., whitespace at end of line)
Added in-file documentation for --log-regexp switch.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@278 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 12:57:27 +00:00
lrn@chromium.org
7c638ec3e6 Fixed build error on Linux.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 11:59:00 +00:00
lrn@chromium.org
c5d98b775d Added -log-regexp option to log all compilations and executions of regular expressions.
Slightly modified SmartPointer.
Made String.ToWideCString return a SmartPointer instead of a plain pointer.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 11:24:45 +00:00
christian.plesner.hansen@gmail.com
9bed566bdb Changed copyright header from google inc. to v8 project authors.
Added presubmit step to check copyright.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 20:08:45 +00:00
mads.s.ager@gmail.com
769cc962a0 Improved performance of unary addition by avoiding runtime calls.
Fixed the handling of '>' and '<=' to use right-to-left conversion and left-to-right evaluation as specified by ECMA-262.

Fixed a branch elimination bug on the ARM platform where incorrect code was generated because of overly aggressive branch elimination.

Improved performance of code that repeatedly assigns the same function to the same property of different objects with the same map.

Untangled DEBUG and ENABLE_DISASSEMBLER defines.  The disassembler no longer expects DEBUG to be defined.

Added platform-nullos.cc to serve as the basis for new platform implementations.


git-svn-id: http://v8.googlecode.com/svn/trunk@9 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-06 10:02:49 +00:00
kasper.lund
7276f14ca7 Changed all text files to have native svn:eol-style.
Added a few samples and support for building them. The samples include a simple shell that can be used to benchmark and test V8.

Changed V8::GetVersion to return the version as a string.

Added source for lazily loaded scripts to snapshots and made serialization non-destructive.

Improved ARM support by fixing the write barrier code to use aligned loads and stores and by removing premature locals optimization that relied on broken support for callee-saved registers (removed).

Refactored the code for marking live objects during garbage collection and the code for allocating objects in paged spaces. Introduced an abstraction for the map word of a heap-allocated object and changed the memory allocator to allocate executable memory only for spaces that may contain code objects.

Moved StringBuilder to utils.h and ScopedLock to platform.h, where they can be used by debugging and logging modules. Added thread-safe message queues for dealing with debugger events.

Fixed the source code reported by toString for certain builtin empty functions and made sure that the prototype property of a function is enumerable.

Improved performance of converting values to condition flags in generated code.

Merged disassembler-{arch} files.


git-svn-id: http://v8.googlecode.com/svn/trunk@8 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-30 08:49:36 +00:00
christian.plesner.hansen
43d26ecc35 Initial export.
git-svn-id: http://v8.googlecode.com/svn/trunk@2 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-03 15:10:15 +00:00