Commit Graph

896 Commits

Author SHA1 Message Date
jochen@chromium.org
feeccf0d10 Revert r20335 - "Raise StackOverflow during bootstrapping"
Reason for revert: New test crashes on nosnap bots

> See https://github.com/joyent/node/issues/7120
>
> R=jarin@chromium.org
> BUG=
>
> Review URL: https://codereview.chromium.org/178073002
>
> Patch from Alexis Campailla <alexis@janeasystems.com>.

TBR=jarin@chromium.org
BUG=none
LOG=n

Review URL: https://codereview.chromium.org/217013002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20337 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-28 14:16:11 +00:00
jarin@chromium.org
ee173152ef Raise StackOverflow during bootstrapping
See https://github.com/joyent/node/issues/7120

R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/178073002

Patch from Alexis Campailla <alexis@janeasystems.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-28 13:26:20 +00:00
marja@chromium.org
6730ec8433 Amend PersistentValueMap:
- Use the surrounding map (instead of Traits::Impl) for weak callback.
- Provide for a fast reference to a mapped value.
- Restructure Traits to accomondate for the first point above.

[Why?] As discussed, I proceeded to replace Impl with the map.
The problem I encountered with that version is that now the
Traits class depends on itself: The weak-related methods require the
map type in their signature. But the map type includes the Traits class
and hence the Traits class method signatures depend on the specific Traits class. That
makes them practically un-derivable: While you can derive a Traits class
from another one, since the compiler now expects methods with a different
signature. To accommodate, I pulled the dispose traits into the weak traits
class. I also removed the Impl*/MapType* parameter from the Dispose call,
since no implementation seems to need it.

R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/212893007

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-28 09:35:50 +00:00
yurys@chromium.org
f7b437d086 Deprecate Start/StopCpuProfiling methods
BUG=v8:3213
LOG=Y
R=alph@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/197513005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-28 09:24:49 +00:00
rossberg@chromium.org
826cf64fd3 Ship promises and weak collections
R=mstarzinger@chromium.org
BUG=

Committed: https://code.google.com/p/v8/source/detail?r=20211

Review URL: https://codereview.chromium.org/206163004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20313 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-27 16:42:34 +00:00
ishell@chromium.org
f306341b46 TransitionElementsKind() and its recursive call chain handlified.
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/207553005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-25 15:33:22 +00:00
rossberg@chromium.org
2e1b16de2a Revert "Ship promises and weak collections"
Reason: breaks Blink layout tests.

R=machenbach@chromium.org
BUG=

Review URL: https://codereview.chromium.org/210853003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-25 10:57:52 +00:00
rossberg@chromium.org
33be68c2fa Ship promises and weak collections
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/206163004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 16:59:04 +00:00
rossberg@chromium.org
ff1186c834 Add support for per-isolate private symbols
R=mstarzinger@chromium.org
BUG=
LOG=Y

Review URL: https://codereview.chromium.org/196103004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 16:34:06 +00:00
yangguo@chromium.org
8b8fb30e7f Reland "Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException."
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/209903003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 10:07:15 +00:00
yangguo@chromium.org
03866841aa Revert "Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException."
This reverts r20179.

TBR=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/201573007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20183 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 09:17:18 +00:00
yangguo@chromium.org
62f65d8697 Remove Failure::OutOfMemory propagation and V8::IgnoreOutOfMemoryException.
R=dcarney@chromium.org
BUG=v8:3060
LOG=Y

Review URL: https://codereview.chromium.org/208263002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20179 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 08:47:45 +00:00
dcarney@chromium.org
3ab0622b96 add setaccessorproperty to object
R=svenpanne@chromium.org

LOG=N
BUG=v8:2964

Review URL: https://codereview.chromium.org/209853002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20178 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-24 08:41:59 +00:00
mstarzinger@chromium.org
c27758bcc7 Fix missing access check in Runtime_SetPrototype.
R=rossberg@chromium.org
BUG=chromium:354123
TEST=cctest/test-api/Regress354123
LOG=y

Review URL: https://codereview.chromium.org/205033011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-20 18:14:33 +00:00
yangguo@chromium.org
8f48dbb7d2 Remove outdated OOM tests.
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/206373003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20129 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-20 14:12:06 +00:00
yangguo@chromium.org
77a28b731d Handlify callers to GetElementNoException.
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/204693002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-20 12:22:13 +00:00
dcarney@chromium.org
99b115b120 Provide default traits for PersistentValueMap
Re-try of issue 201643003. This caused linker errors on Win64, since the
linker insists on seeing the StrongMapTrait method implementations even
though they are never used. This will provide default implementations
for them.

R=dcarney@chromium.org

BUG=

Review URL: https://codereview.chromium.org/204343006

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20084 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-19 15:35:02 +00:00
marja@chromium.org
932a29a66a New compilation API, part 2.
This CL makes the Parser produce the data PreParser used to produce. This
enables us to get rid of the unnecessary preparsing phase.

The first part is here: https://codereview.chromium.org/199063003/

BUG=
R=dcarney@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/203353002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20075 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-19 13:24:13 +00:00
yangguo@chromium.org
d8c3c5ef0a Introduce API to trigger exception on JS execution.
R=jochen@chromium.org, pmarch@chromium.org

Review URL: https://codereview.chromium.org/203223013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-19 13:06:53 +00:00
yangguo@chromium.org
0bc684a794 Introduce per-isolate assert scopes and API to guard JS execution.
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/198253004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20062 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-19 11:31:43 +00:00
yangguo@chromium.org
0dd31685f0 Revert "First attempt at providing default traits for PersistentValueMap."
This reverts r20038.

TBR=vogelheim@chromium.org

Review URL: https://codereview.chromium.org/203553002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20042 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-18 16:32:39 +00:00
dcarney@chromium.org
6deb7b0db4 First attempt at providing default traits for PersistentValueMap.
BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/201643003

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-18 15:01:12 +00:00
yangguo@chromium.org
c76a97159f Handlify callers of Object::GetElement.
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/200363002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-18 12:34:02 +00:00
hpayer@chromium.org
e3554870e6 Fix Windows compile problem.
BUG=
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/201133006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 12:17:13 +00:00
hpayer@chromium.org
9305589c04 Make sure allocated objects in PrologueCallbackAlloc and EpilogueCallbackAlloc API test are used.
BUG=
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/201633003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 10:52:33 +00:00
hpayer@chromium.org
4c20e76b4b heap: allow allocation in gc prologue/epilogue
BUG=
R=hpayer@chromium.org, danno@chromium.org

Review URL: https://codereview.chromium.org/177243012

Patch from Fedor Indutny <fedor.indutny@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 10:38:45 +00:00
rossberg@chromium.org
0a2f4c86bd Split Promise API into Promise/Resolver
R=svenpanne@chromium.org
BUG=
LOG=Y

Review URL: https://codereview.chromium.org/196943014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 09:57:25 +00:00
dcarney@chromium.org
45ffad09d8 Move PersitentValueMap into seperate header, to avoid excessive polution
of v8.h.

R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/195793024

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19936 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-14 14:57:04 +00:00
marja@chromium.org
6923d84785 New Compilation API, part 1, try 2
- Distinguish between context bound scripts (Script) and context unbound scripts
(UnboundScript).
- Add ScriptCompiler (which will later contain functions for async compilation).

This is a breaking change, in particular, Script::New no longer exists (it is
replaced by ScriptCompiler::CompileUnbound). Script::Compile remains as a
backwards-compatible shorthand for ScriptCompiler::Compile.

Passing CompilerOptions with produce_data_to_cache = true doesn't do anything
yet; the only way to generate the data to cache is the old preparsing API. (To
be fixed in the next version.)

This is a fixed version of https://codereview.chromium.org/186723005/

BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/199063003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19925 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-14 10:20:33 +00:00
marja@chromium.org
ee6b885d25 Revert "New Compilation API, part 1"
This reverts revision 19881.

Reason: WebKit build failure (will commit a fixed version shortly).

BUG=

Review URL: https://codereview.chromium.org/196793013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-13 09:14:16 +00:00
marja@chromium.org
52c0098f0d New Compilation API, part 1
- Distinguish between context bound scripts (Script) and context unbound scripts
(UnboundScript).
- Add ScriptCompiler (which will later contain functions for async compilation).

This is a breaking change, in particular, Script::New no longer exists (it is
replaced by ScriptCompiler::CompileUnbound). Script::Compile remains as a
backwards-compatible shorthand for ScriptCompiler::Compile.

Passing CompilerOptions with produce_data_to_cache = true doesn't do anything
yet; the only way to generate the data to cache is the old preparsing API. (To
be fixed in the next version.)

BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/186723005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19881 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-13 08:54:11 +00:00
dcarney@chromium.org
75ad285860 Implement PersistentValueMap, a map that stores UniquePersistent values.
This is preparatory work to get rid of UnsafePersistent in blink.

The previous version had to be reverted due to timeouts in win32/Debug: https://codereview.chromium.org/197173002/

The timeouts happened because the STL version on that platform contains sanity checking code which opens a 'debug window' in the GUI, patiently waiting for the user to click ok/cancel/somethirdoption. It turns out, the cause for that debug window was totally valid and the test had a use-after-free issue.

The 1st patch set is the code as before. The 2nd patch set contains the fix.

Related blink changes are here: https://codereview.chromium.org/180363004/

This patch is largely based on https://codereview.chromium.org/175503003/, with some methods added to support the blink change mentioned above.

BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/197263002

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-13 07:10:59 +00:00
dslomov@chromium.org
79e817aac4 Revert "Implement PersistentValueMap, a map that stores UniquePersistent values."
and "Win64 fix for r19833."

This reverts commits r19833 and r19837 for breaking Windows tests
(test-api/PersistentValueMap).

TBR=vogelheim@chromium.org,dcarney@chromium.org

Review URL: https://codereview.chromium.org/197173002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-12 11:40:40 +00:00
dcarney@chromium.org
3aac1d3c07 Win64 fix for r19833.
R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/197083002

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-12 10:33:40 +00:00
dcarney@chromium.org
25468478e3 Implement PersistentValueMap, a map that stores UniquePersistent values.
This is preparatory work to get rid of UnsafePersistent in blink.

Related blink changes are here: https://codereview.chromium.org/180363004/

This patch is largely based on https://codereview.chromium.org/175503003/, with some methods added to support the blink change mentioned above.

BUG=
R=dcarney@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/189463019

Patch from Daniel Vogelheim <vogelheim@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19833 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-12 09:11:25 +00:00
rossberg@chromium.org
94b5180db0 API support for promises
R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/194663003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-11 16:17:20 +00:00
rossberg@chromium.org
8e3f3cee9e Eliminate extended mode, and other modes clean-up
- Merge LanguageMode and StrictModeFlag enums
- Make harmony-scoping depend only on strict mode
- Free some bits on the way
- Plus additional clean-up and renaming

R=ulan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/181543002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19800 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-11 14:41:22 +00:00
rossberg@chromium.org
3f702d4bf9 Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/177683002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-11 14:39:08 +00:00
marja@chromium.org
8bd37cb7c3 Refactor script compilation / running & use of helper funcs in test-api.cc.
The tests were using different kind of constructs for achieving the same
thing. This makes refactoring the compilation API more difficult than it should
be.

cctest.h already contained helpers for compiling and running scripts, but they
were not used consistently.

For example, all these were used for running scripts:

v8::Script::Compile(v8_str("foo"))->Run();
v8::Script::Compile(v8::String::NewFromUtf8(isolate, "foo))->Run();
CompileRun(v8_str("foo"));
CompileRun(v8::String::NewFromUtf8(some_way_to_get_isolate(), "foo"));
v8::Local<v8::Script> script = any_of_the_above; script->Run();

Most of the tests just want to run a script (which is in const char*) and don't
care about how the v8::String is constructed or passed to the compiler API. Using
the helpers makes the test more readable and reduces boilerplate code which is
unrelated to what the test is testing.

R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/190503002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-10 11:58:56 +00:00
yangguo@chromium.org
d3a16a2e2a Add support for allowing an embedder to get the V8 profile timer event logs.
Contributed by fmeawad@chromium.org

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/186163002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-10 08:56:48 +00:00
dcarney@chromium.org
2c74163f59 initialize v8::Private with v8::String
R=rossberg@chromium.org

BUG=

Review URL: https://codereview.chromium.org/179983002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19741 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-10 08:20:56 +00:00
dcarney@chromium.org
7d8cda6ea0 Allow Object::InternalFieldCount and Object::GetAlignedPointerFromInternalField to be called from Persistent classes
R=svenpanne@chromium.org

BUG=

Review URL: https://codereview.chromium.org/177343002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19740 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-10 08:18:57 +00:00
marja@chromium.org
bd1fb97d5c Remove Script::SetData and the script_data parameter from Script::(Compile|New).
This feature makes it possible to associate data with a script and get it back
when the script is compiled or when an event is handled. It was historically
used by Chromium Dev Tools, but not any more. It is not used by node.js.

Note: this has nothing to do with the preparse data, despite the confusing name.
The preparse data is passed as ScriptData*.

Note 2: This is the same as r19616 ( https://codereview.chromium.org/184403002/ )
with a unused variable fix in bootstrapper.cc.

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/185533014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19702 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-07 08:43:54 +00:00
rossberg@chromium.org
758a688bb6 Add --es-staging flag
...and remove some obsolete ones.

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/165723008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19669 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-05 10:07:07 +00:00
marja@chromium.org
40ffba58a4 Revert "Remove Script::SetData and the script_data parameter from Script::(Compile|New)."
This reverts revision 19616.

BUG=
TBR=marja@chromium.org,svenpanne@chromium.org

Review URL: https://codereview.chromium.org/181113008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-28 14:09:52 +00:00
marja@chromium.org
55750b1c62 Remove Script::SetData and the script_data parameter from Script::(Compile|New).
This feature makes it possible to associate data with a script and get it back
when the script is compiled or when an event is handled. It was historically
used by Chromium Dev Tools, but not any more. It is not used by node.js.

Note: this has nothing to do with the preparse data, despite the confusing name.
The preparse data is passed as ScriptData*.

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/184403002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-28 13:54:14 +00:00
dcarney@chromium.org
703536eba1 Revert "Better threaded fuzzing for TestFunctionCallOptimization"
This reverts commit 19567.

TBR=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/182893003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-27 09:48:56 +00:00
dcarney@chromium.org
44da745247 Better threaded fuzzing for TestFunctionCallOptimization
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/182863002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-27 09:18:37 +00:00
rossberg@chromium.org
0d34254f8d Upgrade Symbol implementation to match current ES6 behavior.
Refresh the implementation of Symbols to catch up with what the
specification now mandates:

* The global Symbol() function manufactures new Symbol values,
  optionally with a string description attached.

* Invoking Symbol() as a constructor will now throw.

* ToString() over Symbol values still throws, and
  Object.prototype.toString() stringifies like before.

* A Symbol value is wrapped in a Symbol object either implicitly if
  it is the receiver, or explicitly done via Object(symbolValue) or
  (new Object(symbolValue).)

* The Symbol.prototype.toString() method no longer throws on Symbol
  wrapper objects (nor Symbol values.) Ditto for Symbol.prototype.valueOf().

* Symbol.prototype.toString() stringifies as "Symbol("<description>"),
  valueOf() returns the wrapper's Symbol value.

* ToPrimitive() over Symbol wrapper objects now throws.

Overall, this provides a stricter separation between Symbol values and
wrapper objects than before, and the explicit fetching out of the
description (nee name) via the "name" property is no longer supported
(by the spec nor the implementation.)

Adjusted existing Symbol test files to fit current, adding some extra
tests for new/changed behavior.

LOG=N
R=arv@chromium.org, rossberg@chromium.org, arv, rossberg
BUG=v8:3053

Review URL: https://codereview.chromium.org/118553003

Patch from Sigbjorn Finne <sigbjornf@opera.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-19 14:19:42 +00:00
jarin@chromium.org
58d0682f8d Add filler at the new space top when forcing scavenge.
We only seem to force scavenge in our cctest test suite, so this is
expected to fix some flakiness in our tests, but it will not
improve stability of v8 itself.

R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/167423004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19460 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-18 16:34:52 +00:00
dcarney@chromium.org
0c844cc590 api accessor store ics should return passed value
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/166653003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-14 14:13:06 +00:00
yangguo@chromium.org
fb22b7b05e Internalize string keys in Keyed{Store,Load}IC.
R=jkummerow@chromium.org
BUG=v8:3144
LOG=N

Review URL: https://codereview.chromium.org/162983003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19345 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-13 08:43:53 +00:00
rafaelw@chromium.org
6b5a4cdef2 V8 Microtask Queue & API
This patch generalizes Object.observe callbacks and promise resolution into a FIFO queue called a "microtask queue".

It also exposes new V8 API which exposes the microtask queue to the embedder. In particular, it allows the embedder to

-schedule a microtask (EnqueueExternalMicrotask)
-run the microtask queue (RunMicrotasks)
-control whether the microtask queue is run automatically within V8 when the last script exits (SetAutorunMicrotasks).

R=dcarney@chromium.org, rossberg@chromium.org, dcarney, rossberg, svenpanne
BUG=

Review URL: https://codereview.chromium.org/154283002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19344 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-12 22:04:19 +00:00
alph@chromium.org
887bd2850d Stack trace string should use dynamic script sourceURL if present.
BUG=v8:2342
R=dcarney@chromium.org, yurys@chromium.org, yurys
LOG=N

Review URL: https://codereview.chromium.org/143283015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19333 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-12 15:50:23 +00:00
dcarney@chromium.org
ce789e8890 Add more test cases for api function inlining
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/154283003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19278 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-11 12:49:15 +00:00
svenpanne@chromium.org
5f8105af3c Make LeakSanitizer happy, part 3.
Fixed a few more cctests and removed some which were broken for ages
and/or tested nothing useful anymore.

Note that cctests are now fully LeakSanitized (at least on x64)!

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/157463002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-07 12:17:45 +00:00
dcarney@chromium.org
6df537d631 inline api setters in crankshaft
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/155913002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19129 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-06 07:31:08 +00:00
dcarney@chromium.org
5028ebaa8b inline api getters in crankshaft
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/146023004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-05 15:52:31 +00:00
yangguo@chromium.org
f6d1a4fef1 Allow externalizing strings in old pointer space.
This is what I think is a better solution to the "external strings in
old pointer space" problem. Basically, it is an issue because GC scans
all fields of objects in old pointer space and if the cached address
of the backing store is unaligned, it looks like a heap object, boom.

The solution here is to use short external strings when we externalize
a string in old pointer space, and when the address is unaligned.
Short external strings don't cache the address, so GC has no issues.

BUG=268686
LOG=Y
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/146183006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-05 09:29:04 +00:00
svenpanne@chromium.org
c270bad71e Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup in cctests again.
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/146973005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-04 12:23:30 +00:00
svenpanne@chromium.org
16bcd43187 More cctest fixes regarding lifetime/ownership.
* Avoid double-free in cctest/test-api/RegExpInterruption.

   * Avoid incorrect zone fiddling in cctest/test-strings.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/144533005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-03 07:29:23 +00:00
verwaest@chromium.org
ae7a209e71 Remove CallICs
BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/148223002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19001 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-31 16:52:17 +00:00
svenpanne@chromium.org
2daf43ac13 Once again: Fixed some lifetime/ownership issues in cctest
* Fixed lifetime issue in cctest/test-heap-profiler/HeapSnapshotJSONSerialization.

   * Fixed ownership issue in cctest/test-api/ContainsOnlyOneByte.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/142553005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-31 09:59:50 +00:00
svenpanne@chromium.org
39d1534d66 Fixed a few lifetime/ownership issues in cctest/test-api.
* Fixed CompileExternalTwoByteSource: Registered resources should
     better still be alive when they are accessed.

   * Fixed ownership in cctest/test-api/VisitExternalStrings.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/139923003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-31 07:29:25 +00:00
dcarney@chromium.org
5c589640bf crankshaft support for api method calls
R=verwaest@chromium.org

BUG=

Review URL: https://codereview.chromium.org/148333003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-30 13:18:41 +00:00
svenpanne@chromium.org
0c2c9ece90 Make sure we delete[] what we got from new[], not one byte after it.
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/150213002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-30 10:53:20 +00:00
machenbach@chromium.org
1f346769c1 Don't parallelize tests that register extensions.
These tests register extensions on the isolate and the configuration of the extensions runs out of scope. If run in parallel, other tests access the isolate's state and read the registered extensions.

BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/149413005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-29 15:29:58 +00:00
dslomov@chromium.org
1a67b7f86a External Array renaming and boilerplate scrapping
Replaced symbolic names with correct JS name (byte -> int8, unsigned int -> uint32 etc).
Using macros to scrap the boilerplate
BUG=
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/145133013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-24 16:01:15 +00:00
verwaest@chromium.org
c478b6dc60 Ensure we don't overwrite transitions in SetPropertyIgnoreAttributes.
BUG=326155
LOG=y
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/134733011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18754 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-22 14:02:00 +00:00
jochen@chromium.org
c970c1cb6f Update Isolate::RequestGarbageCollection after r18691
BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/143403002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-20 15:44:03 +00:00
dcarney@chromium.org
f93f8ded96 String:WriteUtf8: Add REPLACE_INVALID_UTF8 option
This patch makes String::WriteUtf8 replace invalid code points (i.e. unmatched
surrogates) with the unicode replacement character when REPLACE_INVALID_UTF8 is
set.  This is done to avoid creating invalid UTF-8 output which can lead to
compatibility issues with software requiring valid UTF-8 inputs (e.g. the
WebSocket protocol requires valid UTF-8 and terminates connections when invalid
UTF-8 is encountered).

R=dcarney@chromium.org

BUG=

Review URL: https://codereview.chromium.org/121173009

Patch from Felix Geisendörfer <haimuiba@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18683 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-20 09:52:54 +00:00
dcarney@chromium.org
7cee52948f Fix stub-invoked setter callback handling.
When invoking a setter callback for a property using
JSObject::SetPropertyWithCallback(),the callback arguments includes
a correct pair of receiver and holder objects.

Such a pair of _possibly different_ arguments (receiver, holder) must
also be supplied when invoking the same setter callback from JITed
code, when the setter is invoked through the StoreCallbackProperty
stub.

An example where this matters are the accessor properties kept on the
global scope of Worker (i.e., properties kept on the global object
itself, and not on its prototype.) Conflating the receiver with the
holder leads to general confusion when attempting to fetch out the
wrapper object.

LOG=N
R=dcarney@chromium.org, dcarney
BUG=239669

Review URL: https://codereview.chromium.org/139263008

Patch from Sigbjorn Finne <sigbjornf@opera.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18658 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-17 10:34:43 +00:00
dslomov@chromium.org
5da41be7b8 Implement in-heap backing store for typed arrays.
This adds a fixed array sub-type that will represent a backing store for
typed arrays allocated with TypedArray(length) construtor.

R=mvstanton@chromium.org, verwaest@chromium.org

Review URL: https://codereview.chromium.org/101413006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18651 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-16 17:08:45 +00:00
dslomov@chromium.org
34eeeb8953 Revert "Implement in-heap backing store for typed arrays."
This reverts commit r18649 for breaking Linux/nosnap and Win64 tests.

TBR=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/140793003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18650 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-16 16:00:36 +00:00
dslomov@chromium.org
97040ce67b Implement in-heap backing store for typed arrays.
This adds a fixed array sub-type that will represent a backing store for
typed arrays allocated with TypedArray(length) construtor.

R=mvstanton@chromium.org, verwaest@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=18646

Review URL: https://codereview.chromium.org/101413006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-16 15:01:27 +00:00
dslomov@chromium.org
95f572389e Revert "Implement in-heap backing store for typed arrays."
This reverts commit r18646 for breaking Win32 build.

TBR=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/132233012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18647 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-16 14:26:15 +00:00
dslomov@chromium.org
0c960c2e96 Implement in-heap backing store for typed arrays.
This adds a fixed array sub-type that will represent a backing store for
typed arrays allocated with TypedArray(length) construtor.

R=mvstanton@chromium.org, verwaest@chromium.org

Review URL: https://codereview.chromium.org/101413006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-16 14:18:37 +00:00
bmeurer@chromium.org
be986094a3 Use std:: on symbols declared in C++-style C headers.
Some libraries (e.g. Dinkumware) perform strict checks on whether
the symbols defined in classic C library headers (e.g. <stdio.h>),
or in C++-style C library headers (e.g. <cmath>) are used correctly
(respectively, in the global namespace, or in namespace std).

BUG=
R=danno@chromium.org

Review URL: https://codereview.chromium.org/121303005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18578 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-14 09:57:05 +00:00
marja@chromium.org
e9c8de04da Fix r18556; tests were missing handlescopes.
BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/133763005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-13 11:15:06 +00:00
marja@chromium.org
21f1ca5850 Remove ScriptData::PreCompile which takes const char*.
The version taking a Handle should be used instead.

It's not used by Chromium and complicates the ongoing lexer work.

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/136413003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18556 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-13 10:51:40 +00:00
rossberg@chromium.org
014a86ef8c ES6: Add Object.getOwnPropertySymbols
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.getownpropertysymbols

This allows you to get the symbols used as property keys for an object.

  var object = {};
  var sym = Symbol();
  object[sym] = 42;
  assert(Object.getOwnPropertySymbols(object)[0] === sym);

This is only available with --harmony-symbols

BUG=v8:3049
R=rossberg@chromium.org, rossberg
LOG=Y

Review URL: https://codereview.chromium.org/108083005

Patch from Erik Arvidsson <arv@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-09 15:57:30 +00:00
svenpanne@chromium.org
8f7720aa25 Add Isolate parameter to HandleScope::NumberOfHandles.
LOG=y
BUG=324225
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/128233002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-09 10:37:15 +00:00
svenpanne@chromium.org
005c0d8178 Prepare removal of ObjectTemplate::New without Isolate parameter.
LOG=y
BUG=324225
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/124943004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-08 06:53:31 +00:00
verwaest@chromium.org
4615e9edac Reland v8:18458 "Load the global proxy from the context of the target function."
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/104013008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-07 10:46:39 +00:00
rossberg@chromium.org
2879f2104c Revert "Load the global proxy from the context of the target function."
This reverts commit https://code.google.com/p/v8/source/detail?r=18458, since it exhibits a bug that breaks some tests.

TBR=verwaest@chromium.org
BUG=

Review URL: https://codereview.chromium.org/93863006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-07 09:55:25 +00:00
verwaest@chromium.org
5b40c38679 Load the global proxy from the context of the target function.
BUG=
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/111613003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-07 08:21:17 +00:00
ulan@chromium.org
343813c59e Revert r18451 "Revert r18449 "Reland r18383: More API cleanup." and r18450 "Unbreak build."" since necessary WebKit changes are rolled in Chromium.
TBR=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/119753008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-03 14:31:17 +00:00
ulan@chromium.org
163386c700 Revert r18449 "Reland r18383: More API cleanup." and r18450 "Unbreak build."
because of broken WebKit bots.

TBR=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/119323006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-03 14:13:21 +00:00
svenpanne@chromium.org
08354f8f07 Unbreak build.
Test/update/commit race condition... >:-(

TBR=ulan@chromium.org

Review URL: https://codereview.chromium.org/123383003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-03 12:21:48 +00:00
svenpanne@chromium.org
1143ab132e Reland r18383: More API cleanup.
* Removed String::Empty, Number::New, Integer::New, Integer::NewFromUnsigned, FunctionTemplate::New and Object::New without Isolate* parameter.

* Removed Integer::New and Integer::NewUnsigned with weird argument order.

Chrome CLs matching this change have been landed.

TBR=dcarney@chromium.org
LOG=y
BUG=324225

Review URL: https://codereview.chromium.org/108783007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-03 11:56:33 +00:00
jochen@chromium.org
e3fa6d67ca Avoid duplication of a hidden & inherited prototype's properties.
In Runtime_GetLocalPropertyNames(), the hidden prototypes of an object
are also consulted when deriving the property name set. However, if
given a function object and its template was inherited from the
template of one of its hidden prototypes, that hidden prototype's
property accessors will be present on the object already. Unwanted
duplicates will therefore appear.

Hence, go through the property names that the hidden prototypes
contribute and remove any already occurring ones.

Assumed to be a rare constellation, so the cost of this extra pass is
considered acceptable.

LOG=N
R=dcarney@chromium.org, jochen@chromium.org, rossberg@chromium.org
BUG=269562

Review URL: https://codereview.chromium.org/116533003

Patch from Sigbjorn Finne <sof@opera.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-03 11:19:13 +00:00
yangguo@chromium.org
f7929d2a87 Reland "Handlify concat string and substring."
This relands commit r17490.

BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/114943004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18408 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-23 12:37:56 +00:00
yurys@chromium.org
61c1692c9b This adds functionality for getting original functions from bound functions.
It's of much use when information about function calls is shown on the Events timeline in DevTools: instead of referencing to v8natives.js where bound functions are created, we'll be able to show real function data (name, resource, script line and column numbers) retrieved from original functions.

BUG=None
LOG=Y
R=yangguo@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/106763002

Patch from Alexandra Mikhaylova <amikhaylova@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-23 08:04:54 +00:00
vegorov@chromium.org
79ad8bf2e0 Fix sporadic crash in the RequestInterruptTestWithNativeAccessor.
The test was broken. V8 currently does not correctly lookup NativeDataProperty accessors attached to the PrototypeTemplate of FunctionTemplate (Issue 3066). As the result while(obj.shouldContinue) loop was immediately exiting and the test would terminate while RequestInterruptTestBase::InterruptThread would be still starting up. As the result later InterruptThread would try to access members of the test object which was destroyed.

The test was fixed:

- instead of attaching accessor to PrototypeTemplate we attach it to  InstanceTemplate;
- an assertion was added to verify that we completed the test successfully due to interruptor firing not due to sporadic loop termination due to some unrelated bug.

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/109653010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-20 14:07:19 +00:00
svenpanne@chromium.org
e595dc0368 Revert "More API cleanup."
This reverts r18383. The CL in itself is OK, we just have to wait until Chrome's commit queue lands the final corresponding change and re-land this CL. :-/

TBR=hpayer@chromium.org

Review URL: https://codereview.chromium.org/119013004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-20 11:35:53 +00:00
svenpanne@chromium.org
d54a4e6d40 More API cleanup.
* Removed String::Empty, Number::New, Integer::New, Integer::NewFromUnsigned, FunctionTemplate::New and Object::New without Isolate* parameter.

* Removed Integer::New and Integer::NewUnsigned with weird argument order.

Chrome CLs matching this change are prepared, BTW.

LOG=y
BUG=324225
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/118523003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18383 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-20 10:49:27 +00:00
vegorov@chromium.org
bc77d4d60a Reland r18363.
Introduce API to temporarily interrupt long running JavaScript code.

It is different from termination API as interrupted JavaScript will continue to execute normally when registered InterruptCallback returns.

  /**
   * Request V8 to interrupt long running JavaScript code and invoke
   * the given |callback| passing the given |data| to it. After |callback|
   * returns control will be returned to the JavaScript code.
   * At any given moment V8 can remember only a single callback for the very
   * last interrupt request.
   * Can be called from another thread without acquiring a |Locker|.
   * Registered |callback| must not reenter interrupted Isolate.
   */
  void RequestInterrupt(InterruptCallback callback, void* data);

  /**
   * Clear interrupt request created by |RequestInterrupt|.
   * Can be called from another thread without acquiring a |Locker|.
   */
  void ClearInterrupt();

Fix Hydrogen SCE pass to avoid eliminating stack guards too aggressively. Only normal JavaScript functions are guaranteed to have stack guard in the prologue. If function is a builtin or has a custom call IC it will lack one.

Changes from r18363:

- includes r18364 to fix compilation errors: removes debugging only code;

- makes interrupiton related tests not threaded, because they rely on having exclusive access to the V8 instance and the fact that they can only interrupt themselves, if they are interrupted from the outside they break;

- changes HasStackCheck predicate used during SCE pass to avoid handles dereference to make SCE compatible with parallel recompilation.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/104823008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-19 16:45:58 +00:00
vegorov@chromium.org
dd8a793962 Revert "Introduce API to temporarily interrupt long running JavaScript code."
This reverts commit r18363.

Revert "Fix compilation error introduced by r18363."

This reverts commit r18364.

Changes in SCE pass are incompatible with parallel compilation

TBR=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/101463003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 19:21:27 +00:00
vegorov@chromium.org
cd045f473e Fix compilation error introduced by r18363.
Remove debugging related code.

TBR=dcarney@chromium.org

Review URL: https://codereview.chromium.org/104793005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 19:01:02 +00:00
vegorov@chromium.org
64d2dfa232 Introduce API to temporarily interrupt long running JavaScript code.
It is different from termination API as interrupted JavaScript will continue to execute normally when registered InterruptCallback returns.

  /**
   * Request V8 to interrupt long running JavaScript code and invoke
   * the given |callback| passing the given |data| to it. After |callback|
   * returns control will be returned to the JavaScript code.
   * At any given moment V8 can remember only a single callback for the very
   * last interrupt request.
   * Can be called from another thread without acquiring a |Locker|.
   * Registered |callback| must not reenter interrupted Isolate.
   */
  void RequestInterrupt(InterruptCallback callback, void* data);

  /**
   * Clear interrupt request created by |RequestInterrupt|.
   * Can be called from another thread without acquiring a |Locker|.
   */
  void ClearInterrupt();

Fix Hydrogen SCE pass to avoid eliminating stack guards too aggressively. Only normal JavaScript functions are guaranteed to have stack guard in the prologue. If function is a builtin or has a custom call IC it will lack one.

BUG=
R=danno@chromium.org, dcarney@chromium.org

Review URL: https://codereview.chromium.org/102063004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18363 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 18:38:35 +00:00