Commit Graph

30337 Commits

Author SHA1 Message Date
titzer
058939ab93 [wasm] Enforce limits for maximums for many WebAssembly binary entities.
This CL moves even more limits to wasm-limits.h and enforces limits for
types, functions, parameter counts, return counts, local counts, imports,
globals, and exports.

R=clemensh@chromium.org, ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2574133002
Cr-Commit-Position: refs/heads/master@{#41699}
2016-12-14 17:46:47 +00:00
leszeks
f3b7f21cbc [turbofan] Reserve the StateValueList's size before filling it
Avoid needless resizing of the StateValueList's fields vector by
reserving its (already known) size.

Review-Url: https://codereview.chromium.org/2572683005
Cr-Commit-Position: refs/heads/master@{#41698}
2016-12-14 14:55:18 +00:00
epertoso
e521757f47 [turbofan] Cleaning up InlineApiCall in JSNativeContextReducer.
R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2578563002
Cr-Commit-Position: refs/heads/master@{#41697}
2016-12-14 14:23:30 +00:00
bradnelson
d40195e4f7 Revert "[ia32] Optimize index calculation for certain checked load/stores."
This reverts commit 5c1babcc16.

This seems to regress a range of benchmarks on ia32:
  Emscripten for Fannkuch, Zlib, MemOps, Life, Bullet
  AreWeFastYet for BulletLoadTime, Fasta, Fannkuch
  JetStream for towers.c, quicksort.c, gcc-loops.cpp, bigfib.cpp

BUG=673861
R=jarin@chromium.org,shiyu.zhang@intel.com

Review-Url: https://codereview.chromium.org/2573983003
Cr-Commit-Position: refs/heads/master@{#41696}
2016-12-14 14:12:37 +00:00
bradnelson
21255208e2 [wasm][asm.js] Adding timing info message about asm.js
Adding timing info going to the console about asm.js

Rename ConvertAsmToWasm -> CompileAsmViaWasm, to be more precise.
Add enum for wasm data elements.

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

Review-Url: https://codereview.chromium.org/2577453003
Cr-Commit-Position: refs/heads/master@{#41695}
2016-12-14 14:10:22 +00:00
ishell
33480daa60 [stubs] Enable machine graph verification for fast accessor assembler.
... and clean it up.

BUG=

Review-Url: https://codereview.chromium.org/2569353004
Cr-Commit-Position: refs/heads/master@{#41694}
2016-12-14 13:37:39 +00:00
tebbi
859414da4c [source-positions] make the SourcePositionInfo constructor actually compute position info
R=danno@chromium.org

BUG=

Review-Url: https://codereview.chromium.org/2568303008
Cr-Commit-Position: refs/heads/master@{#41693}
2016-12-14 12:58:19 +00:00
nikolaos
f39665e360 [parser] Fix bug with non-static name method/property
Without this patch, the tests on lines 410, 414, 418 and 422 in
function testNonStaticName of test/mjsunit/es6/function-name.js
would all fail.  The bug caused non-static "name" methods and
properties to be mistaken for static ones.

R=adamk@chromium.org, verwaest@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2567343004
Cr-Commit-Position: refs/heads/master@{#41692}
2016-12-14 12:12:01 +00:00
titzer
576abe14c6 [runtime] Add instance size check for CheckEquivalent().
WASM exported functions have additional internal fields which change the instance
size. Adding a getter or setter to such an exported function results in its map
becoming normalized. The normalized map cache, however, finds a different map
with a different instance size, and thus BOOM.

R=verwaest@chromium.org,cbruni@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2554343002
Cr-Commit-Position: refs/heads/master@{#41691}
2016-12-14 11:59:56 +00:00
ishell
a54d7acb11 [stubs] Enable graph verification for builtins.
... and fix the inconsistencies.

BUG=

Review-Url: https://codereview.chromium.org/2573573004
Cr-Commit-Position: refs/heads/master@{#41690}
2016-12-14 10:51:30 +00:00
alph
cc47e27a37 [profiler] Add check for SFI::script() being not undefined
BUG=v8:5735

Review-Url: https://codereview.chromium.org/2574943002
Cr-Commit-Position: refs/heads/master@{#41689}
2016-12-14 10:20:43 +00:00
jgruber
bbf3c697ae [heap] Initialize the owner on each page after lospace allocation
The least two bits of the owner field of a Page are used to determine
whether the Page is part of a large object. If these bits are not equal
to 0x11, the page is part of a large object and needs special handling
e.g. in MemoryChunk::FromAnyPointerAddress to determine which chunk it
belongs to.

This CL fixes an issue in which the store buffer overflows after
a large object space allocation but before the object has been fully
initialized. Store buffer overflow handling attempts to look up the
chunk of a page, but fails to do so correctly since the page's owner
field has not yet been initialized.

This CL ensures that the owner field of all pages belonging to a large
object allocation are initialized to a value that is interpreted
correctly.

BUG=chromium:672041

Committed: https://crrev.com/9b6808bfb5366beebe3af30a06f9851edb2039d4
Review-Url: https://codereview.chromium.org/2565713002
Cr-Original-Commit-Position: refs/heads/master@{#41641}
Cr-Commit-Position: refs/heads/master@{#41687}
2016-12-14 06:45:35 +00:00
kozyatinskiy
3dea2c8354 Revert of Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (patchset #11 id:190001 of https://codereview.chromium.org/2547483002/ )
Reason for revert:
LiveEdit is broken in some cases.

Original issue's description:
> Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
>
> Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
> we can use them as an index into an array, instead of using a
> WeakFixedArray where we have to do a linear scan.
>
> Hooking up liveedit is a bit more involved, see
> https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
> for an overview
>
> BUG=v8:5589
> R=verwaest@chromium.org,jgruber@chromium.org
>
> Committed: https://crrev.com/6595e7405769dc9d49e9568d61485efc6d468baf
> Cr-Commit-Position: refs/heads/master@{#41600}

TBR=jgruber@chromium.org,verwaest@chromium.org,yangguo@chromium.org,jochen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=v8:5589,chromium:673950
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2578433002
Cr-Commit-Position: refs/heads/master@{#41684}
2016-12-14 02:05:05 +00:00
gsathya
9fc3c017e1 PromiseHandle port to TF
Splits PromiseHandle into two TF builtins to account for catch
prediction. An exception in PromiseHandleReject builtin results in a
"caught" prediction whereas an expception in PromiseHandle results in a
"promise rejection" prediction.

An extra is_exception_caught bit is added to Code to mark this catch
prediction behavior.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2572623002
Cr-Commit-Position: refs/heads/master@{#41683}
2016-12-13 23:55:08 +00:00
gsathya
3b1a09f56d [stubs] Add CSA::IsSymbol() and CSA::IsPrivateSymbol().
Review-Url: https://codereview.chromium.org/2571883002
Cr-Commit-Position: refs/heads/master@{#41682}
2016-12-13 23:13:20 +00:00
tebbi
8ff9efc84e [turbofan] enforce single pass for redundancy elimination
R=jarin@chromium.org

BUG=

Review-Url: https://codereview.chromium.org/2568423003
Cr-Commit-Position: refs/heads/master@{#41681}
2016-12-13 20:12:49 +00:00
tebbi
c22c70b605 [turbofan] fixed escape analysis crash because of incomplete replacements
R=epertoso@chromium.org,mstarzinger@chromium.org

BUG=671324

Review-Url: https://codereview.chromium.org/2571793002
Cr-Commit-Position: refs/heads/master@{#41679}
2016-12-13 16:25:30 +00:00
honggyu.kp
6106a483de [heap] Set class RememberedSet to AllStatic
Since class RememberedSet only contains static methods, it'd be better
to make it as AllStatic class.

BUG=
R=ulan@chromium.org, yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2570783004
Cr-Commit-Position: refs/heads/master@{#41678}
2016-12-13 15:37:14 +00:00
leszeks
f6ee3b5ff3 [ignition] Fix hole check for dynamic local variables
The fast-path for dynamic local variables was previously checking the
lookup variable rather than the shadowed variable when deciding whether
to add a hole check.

BUG=669540

Review-Url: https://codereview.chromium.org/2551023004
Cr-Commit-Position: refs/heads/master@{#41677}
2016-12-13 14:29:07 +00:00
ishell
b5a9381a56 [interpreter][stubs] Enable graph verification for bytecode handlers and stubs included into snapshot.
BUG=

Review-Url: https://codereview.chromium.org/2575473002
Cr-Commit-Position: refs/heads/master@{#41676}
2016-12-13 13:55:29 +00:00
jarin
a989a11639 [turbofan] Remove the unused loop peeling stress option.
Review-Url: https://codereview.chromium.org/2570803002
Cr-Commit-Position: refs/heads/master@{#41675}
2016-12-13 13:29:39 +00:00
gsathya
dfa2660672 Add PromiseReactionJobInfo to CSA
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2573703002
Cr-Commit-Position: refs/heads/master@{#41674}
2016-12-13 13:22:15 +00:00
marja
788e74f5dc Preparsing inner functions: Tentatively turn on FLAG_lazy_inner_functions.
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2567953003
Cr-Commit-Position: refs/heads/master@{#41673}
2016-12-13 13:13:49 +00:00
jarin
e32535af5a [turbofan] Remove value numbering from late optimization pass.
Review-Url: https://codereview.chromium.org/2570813002
Cr-Commit-Position: refs/heads/master@{#41672}
2016-12-13 13:03:20 +00:00
shiyu.zhang
5c1babcc16 [ia32] Optimize index calculation for certain checked load/stores.
It reduces the add operation for certain checked load/stores by pre-do the add in compiling phase.

BUG=

Review-Url: https://codereview.chromium.org/2563483005
Cr-Commit-Position: refs/heads/master@{#41671}
2016-12-13 12:45:46 +00:00
marja
0c827cd000 PreParsing inner funcs: Remove nonsense code from PreParser.
The assignment in default parameters (e.g., function foo(a = somedefault) { }
doesn't flow through PreParserFactory::NewAssignment even if the comment claims so.
Thus, piping through the variables is not needed.

Kudos to neis@ for pointing this out.

BUG=v8:5501
R=neis@chromium.org

Review-Url: https://codereview.chromium.org/2569983003
Cr-Commit-Position: refs/heads/master@{#41670}
2016-12-13 12:35:11 +00:00
leszeks
1df36a80de [turbofan] Add a mutex for recording compilation statistics
There was previously a race between different phases recording their
first entry -- and thus, their insert order -- on the main and
concurrent-compilation thread. This would later manifest as a segfault
when creating the sorted array of phases for --turbo-stats (as two
phases would have the same insert order and so there would be a gap in
the array).

Review-Url: https://codereview.chromium.org/2572713003
Cr-Commit-Position: refs/heads/master@{#41669}
2016-12-13 12:15:14 +00:00
yangguo
449829b85c [serializer] API to re-use global proxy in v8::Context::FromSnapshot.
R=jochen@chromium.org, peria@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2571743002
Cr-Commit-Position: refs/heads/master@{#41668}
2016-12-13 11:24:58 +00:00
ulan
ca9209d705 [heap] Special handling for small heaps in eager finalization of
incremental marking.

BUG=chromium:671994

Review-Url: https://codereview.chromium.org/2565173004
Cr-Commit-Position: refs/heads/master@{#41666}
2016-12-13 10:25:53 +00:00
machenbach
cd23d6771a Revert of [heap] Enable black allocation when finalizing marking. (patchset #3 id:40001 of https://codereview.chromium.org/2440943002/ )
Reason for revert:
Seems to block roll:
https://codereview.chromium.org/2569133002/

Original issue's description:
> [heap] Enable black allocation when finalizing marking.
>
> BUG=chromium:630386
>
> Committed: https://crrev.com/a98d971412a5c32967bbef4b77b9d2658055ff1c
> Cr-Commit-Position: refs/heads/master@{#41655}

TBR=ulan@chromium.org,hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:630386

Review-Url: https://codereview.chromium.org/2567353002
Cr-Commit-Position: refs/heads/master@{#41665}
2016-12-13 09:41:04 +00:00
vegorov
7371284dcf Fix how Hydrogen traces inlined functions.
https://crrev.com/c3a6ca68d0646b10885ef7017557eaf463db2e4a changed what kind of information is dumped which broke some properties of the output that IRHydra relies on:

1. Because IRHydra does not have access to the whole scripts it relies on function sources dumps to map IR and deoptimization to the actual source. This means that source positions must be dumped in a way that allows for this mapping and previously we used positions relative to the beginning of the function to allow that. Now we are dumping absolute script positions which means that function sources must be annotated with the start position so that IRHydra (or any other similar tools) could translate absolute script positions into function-relative ones.

2. When dumping inlined functions we should dump which function are we inlining into because position itself is not enough to recover the inlining stack from the output.

BUG=

Review-Url: https://codereview.chromium.org/2573653002
Cr-Commit-Position: refs/heads/master@{#41663}
2016-12-13 07:31:30 +00:00
gsathya
10e30279b7 [typedarrays] fix typo
Review-Url: https://codereview.chromium.org/2569663003
Cr-Commit-Position: refs/heads/master@{#41662}
2016-12-13 06:21:45 +00:00
gsathya
2886e3917f [promises] Refactor CreatePromise
BUG=v8:5343

Review-Url: https://codereview.chromium.org/2571663002
Cr-Commit-Position: refs/heads/master@{#41660}
2016-12-13 02:15:20 +00:00
zhengxing.li
493d48d8a6 [x86] [crankshaft] unify jump label's distance value in DoWrapReceiver().
Currently the jump label's distance value in LCodeGen::DoWrapReceiver() of X86 is unconsistent.

  For avoiding potential bugs caused by this unconsistent usage for the same label when DeoptEveryNTimes()
  return true, This CL unify the label's distance value usage in LCodeGen::DoWrapReceiver().

  For more informations, please refer CL #41419 (https://codereview.chromium.org/2539403002/ ).

BUG=

Review-Url: https://codereview.chromium.org/2554493002
Cr-Commit-Position: refs/heads/master@{#41659}
2016-12-13 01:56:23 +00:00
lpy
dca99f4fc8 [Tracing] Show background parsing runtime statistics in tracing
When ParseOnBackground is done, we should construct a trace event and dump all
background parsing runtime statistics as argument. In tracing we don't want to
merge it back to to main thread, instead we show the trace event together with
background parsing trace event on script streamer thread track in Trace Viewer.

To perf sheriff: A series of counters ParseBackgroundxxx and
PreparseBackgroundxxx will be taken into account in this patch, thus runtime
statistics graph will increase after this patch gets landed.

BUG=v8:5089

Review-Url: https://codereview.chromium.org/2559403002
Cr-Commit-Position: refs/heads/master@{#41658}
2016-12-12 23:15:08 +00:00
dgozman
2bdd0feb77 [inspector] Store interger in context embedder data instead of a string.
This is to improve the performance of common operation of
extracting contextId or contextGroupId out of Context.

BUG=none

Review-Url: https://codereview.chromium.org/2558913004
Cr-Commit-Position: refs/heads/master@{#41657}
2016-12-12 21:17:32 +00:00
jkummerow
bb753b6dd7 [stubs] Fix negative index lookup in hasOwnProperty
...and HasProperty, for dictionary-elements receivers.

BUG=chromium:673008

Review-Url: https://codereview.chromium.org/2568943002
Cr-Commit-Position: refs/heads/master@{#41656}
2016-12-12 20:13:07 +00:00
hpayer
a98d971412 [heap] Enable black allocation when finalizing marking.
BUG=chromium:630386

Review-Url: https://codereview.chromium.org/2440943002
Cr-Commit-Position: refs/heads/master@{#41655}
2016-12-12 19:54:37 +00:00
hpayer
7ca036bf1c [heap] Clean-up uses of EnsureSweepingComplete uses.
BUG=

Review-Url: https://codereview.chromium.org/2566133002
Cr-Commit-Position: refs/heads/master@{#41654}
2016-12-12 18:10:54 +00:00
ishell
769442a1b8 [interpreter][stubs] Don't modify FLAG_csa_verify flag to make TSAN happy.
BUG=

Review-Url: https://codereview.chromium.org/2568173002
Cr-Commit-Position: refs/heads/master@{#41653}
2016-12-12 17:03:54 +00:00
titzer
257793e3f5 [wasm] Disable parallel compilation in predictable mode.
R=bradnelson@chromium.org,ishell@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2570543002
Cr-Commit-Position: refs/heads/master@{#41652}
2016-12-12 16:26:52 +00:00
ishell
9978f90381 [stubs] Fixing issues found by machine graph verifier in code stubs.
BUG=

Review-Url: https://codereview.chromium.org/2568713002
Cr-Commit-Position: refs/heads/master@{#41651}
2016-12-12 15:53:58 +00:00
jochen
1bdf908db0 Add a basic compiler dispatcher
It doesn't schedule steps yet, but there are tests.

BUG=v8:5215
R=rmcilroy@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2558293004
Cr-Commit-Position: refs/heads/master@{#41650}
2016-12-12 15:36:25 +00:00
ishell
02f917f7ef [interpreter][stubs] Fixing issues found by machine graph verifier.
All issues in interpreter bytecode handlers are fixed.

BUG=

Review-Url: https://codereview.chromium.org/2552883012
Cr-Commit-Position: refs/heads/master@{#41649}
2016-12-12 14:53:04 +00:00
bradnelson
aabbbec67c [wasm] [asmjs] Route asm.js warnings to the dev console.
Generalize Messages to include an error level.
Add a parameter to AddMessageHandler to select which error levels to receive, using a mask (default being just errors, i.e. the current behavior).

BUG=v8:4203
R=dgozman@chromium.org,machenbach@chromium.org,danno@chromium.org,bmeurer@chromium.org,jochen@chromium.org

Review-Url: https://codereview.chromium.org/2526703002
Cr-Commit-Position: refs/heads/master@{#41648}
2016-12-12 14:48:50 +00:00
bradnelson
be9ee2237d [wasm][asm.js] Ignore duplicate exports in asm.js.
BUG=672789
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2559113006
Cr-Commit-Position: refs/heads/master@{#41647}
2016-12-12 14:47:38 +00:00
hpayer
fc2503d137 [heap] Black areas are created for both linear and free list allocations.
BUG=

Review-Url: https://codereview.chromium.org/2562383002
Cr-Commit-Position: refs/heads/master@{#41646}
2016-12-12 14:46:27 +00:00
marja
64d9352a54 Preparsing inner funcs: be less pessimistic about maybe_assigned.
BUG=v8:5501, v8:5678

Review-Url: https://codereview.chromium.org/2539123002
Cr-Commit-Position: refs/heads/master@{#41645}
2016-12-12 14:45:16 +00:00
hablich
1e70454f73 Revert of [heap] Initialize the owner on each page after lospace allocation (patchset #2 id:20001 of https://codereview.chromium.org/2565713002/ )
Reason for revert:
Tree closer: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/12409

Original issue's description:
> [heap] Initialize the owner on each page after lospace allocation
>
> The least two bits of the owner field of a Page are used to determine
> whether the Page is part of a large object. If these bits are not equal
> to 0x11, the page is part of a large object and needs special handling
> e.g. in MemoryChunk::FromAnyPointerAddress to determine which chunk it
> belongs to.
>
> This CL fixes an issue in which the store buffer overflows after
> a large object space allocation but before the object has been fully
> initialized. Store buffer overflow handling attempts to look up the
> chunk of a page, but fails to do so correctly since the page's owner
> field has not yet been initialized.
>
> This CL ensures that the owner field of all pages belonging to a large
> object allocation are initialized to a value that is interpreted
> correctly.
>
> BUG=chromium:672041
>
> Committed: https://crrev.com/9b6808bfb5366beebe3af30a06f9851edb2039d4
> Cr-Commit-Position: refs/heads/master@{#41641}

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

Review-Url: https://codereview.chromium.org/2562273004
Cr-Commit-Position: refs/heads/master@{#41644}
2016-12-12 14:37:44 +00:00
bradnelson
626d620d4d [wasm][asm.js] Require a number for fround literals.
BUG=673240
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2565343002
Cr-Commit-Position: refs/heads/master@{#41643}
2016-12-12 13:51:25 +00:00
clemensh
c4057d4645 [wasm] Provide correct eval origin for asm.js code
This CL moves all methods related to scripts and eval origin (HasScript,
GetScript, IsEval, GetEvalOrigin) from JSStackFrame to StackFrameBase,
because it also applies to WasmFrames.
This makes the AppendFileLocation method append the same information to
WasmStackFrames and AsmJsWasmStackFrames than to JSStackFrames.

R=titzer@chromium.org, mstarzinger@chromium.org
BUG=v8:4203

Review-Url: https://codereview.chromium.org/2557923005
Cr-Commit-Position: refs/heads/master@{#41642}
2016-12-12 13:31:37 +00:00
jgruber
9b6808bfb5 [heap] Initialize the owner on each page after lospace allocation
The least two bits of the owner field of a Page are used to determine
whether the Page is part of a large object. If these bits are not equal
to 0x11, the page is part of a large object and needs special handling
e.g. in MemoryChunk::FromAnyPointerAddress to determine which chunk it
belongs to.

This CL fixes an issue in which the store buffer overflows after
a large object space allocation but before the object has been fully
initialized. Store buffer overflow handling attempts to look up the
chunk of a page, but fails to do so correctly since the page's owner
field has not yet been initialized.

This CL ensures that the owner field of all pages belonging to a large
object allocation are initialized to a value that is interpreted
correctly.

BUG=chromium:672041

Review-Url: https://codereview.chromium.org/2565713002
Cr-Commit-Position: refs/heads/master@{#41641}
2016-12-12 13:19:07 +00:00
clemensh
222541dff5 [wasm] Generate correct locations for error messages
The current logic in Isolate::GetLocationFromStackTrace just ignores
wasm frames, making the computed location point to the first javascript
frame, like this:

test.js:17: RuntimeError: divide by zero
module.exports.main();
               ^
RuntimeError: divide by zero
    at main (<WASM>[1]+5)
    at test.js:17:16

This CL not only fixes the location to point to the top-most wasm
frame, but also exposes to the embedder that the script of that location
is a wasm script, allowing for custom printing of wasm locations.
The Shell::ReportException method now checks for this flag, and prints
wasm locations like this:

<WASM>[0]+5: RuntimeError: divide by zero
RuntimeError: divide by zero
    at main (<WASM>[0]+5)
    at test/message/wasm-trap.js:15:16

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

Review-Url: https://codereview.chromium.org/2563673002
Cr-Commit-Position: refs/heads/master@{#41640}
2016-12-12 12:46:02 +00:00
clemensh
c69b48adc4 [wasm] Handle potentially null callee-pc
This only happens if there is a asm.js-wasm-frame on top of the stack
trace, which was not covered by our tests so far. The regression test
create a stack overflow in asm.js code, triggering this case.

R=mstarzinger@chromium.org
CC=titzer@chromium.org, bradnelson@chromium.org
BUG=chromium:673241

Review-Url: https://codereview.chromium.org/2562333002
Cr-Commit-Position: refs/heads/master@{#41639}
2016-12-12 12:30:39 +00:00
bradnelson
7659728be2 [wasm][asm.js] Forbid function declaration replacing variable declaration.
BUG=673240
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2568773002
Cr-Commit-Position: refs/heads/master@{#41638}
2016-12-12 12:27:14 +00:00
danno
94fb89040b [turbofan] Fix source position integration with Linux perf
Review-Url: https://codereview.chromium.org/2558283002
Cr-Commit-Position: refs/heads/master@{#41637}
2016-12-12 12:25:56 +00:00
petermarshall
291ab70f4b [Turbofan] Add CallConstructWithSpread JSOperator.
Add the operator in preparation for actual perf work. The operator is replaced
by the same runtime call as before, during lowering.

The CallConstructWithSpreadParameters is a bit silly at the moment, but will
hold more once we add feedback.

BUG=v8:5659

Review-Url: https://codereview.chromium.org/2561103003
Cr-Commit-Position: refs/heads/master@{#41636}
2016-12-12 10:44:31 +00:00
neis
80567914c7 [parsing] Fix context allocation for async functions.
For generator-based functions (e.g. async functions) we force variables to be
context-allocated.  Due to a bug in the parser, this didn't always work
correctly.  For instance, in "async function foo([a]) { ... }" the variable "a"
could become stack-allocated due to context allocation being forced on the wrong
scope.

Besides fixing this, I'm also cleaning up some related code in the async parsing
setup and adding some guards.

R=adamk@chromium.org, littledan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2561093002
Cr-Commit-Position: refs/heads/master@{#41635}
2016-12-12 09:57:28 +00:00
jarin
d024df4d22 [turbofan] Fix representation change from bit to tagged pointer.
BUG=chromium:673244

Review-Url: https://codereview.chromium.org/2568053002
Cr-Commit-Position: refs/heads/master@{#41634}
2016-12-12 09:36:47 +00:00
petermarshall
375fc067b0 [Ignition] Fix incorrect arg evaluation order for some super calls.
The evaluation order of this argument was accidentally changed when the
special-case was added for super calls with a final spread argument.

Review-Url: https://codereview.chromium.org/2563423002
Cr-Commit-Position: refs/heads/master@{#41633}
2016-12-12 08:46:01 +00:00
jarin
522815a63b [turbofan] Stage escape analysis to continue getting some coverage.
Review-Url: https://codereview.chromium.org/2566933002
Cr-Commit-Position: refs/heads/master@{#41632}
2016-12-12 08:21:16 +00:00
franzih
9c9c945f18 [interpreter] Add check for max number of operands.
BUG=

Review-Url: https://codereview.chromium.org/2565093003
Cr-Commit-Position: refs/heads/master@{#41630}
2016-12-11 17:11:37 +00:00
bjaideep
33e651e513 PPC/s390: [x86] Also deal with holey arrays in the Apply builtin.
Port d4f01b8a65

Original Commit Message:

    Add fast paths for holey smi and object arrays to
    Function.prototype.apply, Reflect.apply and Reflect.construct.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2566793002
Cr-Commit-Position: refs/heads/master@{#41626}
2016-12-10 01:24:02 +00:00
ulan
a6976211d1 [heap] Relax condition for forced finalization of incremental marking.
Forcing finalization after reaching allocation limit regresses gc pause
time in benchmarks as we have to do a lot of non-incremental marking work.

This patch allows overshoot of the limit by some margin.

BUG=chromium:670675,chromium:671994
TBR=mlippautz@chromium.org

Review-Url: https://codereview.chromium.org/2554423005
Cr-Commit-Position: refs/heads/master@{#41625}
2016-12-09 16:23:06 +00:00
bradnelson
25189ffc36 [wasm][asm.js] Check that property keys are literals for imports.
BUG=672785
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2566683002
Cr-Commit-Position: refs/heads/master@{#41624}
2016-12-09 15:58:40 +00:00
mstarzinger
50c5ac57de [deoptimizer] Fix Deoptimizer::GetDeoptInfo for last entry.
This fixes the corner-case where the method in question failed to lookup
the very last deoptimization bailout without subsequent entries within
the relocation info. Also enable a test covering this.

R=tebbi@chromium.org
TEST=cctest/test-cpu-profiler/CollectDeoptEvents

Review-Url: https://codereview.chromium.org/2565733002
Cr-Commit-Position: refs/heads/master@{#41623}
2016-12-09 15:06:26 +00:00
bradnelson
89e10055e4 [wasm][asm.js] Allow true/false in int binary ops.
Because the parser optimizes !123 -> false,
we allow booleans in expressions (but not parameter annotations).
Allow this in asm-wasm-builder.
Turn on an early out case in asm-typer that is fine.

BUG=672784
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2561193003
Cr-Commit-Position: refs/heads/master@{#41622}
2016-12-09 15:01:30 +00:00
titzer
768acf683b [wasm] Only do SIMD lowering if SIMD is present in the graph.
R=bradnelson@chromium.org, ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2568493002
Cr-Commit-Position: refs/heads/master@{#41621}
2016-12-09 14:57:14 +00:00
yangguo
c9f8e23bbc Switch to std::is_fundamental<>.
Thanks for pointing this out to me!

R=clemensh@chromium.org
BUG=v8:5731

Review-Url: https://codereview.chromium.org/2565743002
Cr-Commit-Position: refs/heads/master@{#41620}
2016-12-09 14:54:32 +00:00
yangguo
75f5200508 [perf-prof] fix crash when logging.
Logging for --perf-prof is not GC safe. Now, we are going to
emit source position info for optimized code when we are
profiling, logging, or debugging, and under the same condition,
pre-compute the line ends array for line number computation.

R=tebbi@chromium.org
BUG=v8:5730

Review-Url: https://codereview.chromium.org/2562973002
Cr-Commit-Position: refs/heads/master@{#41619}
2016-12-09 14:30:38 +00:00
clemensh
0868b76bb1 [wasm] Remove declared but undefined methods
We should really think about having a static analysis to check for
such errors, and a bot executing it regularly.
This is not the first time I encounter declared functions that are
never defined.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2561333002
Cr-Commit-Position: refs/heads/master@{#41617}
2016-12-09 14:01:29 +00:00
mstarzinger
75128636f3 [wasm] Remove obsolete %IsNotAsmWasmCode predicate.
By now the predicate in question is an exact negation of %IsAsmWasmCode
as the name intuitively implies. The need for two separate test methods
no longer exists and one of the two can be removed.

R=bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/2562003002
Cr-Commit-Position: refs/heads/master@{#41616}
2016-12-09 11:56:05 +00:00
mstarzinger
9fde10ebed [wasm] Cleanup %IsAsmWasmCode testing predicate.
By now the compiler pipeline will not produce optimized code for asm.js
functions unless validation failed (even when --always-opt is enabled).
The related workaround in the testing predicate can be removed.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2549463002
Cr-Commit-Position: refs/heads/master@{#41614}
2016-12-09 11:30:10 +00:00
clemensh
890d28f361 [wasm] Fix location for error in asm.js ToNumber conversion
In the asm.js code translated to wasm, we call imported functions via a
WASM_TO_JS stub, which first calls the function and then calls ToNumber
on the return value. Exceptions can happen in both calls.
We were only ever reporting the location of the function call, whereas
asm.js code executed via turbofan reported the location of the type
coercion operator ("+" on "+foo()" or "|" on "foo()|0").

This CL implements the same behaviour for asm.js code translated to
wasm. The following is changed:
- the AsmWasmBuilder records the parent node when descending on a binary
  operator (also "+foo()" is represented by a binary operation).
- it stores not one location per call in the source position side
  table, but two (one for the call, one for the parent which does the
  type coercion).
- the wasm compiler annotates the source positions "0" and "1" to the
  two calls in the WASM_TO_JS wrapper (only if the module origin is
  asm.js).
- the StackFrame::State struct now also holds the callee_pc_address,
  which is set in ComputeCallerState. The WASM frame uses this
  information to determine whether the callee frame is WASM_TO_JS, and
  whether that frame is at the ToNumber conversion call.
- the same information is also stored in the FrameArray which is used
  to reconstruct the stack trace later.

R=titzer@chromium.org, bradnelson@chromium.org
CC=jgruber@chromium.org
BUG=v8:4203,v8:5724

Committed: https://crrev.com/94cd46b55e24fa2bb7b06b3da4d5ba7f029bc262
Review-Url: https://codereview.chromium.org/2555243002
Cr-Original-Commit-Position: refs/heads/master@{#41599}
Cr-Commit-Position: refs/heads/master@{#41613}
2016-12-09 10:30:19 +00:00
jarin
5465651800 [turbofan] Turn off escape analysis.
Too many crashes in Canary.

Review-Url: https://codereview.chromium.org/2554423004
Cr-Commit-Position: refs/heads/master@{#41612}
2016-12-09 10:15:17 +00:00
mstarzinger
5dcda5bb17 [parser] Ensure asm.js modules always allocate context.
The deserialization of the {Scope::asm_module} predicate relies on a
context being present for such modules. This ensures we always allocate
such a context, even in cases where no variables are allocated in it.

R=neis@chromium.org
TEST=cctest/test-parsing/AsmModuleFlag
BUG=v8:5653

Review-Url: https://codereview.chromium.org/2561103004
Cr-Commit-Position: refs/heads/master@{#41611}
2016-12-09 10:12:40 +00:00
mtrofin
dd10d9b100 [turbofan] regalloc: avoid more redundant intersections
Same idea as in the previous change. In addition, explicitly limited to non-aliased
registers, because the logic there needs to take account of, well, alias IDs. Left a
TODO for that part.

BUG=v8:5644

Review-Url: https://codereview.chromium.org/2565593002
Cr-Commit-Position: refs/heads/master@{#41609}
2016-12-09 06:59:44 +00:00
gsathya
d778b36f0c [promisehook] Add is_promisehook_enabled
This will be used in CSA to check if any promisehook is set.

-- Adds a is_promisehook_enabled_ field to the isolate and helper methods.
-- Adds this field to the ExternalReference table.
-- Adds a helper method to access this from CSA

Note -- this patch doesn't actually add the ability to attach the hook
yet.

BUG=v8:4643

Review-Url: https://codereview.chromium.org/2566483002
Cr-Commit-Position: refs/heads/master@{#41607}
2016-12-09 06:57:22 +00:00
zhengxing.li
007a18656e X87: Store OSR'd optimized code on the native context.
port 378b6b22fb (r41554)

  original commit message:
  Since we OSR code rarely, it makes sense to store it and look for it on the native context rather than the SharedFunctionInfo.
  This makes the OptimizedCodeMap data structure more space efficient, as it doesn't have to store an ast ID for the OSR entry point.

BUG=

Review-Url: https://codereview.chromium.org/2559083002
Cr-Commit-Position: refs/heads/master@{#41606}
2016-12-09 06:56:10 +00:00
neis
bb309a6998 [ast] Make --print-scopes indicate a scope's forced context allocation.
R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2552373004
Cr-Commit-Position: refs/heads/master@{#41605}
2016-12-08 23:04:45 +00:00
nverne
5d51583c0c Changes api logging for FunctionTemplate_NewWithCache.
https://codereview.chromium.org/2405213002/ introduced FunctionTemplate::NewWithCache in src/api.cc, but used LOG_API(..., NewWithFastHandler)

BUG=667237

Review-Url: https://codereview.chromium.org/2559643003
Cr-Commit-Position: refs/heads/master@{#41604}
2016-12-08 22:31:01 +00:00
gdeepti
0061089aa0 [wasm] Update WasmMemoryObject correctly when module memory is exported.
BUG=chromium:670683

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2548223002
Cr-Commit-Position: refs/heads/master@{#41603}
2016-12-08 20:30:54 +00:00
mtrofin
43e7d05125 [turbofan] regalloc: avoid redundant range intersections
When finding conflicts, there's no reason to keep looking for registers that are clearly
not going to be available to a candidate live range.

BUG=v8:5644

Review-Url: https://codereview.chromium.org/2559733002
Cr-Commit-Position: refs/heads/master@{#41602}
2016-12-08 19:16:30 +00:00
clemensh
d3d125417d Revert of [wasm] Fix location for error in asm.js ToNumber conversion (patchset #5 id:80001 of https://codereview.chromium.org/2555243002/ )
Reason for revert:
gc-stress failures

Original issue's description:
> [wasm] Fix location for error in asm.js ToNumber conversion
>
> In the asm.js code translated to wasm, we call imported functions via a
> WASM_TO_JS stub, which first calls the function and then calls ToNumber
> on the return value. Exceptions can happen in both calls.
> We were only ever reporting the location of the function call, whereas
> asm.js code executed via turbofan reported the location of the type
> coercion operator ("+" on "+foo()" or "|" on "foo()|0").
>
> This CL implements the same behaviour for asm.js code translated to
> wasm. The following is changed:
> - the AsmWasmBuilder records the parent node when descending on a binary
>   operator (also "+foo()" is represented by a binary operation).
> - it stores not one location per call in the source position side
>   table, but two (one for the call, one for the parent which does the
>   type coercion).
> - the wasm compiler annotates the source positions "0" and "1" to the
>   two calls in the WASM_TO_JS wrapper (only if the module origin is
>   asm.js).
> - during stack trace generation (in the StackTraceIterator), when we
>   move from the WASM_TO_JS frame to the WASM frame, we remember at which
>   call inside the WASM_TO_JS wrapper we are, and encode this information
>   in the generated caller state, used for the WASM frame.
> - the same information is also stored in the FrameArray which is used
>   to reconstruct the stack trace later.
>
> R=titzer@chromium.org, bradnelson@chromium.org
> CC=jgruber@chromium.org
> BUG=v8:4203,v8:5724
>
> Committed: https://crrev.com/94cd46b55e24fa2bb7b06b3da4d5ba7f029bc262
> Cr-Commit-Position: refs/heads/master@{#41599}

TBR=bradnelson@chromium.org,mstarzinger@chromium.org,titzer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4203,v8:5724

Review-Url: https://codereview.chromium.org/2563613003
Cr-Commit-Position: refs/heads/master@{#41601}
2016-12-08 17:36:14 +00:00
jochen
6595e74057 Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
we can use them as an index into an array, instead of using a
WeakFixedArray where we have to do a linear scan.

Hooking up liveedit is a bit more involved, see
https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
for an overview

BUG=v8:5589
R=verwaest@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2547483002
Cr-Commit-Position: refs/heads/master@{#41600}
2016-12-08 17:07:11 +00:00
clemensh
94cd46b55e [wasm] Fix location for error in asm.js ToNumber conversion
In the asm.js code translated to wasm, we call imported functions via a
WASM_TO_JS stub, which first calls the function and then calls ToNumber
on the return value. Exceptions can happen in both calls.
We were only ever reporting the location of the function call, whereas
asm.js code executed via turbofan reported the location of the type
coercion operator ("+" on "+foo()" or "|" on "foo()|0").

This CL implements the same behaviour for asm.js code translated to
wasm. The following is changed:
- the AsmWasmBuilder records the parent node when descending on a binary
  operator (also "+foo()" is represented by a binary operation).
- it stores not one location per call in the source position side
  table, but two (one for the call, one for the parent which does the
  type coercion).
- the wasm compiler annotates the source positions "0" and "1" to the
  two calls in the WASM_TO_JS wrapper (only if the module origin is
  asm.js).
- during stack trace generation (in the StackTraceIterator), when we
  move from the WASM_TO_JS frame to the WASM frame, we remember at which
  call inside the WASM_TO_JS wrapper we are, and encode this information
  in the generated caller state, used for the WASM frame.
- the same information is also stored in the FrameArray which is used
  to reconstruct the stack trace later.

R=titzer@chromium.org, bradnelson@chromium.org
CC=jgruber@chromium.org
BUG=v8:4203,v8:5724

Review-Url: https://codereview.chromium.org/2555243002
Cr-Commit-Position: refs/heads/master@{#41599}
2016-12-08 16:48:08 +00:00
franzih
987f63865d [TypeFeedbackVector] Delete unused DummySlot.
BUG=

Review-Url: https://codereview.chromium.org/2557333002
Cr-Commit-Position: refs/heads/master@{#41598}
2016-12-08 15:48:30 +00:00
marja
f36497d2c9 AstValueFactory: add a cache for one-character strings.
Lowercase 1 character strings occur frequently in minified code. Add a
cache for them, so that we don't need to compute the hash + do the hash
table lookup for each occurrence.

BUG=

Review-Url: https://codereview.chromium.org/2541353002
Cr-Commit-Position: refs/heads/master@{#41597}
2016-12-08 15:40:04 +00:00
Ilija.Pavlovic
e8f5adbed2 MIPS[64]: Fix MIPS: Improve Float(32|64)(Max|Min).
Fix 7a6f294ffe.

The first correction enables correct execution DoMathMinMax when two
input registers are the same register.
The second correction adds NOP instructions after branch instructions
in tests macro_float_minmaxf(32|64).

TEST=cctest/test-macro-assembler-mips[64]/macro_float_minmax_f32
     cctest/test-macro-assembler-mips[64]/macro_float_minmax_f64
     mjsunit/regress/math-min
BUG=

Review-Url: https://codereview.chromium.org/2556793003
Cr-Commit-Position: refs/heads/master@{#41596}
2016-12-08 14:57:07 +00:00
bradnelson
4a637abea3 [wasm][asm.js] Confirm literals are Numbers before using AsNumber, refactor.
We have been assuming in several places that ContainsDot or ToInt32 is
sufficient to check a value is a valid double or int.
Refactoring all the checks to one place and making them cope with booleans
or other unexpected types being present.

BUG=672044
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2555323003
Cr-Commit-Position: refs/heads/master@{#41595}
2016-12-08 14:55:03 +00:00
bradnelson
6deb99c6d9 [wasm][asm.js] Fail sooner if eval is present.
Use of eval in a function wraps it in a context.
This throws off assumptions not checked until later,
which is at odds with incremental validation and conversion.
Check that module parameters are PARAMETER location early.

BUG=672045
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2558813004
Cr-Commit-Position: refs/heads/master@{#41594}
2016-12-08 14:44:00 +00:00
ulan
ee2d502735 [heap] Prefer mark-compact over scavenger if incremental marking
needs finalization and allocation limit is reached.

BUG=

Review-Url: https://codereview.chromium.org/2561103002
Cr-Commit-Position: refs/heads/master@{#41593}
2016-12-08 14:42:52 +00:00
hpayer
9c191a0cda [heap] Use callbacks to dispatch store buffer operations.
BUG=chromium:648568, chromium:669920

Review-Url: https://codereview.chromium.org/2548213004
Cr-Commit-Position: refs/heads/master@{#41592}
2016-12-08 14:19:10 +00:00
jyan
dcbd3758d9 s390: Remove RSubI on s390 and optimize ConstantI
https://github.com/ibmruntimes/v8/issues/27

R=joransiu@ca.ibm.com, bjaideep@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2561673002
Cr-Commit-Position: refs/heads/master@{#41591}
2016-12-08 14:03:14 +00:00
epertoso
2547ec8729 [turbofan] Inlining of API functions.
BUG=

Review-Url: https://codereview.chromium.org/2555223002
Cr-Commit-Position: refs/heads/master@{#41590}
2016-12-08 13:59:45 +00:00
leszeks
7b64e8d102 [ignition/turbofan] Wrap bytecode liveness bitvectors
Wrap the liveness bitvectors from the bytecode liveness analysis with a
helper class, which makes the register/accumulator bits explicit.

Review-Url: https://codereview.chromium.org/2552723004
Cr-Commit-Position: refs/heads/master@{#41589}
2016-12-08 12:48:05 +00:00
yangguo
98b563ebf3 [serializer] include global proxy in additional context snapshots.
Aside from the default snapshot, there is no need for additional context
snapshots to have the ability to replace the global proxy and global object
after deserialization. Changes include:
 - Changes to the API to better distinguish default context snapshot from
   additional context snapshots.
 - Disallow global handles when creating snapshots.
 - Allow extensions when creating snapshots.

This solves the issue of not being able to having accessors and interceptors on
the global object of contexts to be serialized.

R=jochen@chromium.org, peria@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2557743003
Cr-Commit-Position: refs/heads/master@{#41588}
2016-12-08 12:45:05 +00:00
yangguo
1416c6c9ab [serializer] wipe simulator redirects for accessor infos.
R=jochen@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2561783002
Cr-Commit-Position: refs/heads/master@{#41587}
2016-12-08 12:14:05 +00:00
ishell
c522c6baa5 [turbofan] Further adapting machine graph verifier to code stubs.
All accessor IC stubs now pass the verification.

BUG=

Review-Url: https://codereview.chromium.org/2556123002
Cr-Commit-Position: refs/heads/master@{#41585}
2016-12-08 11:31:34 +00:00
mvstanton
044b2d1bd8 Reland Store OSR'd optimized code on the native context.
The patch was reverted due to a bug - we failed to evict OSR-optimized
code in the case where the SharedFunctionInfo OptimizedCodeMap was
empty/cleared.

Since we OSR code rarely, it makes sense to store it and look for it on the native context rather than the SharedFunctionInfo. This makes the OptimizedCodeMap data structure more space efficient, as it doesn't have to store an ast ID for the OSR entry point.

Review-Url: https://codereview.chromium.org/2561083002
Cr-Commit-Position: refs/heads/master@{#41584}
2016-12-08 11:13:59 +00:00