Commit Graph

76 Commits

Author SHA1 Message Date
sgjesse@chromium.org
f6cce43255 Add stack alignment check to ia32 and x64
The stack is now checked for proper alignment before calling into C code when the flag --debug-code is turned on.
Review URL: http://codereview.chromium.org/1637015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-15 12:41:30 +00:00
mikhail.naganov@gmail.com
c007fd4d15 merged
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 18:48:05 +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
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
393aa6865b C++ profiler: publish the new API, make compatible with WebKit / Chromium.
I succeeded at connecting the new implementation to Chromium, this
commit includes required (although, not all) adjustments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 14:54:20 +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
kasperl@chromium.org
7d6a3b433f Merge the partial_snapshots branch back into bleeding_edge. For
now, the custom call generator stuff is disabled.
Review URL: http://codereview.chromium.org/1094014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 11:40:38 +00:00
mikhail.naganov@gmail.com
6df83af604 [Linux] Patch LogSharedLibraryAddresses to work correctly on Android.
On 'usual' Linux systems in '/proc/self/maps' we encounter two entries
per library: one has 'rw-p' attrs and the other has 'r-xp'. While on
Android, I see 'rwxp' and 'r-xp' (both entries are marked executable.)
So I've added an explicit check for non-writability to leave only a
single record in the log file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 12:32:47 +00:00
mikhail.naganov@gmail.com
af3fc27613 Assign to "sample.state" before reading it.
I noticed a funny thing: in StackTracer::Trace "sample.state" is
checked, but it is only assigned after the check. I've put assignment
before the check.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4017 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 12:32:03 +00:00
sgjesse@chromium.org
2618422ed5 ARMv7 ubfx support
Patch from Kun Zhang <zhangk@codeaurora.org>, see http://codereview.chromium.org/569015.
Review URL: http://codereview.chromium.org/573027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-05 08:46:41 +00:00
sgjesse@chromium.org
a6a7c75ae0 MIPS port initial commit
This is the first step in the MIPS port of V8. It adds assembler, disassembler and simulator for the MIPS32 architecture.

Contains stubbed out implementation of all the compiler/code generator infrastructure to make it all build.

Patch by Alexandre Rames from Sigma Designs Inc.

This is the landing of http://codereview.chromium.org/543161.
Review URL: http://codereview.chromium.org/561072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 20:36:58 +00:00
ager@chromium.org
cd51fcd35f Land patch to add Solaris platform support.
Patch by Erich Ocean and Ryan Dahl.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 12:37:31 +00:00
mikhail.naganov@gmail.com
999e3fca90 Fix issue 553: function frame is skipped in profile when compare stub is called.
The problem appeared due to a fact that stubs doesn't create a stack
frame, reusing the stack frame of the caller function. When building
stack traces, the current function is retrieved from PC, and its
callees are retrieved by traversing the stack backwards. Thus, for
stubs, the stub itself was discovered via PC, and then stub's caller's
caller was retrieved from stack.

To fix this problem, a pointer to JSFunction object is now captured
from the topmost stack frame, and is saved into stack trace log
record. Then a simple heuristics is applied whether a referred
function should be added to decoded stack, or not, to avoid reporting
the same function twice (from PC and from the pointer.)

BUG=553
TEST=added to mjsunit/tools/tickprocessor

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 16:42:41 +00:00
sgjesse@chromium.org
2cfb4941a1 Move function nan_value to POSIX platform file
Strictly speaking NAN from math.h is not in a POSIX standard but in C99. However it seems that all our POSIX platforms have it.
Review URL: http://codereview.chromium.org/464015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-03 09:29:21 +00:00
erik.corry@gmail.com
df4f52347b Allow a platform to indicate that some CPU features are always
available.  We use this to ensure that snapshots on MacOSX can
use SSE2 instructions.  Also clean up and assertify the
handling of things we can't do when we are generating a
snapshot.  Fix a bug in the new serialization tests where
they activated Snapshot::enable() too late after code had been
generated that assumed no snapshots.
Review URL: http://codereview.chromium.org/391051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3301 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 12:32:57 +00:00
erik.corry@gmail.com
407816af39 Fix some style issues in the ARM code.
Also move a function into the macro assembler.
Fix some *& placement errors that had accumulated.
Review URL: http://codereview.chromium.org/385069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 13:55:21 +00:00
erik.corry@gmail.com
0d94d7c785 Add vfp support on ARM. Patch from John Jozwiak.
Review URL: http://codereview.chromium.org/348019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 13:04:02 +00:00
ager@chromium.org
e5095880cb Add MAP_FIXED to Uncommit calls to see if that has an effect on GMail
memory usage in Chromium 64-bit Linux.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-09 07:51:51 +00:00
mikhail.naganov@gmail.com
65dcf75c2c Linux profiler: check whether signal handler is called in the VM thread.
I have several Chromium's core files having SIGPROF signal handler called in the context of an arbitrary thread, causing a crash. This change introduces checking of current thread in the signal handler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2825 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-04 11:16:51 +00:00
iposva@chromium.org
3d070f1f0c - Fix a style violation which was flagged by gcc: while loop without body
- Restructured the entire function because:
  During the simple style fix I discovered that this whole routine was
  hard to read due to a general lack of comments. While adding comments I
  realized that the function was also skipping entries if there were two
  consecutive entries in the maps file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-01 06:11:53 +00:00
iposva@chromium.org
8a82d61722 - getc returns an int.
Review URL: http://codereview.chromium.org/159538

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-28 21:10:13 +00:00
mikhail.naganov@gmail.com
ee340a52ff X64: Fixes to enable C/C++ functions processing in profiler.
- rewrote Linux version of LogSharedLibraryAddresses to work correctly with 64-bit libs;
 - fixed address length restriction in JS tickprofiler script.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2563 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-28 15:37:05 +00:00
mikhail.naganov@gmail.com
8318f5e5f1 Reimplement profiler sampler on Mac OS X to get it working under Chromium.
Previous implementation of sampler for OS X was copied from the Linux one. But BSD (OS X) and Linux has a very important difference in signal handling. LinuxThreads doesn't support the notion of process-directed signals. So, the SIGPROF signal was directed to the thread that installed the handler---the V8 thread. But on BSD, signal handling is implemented according to POSIX spec, where process-directed signal is to be handled by an arbitrary selected thread. By a coincidence, in V8's sample shell and in Chromium's test shell, V8's thread was picked almost every time, so sampling seemed working. But not in case of Chromium.

So, I've changed the implementation of profiler sampler to use the same scheme as on Windows---a dedicated thread with high priority is used to periodically pause and sample V8's thread.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-01 08:46:59 +00:00
erik.corry@gmail.com
52dfeca5f2 Fix profiling for shared libraries on Linux loaded at negative addresses
(Android does this).  Fix logging for executable mappings that have no
file associated.  Be more consistent with use of uintptr_t.
Review URL: http://codereview.chromium.org/125183

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 12:52:02 +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
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
deanm@chromium.org
4cd00fbc64 Adjust for differences in the arm signal structures between glibc versions.
Review URL: http://codereview.chromium.org/113332


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-13 13:44:25 +00:00
erik.corry@gmail.com
79fbaf7962 Fix fp problems in runtime code on ARM EABI by 8-byte aligning
the stack on exit to C.
Review URL: http://codereview.chromium.org/115256

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 20:11:01 +00:00
lrn@chromium.org
883b2826b9 X64: Changed TickSample to hold pointer-sized values for registers.
Review URL: http://codereview.chromium.org/113094


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-07 09:34:16 +00:00
deanm@chromium.org
0f64915781 Use the correct V8_HOST_ARCH macro, it is IA32 and not X86.
Review URL: http://codereview.chromium.org/115022


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1880 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 11:40:44 +00:00
deanm@chromium.org
5f4322f77f Have the profiler load the correct registers on x64.
This is still not correct, since internally they are kept as an int.
Use our new V8_HOST_ARCH macros for detecting the host processor.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 11:19:50 +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
erik.corry@gmail.com
413bd7a91c Lint.
Review URL: http://codereview.chromium.org/77026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 13:57:15 +00:00
erik.corry@gmail.com
8f911a2f5d * Remove unused code from codegen-arm.cc
* Fix fp ops on pre-EABI ARM targets.
* Fix missing TIMEVAL_TO_TIMESPEC on Android.
Review URL: http://codereview.chromium.org/77025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 13:27:36 +00:00
iposva@chromium.org
7dece760ad - Fix delta time calculation in LinuxSemaphore::Wait.
Review URL: http://codereview.chromium.org/69024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 00:56:52 +00:00
iposva@chromium.org
e05c2e3693 Start addressing massive arrays on the stack. There is hardly ever
a reason to stack allocate large chunks of stack space.
- Runtime_GetCFrames used to allocate a frame size of 52040 bytes.
- PreallocatedMemoryThread::Run used to allocate 32784 bytes.
- Fixed StringStream overflow conditions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 21:01:05 +00:00
erik.corry@gmail.com
59d3cf8403 Fix profiling on Android.
Review URL: http://codereview.chromium.org/62102

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-07 13:33:39 +00:00
sgjesse@chromium.org
8e34544bd1 Moved stdio and string functions to POSIX platform file.
Review URL: http://codereview.chromium.org/45063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1626 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 08:38:02 +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
sgjesse@chromium.org
0e5999efae Move time related functions to POSIX platform file.
The functions getrusage, gettimeofday and localtime are in POSIX.1-2001.
Review URL: http://codereview.chromium.org/53045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-26 09:28:27 +00:00
kmillikin@chromium.org
89a43b8f18 Fix ARM simulator. Unless building for the actual ARM hardware,
inline assembler in C++ code should be IA32 assembly, not ARM.

TBR=erik.corry@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1597 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 13:21:34 +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
sgjesse@chromium.org
96088babe7 Add a new "pseudo" platform for POSIX. It it will contain code shared by the platforms supporting POSIX. Currently Linux, Mac OS and FreeBSD are considered POSIX platforms using the POSIX implementation.
Initially the platform socket implementation has been moved from the Linux, Mac OS and FreeBSD platforms to the POSIX platform.

If implementation which ends up in the POSIX platform at some point cannot be the same across POSIX platforms the implementation can easily be moved back into the individual POSIX "complient" platforms.
Review URL: http://codereview.chromium.org/51001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1583 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 06:32:00 +00:00
erik.corry@gmail.com
aa81281b3d Reapply portability fixes, this time without 64 bit system bug.
Review URL: http://codereview.chromium.org/52010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 12:37:53 +00:00
erik.corry@gmail.com
80ce1b2500 Reverse latest build tweaks since they fail on some 64 bit systems
TBR=ager

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 17:01:15 +00:00
erik.corry@gmail.com
77b963ca04 More compatibility changes.
Review URL: http://codereview.chromium.org/47004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 16:37:18 +00:00
sgjesse@chromium.org
83111deb97 Add support for setting the SO_REUSEADDR option for sockets.
Review URL: http://codereview.chromium.org/50036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1557 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 08:53:57 +00:00
sgjesse@chromium.org
881e01b245 Change the socket close to shutdown.
Removed the close method for socket and added shutdown instead. The shutdown method is the one to use when terminating socket communication. The close call is in the destructor.
Review URL: http://codereview.chromium.org/42387

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 11:55:09 +00:00
erik.corry@gmail.com
2d4dd93bdd Misc. portability fixes.
Review URL: http://codereview.chromium.org/42337

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1538 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-18 15:20:26 +00:00