Commit Graph

6823 Commits

Author SHA1 Message Date
mvstanton
aea3ce3df3 [TypeFeedbackVector] Root feedback vectors at function literal site.
TypeFeedbackVectors are strongly rooted by a closure. However, in modern
JavaScript closures are created and abandoned more freely. An important
closure may not be present in the root-set at time of garbage collection,
even though we've cached optimized code and use it regularly. For
example, consider leaf functions in an event dispatching system. They may
well be "hot," but tragically non-present when we collect the heap.

Until now, we've relied on a weak root to cache the feedback vector in
this case. Since there is no way to signal intent or relative importance,
this weak root is as susceptible to clearing as any other weak root at
garbage collection time.

Meanwhile, the feedback vector has become more important. All of our
ICs store their data there. Literal and regex boilerplates are stored there.
If we lose the vector, then we not only lose optimized code built from
it, we also lose the very feedback which allowed us to create that optimized
code. Therefore it's vital to express that dependency through the root
set.

This CL does this by creating a strong link to a feedback
vector at the instantiation site of the function closure.
This instantiation site is in the code and feedback vector
of the outer closure.

BUG=v8:5456

Review-Url: https://codereview.chromium.org/2674593003
Cr-Commit-Position: refs/heads/master@{#42953}
2017-02-06 10:18:05 +00:00
jgruber
9576d08c92 [string] Don't tail-call into runtime with adaptor frames
TailCallRuntime currently does not seem to handle adaptor frames
correctly.

BUG=chromium:688690

Review-Url: https://codereview.chromium.org/2675133003
Cr-Commit-Position: refs/heads/master@{#42950}
2017-02-06 09:47:55 +00:00
bmeurer
c21d1281d9 [turbofan] Properly ensure that deoptimization is enabled.
We cannot optimize global proxy access unless deoptimization is enabled.

BUG=chromium:687990
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2675793002
Cr-Commit-Position: refs/heads/master@{#42928}
2017-02-03 14:06:06 +00:00
danno
5205b9db06 [builtins] TurboFan version of Array.prototype.forEach including fast path for FAST_ELEMENTS
BUG=v8:5269, v8:1956
LOG=N
R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2663033003
Cr-Commit-Position: refs/heads/master@{#42926}
2017-02-03 13:16:19 +00:00
yangguo
b963cb2351 Add test case for built-in objects' property mode.
R=jgruber@chromium.org
BUG=v8:5902

Review-Url: https://codereview.chromium.org/2669423002
Cr-Commit-Position: refs/heads/master@{#42922}
2017-02-03 12:19:21 +00:00
ahaas
f3ae77ffe9 [wasm] Do not fold f32-to-f64 and f64-to-f32 conversions.
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2669753002
Cr-Commit-Position: refs/heads/master@{#42920}
2017-02-03 12:05:29 +00:00
tebbi
994d906ec3 [turbofan] fix wrong materialization of arguments object
R=jarin@chromium.org

BUG=

Review-Url: https://codereview.chromium.org/2664423003
Cr-Commit-Position: refs/heads/master@{#42916}
2017-02-03 09:25:16 +00:00
titzer
a9b8a56758 [wasm] Implement polymorphic checking, matching the reference interpreter.
R=rossberg@chromium.org, bradnelson@chromium.org
BUG=chromium:682659

Review-Url: https://codereview.chromium.org/2670673002
Cr-Commit-Position: refs/heads/master@{#42904}
2017-02-02 23:06:21 +00:00
ahaas
1b116567dd [wasm] Remove -0 -x = -x folding because of signalling NaNs.
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2662363003
Cr-Commit-Position: refs/heads/master@{#42902}
2017-02-02 22:34:52 +00:00
mtrofin
b0e58a9cee [turbofan] more regalloc fixes
BUG=v8:5911

Review-Url: https://codereview.chromium.org/2667963004
Cr-Commit-Position: refs/heads/master@{#42900}
2017-02-02 22:33:40 +00:00
yangguo
8ae463d736 [debugger] remove mirror cache and v8::Debug::GetMirror.
R=jgruber@chromium.org
BUG=v8:5530

Review-Url: https://codereview.chromium.org/2670823002
Cr-Commit-Position: refs/heads/master@{#42893}
2017-02-02 14:22:15 +00:00
jgruber
cb19ecd610 [string] Migrate String.prototype.{split,replace} to TF
BUG=

Review-Url: https://codereview.chromium.org/2663803002
Cr-Original-Commit-Position: refs/heads/master@{#42881}
Committed: 65ad1e35d9
Review-Url: https://codereview.chromium.org/2663803002
Cr-Commit-Position: refs/heads/master@{#42883}
2017-02-02 11:31:01 +00:00
machenbach
2517b79cd6 Revert of [string] Migrate String.prototype.{split,replace} to TF (patchset #12 id:220001 of https://codereview.chromium.org/2663803002/ )
Reason for revert:
Breaks win64 debug:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/14967

Original issue's description:
> [string] Migrate String.prototype.{split,replace} to TF
>
> BUG=
>
> Review-Url: https://codereview.chromium.org/2663803002
> Cr-Commit-Position: refs/heads/master@{#42881}
> Committed: 65ad1e35d9

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

Review-Url: https://codereview.chromium.org/2671673003
Cr-Commit-Position: refs/heads/master@{#42882}
2017-02-02 11:10:26 +00:00
jgruber
65ad1e35d9 [string] Migrate String.prototype.{split,replace} to TF
BUG=

Review-Url: https://codereview.chromium.org/2663803002
Cr-Commit-Position: refs/heads/master@{#42881}
2017-02-02 10:09:10 +00:00
binji
aa3422b671 [SAB] Fix crash in Atomics.wake w/ infinite count.
Also if the count is not specified, it should wake all waiters.

BUG=v8:4777

Review-Url: https://codereview.chromium.org/2659083004
Cr-Commit-Position: refs/heads/master@{#42871}
2017-02-01 21:47:22 +00:00
neis
5020db7f9c [promises] Fix .arguments on builtin function.
Using .caller, one can get access to the internal function that invokes the
handler passed to Promise.prototype.then.  This internal function is a TF
builtin that was set up as non-native and without an argument adaptor.  As a
consequence of this, when accessing .arguments on it, the frame-walking logic in
the .arguments accessor thinks the number of arguments is -1 and we try to
allocate an array of size -1.

This CL marks the builtin function as native (making its .arguments be null),
along with a few others that may have been incorrect in the same way.

BUG=chromium:682349

Review-Url: https://codereview.chromium.org/2672453002
Cr-Commit-Position: refs/heads/master@{#42855}
2017-02-01 14:06:38 +00:00
bmeurer
58611d0115 [tools] Fix RegExp for ticksprocessor.
Properly attribute all builtins, bytecode handlers and other stubs to
the calling function unless --separate-ic is passed.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2668953002
Cr-Original-Commit-Position: refs/heads/master@{#42849}
Committed: 42011d2997
Review-Url: https://codereview.chromium.org/2668953002
Cr-Commit-Position: refs/heads/master@{#42852}
2017-02-01 12:32:53 +00:00
neis
68a8cb532e [turbofan] Mark loads of a module (from a module context) immutable.
This is sound because the slot never changes, and it enables optimization by
JSContextSpecialization.

R=mstarzinger@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2662093004
Cr-Commit-Position: refs/heads/master@{#42848}
2017-02-01 10:51:20 +00:00
neis
ed3d888df6 [test] Remove bogus --crankshaft flag from a modules test.
The function being tested is forced to go through Turbofan anyway (since it references a module variable).

Adding --turbo explicitly just to make a check happy.

BUG=

Review-Url: https://codereview.chromium.org/2664393003
Cr-Commit-Position: refs/heads/master@{#42844}
2017-02-01 10:36:09 +00:00
jgruber
d52ec9e6cf [regexp] Store named captures on the regexp result
This implements storing named captures on the regexp result object.
For instance, /(?<a>.)/u.exec("b") will return a result such that:

result.group.a  // "b"

https://tc39.github.io/proposal-regexp-named-groups/

BUG=v8:5437

Review-Url: https://codereview.chromium.org/2630233003
Cr-Original-Original-Original-Commit-Position: refs/heads/master@{#42532}
Committed: 70000946eb
Review-Url: https://codereview.chromium.org/2630233003
Cr-Original-Original-Commit-Position: refs/heads/master@{#42570}
Committed: ee94fa11ed
Review-Url: https://codereview.chromium.org/2630233003
Cr-Original-Commit-Position: refs/heads/master@{#42676}
Committed: 8bf52534f6
Review-Url: https://codereview.chromium.org/2630233003
Cr-Commit-Position: refs/heads/master@{#42838}
2017-02-01 08:54:38 +00:00
jwolfe
ea96fdec68 Enable --harmony-trailing-commas
Also updated some tests due to the change. The general pattern is when a
trailing comma is expected to cause a SyntaxError, an additional comma was
added.

BUG=v8:5051
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2638513002
Cr-Commit-Position: refs/heads/master@{#42826}
2017-01-31 23:30:57 +00:00
machenbach
c2e4eb29cc Revert of [wasm] include JS conformance tests in Wasm mjsunit tests (patchset #5 id:80001 of https://codereview.chromium.org/2660903003/ )
Reason for revert:
http://crbug.com/687279

Original issue's description:
> [wasm] include JS conformance tests in Wasm mjsunit tests
>
> BUG=
>
> Review-Url: https://codereview.chromium.org/2660903003
> Cr-Commit-Position: refs/heads/master@{#42821}
> Committed: eb9b5edffb

TBR=mtrofin@chromium.org,titzer@chromium.org,bradnelson@chromium.org,eholk@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2663063005
Cr-Commit-Position: refs/heads/master@{#42823}
2017-01-31 19:59:30 +00:00
binji
bfcc65d675 [SAB] Handle non-numerics in Atomics.isLockFree
BUG=v8:4741

Review-Url: https://codereview.chromium.org/2658143003
Cr-Commit-Position: refs/heads/master@{#42822}
2017-01-31 19:33:46 +00:00
eholk
eb9b5edffb [wasm] include JS conformance tests in Wasm mjsunit tests
BUG=

Review-Url: https://codereview.chromium.org/2660903003
Cr-Commit-Position: refs/heads/master@{#42821}
2017-01-31 19:28:12 +00:00
bmeurer
64eae6eff2 [turbofan] Remove over-restrictive DCHECKs.
The KeyedStoreMode that we get out of the FeedbackNexus doesn't
necessarily need to apply when we have "static knowledge" about
the receiver, i.e. when the receiver is a known JSTypedArray, but
the KEYED_STORE_IC has seen only JSArray instances so far. The
DCHECK was too restrictive in this case, since we can just ignore
the KEYED_STORE_IC mode (like we ignore the maps).

BUG=chromium:685050
R=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2668643002
Cr-Commit-Position: refs/heads/master@{#42810}
2017-01-31 09:00:55 +00:00
bmeurer
68ae57ce1e [turbofan] Introduce ChangeTaggedToTaggedSigned operator.
We were missing a case for Tagged->TaggedSigned conversions when the
input type is known to be Type::SignedSmall.

BUG=chromium:687029
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2666863002
Cr-Commit-Position: refs/heads/master@{#42809}
2017-01-31 08:55:56 +00:00
bmeurer
b8df954993 [turbofan] Don't eliminate unused CheckFloat64Hole.
We cannot eliminate unused CheckFloat64Hole nodes, since loading from a
holey array can have side-effects, i.e. triggering getters in the
prototype chain.

R=mvstanton@chromium.org
BUG=chromium:686737

Review-Url: https://codereview.chromium.org/2665123002
Cr-Commit-Position: refs/heads/master@{#42806}
2017-01-31 08:30:55 +00:00
gdeepti
bc57081795 [wasm] Enable grow_memory tests on gc_stress
R=bradnelson@chromium.org, ahaas@chromium.org

BUG=5553

Review-Url: https://codereview.chromium.org/2662153002
Cr-Commit-Position: refs/heads/master@{#42801}
2017-01-31 02:12:45 +00:00
gdeepti
3901e247b3 [wasm] Enable wasm imported memory tests on gc_stress
Issues with instance wrapper allocation and JS Api errata have been fixed over the last few weeks, test in the bug no longer fails - enabling tests for imported memory.

BUG=5683

R=bradnelson@chromium.org, ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2666763002
Cr-Commit-Position: refs/heads/master@{#42795}
2017-01-30 23:48:52 +00:00
jkummerow
7438304229 ThinStrings: fix Factory::NewProperSubString
BUG=chromium:685504

Review-Url: https://codereview.chromium.org/2660823002
Cr-Commit-Position: refs/heads/master@{#42783}
2017-01-30 18:24:16 +00:00
jkummerow
9ea3e56bd9 ThinStrings: fix CodeStubAssembler::SubString
BUG=chromium:685965

Review-Url: https://codereview.chromium.org/2660123002
Cr-Commit-Position: refs/heads/master@{#42782}
2017-01-30 18:17:52 +00:00
gdeepti
930142e877 [wasm] Update table bounds when module is instantiated with a table import
When WebAssembly.Table initial size is greater than the declared initial size, table size references should be updated on instantiate for functions to be called at indices greater than the declared initial size.

R=bradnelson@chromium.org, titzer@chromium.org

Review-Url: https://codereview.chromium.org/2661773002
Cr-Commit-Position: refs/heads/master@{#42781}
2017-01-30 18:10:32 +00:00
jochen
1fc5ca85fc Fix --noopt to not optimize
BUG=v8:5904,chromium:639217
R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2660103002
Cr-Commit-Position: refs/heads/master@{#42777}
2017-01-30 14:41:29 +00:00
tebbi
8b6fa9d519 [turbofan] escape analysis reducer no longer confused by TypeGuards it introduced itself
R=bmeurer@chromium.org

BUG=chromium:682570

Review-Url: https://codereview.chromium.org/2664683003
Cr-Commit-Position: refs/heads/master@{#42769}
2017-01-30 11:51:22 +00:00
bmeurer
b912851650 [turbofan] Don't constant-fold ACCESSOR properties.
R=ishell@chromium.org
BUG=chromium:686102

Review-Url: https://codereview.chromium.org/2662793002
Cr-Commit-Position: refs/heads/master@{#42767}
2017-01-30 11:15:02 +00:00
petermarshall
409d018005 [turbofan] Reduce CallConstructWithSpread where iteration is not observable.
Where the arguments have already been inlined, we can replace these calls with a
direct call to construct. We have to make sure that the iteration over the arguments is not observable.

BUG=v8:5895

Review-Url: https://codereview.chromium.org/2659623002
Cr-Commit-Position: refs/heads/master@{#42765}
2017-01-30 10:29:05 +00:00
neis
5ed733737e [modules] Update a test and status file to reflect recent spec changes.
R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2657773006
Cr-Commit-Position: refs/heads/master@{#42763}
2017-01-30 09:41:15 +00:00
machenbach
a8638789c2 [test] Skip flaky test
BUG=v8:5906
NOTRY=true
TBR=binji@chromium.org

Review-Url: https://codereview.chromium.org/2659273002
Cr-Commit-Position: refs/heads/master@{#42759}
2017-01-29 12:52:05 +00:00
bradnelson
437735ed34 [wasm][asm.js] Make asm.js->wasm return a regular object.
Return a regular JSObject in the asm.js -> wasm case.

BUG=v8:5877
R=mtrofin@chromium.org,aseemgarg@chromium.org,titzer@chromium.org

Review-Url: https://codereview.chromium.org/2664493002
Cr-Commit-Position: refs/heads/master@{#42757}
2017-01-28 23:15:58 +00:00
jarin
6cd2d4ba41 [turbofan] Only use Tagged machine representation for tagged state values.
This avoids using kTaggedSigned and kTaggedPointer because the
semantic information of those type could be invalid in unreachable
code.

For example, SmiCheck(0.1) has representation TaggedSigned, but it is
later compiled to DeoptimizeUnless(ObjectIsSmi(0.1)) with the constant
0.1 directly connected to the uses. If the use is state-values, which
recorded the TaggedSigned representation of CheckSmi, the code
generator will be confused because it will see constant 0.1 that
claims to be TaggedSigned value.

BUG=chromium:675704

Review-Url: https://codereview.chromium.org/2656243004
Cr-Commit-Position: refs/heads/master@{#42756}
2017-01-28 17:25:46 +00:00
binji
966355585b [d8] Use ValueSerializer for postMessage (instead of ad-hoc serializer)
Review-Url: https://codereview.chromium.org/2643723010
Cr-Commit-Position: refs/heads/master@{#42749}
2017-01-27 20:15:37 +00:00
ivica.bogosavljevic
2f728bd9a0 MIPS[64]: Prevent multiple instances of tests that require a lot of memory
Some tests require a lot of memory and they fail on buildbots if they run
in parallel with other tests of the same kind.
We try to limit this by disabling multiple vairants of the same tests,
assuming this would stop the failures in most of the cases.

BUG=

Review-Url: https://codereview.chromium.org/2653603002
Cr-Commit-Position: refs/heads/master@{#42741}
2017-01-27 14:15:59 +00:00
tebbi
c1a43ff996 [turbofan] No longer ignore FrameState input to Call
R=mstarzinger@chromium.org

BUG=chromium:683566

Review-Url: https://codereview.chromium.org/2653953010
Cr-Commit-Position: refs/heads/master@{#42737}
2017-01-27 12:40:05 +00:00
bmeurer
b975441e77 [turbofan] Introduce dedicated StringIndexOf operator.
The StringIndexOf operation is pure on the JS level, but the actual stub
call must be in the effect chain later so that the Scheduler doesn't
place it inside some allocation region (The %StringIndexOf runtime
function may trigger a GC for string flattening).

BUG=chromium:685580
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2657243002
Cr-Commit-Position: refs/heads/master@{#42736}
2017-01-27 12:02:42 +00:00
ishell
c5644146bc [tests] Fix assertUnoptimized() when --deopt-every-n-times flag is used.
Basically, with --deopt-every-n-times flag all bets are off since
the functions can be optimized and deoptimized at any time.

BUG=v8:5890

Review-Url: https://codereview.chromium.org/2655263004
Cr-Commit-Position: refs/heads/master@{#42735}
2017-01-27 11:58:47 +00:00
ishell
4a5446fb2b [tests] Make assertOptimized()/assertUnoptimized() great again.
The mentioned asserts did not work properly with interpreted and turbofanned functions.

To fix this issue %GetOptimizationStatus() now returns a set of flags instead of a single value.

This CL also adds more helper functions to mjsunit, like isNeverOptimize(), isAlwaysOptimize(),
isOptimized(fun), etc.

BUG=v8:5890

Review-Url: https://codereview.chromium.org/2654733004
Cr-Original-Commit-Position: refs/heads/master@{#42703}
Committed: d1ddec7857
Review-Url: https://codereview.chromium.org/2654733004
Cr-Commit-Position: refs/heads/master@{#42731}
2017-01-27 10:13:53 +00:00
yangguo
3f47c63ded [liveedit] reimplement frame restarting.
Previously, when restarting a frame, we would rewrite all frames
between the debugger activation and the frame to restart to squash
them, and replace the return address with that of a builtin to
leave that rewritten frame, and restart the function by calling it.

We now simply remember the frame to drop to, and upon returning
from the debugger, we check whether to drop the frame, load the
new FP, and restart the function.

R=jgruber@chromium.org, mstarzinger@chromium.org
BUG=v8:5587

Review-Url: https://codereview.chromium.org/2636913002
Cr-Commit-Position: refs/heads/master@{#42725}
2017-01-27 07:31:03 +00:00
gdeepti
e6d13999fd [wasm] Memory buffer should be detached after Memory.Grow
Memory.Grow should detach the ArrayBuffer associated with the Mem object after Grow. Currently, when guard pages are enabled protection is changed to make more of the buffer accessible. This does not work for when the buffer should be detached after grow, because the memory object has a reference to the same buffer befor/after grow.

R=titzer@chromium.org, eholk@chromium.org

Review-Url: https://codereview.chromium.org/2653183003
Cr-Commit-Position: refs/heads/master@{#42717}
2017-01-26 22:15:59 +00:00
bmeurer
7be3b4c90f [turbofan] Don't try to optimize tail calls to .apply.
BUG=chromium:685634
R=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2658853002
Cr-Commit-Position: refs/heads/master@{#42713}
2017-01-26 20:52:21 +00:00
mtrofin
70fdac9a64 [turbofan] Correct regalloc blocked register behavior
This corrects the case when we need to allocate a
blocked register, but the blockage happens after a
use as an instruction input, and there's no place to
split before that.

BUG=v8:5888

Review-Url: https://codereview.chromium.org/2652153005
Cr-Original-Commit-Position: refs/heads/master@{#42706}
Committed: ca779b29a6
Review-Url: https://codereview.chromium.org/2652153005
Cr-Commit-Position: refs/heads/master@{#42710}
2017-01-26 17:47:54 +00:00