Commit Graph

226 Commits

Author SHA1 Message Date
deanm@chromium.org
00b9b2e5e4 Cleanup v8.gyp. This also drops a bunch of unused targets (the shell, d8,
etc).

There are now two gyp variables to control whether we build snapshots and which
target we are building for.  This allows you to easily cross-compile for arm and
disable snapshots.

Patch by Joel Stanley.

Original review: http://codereview.chromium.org/149243

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2392 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-08 14:56:56 +00:00
kasperl@chromium.org
0684291c89 Revert r2372 to get the tree green again.
TBR=mikhail.naganov@gmail.com
Review URL: http://codereview.chromium.org/155137

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2377 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-07 13:06:40 +00:00
mikhail.naganov@gmail.com
0f7b263bdd Add automatic tests for Tick Processor.
Added tests for cmdline args parsing, symbols processing, and the whole process.

Tick Processor code was refactored to make it testable.

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


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

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-07 08:11:19 +00:00
antonm@chromium.org
ecfd1f1017 Attempt to reduce performance penalty for logging and profiling
Review URL: http://codereview.chromium.org/125141

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-24 13:09:34 +00:00
mikhail.naganov@gmail.com
1e18e55c15 Two requested changes to tick processor.
1. If D8_PATH isn't specified, first try to locate 'd8' shell in path,
   and if not found, fallback to the one in tools_path/..
2. Add '--nm=<nm_exec>' parameter to specify 'nm' executable to use.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2225 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-20 12:54:02 +00:00
mikhail.naganov@gmail.com
6b03961d4c Fix 'nm' results parsing in tickprocessor.
Without an explicit check if a function belongs to shared library address space, "finishing" a library symbols processing with 'addPrevEntry(libEnd);' can cause emission of code entries which cover almost the entire address space, shadowing other code.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-19 07:08:31 +00:00
mikhail.naganov@gmail.com
a1a962f65e Implemented processing of compressed log files.
- fixed address delta calculation;
- code creations are also compressed to be in sync with other events;
- factored out a base class from TickProcessor to reuse code in DevTools profiler.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-18 07:59:13 +00:00
kasperl@chromium.org
43d68a5886 Make sure to treat tests that time out as having the
TIMEOUT outcome.
Review URL: http://codereview.chromium.org/125248

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2205 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 12:19:51 +00:00
mikhail.naganov@gmail.com
4ca9836bc7 Include weak symbols from 'nm' report. This fixes "C++" part of profiling results.
Review URL: http://codereview.chromium.org/125243


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 08:27:19 +00:00
mikhail.naganov@gmail.com
2cc6fef9d5 Fix the problem with JS entries in tickprocessor.
The main problem was due to the following: after Erik had fixed the logger to report library addresses, tickprocessor started to add to the code map entries that covered almost entire memory. This happened because tickprocessor contains a heuristic to bias addresses of functions from dynamic libraries:

    if (funcInfo.start < libStart && funcInfo.start < libEnd - libStart) {
      funcInfo.start += libStart;
    }

And, as tickprocessor tried to process all symbols from the library, including data entries, which can be outside reported library addresses range, the second condition failed, and funcInfo.start remained unbiased.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2194 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 18:57:26 +00:00
erik.corry@gmail.com
398c5a9b37 Use >>> instead of >> in order to cover the full 32 bit range when
handling addresses.
Review URL: http://codereview.chromium.org/125187

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 15:01:24 +00:00
erik.corry@gmail.com
92bbf75971 Don't panic if tickprocessor can't find a shared library.
Don't swallow exceptions so we can't see where they are really
thrown.
Review URL: http://codereview.chromium.org/126200

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 13:44:48 +00:00
sgjesse@chromium.org
78a8cdfbe8 Added utility scripts for running oprofile in tools/oprofile.
To profile running the JavaScript file test.js using the V8 release mode shell (assuming it is build passing prof=oprofile to the SCons build). The following commands can be used:

$ tools/oprofile/start
$ tools/oprofile/run test.js
$ tools/oprofile/report | less
$ tools/oprofile/annotate | less
$ tools/oprofile/shutdown

Here is a summary of the commands.

For all the commands taking an executable the executable is expected to be a binary using V8. If no executable is specified the release mode V8 shell is assumed.

By default the --session-dir=/tmp/oprofv8 is passed to all oprofile commands. This walue can be changed by setting environment variable OPROFILE_SESSION_DIR.

When using the defaulf executable (V8 shell in release mode) it is assumed to be located in ../.. relative from the oprofile utility scripts. This default location can be overridden using the V8_SHELL_DIR environment variable.

start
-----
Start the oprofiling daemon.

run [executable] [parameters]
-----------------------------
Profile a V8 executable. Running this will reset oprofile samples, run the command and do an oprofile dump to flush samples and write ELF binaries for the generated code. The parameters are passed to the executable together with the --oprofile option.

report [executable] [parameters]
--------------------------------
Print the report for a profile run. The parameters are passed to opreport. E.g report --callgraph.

annotate [executable] [parameters]
----------------------------------
Print annotated assembly for a profile run. The parameters are passed to opannotate. E.g annotate -threshold 1.

reset
-----
Reset oprofile samples.

dump
----
Flush oprofile samples and write ELF binaries for the generated code.

shutdown
--------
Shutdown oprofile daemon.

Added a warning which is printed if option --oprofile is passed to a V8 which has not been compiled with oprofile support.
Review URL: http://codereview.chromium.org/125181

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2186 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 12:08:59 +00:00
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
18b4d8bfa7 Add an ability to explicitly specify path to d8 shell to linux-tick-processor.
Review URL: http://codereview.chromium.org/118306


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 15:49:37 +00:00
kasperl@chromium.org
be11c4e979 Patch by Craig Schlenter. See http://codereview.chromium.org/118153
Change stack alignment on linux to 16 bytes to keep gcc 4.4 happy. 
This fixes the mksnapshot segfault without requiring -fno-tree-vectorize
which just avoided the problem by not generating code with movdqa.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2107 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 06:20:30 +00:00
mikhail.naganov@gmail.com
ba09fb12aa Profiler cleanup: removed another piece that is only needed for DevTools profiler.
Review URL: http://codereview.chromium.org/118229


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-04 09:20:27 +00:00
sgjesse@chromium.org
d1f466cce3 Added more output on timeout failures to test runner.
Review URL: http://codereview.chromium.org/119112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-04 09:18:39 +00:00
mikhail.naganov@gmail.com
703fcecaaf Make tickprocessor's ProfileView extensible and move out DevTools-only stuff.
Review URL: http://codereview.chromium.org/119076


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-03 11:21:23 +00:00
mikhail.naganov@gmail.com
e48095b87c Implement a dynamically growing memory log buffer with an upper limit.
The goal of this change is to allow longer profiling sessions and preserve memory when profiler isn't started. The buffer starts with 64K and grows until it reaches the upper limit, which is currently set to 50MB --- according to my evaluations, this is enough for at least 20 minutes of GMail profiling. As we're planning to introduce compression for the profiler log, this time boundary will be significantly increased soon.

To make possible unit testing of the new component, I've factored out Logger's utility classes into a separate source file: log-utils.h/cc. Log and LogMessageBuilder are moved there from log.cc without any semantical changes.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 07:08:09 +00:00
ager@chromium.org
0582ee5da5 Land patch from Craig Schlenter to make V8 build and run when compiled
with -O3 on gcc 4.4.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-22 06:52:02 +00:00
mikhail.naganov@gmail.com
f04016b19d In linux-tick-processor only compile d8 if it doesn't exist.
Review URL: http://codereview.chromium.org/113581


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 09:37:36 +00:00
ager@chromium.org
af59c3d68f Reapply revision 1949. Stupid error.
Add virtual destructor to jump targets to make compiler happy.
Review URL: http://codereview.chromium.org/113396

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1951 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 12:18:25 +00:00
ager@chromium.org
c9eda02def Revert revision 1949.
Review URL: http://codereview.chromium.org/115350

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1950 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 11:55:18 +00:00
ager@chromium.org
f4778b007f Reduce the memory used by frame elements from two words to one by
encoding the values in one word and by using an indirection table for
handles.

This reduces compilation time by roughly 10% and we should be able to make the slow case equality checking of frame elements faster as well.
Review URL: http://codereview.chromium.org/115347

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1949 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 11:43:09 +00:00
mikhail.naganov@gmail.com
7bfae7d976 Merge into tools/profile_view.js changes needed for DevTools profiler.
Happily, most of them are removals of unneeded code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 09:27:34 +00:00
kasperl@chromium.org
32d805f284 Valgrind outputs large numbers like 4,096 (with the commas) and
that isn't matched by \d+. Ug.
Review URL: http://codereview.chromium.org/115238

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 14:05:37 +00:00
mikhail.naganov@gmail.com
7d260e5f8c Don't keep data about JS code that is never executed.
This reduces memory usage of tickprocessor. Thanks to William Hesse for pointing out this issue.

Also speed up static symbols loading.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-08 11:27:02 +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
deanm@chromium.org
2b56660a8b Introduce two separate classes of processor detection:
- TARGET, the architecture we will generate code for.
  This is brought it from the build system.
- HOST, the architecture our C++ compiler is building for.
  This is detected automatically based on compiler defines.

This adds macros for 32 or 64 bit, and cleans up some
include conditionals, etc.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 12:06:20 +00:00
iposva@chromium.org
dc6a6f71b8 Add version.cc and version.h to Xcode project.
Review URL: http://codereview.chromium.org/100211

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-30 17:06:02 +00:00
sgjesse@chromium.org
a470847226 Added better version information
The current version is now held in src/version.cc in a number of defines which needs to be modified when changing version.

The following defines make up the version information:

  MAJOR_VERSION
  MINOR_VERSION
  BUILD_NUMBER
  PATCH_LEVEL
  CANDIDATE_VERSION

The first four are numbers and the fifth is a boolean. Besides these five the define

  SONAME

can be used to set a specific soname when building the a shared library (see below). This will most likely be used on stable branches where binary compatibility is ensured between different versions. This define is a string.

This version information is now read by the SCons build to support setting the soname for a Linux shared library. This requires passing the option soname=on to the SCons build.

When soname=on is specified the soname for the shared library can be set in two different ways. Either it will be the full versioned library name (e.g. libv8-1.2.2.so) or a specific soname defined in src/version.cc. Whenever a shared library is build with an soname the filename of the library will hold the full version name (e.g. libv8-1.2.2.so).

I did not update the xcode project with the new files.

BUG=151
Review URL: http://codereview.chromium.org/100104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-30 09:29:15 +00:00
mikhail.naganov@gmail.com
178a656429 Enhancing profiling data processing code with functionality needed for the Dev Tools Profiler.
Details:

 - added properties / functions in view objects needed for WebKit's ProfileView;

 - added ability to count profiles for specific functions.

The tickprocessor functionality does not affected.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-30 08:10:27 +00:00
lrn@chromium.org
976a9025e4 Fix .gyp file and avoid adding -m32 on 32 bit systems.
Fix SConstruct to only add -m32 if the compiler needs it.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 15:20:37 +00:00
ager@chromium.org
774d0d504b Fix the xcode project to define the correct V8_ARCH_*.
TBR=lrn@chromium.org
Review URL: http://codereview.chromium.org/99188

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 14:06:10 +00:00
lrn@chromium.org
ea56336518 Create build structure for X64.
Possible to attempt to build for X64.
Build will be unsuccessful, since all x64 source files are
missing and pointers are reinterpreted as integers everywhere.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 13:11:48 +00:00
iposva@chromium.org
a6434ab5e4 Fix names after move of architecture dependent files.
TBR=lrn

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1810 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 00:01:51 +00:00
mikhail.naganov@gmail.com
bffdfa3552 Rename profileview.js -> profile_view.js because WebInspector already has ProfileView.js.
Review URL: http://codereview.chromium.org/100102

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1805 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-28 09:15:31 +00:00
mikhail.naganov@gmail.com
aa2c33126c TickProcessor script reimplemented in JavaScript.
This is an effort to reuse profiler data processing code both in
TickProcessor and Dev Tools Profiler. The old Python implementation
will be removed.

The new TickProcessor works almost identical to the previous one.
However, it has some differences:

1. Not very useful "Call profile" section is replaced with a new
   WebKit-like "Bottom up (heavy) profile" which shows the most
   expensive functions together with their callers. I used it
   personally in order to find and remove bottlenecks in the
   tickprocessor script itself, and found it quite helpful.

2. Code entries with duplicate names (they occur for RegExes, stubs
   and sometimes for anonymous Function objects) are now distinguished
   by adding an occurence number inside curly brackets.

3. (Address -> code entry) mapping is more precise in boundary cases.

4. Windows version no more requires specifying .map file location.

5. Works faster.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1802 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 13:50:42 +00:00
ager@chromium.org
e3e50f7070 Add gyp file to v8 repository.
Gyp is used to generate project files used to build chromium.  Moving
the v8.gyp file to the v8 repository makes it easier to have V8 and
the v8.gyp file synchronized (so a DEPS update in chromium gets the
right v8.gyp file associated with that revision of V8).

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



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1795 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 09:04:39 +00:00
ager@chromium.org
5efbfcff22 Fix V8 xcode build.
Let xcode fix a couple of things and add json-delay.js to the project.
Review URL: http://codereview.chromium.org/93122

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1792 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 13:18:40 +00:00
mikhail.naganov@gmail.com
2060dc1512 Added ProfileView object for performing sorting, searching and filtering operations on a profile.
It will be used both in the new tickprocessor and Dev Tools profiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 11:37:38 +00:00
christian.plesner.hansen@gmail.com
1f7e96743d - Extended lazy loading to general objects, not just functions.
- Added lazily loaded JSON object.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 08:13:09 +00:00
lrn@chromium.org
a4d756a1c8 Move backend specific files to separate directories.
Move ia32 and arm specific files to subdirectories to make it easier to add more backends.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-23 12:06:38 +00:00
sgjesse@chromium.org
8c7ca1dd92 Add missing files to the Visual Studio ARM simulator project.
Review URL: http://codereview.chromium.org/93007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1762 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-22 11:39:47 +00:00
mikhail.naganov@gmail.com
6290e19716 Implemented a CSV parser in JavaScript.
Review URL: http://codereview.chromium.org/67253

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1740 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 17:58:14 +00:00
mikhail.naganov@gmail.com
dfe8af02a6 Implemented Profile object that processes profiling events and calculates profiling data.
Review URL: http://codereview.chromium.org/77014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 17:40:52 +00:00
mikhail.naganov@gmail.com
5edf6f35bc Reimplement (address -> code) mapping from tickprocessor.py in JS.
Found a pair of bugs concerned with border cases in the original implementation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1726 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 16:05:17 +00:00
mikhail.naganov@gmail.com
e9aa21849b Reimplement Splay Tree in JavaScript (and add unit tests!).
This is the first step in reimplementing tick processing scripts in
JavaScript. The goal is to have the same source both for Dev Tools and
Golem, so Python implementation will be removed to avoid code
duplication.

The implementation follows the Dev Tools style: namespaces and JSDocs
are used.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-15 01:22:52 +00:00
mikhail.naganov@gmail.com
3c2a7bdf21 Add name inference for anonymous functions to facilitate debugging and profiling of JS code.
Currently function name inference is wired with AST optimization pass to avoid introducing another pass over AST. A better solution would be to rewrite AST visitors so they can be naturally combined together in a single pass, as their current implementation doesn't allow it.

For examples of cases where function names can be inferred, see the tests file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 00:51:59 +00:00
iposva@chromium.org
b5ba35b742 - Fix lint failure.
- Add missing files d8-posix.cc and d8-windows.cc to Xcode project.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1690 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-09 23:17:45 +00:00
iposva@chromium.org
f7473610c8 - Exclude "build/include_what_you_use" from cpplint.py filters.
Review URL: http://codereview.chromium.org/65017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-09 20:07:30 +00:00
sgjesse@chromium.org
34064c821a Remove the PCRE_STATIC define.
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/62103

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-07 16:01:45 +00:00
ager@chromium.org
aacd90314f Reland exception propagation fix.
Fix exception propagation problem where undefined was returned instead
of an empty handle in case of an exception.  This problem can break
C++ programs that are not interested in catching exceptions and just
want to propagate them out by testing for empty handles.

The issue is that exceptions are not rescheduled if they are
externally caught.  Externally caught exceptions have to be
rescheduled if there is a JavaScript frame on the way to the C++ frame
that holds the external handler.

A couple of tests will fail on the ARM simulator because the simulator
has separate stacks for C++ and JavaScript.  I have marked the tests
as failing only on the simulator.
Review URL: http://codereview.chromium.org/56105

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 15:23:58 +00:00
sgjesse@chromium.org
745cccdcba Fix developer shell build on Windows.
Fixed the OS check in the SCons build. Moved SetEnvironment to platform file as Windows does not have setenv. Added the d8-windows.cc to the Visual Studio project.
Review URL: http://codereview.chromium.org/57050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 11:45:20 +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
kmillikin@chromium.org
99ba650f71 Mark some of the places we leave V8 via callbacks as transitions to
state EXTERNAL rather than OTHER.
Review URL: http://codereview.chromium.org/55007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 12:32:28 +00:00
christian.plesner.hansen@gmail.com
1a823e8216 Fixed second problem with special commands.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1625 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 03:27:04 +00:00
christian.plesner.hansen@gmail.com
358aaa135f Fixed special command problem I just introduced. Guess I should have
waited for review eh.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 03:22:06 +00:00
christian.plesner.hansen@gmail.com
76e725d777 Added url decoding of special commands.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1623 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 03:13:46 +00:00
iposva@chromium.org
dc0e1e0887 - Add missing files to the Xcode project.
TBR=mark@chromium.org
Review URL: http://codereview.chromium.org/53087

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1615 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-26 05:43:54 +00:00
kasperl@chromium.org
fc0af92f60 Introduce splaytree.KeyNotFoundError and use it for reporting
issues when removing non-existing nodes from a SplayTree.
Review URL: http://codereview.chromium.org/42599

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1609 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-25 12:14:13 +00:00
kasperl@chromium.org
4d8ea7143f Make sure to generate a CodeCreateEvent for the CPU features
probe code object, and really raise an exception if SplayTree.Remove
is called with a key that cannot be found. 
Review URL: http://codereview.chromium.org/42597

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1606 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-25 10:29:22 +00:00
kmillikin@chromium.org
bc3fb11881 Add basic infrastructure for protecting V8's heap when leaving the VM
and unprotecting it when (re)entering.  The functionality is enabled
by the flag --protect-heap and requires V8 to be built with
ENABLE_HEAP_PROTECTION and ENABLE_LOGGING_AND_PROFILING defined.

Implemented on Linux and Windows but not yet for other platforms.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 12:47:53 +00:00
ager@chromium.org
9f4eced34c Landing http://codereview.chromium.org/42374
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 17:09:07 +00:00
kasperl@chromium.org
039d25b27e Add support for running the tests through valgrind.
Review URL: http://codereview.chromium.org/43073

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 06:52:24 +00:00
erik.corry@gmail.com
912c8eb03a * Reapply revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge, reverted in 1429.
* Fix of $1 accessor on sliced strings.
* Fix of lastParen method when last parenthesis did not match.
Review URL: http://codereview.chromium.org/43075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 14:00:55 +00:00
kasperl@chromium.org
e9e8628380 Revert revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge until we have a fix
for the crashers we see on the distributed test infra-
structure.

We know that revision 1383 is causing issues, but I 
had to revert some of the other recent RegExp changes
in order to get this part out.
Review URL: http://codereview.chromium.org/39186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 15:23:17 +00:00
mikhail.naganov@gmail.com
0554042907 Fixed projects after adding oprofile-agent* sources.
Review URL: http://codereview.chromium.org/40159

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1427 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 11:35:44 +00:00
iposva@chromium.org
63d5fc4040 Properly add debug-agent.[cc|h] files.
Review URL: http://codereview.chromium.org/40014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-03 16:01:22 +00:00
sgjesse@chromium.org
92aa4ab36c Add V8 debugger agent.
The debugger agent listens on a TCP/IP port for a remote debugger connection. When such a connection is established the debuger JSON protocol is communicated between the agent the the remote debugger. The messages containing the JSON protocol has a RFC-822 like header with a Content-Length field and with the body containing the JSON in UTF-8 encoding.

The D8 shell has option --debugger-agent to start the debugger agent.
Review URL: http://codereview.chromium.org/27355

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-03 12:23:45 +00:00
kmillikin@chromium.org
f4735247cf Merge from experimental code generator branch to bleeding edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-27 13:00:32 +00:00
erik.corry@gmail.com
5b8c63f9d5 Avoids allocating a JSArray of capture information on each non-global
regular expression match.
Also moves all last-match information into one place where it can be
updated from C++ code (this will be used in another afsnit).
Review URL: http://codereview.chromium.org/28184

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1383 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-27 10:04:34 +00:00
mikhail.naganov@gmail.com
0864b2d646 Two small changes regarding GC ticks.
1) Don't try to sample the stack if VM is in 'GC' state
2) Show GC ticks in profiler statistics

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 15:48:32 +00:00
iposva@chromium.org
548a8bc2cf Remove PCRE files from Xcode project.
Review URL: http://codereview.chromium.org/27134

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:23:49 +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
6ace05ed2a Issue 63: Running tests fails of there is a dot in the checkout path
Patch by Matt Hanselman (http://codereview.chromium.org/27086). Pass in the module's filename while loading rather than the full path (so call to load_module now matches find_module).  Otherwise dots in path name get mistaken for file suffixes.

Added Matt Hanselman to AUTHORS file.

BUG=63
Review URL: http://codereview.chromium.org/28109

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1356 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 10:09:42 +00:00
erik.corry@gmail.com
bbc2a73f31 Remove JSCRE
Review URL: http://codereview.chromium.org/21504

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

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-24 13:32:01 +00:00
sgjesse@chromium.org
6ea0862592 Added ticks to the display of unknown time in the profile.
Review URL: http://codereview.chromium.org/27050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1343 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-24 07:36:58 +00:00
sgjesse@chromium.org
f85b52615b Only account for actual time spend in call path calculation.
The call path section of the profile now starts with information on the percentage of the ticks which does not contain call path information.

Added tick count to the call path part as well.
Review URL: http://codereview.chromium.org/28022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-23 12:18:46 +00:00
mike@belshe.com
0b4b32d9f7 add ticks to tickprocessor
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-20 01:56:08 +00:00
mikhail.naganov@gmail.com
4cc5c314d1 Profiler tick processor now counts IC ticks on behalf of a caller.
This is enabled by default. To get back to old behavior, use '--separate-ic' switch.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1305 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-18 16:12:40 +00:00
mikhail.naganov@gmail.com
ddd2ac4015 Refactored command-line options handling in tick processor scripts
to remove code duplications. This makes easier adding new options.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-18 13:45:54 +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
mikhail.naganov@gmail.com
a23fd3284a Added the simplest call stack sampling and call profile in tick processor output.
Currently only two stack frames are sampled (current function and its caller).

Output of tick processor looks like this:

 [Call profile]:
   total  call path
   15.2%  LazyCompile: am3 crypto.js:108  <-  LazyCompile: montReduce crypto.js:583
    6.5%  LazyCompile: am3 crypto.js:108  <-  LazyCompile: bnpSquareTo crypto.js:431
    2.9%  Builtin: KeyedStoreIC_Generic  <-  LazyCompile: montReduce crypto.js:583
    2.3%  LazyCompile: am3 crypto.js:108  <-  LazyCompile: bnpMultiplyTo crypto.js:415

Tested under Windows, Linux and OS X.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-17 14:45:45 +00:00
sgjesse@chromium.org
85584333f9 Support for building V8 with MinGW
V8 can now be build with MinGW. It still fails the following four tests in debug mode:

  mjsunit/parse-int-float
  mjsunit/mirror-array.js
  mjsunit/integer-to-string.js
  mjsunit/regress/regress-114.js

Building with MinGW has been tested with version 5.1.4 using GCC 3.4.5.

In addition to supporting MinGW this change also makes it more explicit which targets needs to link with which libraries.

BUG=64
Review URL: http://codereview.chromium.org/20177

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1240 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-09 15:06:07 +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
olehougaard
da4fdea61a Fixing the flakiness of the serialization tests by assuring that serialization is run before every deserialization test.
Review URL: http://codereview.chromium.org/19541

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 08:35:03 +00:00
erik.corry@gmail.com
18d6c23971 Tell presubmit.py that regexp-pcre.js doesn't need a standard copyright
message since it has a special one.
Review URL: http://codereview.chromium.org/19752

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-02 16:27:08 +00:00
ager@chromium.org
06d96bade5 jsmin does not have our copyright header and shouldn't have. Exclude
it from the presubmit check.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-28 11:49:44 +00:00
deanm@chromium.org
aa8662545a Further minify non-visible JavaScript.
This imports a Python version of Douglas Crockford's JSMin.  JavaScript files can annotate that they want to be run through the minifier.  Currently debug and mirror are minified.

This results in ~12k savings on the final binary size.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-28 10:15:11 +00:00
maruel@chromium.org
4c8cd0d346 Fix snapshot generation on Visual Studio. Compiling source files generated
inside the same project is flaky with VisualStudio when building with
Incredibuild.
So I splitted the mksnapshot.exe generation, snapshot.cc generation and
snapshot.cc compilation in three different projects.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1176 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-27 16:20:10 +00:00
deanm@chromium.org
89bf4d5634 Strip /* */ style comments in js2c. Saves ~17k of binary size.
Review URL: http://codereview.chromium.org/19012


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-27 13:08:06 +00:00
iposva@chromium.org
ff3433d0fd - Preserve bootstrapper state across thread switches (fixes issue 143).
- Make sure stack guards are properly setup even when preemption is active.
- Fix missing v8::Locker and v8::Unlocker use in d8.cc.
- Threads forked in d8 do get their own context setup.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1161 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 18:09:46 +00:00
iposva@chromium.org
e718576d4f Split handle scopes into an internal version and a version accessible
through the API. This allows us to verify state on entry through the API.
In this change verification in the API entry is checking that the current
thread holds the V8 lock when a HandleScope is instantiated if a v8::Locker
has ever been used by the V8 instance.
Review URL: http://codereview.chromium.org/18707

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-23 17:22:23 +00:00
iposva@chromium.org
92b0ed1132 Fix Xcode project:
- Add regexp-stack.[cpp|h]

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-17 01:08:54 +00:00
lrn@chromium.org
21d2865757 Separately growing stack for irregexp ia32 backtrack stack.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1053 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-12 13:05:23 +00:00
ager@chromium.org
e639876dbe Allow 2009 as a valid year in the copyright header.
Review URL: http://codereview.chromium.org/16568

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-07 11:51:03 +00:00