Commit Graph

666 Commits

Author SHA1 Message Date
antonm@chromium.org
897f7dedc1 Allow to define accessors on objects.
Currently one can only define accessors on object templates.  This patch
allows to create accessors on the fly.

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

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

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

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

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

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4710 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 06:38:19 +00:00
mikhail.naganov@gmail.com
decd0fed78 CPU profiler: make code events handling scalable.
I changed the implementation of a queue between the VM and processor
thread to be unbounded and lock-free, using Herb Sutter's example from
DDJ article: http://www.ddj.com/high-performance-computing/210604448
This had brought back profiling overhead to a minimum for the page
from Chromium's issue 16184.

BUG=714

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4706 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-22 05:27:19 +00:00
dimich@chromium.org
2c48283185 Include check for execution termination into bailout check.
This prevents re-entry into JS during stack unwinding caused by TerminateExecution().

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4705 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 20:52:19 +00:00
vegorov@chromium.org
2241d2af45 Reverting r4703.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2073018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 17:37:47 +00:00
vegorov@chromium.org
8879691793 Cardmarking writebarrier.
Reapplication of r4685 (reviewed http://codereview.chromium.org/2101002) with minor modifications:

- Fix compilation problems on Win64.
- Improve heap verification pass: search for garbage pointers to new space not only in dirty regions but in all regions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 15:52:38 +00:00
yurys@chromium.org
f6a2ccf6b4 Provide debug event listener with access to the debuggee context. Also introduce new event listener setter that allows to set a callback that accepts single parameter encapsulating all debug event details so that additional information can later be passed to the listener without breaking compatibility with existing clients.
Review URL: http://codereview.chromium.org/2108024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4693 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 17:15:46 +00:00
ager@chromium.org
1d5eb6517f Reapply r4686: Complete version of full codegen for x64.
Already reviewed at: http://codereview.chromium.org/2078022/show

TBR=vegorov@chromium.org
Review URL: http://codereview.chromium.org/2137008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4689 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:33:02 +00:00
vegorov@chromium.org
955828e437 Reverting r4685, r4686, r4687
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2071020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:02:51 +00:00
ager@chromium.org
355d3166e1 Complete the full codegenerator on x64.
Review URL: http://codereview.chromium.org/2078022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:50:09 +00:00
vegorov@chromium.org
b38a0a719a - Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special way.
- Cardmarking write barrier. New barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:10:38 +00:00
sgjesse@chromium.org
209711201d IA32: Use the full compiler when debugging
The full compiler will now be used for all code compiler when debugging is active. As the code generated by the full compiler is much simpler it will be easier to make debugging work better when using that code.

To ensure that all code debugged is from the full compiler all functions will have to be recompiled when starting debugging. Initialing debugging already turns off the code cache.
Review URL: http://codereview.chromium.org/2120009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-19 09:07:33 +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
c7b2af37ba Use direct loop when filling small arrays.
r3995 (http://code.google.com/p/v8/source/detail?r=3995) introduce performance
regression for the case when arrat size is small (think new Array(4)).

It turns out that in those cases rep stos is slower than plain loop (apprently
due to ecx increment, but I didn't check this hypothesis.)  The next thing
to try could be direct jump into right place of long sequence of stos'es.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-17 14:14:34 +00:00
sgjesse@chromium.org
6d54362dbd Fixes bug with v8::StackTrace for non-zero script line offsets
Change by jaimeyap see http://codereview.chromium.org/1985004 for details.
Review URL: http://codereview.chromium.org/2049004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4623 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 06:24:01 +00:00
antonm@chromium.org
a83a88cd58 Moving more code to lookup an item from the native cache into code generator.
To bypass expensive invocation of JS functions from C++ and omit runtime
call overhead for searching the cache, more elaborate deferred code is generated.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 12:48:18 +00:00
ricow@chromium.org
aaf5662262 Use Int32Value() instead of ToNumber()->Value() in test-api.cc.
This problem was introduced in revision 4597.

ToNumber()->Value() used as an int will throw a compile waring on
windows since it returns a double.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 11:05:50 +00:00
serya@chromium.org
eaa95c523b Inlined load of string.length and array.length.
http://compute1.aar:9013/golem/r4583-v8-serya-length-inlined-vs-4583-v8.html

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 10:50:22 +00:00
whesse@chromium.org
1f13b58b97 Correct bug with left shift on X64 platform from change 4571 (http://code.google.com/p/v8/source/detail?r=4571). Speed up left shift with a constant left hand side on X64 platform. Add unit test for this bug. Remove unused failure target argument from MacroAssembler::SmiShiftLeft and MacroAssembler::SmiShiftLeftConstant.
Review URL: http://codereview.chromium.org/1934004

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4597 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 07:32:44 +00:00
floitschV8@gmail.com
7fc98eb1f4 Dtoa for fixed notation.
Review URL: http://codereview.chromium.org/1956005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4596 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 13:51:27 +00:00
floitschV8@gmail.com
92a9e30cd8 Revert r4591
Review URL: http://codereview.chromium.org/1968003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 10:33:27 +00:00
floitschV8@gmail.com
b441d246b3 Provide (non Gay) dtoa for fixed notation.
Review URL: http://codereview.chromium.org/1865001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4591 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 09:29:18 +00:00
antonm@chromium.org
6617fac3d4 Clean JS function results cache on each major GC.
We don't want to retain cached objects for too long.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 14:49:50 +00:00
floitschV8@gmail.com
0aa67676f6 Switch to vectors instead of bare char* arrays.
Review URL: http://codereview.chromium.org/1732019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4546 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 12:15:02 +00:00
yurys@chromium.org
cf63fc5b9e Ensure v8 is initialized before initializing debug context
Review URL: http://codereview.chromium.org/1756018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 11:59:43 +00:00
vegorov@chromium.org
8c8b7f893d Fix api tests based on incorrect assumptions about GC behavior.
Review URL: http://codereview.chromium.org/1701018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4529 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 11:02:26 +00:00
yurys@chromium.org
9223815b6e Temporarily disable DebugContextIsPreservedBetweenAccesses which fails when snapshot=on
TBR=sgjesse
Review URL: http://codereview.chromium.org/1723018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 10:09:20 +00:00
yurys@chromium.org
9a9a268756 Fix test-debug: make sure debugger is unloaded before running next test
Review URL: http://codereview.chromium.org/1704015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4527 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 09:18:53 +00:00
yurys@chromium.org
0908fdc2f8 Don't unload debug context after it was requested through public API
Review URL: http://codereview.chromium.org/1731011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 08:23:20 +00:00
peter.rybin@gmail.com
6684b3c5d3 Rename Compare -> Comparator to resolve name conflict in v8::internal
Review URL: http://codereview.chromium.org/1737009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 21:20:02 +00:00
vegorov@chromium.org
cb27d09534 Fix bugs introduced by r4475:
- RelinkPageListInChunkOrder might relink unused pages into the middle of a sequence of used pages. Filler objects should be placed at the beginning of such unused pages otherwise generic iterators (e.g. HeapObjectIterator) would not handle them correctly. 
- ObjectAreaEnd() should not be used as an allocation limit for pages from FixedSpace. Pages in such spaces do not use top page_extra_ bytes of object area.

TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/1700005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-22 16:43:38 +00:00
vegorov@chromium.org
3fa49f8b91 Put empty pages discovered during sweeping to the end of the list of pages
instead of adding them to the free list.
Review URL: http://codereview.chromium.org/1683001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-22 14:42:21 +00:00
ricow@chromium.org
27f460b134 Change strlen to v8::internal::StrLength in liveedit tests (to fix compile error on windows 64)
Review URL: http://codereview.chromium.org/1610038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4447 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-20 10:41:38 +00:00
erik.corry@gmail.com
e1b3b92a2c Make not sucking at regexp the default
(remove V8_NATIVE_REGEXP flag, add
V8_INTERPRETED_REGEXP flag).
Review URL: http://codereview.chromium.org/1635001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-19 19:30:11 +00:00
peter.rybin@gmail.com
8fdc7a5ae1 LiveEdit: calculate a real script difference
Review URL: http://codereview.chromium.org/1652008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4441 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-19 16:08:26 +00:00
mikhail.naganov@gmail.com
61085478c6 Report approximated duration in milliseconds for profile nodes.
The simple formula "ms = ticks * sampler_interval" doesn't work,
because e.g. on Linux, the actual sampling rate can be 5 times
lower than the one set up in the code. To calculate actual sampling
rate, current time is periodically queried and processed along with
actual sampling ticks count.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4427 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-15 11:37:29 +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
antonm@chromium.org
6e8c85dc84 Expose a hint which communicates that string might be written many times.
Review URL: http://codereview.chromium.org/1609021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-13 17:00:33 +00:00
lrn@chromium.org
7bca61c11d Fix build problems on Windows 64-bit by casting.
Gave the root register a name for reference.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4397 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-13 11:59:37 +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
antonm@chromium.org
c898c7ae03 Landing http://codereview.chromium.org/1594017 for Ryan.
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 18:23:10 +00:00
sgjesse@chromium.org
de69f5beba Add support for bkpt instruction
The bkpt instruction is now supported by both the disassembler and the simulator. In the simulator it breaks to the native debugger if any like int3 on Intel.

Moved the handling of the miscellaneous instructions to a separate part.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4360 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 13:30:48 +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
whesse@chromium.org
c33886c9b7 Change Math.random() to return 32 bits of random goodness, instead of 30 random bits. Math.random now allocates a HeapNumber inline, and calls a C funciton directly to put the random bits into it.
Review URL: http://codereview.chromium.org/1599019

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 17:58:43 +00:00
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
mikhail.naganov@gmail.com
dde48831be C++ profiles processor: put under #ifdef and fix issues.
Review URL: http://codereview.chromium.org/1514006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4317 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-30 11:38:39 +00:00
ager@chromium.org
2bcc49740c Port number dictionary probing in generated code to ARM.
Fix bug in ARM pixel array load code and a typo in the x64 number
dictionary load code.

Fix bug in string dictionary probing where we did not bail out if the
object has an interceptor.

BUG=640

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-26 09:05:22 +00:00