Commit Graph

14281 Commits

Author SHA1 Message Date
titzer
ceb29f7c62 [wasm] Rename ast-decoder.* to function-body-decoder.*
Since WASM is no longer an AST :-(

R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2594973003
Cr-Commit-Position: refs/heads/master@{#41889}
2016-12-21 12:42:06 +00:00
titzer
01c464a5af [wasm] Set JS API names and function lengths appropriately.
R=clemensh@chromium.org
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2590243003
Cr-Commit-Position: refs/heads/master@{#41885}
2016-12-21 09:03:35 +00:00
jshin
a42c8c67de Turn on icu_case_mapping by default
Update string-capitalize expected result because now it
passes all the tests in the file.
Mark fast/js/string-capitalization as failing with no_i18n.

Relanding after revert because the failure was taken care of
by Adam's CL at https://codereview.chromium.org/2597543002 .

BUG=v8:4477, v8:4476
TEST=test262/{built-ins,intl402}/Strings/*, webkit/fast/js/*,
     mjsunit/string-case, intl/general/case*

Cr-Original-Commit-Position: refs/heads/master@{#41834}
Committed: 7c79e23c34
Review-Url: https://codereview.chromium.org/2588963002
Cr-Commit-Position: refs/heads/master@{#41883}
2016-12-21 06:48:47 +00:00
adamk
b0c05f4ab3 [test] Avoid stack space exhaustion in test by passing --no-lazy
The test depends on tricky stack space requirements, so it stopped
working in some configurations win FLAG_min_preparse_length was removed
in commit 4a5b7e32c4.

As a workaround, pass --no-lazy until the test can be refined to work
on all configurations.

BUG=v8:5729
TBR=marja@chromium.org

Review-Url: https://codereview.chromium.org/2596673002
Cr-Commit-Position: refs/heads/master@{#41878}
2016-12-21 00:08:46 +00:00
Adam Klein
75586d3d9b Skip regress-trap-allocation-memento in gc_stress
This test requires its objects to live in new space, so running it
through gc stress runs just makes it susceptible to flakiness, as
was recently seen when turning on the --harmony-string-padding
flag (which just adds an extra JS file to the bootstrapper sequence).

TBR=ishell@chromium.org, jkummerow@chromium.org

Review-Url: https://codereview.chromium.org/2597543002 .
Cr-Commit-Position: refs/heads/master@{#41876}
2016-12-20 23:09:16 +00:00
bbudge
5354e28c8d [Turbofan] Add native ARM support for Simd Float32x4 operations.
- Adds Float32x4 Abs, Neg, Equal, NotEqual.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2594683002
Cr-Commit-Position: refs/heads/master@{#41870}
2016-12-20 16:49:53 +00:00
littledan
53fdf9d192 Use a different map to distinguish eval contexts
eval() may introduce a scope which needs to be represented as a context at
runtime, e.g.,

  eval('var x; let y; ()=>y')

introduces a variable y which needs to have a context allocated for it. However,
when traversing upwards to find the declaration context for a variable which leaks,
as the declaration of x does above, this context has to be understood to not be
a declaration context in sloppy mode.

This patch makes that distinction by introducing a different map for eval-introduced
contexts. A dynamic search for the appropriate context will continue past an eval
context to find the appropriate context. Marking contexts as eval contexts rather
than function contexts required updates in each compiler backend.

BUG=v8:5295, chromium:648719

Review-Url: https://codereview.chromium.org/2435023002
Cr-Commit-Position: refs/heads/master@{#41869}
2016-12-20 16:23:19 +00:00
bmeurer
3d9c77d812 [es6] Fix the %TypedArray% constructor.
The %TypedArray% constructor must not ever try to construct an instance,
but rather throw a TypeError instead.

R=jarin@chromium.org
BUG=v8:5763

Review-Url: https://codereview.chromium.org/2587413002
Cr-Commit-Position: refs/heads/master@{#41868}
2016-12-20 16:14:08 +00:00
littledan
b88d96c73a [intl] Remove new.target check in Intl functions and method
The Intl implementation included manual checks to see if they were
being called as a constructor. However, these checks are redundant,
as %FunctionRemovePrototype has already marked the functions as
un-constructable. This path removes the unnecessary checks.

R=yangguo

Review-Url: https://codereview.chromium.org/2587713002
Cr-Commit-Position: refs/heads/master@{#41867}
2016-12-20 16:06:19 +00:00
titzer
6e8338865a [wasm] Implement correct 2-level namespace for imports.
R=clemensh@chromium.org
CC=rossberg@chromium.org
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2591753002
Cr-Commit-Position: refs/heads/master@{#41866}
2016-12-20 15:32:56 +00:00
jyan
2d7f1c2c55 s390: clean up RR/RRE/RRD/RIL format in Assembler
R=joransiu@ca.ibm.com, bjaideep@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2589063002
Cr-Commit-Position: refs/heads/master@{#41864}
2016-12-20 15:03:49 +00:00
clemensh
081ac37048 [wasm] Introduce WasmSharedModuleData and refactor other objects
The new object will hold information which is shared by all clones of a
WasmCompiledModule, e.g. the decoded asm.js offset table, and in the
future also breakpoints. From there, we can set them on each new
instantiation of any clone.

While already changing lots of the code base, I also renamed all
getters from "get_foo" to "foo", to conform to the style guide.

R=titzer@chromium.org, yangguo@chromium.org
BUG=v8:5732

Review-Url: https://codereview.chromium.org/2591653002
Cr-Commit-Position: refs/heads/master@{#41862}
2016-12-20 14:34:07 +00:00
jgruber
9feefafa66 [js-perf-test] Add a basic async-await microbenchmark
These benchmarks are intended to compare the overhead of async-await vs.
a naive promise implementation vs. the babel async-await transformation.
The functions in the benchmark don't do any work themselves, so results
should reflect only overhead of the chosen implementation.

Current numbers on my local machine (higher is better):

BaselineES2017-AsyncAwait(Score): 2006
BaselineNaivePromises-AsyncAwait(Score): 7470
Native-AsyncAwait(Score): 3640

BUG=v8:5639

Review-Url: https://codereview.chromium.org/2577393002
Cr-Commit-Position: refs/heads/master@{#41860}
2016-12-20 13:10:07 +00:00
bbudge
e54e2dd916 [ARM] Add fp version of vceq to assembler, disassembler, and simulator.
LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2593443002
Cr-Commit-Position: refs/heads/master@{#41859}
2016-12-20 13:06:58 +00:00
cbruni
c1402cbde3 [builtins] Fix String.prototype.indexOf with negative positions
BUG=chromium:674889

Review-Url: https://codereview.chromium.org/2593593002
Cr-Commit-Position: refs/heads/master@{#41858}
2016-12-20 12:40:57 +00:00
yangguo
28432588c2 [api] add API for Promise status and result.
Currently, to find out a Promise's status and result, one has to use the
debug context. This is for example done in Node.js. This new API is a
better replacement, also in the context of the debug context being
deprecated eventually.

R=franzih@chromium.org, gsathya@chromium.org, jochen@chromium.org
BUG=v8:5764

Review-Url: https://codereview.chromium.org/2589113002
Cr-Commit-Position: refs/heads/master@{#41855}
2016-12-20 12:13:29 +00:00
leszeks
73afbaa8c1 [tests] Fix test-api for non-optimizing ignition-staging runs
BUG=v8:5762

Review-Url: https://codereview.chromium.org/2590843002
Cr-Commit-Position: refs/heads/master@{#41852}
2016-12-20 11:47:31 +00:00
clemensh
6361f133ab [wasm] Add iterators for opcodes or offsets of one function
We have the BytecodeIterator with next() and has_next() methods, and
pc_offset() and current() accessors.
This CL adds an interface to iterate over the opcodes or offsets in a
C++ foreach loop.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2587143002
Cr-Commit-Position: refs/heads/master@{#41851}
2016-12-20 11:28:44 +00:00
titzer
e797e0ea6d [wasm] Add test for reexport of the same import twice.
R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2592563003
Cr-Commit-Position: refs/heads/master@{#41850}
2016-12-20 10:43:54 +00:00
titzer
cbd3b3d0fe Implement header size calculation for array iterators.
R=bmeurer@chromium.org
BUG=chromium:674232

Review-Url: https://codereview.chromium.org/2592633002
Cr-Commit-Position: refs/heads/master@{#41849}
2016-12-20 10:38:17 +00:00
tebbi
abd63018d7 [turbofan] fixed escape analysis bug: missing copy of virtual state
R=jarin@chromium.org

BUG=chromium:673243

Review-Url: https://codereview.chromium.org/2578133002
Cr-Commit-Position: refs/heads/master@{#41848}
2016-12-20 10:30:52 +00:00
ishell
faf80b4ec0 [crankshaft] Ensure that we use inlined Array.prototype.shift only when there's no elements in the prototype chain.
BUG=chromium:663340

Review-Url: https://codereview.chromium.org/2593553002
Cr-Commit-Position: refs/heads/master@{#41846}
2016-12-20 10:18:02 +00:00
ishell
576a46f520 [crankshaft] Properly handle OOB string accesses.
BUG=chromium:665793

Review-Url: https://codereview.chromium.org/2589823003
Cr-Commit-Position: refs/heads/master@{#41842}
2016-12-20 10:01:59 +00:00
mlippautz
119db080c5 [heap] Fix unittest compilation on mips
BUG=
TBR=hpayer@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2587363002
Cr-Commit-Position: refs/heads/master@{#41841}
2016-12-20 09:56:39 +00:00
mlippautz
17318bbd39 [heap] Create a thin wrapper around wrapper tracing in V8 to avoid misuse
BUG=chromium:468240

Review-Url: https://codereview.chromium.org/2576453002
Cr-Commit-Position: refs/heads/master@{#41837}
2016-12-20 09:35:05 +00:00
machenbach
f6d8ec4fca Revert of Turn on icu_case_mapping by default (patchset #3 id:40001 of https://codereview.chromium.org/2588963002/ )
Reason for revert:
Causes gc stress failures:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/9920

Original issue's description:
> Turn on icu_case_mapping by default
>
> BUG=v8:4477, v8:4476
> TEST=test262/{built-ins,intl402}/Strings/*, webkit/fast/js/*,
>      mjsunit/string-case, intl/general/case*
>
> Review-Url: https://codereview.chromium.org/2588963002
> Cr-Commit-Position: refs/heads/master@{#41834}
> Committed: 7c79e23c34

TBR=littledan@chromium.org,yangguo@chromium.org,jshin@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4477, v8:4476

Review-Url: https://codereview.chromium.org/2593543002
Cr-Commit-Position: refs/heads/master@{#41835}
2016-12-20 09:28:35 +00:00
jshin
7c79e23c34 Turn on icu_case_mapping by default
BUG=v8:4477, v8:4476
TEST=test262/{built-ins,intl402}/Strings/*, webkit/fast/js/*,
     mjsunit/string-case, intl/general/case*

Review-Url: https://codereview.chromium.org/2588963002
Cr-Commit-Position: refs/heads/master@{#41834}
2016-12-20 09:00:50 +00:00
yangguo
a141898108 [debugger] sunset --expose-debug-as flag.
R=jgruber@chromium.org
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2589083002
Cr-Commit-Position: refs/heads/master@{#41832}
2016-12-20 07:45:48 +00:00
bbudge
0625a686b5 [Turbofan] Add native ARM support for basic SIMD 32x4 operations.
- Adds Float32x4 ExtractLane, ReplaceLane, Splat, Add, Sub,
and conversions to Int32x4 and Uint32x4.
- Adds Int32x4 ExtractLane, ReplaceLane, Splat, Add, Sub and
conversions to Float32x4 (int and unsigned int).
- Adds Int32x4 CompareEqual, CompareNotEqual.
- Adds S32x4 Select.
- Adds tests for all new SIMD operations.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2584863002
Cr-Commit-Position: refs/heads/master@{#41828}
2016-12-19 22:23:03 +00:00
gsathya
cc7e0b0eff [promises] Port CreateResolvingFunctions to TF
2% improvement on benchmarks over 5 runs.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2567033003
Cr-Commit-Position: refs/heads/master@{#41827}
2016-12-19 22:21:35 +00:00
littledan
48a36c7df7 [intl] Avoid modifying options bag from constructor
Previously, the Intl.DateTimeFormat constructor and other related paths had
a bug where the options bag passed in would be modified in place. This patch
makes V8's Intl implementation follow the specification's logic to avoid
such a modification.

BUG=v8:4219

Review-Url: https://codereview.chromium.org/2587703002
Cr-Commit-Position: refs/heads/master@{#41826}
2016-12-19 21:36:16 +00:00
clemensh
5cbc4a9674 [wasm] Freeze exports object
We were not conforming to the spec before.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2587913005
Cr-Commit-Position: refs/heads/master@{#41822}
2016-12-19 18:45:07 +00:00
jshin
af38272dd9 Optimize case conversion with icu_case_mapping
Use FastAsciiConvert (as used by Unibrow) for i18n-aware
case conversion with --icu_case_mapping.

Move FastAsciiConvert to src/string-case.cc so that it can be used
by both runtime-{string,i18n}.

Add more tests.

BUG=v8:4477,v8:4476
TEST=intl/general/case*

Review-Url: https://codereview.chromium.org/2533983006
Cr-Commit-Position: refs/heads/master@{#41821}
2016-12-19 18:43:55 +00:00
clemensh
1fef739ab0 [wasm] Implement GetPossibleBreakpoints
This CL implements GetPossibleBreakpoints for wasm, by iterating over
all functions in the requested range and returning the location of all
instructions within that range.

The connection to the inspector will be added later, when setting
breakpoint also works for wasm: http://crrev.com/2536763002

BUG=chromium:613110
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2588763002
Cr-Commit-Position: refs/heads/master@{#41818}
2016-12-19 17:22:55 +00:00
titzer
b6a57e6ff5 [wasm] Add js-api test and fix property details for some functions.
R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2585193004
Cr-Commit-Position: refs/heads/master@{#41817}
2016-12-19 17:19:56 +00:00
gsathya
81f765718e [builtins] move PromiseBuiltinsAssembler to it's own header file
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2585133002
Cr-Commit-Position: refs/heads/master@{#41816}
2016-12-19 17:14:36 +00:00
franzih
86eafdd4c0 Add CreateDataPropertyInLiteralFlags.
Encode the PropertyAttribute and whether the function
names must be set as a flag instead of setting two registers.

BUG=v8:5624

Review-Url: https://codereview.chromium.org/2586463002
Cr-Commit-Position: refs/heads/master@{#41812}
2016-12-19 16:30:36 +00:00
mvstanton
0d4b990497 CompilerDispatcher unittest should use is_compiled() predicate.
BUG=v8:5759
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2588743003
Cr-Commit-Position: refs/heads/master@{#41810}
2016-12-19 15:41:04 +00:00
clemensh
21a85c4a03 [wasm] Always provide a wasm instance object at runtime
When executing wasm code for testing, we did not create a
WasmInstanceObject and link it to the generated code. This required
some special handling at runtime (mainly for stack trace generation).
This CL always provides the WasmInstanceObject, such that e.g. function
names can be resolved the usual way.
The module bytes referenced by the WasmCompiledModule linked with the
WasmInstanceObject do not hold a valid wasm module yet. Instead, we
just add the bytes we need, and make the objects in WasmModule point to
those bytes (currently only used for function names). Those bytes will
not be parsed at runtime anyway.

R=titzer@chromium.org
CC=jgruber@chromium.org
BUG=v8:5620

Review-Url: https://codereview.chromium.org/2551053002
Cr-Commit-Position: refs/heads/master@{#41809}
2016-12-19 15:03:13 +00:00
yangguo
d5566b9e77 [inspector] gracefully handle stack overflows in the inspector.
Hopefully we can avoid going through JS at all, so we can avoid this issue.

R=jgruber@chromium.org, kozyatinskiy@chromium.org
BUG=v8:5654

Review-Url: https://codereview.chromium.org/2510093002
Cr-Original-Commit-Position: refs/heads/master@{#41802}
Committed: 3ab3b6261a
Review-Url: https://codereview.chromium.org/2510093002
Cr-Commit-Position: refs/heads/master@{#41807}
2016-12-19 14:07:55 +00:00
yangguo
a680b260ed Revert of [inspector] gracefully handle stack overflows in the inspector. (patchset #13 id:240001 of https://codereview.chromium.org/2510093002/ )
Reason for revert:
asan failure: https://build.chromium.org/p/client.v8/builders/V8%20Mac64%20ASAN/builds/10047/steps/Ignition%20-%20turbofan/logs/regress-2318

Original issue's description:
> [inspector] gracefully handle stack overflows in the inspector.
>
> Hopefully we can avoid going through JS at all, so we can avoid this issue.
>
> R=jgruber@chromium.org, kozyatinskiy@chromium.org
> BUG=v8:5654
>
> Review-Url: https://codereview.chromium.org/2510093002
> Cr-Commit-Position: refs/heads/master@{#41802}
> Committed: 3ab3b6261a

TBR=jgruber@chromium.org,kozyatinskiy@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5654

Review-Url: https://codereview.chromium.org/2583173002
Cr-Commit-Position: refs/heads/master@{#41805}
2016-12-19 13:28:10 +00:00
cbruni
c0282f608c Add unittests to keep InstanceType lists in sync
STRUCT_LIST and INSTANCE_TYPE_LIST are now forced to have the same order
as the InstanceType enum.

Drive-by-fix 1: Move type check and cast functions closer together in objects-inl.h

Drive-by-fix 2: Remove unused instance types SIGNATURE_INFO_TYPE and  TYPE_SWITCH_INFO_TYPE.

BUG=

Review-Url: https://codereview.chromium.org/2578573002
Cr-Commit-Position: refs/heads/master@{#41804}
2016-12-19 12:50:30 +00:00
cbruni
99a5aa1b95 [crankshaft] Fix IsClassOfTest helper method
Drive-by-fix: Add AstNode::Print() and improve printing of CallRuntime
              Expression.

BUG=v8:5749

Review-Url: https://codereview.chromium.org/2586933002
Cr-Commit-Position: refs/heads/master@{#41803}
2016-12-19 12:49:21 +00:00
yangguo
3ab3b6261a [inspector] gracefully handle stack overflows in the inspector.
Hopefully we can avoid going through JS at all, so we can avoid this issue.

R=jgruber@chromium.org, kozyatinskiy@chromium.org
BUG=v8:5654

Review-Url: https://codereview.chromium.org/2510093002
Cr-Commit-Position: refs/heads/master@{#41802}
2016-12-19 12:24:57 +00:00
cbruni
1c1465f124 [runtime] Add PositiveNumberToUint32 helper to avoid double to uint roundtrip
BUG=

Review-Url: https://codereview.chromium.org/2577143002
Cr-Commit-Position: refs/heads/master@{#41801}
2016-12-19 12:06:58 +00:00
yangguo
8ac9e55aa6 [serializer] fix leak in test.
BUG=chromium:662388
R=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2582333002
Cr-Commit-Position: refs/heads/master@{#41800}
2016-12-19 12:04:19 +00:00
yangguo
2a19ad3603 Fix memory leak in logging-unittest.
R=cbruni@chromium.org
BUG=chromium:662388

Review-Url: https://codereview.chromium.org/2586203002
Cr-Commit-Position: refs/heads/master@{#41799}
2016-12-19 11:58:28 +00:00
ishell
52702e55aa [turbofan] Avoid allocation of temporary array of Nodes when generating calls.
BUG=

Review-Url: https://codereview.chromium.org/2586903002
Cr-Commit-Position: refs/heads/master@{#41798}
2016-12-19 11:35:42 +00:00
machenbach
81dd9847cf Revert of [crankshaft] Fix IsClassOfTest helper method (patchset #1 id:1 of https://codereview.chromium.org/2586933002/ )
Reason for revert:
Breaks vtune:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20vtunejit/builds/15379

Original issue's description:
> [crankshaft] Fix IsClassOfTest helper method
>
> Drive-by-fix: Add AstNode::Print() and improve printing of CallRuntime
>               Expression.
>
> BUG=v8:5749
>
> Review-Url: https://codereview.chromium.org/2586933002
> Cr-Commit-Position: refs/heads/master@{#41792}
> Committed: d4493222b9

TBR=bmeurer@chromium.org,cbruni@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5749

Review-Url: https://codereview.chromium.org/2587973002
Cr-Commit-Position: refs/heads/master@{#41795}
2016-12-19 11:22:36 +00:00
yangguo
07fa0f4967 [serializer] do not serialize script wrappers.
The scenario here: the asm function fails asm validation,
so we emit a message. In doing so, we create a JSValue wrapper for
the script object that we cache on the script object. This wrapper
is context-dependent and causes the code serializer to choke.

R=mtrofin@chromium.org, titzer@chromium.org
BUG=chromium:674446,chromium:673321

Review-Url: https://codereview.chromium.org/2586943003
Cr-Commit-Position: refs/heads/master@{#41794}
2016-12-19 10:53:02 +00:00