Commit Graph

708 Commits

Author SHA1 Message Date
yurys@chromium.org
7832dd1b97 Fix 15.2.3.4 es5conform test
TBR=mnaganov,sgjesse
Review URL: http://codereview.chromium.org/2832029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4959 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-28 09:25:09 +00:00
yurys@chromium.org
8896e45dec Object.getOwnPropertyNames should be free of duplicates
BUG=41243
Review URL: http://codereview.chromium.org/2825026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4958 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-28 08:31:31 +00:00
mikhail.naganov@gmail.com
e2dc1e3870 fixed
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 10:05:57 +00:00
mikhail.naganov@gmail.com
52a257499a Make SampleRateCalculator test resilient to float precision issues.
Tested with kSamplingIntervalMs values 2 and 4.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4933 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 08:57:24 +00:00
mikhail.naganov@gmail.com
b6e6ab6972 Heap profiler: perform a GC round before taking a snapshot
to get rid of global object loaded from a snapshot. This
eliminates the "double global object" issue. Thanks to Mads
for suggesting this!

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4917 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-22 14:58:08 +00:00
erik.corry@gmail.com
53340b2624 Add movw and movt support for ARMv7. This includes some code from
Zhang Kun.  For now we only emit movw and movt in places where no
relocation is needed.  Small performance boost (around 0.5%).
Also adds support for turning ALU operations (eor etc.) with
large immediates into mvn or movw followed by a register-based
ALU operation.
Review URL: http://codereview.chromium.org/2821014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-22 08:38:32 +00:00
sgjesse@chromium.org
685cae6021 API: Resolve linker issues with using V8 as a DLL
This changes the way the constants kJSObjectType, kFirstNonstringType and kProxyType are made available to the inlined part of the V8 API. This change to fixed constants resolves linker this linker error Windows

error LNK2001: unresolved external symbol "public: static int v8::internal::Internals::kJSObjectType" (?kJSObjectType@Internals@internal@v8@@2HA)

when linking against a V8 DLL.

This change also makes it possible to build all the C++ tests with ENABLE_DEBUGGER_SUPPORT not defined. Now C++ tests run ENABLE_DEBUGGER_SUPPORT not defined, and only the JavaScript tests which tests the debugger fails when ENABLE_DEBUGGER_SUPPORT is not defined.
Review URL: http://codereview.chromium.org/2820016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4898 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-18 10:52:59 +00:00
mikhail.naganov@gmail.com
93387f272e Heap profiler: add a missing link between a function closure and shared function info.
Review URL: http://codereview.chromium.org/2846012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 12:56:55 +00:00
podivilov@chromium.org
7808d45af5 Fix a bug when top level break points fall into the last function in script.
Review URL: http://codereview.chromium.org/2824007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 12:47:08 +00:00
podivilov@chromium.org
f5fdef253b Save actual break point location to script break point object.
Review URL: http://codereview.chromium.org/2864003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 14:50:07 +00:00
ager@chromium.org
2043956c54 Remove the comisd instruction from the ia32 and x64 assemblers. We
should always use ucomisd.

Add missing pop from floating-point stack in case of allocation failure.
Review URL: http://codereview.chromium.org/2831009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4878 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 12:32:34 +00:00
antonm@chromium.org
52975ae407 Remove old named property query API.
Review URL: http://codereview.chromium.org/2742007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 17:01:02 +00:00
mikhail.naganov@gmail.com
a4cc374d37 Fix HeapSnapshot test in the case when snapshotting is enabled.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 12:28:25 +00:00
mikhail.naganov@gmail.com
f213b096bc Heap profiler: publish API and add test.
Review URL: http://codereview.chromium.org/2822009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 11:44:07 +00:00
ager@chromium.org
31cb9f7090 Add external references used for regexp execution to the serializer.
Review URL: http://codereview.chromium.org/2838001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4863 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 21:03:59 +00:00
sgjesse@chromium.org
d3fc2db9f6 Fix Mac build of r4860
Build error:
test/cctest/test-api.cc: In function 'void ExternalArrayInfoTestHelper(v8::ExternalArrayType)':
test/cctest/test-api.cc:10069: warning: control may reach end of non-void function 'int ExternalArrayElementSize(v8::ExternalArrayType)' being inlined

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 13:19:16 +00:00
sgjesse@chromium.org
76e24831a6 API: Added functions to retreive information on indexed properties managed by the embedding layer
BUG=737
TEST=test-api/PixelArrayInfo, test-api/ExternalArrayInfo
Review URL: http://codereview.chromium.org/2818003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 13:09:27 +00:00
erik.corry@gmail.com
142de62819 ARM: Be more smart about switching instructions when immediates
don't fit in the instruction.  Use ubfx and sbfx more.
Review URL: http://codereview.chromium.org/2826001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 11:20:36 +00:00
ricow@chromium.org
407aaa9823 Only perform code flusing test if we actually do code flushing.
Puts a check into the code flushing test to only perform this if the
flush_code flag is set to true. 


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-11 08:52:36 +00:00
whesse@chromium.org
b93382d9ff Add test_b(Operand, imm8) to ia32 disassembler.
Review URL: http://codereview.chromium.org/2765001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4822 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:44:24 +00:00
sgjesse@chromium.org
634fb9152c More precise break points and stepping when debugging
Added support for more precise break points when debugging and stepping. To achieve that additional nop instructions are inserted where breaking would otherwise be impossible. The number of nop instructions inserted are sufficient to make place for patching with a call to a debug break code stub. On Intel that is 5 nop's for 32-bit and 13 for 64-bit. Om ARM 3 nop instructions (12 bytes) are required.

In order to avoid inserting nop's in to many places a simple ast checker have been added to check whether there are breakable code in a statement or expression. If it is possible to break in an expression no additional break enabeling code is inserted.

Added break locations to the true and false part of a conditional expression.

Added stepping tests to cover more constructs.

These changes are only in the full compiler.

Changed the default value for the option --debugger in teh d8 shell from true to false. The reason for this is that with --debugger turned on the full compiler will be used for all code in when running d8, which can be unexpeceted.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:04:49 +00:00
mikhail.naganov@gmail.com
a217c50ab2 Move token-related constants from CodeEntry to TokenEnumerator.
Review URL: http://codereview.chromium.org/2745002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 11:27:00 +00:00
sgjesse@chromium.org
c7ab2b6aa3 Remove the SetExternalStringDiposeCallback API
Changed the disposal of external string resources to call a virtual Dispose method on the resource. The default inplementation of Dispose deletes the object and will capture the delete operator matching the new operator used to allocate the object.
Review URL: http://codereview.chromium.org/2658008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 09:35:47 +00:00
ager@chromium.org
6dc72b690c Add an overloaded PreCompile method that takes a Handle<String>.
Code review URL: http://codereview.chromium.org/2633004/show


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 06:20:49 +00:00
ricow@chromium.org
316092c364 Flushing of code from functions that we expect not to use again.
This adds an additional step to full gc, removing code from functions
that are no longer in the compilation cache. The code is replaced with
a lazy compile version enabling us to recompile the function in case
we do actually need it again.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 15:39:10 +00:00
sgjesse@chromium.org
09acdc8446 Add an API to control the disposal of external string resources
A new callback have been added which - if set - will be called to dispose of external string resources passed from the embedder to the V8 engine.
Review URL: http://codereview.chromium.org/2645004

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:27:32 +00:00
antonm@chromium.org
12f6306420 First phase of migration to new named property query callbacks.
Eventually named property query callbacks will return attributes
(as an integer) or an empty handle if property is not intercepted.

To gradually migrate to this new API, USE_NEW_QUERY_CALLBACK
macro would control if old or new style API is used.

So the migration plan is:

1) introduce new API which should be explictily enabled;
2) switch to new API defining USE_NEW_QUERY_CALLBACK before
  include of <v8.h> (that would require changes to client code as well)
3) remove old API from v8
4) remove #define USE_NEW_QUERY_CALLBACK from clients.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4797 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 11:49:44 +00:00
lrn@chromium.org
d3d295efa7 Add optimized version of memcpy on ia32.
Only used in one place right now.
Still room for tweaking.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 11:30:55 +00:00
lrn@chromium.org
c3b4097f28 Fix bug in test case that made it fail to compile in non-debug mode.
Using ASSERT_EQ instead of CHECK_EQ means that a variable becomes unused.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4785 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 11:05:06 +00:00
lrn@chromium.org
5b7e77acea Fix bug that could cause a string to be incorrectly tagged as an array index.
We should only mark a string as an array index if we can store the entire value
of the number in the hash field. We sometimes failed to reject larger numbers.

Fixes http://code.google.com/p/v8/issues/detail?id=728

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 09:31:01 +00:00
mikhail.naganov@gmail.com
cdc09c5073 CPU profiler: sample call stack on profiling start.
This simplifies writing tests a lot, because it is now possible
to guarantee that certain function will present in a profile by
starting profiler from inside it.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 13:52:49 +00:00
mikhail.naganov@gmail.com
f939ccbc26 Unreviewed. Revert r4766, r4767.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 13:42:48 +00:00
mikhail.naganov@gmail.com
d32c918fb4 started adding test
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 13:35:44 +00:00
antonm@chromium.org
ebba43f37a Make intercepted properties retrievable only by getter to be not enumerable.
Currently if there is no query callback, V8 finds out intercepted properties'
attributes using getter: if getter returns not empty handle V8 treats
such a property as property with NONE attribues which means this property
is enumerable.

However, if there is no enumerator, this property cannot be enumerated.
Thus I think we should treat such properties as not enumerable.

Drawback of this approach is now one has to implement both query and enumerator
callbacks to implement enumerable intercepted properties.

BUG=725

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-28 11:54:58 +00:00
erik.corry@gmail.com
67c0ec6f17 Update and improve support for ARMv7 bitfield instructions.
This is a commit of http://codereview.chromium.org/2124022
for Rodolph Perfetta.  I changed the test in
test-assembler-arm.cc so it only runs if ARMv7 is supported.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 13:46:18 +00:00
vegorov@chromium.org
fc7c5f789a Cardmarking writebarrier.
Reapply r4715 with fixes reviewed in http://codereview.chromium.org/2276002.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 12:30:45 +00:00
antonm@chromium.org
3e88d0d2af Various refactorings in interceptor calling and loading.
1) do not push receiver early---that simplifies tail call preparation
on ia32/x64 and renders special cleanup unnecessary;
2) do not do second map check if interceptor's and cached holder
are the same;
3) do not push/pop receiver if receiver and holder registers are the same
(means that receiver is interceptor's holder);
4) do batch pushes on arm;
5) minor cosmetic improvements.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 14:04:37 +00:00
lrn@chromium.org
4afc3d3c4f X64: Make smi memory operations work directly on the embedded value.
Adds Operand-relative Operand constructor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 10:02:07 +00:00
vegorov@chromium.org
e268fbdaba Revert r4715.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2274001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 09:24:44 +00:00
sgjesse@chromium.org
22e4847fde ARM: Update the full compiler to handle all code
The full compiler is now complete on ARM as well. The syntax checker is still used to determine whether to use it for top level code or not during normal execution. When debugging is enabled all code will be compiled with the full compiler.

This change removes the temporary flag --force-full-compiler and now the flag --always-full-compiler enables the full compiler for all code on all platforms.

This also fixes building on Intel platform without debugger support (ENABLE_DEBUGGER_SUPPORT not defined) and adds full check for the full compiler for lazily compiled code.
Review URL: http://codereview.chromium.org/2163006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 14:08:17 +00:00
vegorov@chromium.org
675e711f1c Cardmarking writebarrier.
- New сardmarking write 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).
- 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.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 13:15:16 +00:00
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