Commit Graph

30105 Commits

Author SHA1 Message Date
jkummerow
c491489693 Reland of [cleanup] Refactor builtins-number.cc
Introducing a TF_BUILTIN macro that wraps CodeStubAssembler usage
into a convenient interface (using a subclass under the hood).

No changes since previous attempt; this was only reverted because it blocked another revert.
Original review: https://codereview.chromium.org/2517833005/

TBR=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2529373002
Cr-Commit-Position: refs/heads/master@{#41315}
2016-11-28 12:46:29 +00:00
jarin
72b5a0d40e [deoptimizer] Use the correct function for handler lookup for bytecode.
BUG=chromium:668760

Review-Url: https://codereview.chromium.org/2530403002
Cr-Commit-Position: refs/heads/master@{#41314}
2016-11-28 12:45:29 +00:00
petermarshall
0a1dcadd05 [fullcodegen] Remove deprecated support for super constructor calls.
All super constructor calls go through the ignition + turbofan pipeline, so this is dead code.

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2525233003
Cr-Commit-Position: refs/heads/master@{#41313}
2016-11-28 12:24:08 +00:00
Jochen Eisinger
6c057947de Fix compilation in parser.cc
R=verwaest@chromium.org
TBR=marja@chromium.org, verwaest@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#41310}
2016-11-28 11:47:50 +00:00
jochen
cfebe6034c Assign unique IDs to FunctionLiterals
They're supposed to be stable across several parse passes, so we'll also
store them in the associated SharedFunctionInfos

To achieve this, the PreParser and Parser need to generated the same number of
FunctionLiterals. To achieve this, we teach the PreParser about desuggaring of
class literals.

For regular functions, the function IDs are assigned in the order they occur in
the source. For arrow functions, however, we only know that it's an arrow function
after parsing the parameter list, and so the ID assigned to the arrow function is
larger than the IDs assigned to functions defined in the parameter list. This
implies that we have to reset the function ID counter to before the parameter list
when re-parsing an arrow function. To be able to do this, we store the number of
function literals found in the parameter list of arrow functions as well.

BUG=v8:5589

Review-Url: https://codereview.chromium.org/2481163002
Cr-Commit-Position: refs/heads/master@{#41309}
2016-11-28 11:40:53 +00:00
marja
b31cbbd443 Parser: store parameters in a ThreadedList instead of ZoneList.
ThreadedList is more memory-efficient than ZoneList. This also enables
us to use ThreadedList when making Preparser track parameters (upcoming
work).

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2531593002
Cr-Commit-Position: refs/heads/master@{#41307}
2016-11-28 11:24:10 +00:00
jkummerow
0f48dc7cce Reland of [cleanup] CodeStubAssembler: s/compiler::Node/Node/
Reducing visual clutter.

No changes since previous attempt; this was only reverted because it blocked another revert.
Original review: https://codereview.chromium.org/2519093002/

TBR=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2532063002
Cr-Commit-Position: refs/heads/master@{#41306}
2016-11-28 11:22:20 +00:00
rmcilroy
195754cf31 [TurboFan] Always enable deoptimization for BytecodeGraphBuilder.
The BytecodeGraphBuilder assumes that deoptimization is always enabled,
so always enable it when compiling from bytecode.

BUG=chromium:668654

Review-Url: https://codereview.chromium.org/2531683004
Cr-Commit-Position: refs/heads/master@{#41303}
2016-11-28 10:29:52 +00:00
cbruni
a09e5eda26 [runtime] Add missing @@IsConcatSpreadable check for FAST_DOUBLE_ELEMENTS
A missing @@IsConcatSpreadable check caused the fast path inside the slow path
to be incorrect and follow the default concat strategy when the arguments
arrays contain only doubles.

BUG=chromium:668414

Review-Url: https://codereview.chromium.org/2527173002
Cr-Commit-Position: refs/heads/master@{#41301}
2016-11-28 10:06:17 +00:00
bmeurer
65fd9c4306 [fullcodegen] Remove deprecated support for new.target and rest parameters.
This code is no longer used by full-codegen since all functions which
use new.target, rest parameters or the internal this function binding
now grow through Ignition first, and never tier up to fullcodegen.

BUG=v8:5657
R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2528293002
Cr-Commit-Position: refs/heads/master@{#41298}
2016-11-28 08:59:51 +00:00
bmeurer
ffdf474956 [turbofan] Add more typing rules for Array.prototype builtins.
For a couple of those Array builtins we can specify a useful type that
will help us to eliminate a couple of checks on their outputs.

R=yangguo@chromium.org
BUG=v8:5267

Review-Url: https://codereview.chromium.org/2529233002
Cr-Commit-Position: refs/heads/master@{#41295}
2016-11-28 08:01:26 +00:00
bmeurer
ae14b6b721 [turbofan] Assign types to remaining builtins on String.prototype.
Assign types to the remaining builtins on the String.prototype where we
know a meaningful type, i.e. where the type is not dependent on some
callable function that is pass or loaded.

BUG=v8:5267
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2532463002
Cr-Commit-Position: refs/heads/master@{#41294}
2016-11-27 19:20:39 +00:00
rmcilroy
f666bff8d6 [asm] Don't try to always-opt code which has AsmWasm data.
If code has AsmWasm data we shouldn't try to optimize the JS as well, since
it will instead be optimized using the WASM data.

BUG=

Review-Url: https://codereview.chromium.org/2534463003
Cr-Commit-Position: refs/heads/master@{#41293}
2016-11-26 04:47:01 +00:00
bbudge
ef3f125d37 [Turbofan] Add ARM support for simd128 moves and swaps.
- Adds vmov, vswp instructions for QwNeonRegisters.
- Refactors existing vswp implementation, moves non-Neon adaption to
MacroAssembler.
- Adds simd128 support to CodeGenerator AssembleMove, AssembleSwap.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2523933002
Cr-Commit-Position: refs/heads/master@{#41291}
2016-11-25 19:37:04 +00:00
hpayer
2d3d66ab64 [heap] Use safe way to obtain page in PagedSpace::Contains(Address addr).
Review-Url: https://codereview.chromium.org/2531873003
Cr-Commit-Position: refs/heads/master@{#41290}
2016-11-25 17:08:14 +00:00
mlippautz
ecea1d1911 [heap] StaticNewSpaceVisitor: Add UNREACHABLE handlers for pre-tenured types
BUG=

Review-Url: https://codereview.chromium.org/2529113002
Cr-Commit-Position: refs/heads/master@{#41289}
2016-11-25 16:14:21 +00:00
mlippautz
0e74286133 [heap] Replace NewSpacePageRange with PageRange
Trivial parts of the reverted CL:
  https://codereview.chromium.org/2516303006/

BUG=

Review-Url: https://codereview.chromium.org/2531093002
Cr-Commit-Position: refs/heads/master@{#41288}
2016-11-25 15:44:32 +00:00
hpayer
618e8bef70 [heap] Remove unused PagedSpace::FindObject().
Review-Url: https://codereview.chromium.org/2531073002
Cr-Commit-Position: refs/heads/master@{#41287}
2016-11-25 15:18:00 +00:00
marija.antic
daedefd3fc MIPS64: Port "Reland of "MIPS: Optimize load/store with large offset"".
Port 961a45da69

BUG=

Review-Url: https://codereview.chromium.org/2505923002
Cr-Commit-Position: refs/heads/master@{#41284}
2016-11-25 09:12:29 +00:00
yangguo
d5ada19ce7 [debug] mark more unused debug API as deprecated.
R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2531543002
Cr-Commit-Position: refs/heads/master@{#41283}
2016-11-25 09:11:04 +00:00
rmcilroy
abf4c01d43 [fullcodegen] Remove deprecated support for class literals.
This code is no longer used in full-codegen or ast-graph-builder since all
functions which have class literals go through Ignition first.

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2534463002
Cr-Commit-Position: refs/heads/master@{#41282}
2016-11-25 08:50:18 +00:00
jgruber
485067c66b [regexp] Add file-level typedefs to builtins-regexp.cc
This removes lots of boilerplate typedefs, with the caveat of renaming
CSA::Label and Variable to CLabel and CVariable within builtins-regexp.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2524363002
Cr-Commit-Position: refs/heads/master@{#41281}
2016-11-25 08:31:17 +00:00
yangguo
b6d2bacd66 Fix Number.prototype.toString with non-default radix wrt modulo.
TBR=tebbi@chromium.org
BUG=chromium:668510

Review-Url: https://codereview.chromium.org/2526223003
Cr-Commit-Position: refs/heads/master@{#41280}
2016-11-25 07:46:40 +00:00
mstarzinger
309b77f00d [fullcodegen] Remove exception handling support.
This removes support for try-catch as well as try-finally constructs
from the {FullCodeGenerator}. Consequently optimized code containing
such constructs must use the {BytecodeGraphBuilder} and can no longer
use the {AstGraphBuilder} for graph building.

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

Review-Url: https://codereview.chromium.org/2521233002
Cr-Commit-Position: refs/heads/master@{#41279}
2016-11-25 07:26:20 +00:00
clemensh
29ee62443d Revert of [base] Pass scalar arguments by value in CHECK/DCHECK (patchset #3 id:40001 of https://codereview.chromium.org/2524093002/ )
Reason for revert:
Seems to cause compile errors on Android. Will investigate on Monday.

Original issue's description:
> [base] Pass scalar arguments by value in CHECK/DCHECK
>
> This not only potentially improves performance, but also avoids weird
> linker errors, like the one below, where I used Smi::kMinValue in a
> DCHECK_EQ.
>
> > [421/649] LINK ./mksnapshot
> > FAILED: mksnapshot
> > src/base/logging.h|178| error: undefined reference to
>   'v8::internal::Smi::kMinValue'
>
> R=bmeurer@chromium.org, ishell@chromium.org
>
> Committed: https://crrev.com/76723502528c5af003fdffc3520632ea2a13fef3
> Cr-Commit-Position: refs/heads/master@{#41273}

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

Review-Url: https://codereview.chromium.org/2527883004
Cr-Commit-Position: refs/heads/master@{#41278}
2016-11-24 23:03:16 +00:00
clemensh
0406620c6c Revert of [base] Define CHECK comparison for signed vs. unsigned (patchset #5 id:80001 of https://codereview.chromium.org/2526783002/ )
Reason for revert:
Need to revert previous CL because of Android compile error, and this one depends in it.

Original issue's description:
> [base] Define CHECK comparison for signed vs. unsigned
>
> The current CHECK/DCHECK implementation fails statically if a signed
> value is compared against an unsigned value. The common solution is to
> cast on each caller, which is tedious and error-prone (might hide bugs).
> This CL implements signed vs. unsigned comparisons by executing up to
> two comparisons. For example, if i is int32_t and u is uint_32_t, a
> DCHECK_LE(i, u) would create the check
> i <= 0 || static_cast<uint32_t>(i) <= u.
> For checks against constants, at least one of the checks can be removed
> by compiler optimizations.
>
> The tradeoff we have to make is to sometimes silently execute an
> additional comparison. And we increase code complexity of course, even
> though the usage is just as easy (or even easier) as before.
>
> The compile time impact seems to be minimal:
> I ran 3 full compilations for Optdebug on my local machine, one time on
> the current ToT, one time with this CL plus http://crrev.com/2524093002.
> Before: 143.72 +- 1.21 seconds
> Now: 144.18 +- 0.67 seconds
>
> In order to check that the new comparisons are working, I refactored
> some DCHECKs in wasm to use the new magic.
>
> R=bmeurer@chromium.org, titzer@chromium.org
>
> Committed: https://crrev.com/5925074a9dab5a8577766545b91b62f2c531d3dc
> Cr-Commit-Position: refs/heads/master@{#41275}

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

Review-Url: https://codereview.chromium.org/2531533003
Cr-Commit-Position: refs/heads/master@{#41277}
2016-11-24 19:51:09 +00:00
rmcilroy
4c14bbf97b [fullcodegen] Remove deprecated support for lookup variables, eval and with.
This code is no longer used by full-codegen since all functions which use with statments,
call eval or have lookup variable access now go through Ignition first.

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2514393002
Cr-Commit-Position: refs/heads/master@{#41276}
2016-11-24 18:16:03 +00:00
clemensh
5925074a9d [base] Define CHECK comparison for signed vs. unsigned
The current CHECK/DCHECK implementation fails statically if a signed
value is compared against an unsigned value. The common solution is to
cast on each caller, which is tedious and error-prone (might hide bugs).
This CL implements signed vs. unsigned comparisons by executing up to
two comparisons. For example, if i is int32_t and u is uint_32_t, a
DCHECK_LE(i, u) would create the check
i <= 0 || static_cast<uint32_t>(i) <= u.
For checks against constants, at least one of the checks can be removed
by compiler optimizations.

The tradeoff we have to make is to sometimes silently execute an
additional comparison. And we increase code complexity of course, even
though the usage is just as easy (or even easier) as before.

The compile time impact seems to be minimal:
I ran 3 full compilations for Optdebug on my local machine, one time on
the current ToT, one time with this CL plus http://crrev.com/2524093002.
Before: 143.72 +- 1.21 seconds
Now: 144.18 +- 0.67 seconds

In order to check that the new comparisons are working, I refactored
some DCHECKs in wasm to use the new magic.

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

Review-Url: https://codereview.chromium.org/2526783002
Cr-Commit-Position: refs/heads/master@{#41275}
2016-11-24 17:53:37 +00:00
rmcilroy
49ea60ef9d [GC] Fix code flushing to use bytecode if it exists.
If code is flushed on a SFI, we can still use the bytecode if it was compiled,
since this never gets flushed.

This fixes a DCHECK where we were trying to compile the bytecode multiple
times after the baseline code was flushed.

BUG=chromium:668133

Review-Url: https://codereview.chromium.org/2526243002
Cr-Commit-Position: refs/heads/master@{#41274}
2016-11-24 17:27:04 +00:00
clemensh
7672350252 [base] Pass scalar arguments by value in CHECK/DCHECK
This not only potentially improves performance, but also avoids weird
linker errors, like the one below, where I used Smi::kMinValue in a
DCHECK_EQ.

> [421/649] LINK ./mksnapshot
> FAILED: mksnapshot
> src/base/logging.h|178| error: undefined reference to
  'v8::internal::Smi::kMinValue'

R=bmeurer@chromium.org, ishell@chromium.org

Review-Url: https://codereview.chromium.org/2524093002
Cr-Commit-Position: refs/heads/master@{#41273}
2016-11-24 17:26:02 +00:00
jkummerow
9be747666c Reland^2 of [stubs] KeyedStoreGeneric: inline dictionary property stores
For dictionary-mode receivers, the KeyedStoreGeneric stub can store
properties directly in most cases. Doing so avoids the need to have
an entry in the stub cache for every map/property combination.

Original review: https://codereview.chromium.org/2504403005/

Review-Url: https://codereview.chromium.org/2528883003
Cr-Commit-Position: refs/heads/master@{#41272}
2016-11-24 16:23:12 +00:00
verwaest
c4ccbaa3ea Fix zone in which temp-zone parsed data is allocated for the function scope on the boundary.
BUG=chromium:417697

Review-Url: https://codereview.chromium.org/2522223002
Cr-Commit-Position: refs/heads/master@{#41271}
2016-11-24 16:07:05 +00:00
bjaideep
d5f253cc58 s390: preserve src register in MovIntToFloat
The conversion instr was being called twice and
the src register was not restored after the shift.

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

Review-Url: https://codereview.chromium.org/2527873003
Cr-Commit-Position: refs/heads/master@{#41269}
2016-11-24 15:06:47 +00:00
cbruni
4ec41c355c [elements] Add CreateFromArrayLike fast-path for JS_ARRAY_TYPE
Make apply calls with double array arguments such as
Math.min.apply(Math, [1.1, 2.2]) 1.6x faster.

Drive-by-fix: pass in the isolate to ElementsAccessor::GetImpl.

BUG=v8:4826

Review-Url: https://codereview.chromium.org/2521043005
Cr-Commit-Position: refs/heads/master@{#41268}
2016-11-24 14:48:29 +00:00
vogelheim
9d0f5ab745 Treat all functions in a 'comma sequence' the same for (pre-)parsing.
R=verwaest@chromium.org
BUG=v8:5643

Review-Url: https://codereview.chromium.org/2524263003
Cr-Commit-Position: refs/heads/master@{#41267}
2016-11-24 14:45:19 +00:00
machenbach
061c2ab23a Revert of [heap] Use store buffer for writes coming from mutator. (patchset #6 id:100001 of https://codereview.chromium.org/2528563003/ )
Reason for revert:
tsan problems:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/12860

Original issue's description:
> Store buffer is used for writes that are coming from the mutator. Writes coming from the GC are directly added to the remembered set.
>
> BUG=chromium:648568
>
> Committed: https://crrev.com/c63c34e12e60ac0a19e1338b647882ac61d08741
> Cr-Commit-Position: refs/heads/master@{#41263}

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:648568

Review-Url: https://codereview.chromium.org/2528943002
Cr-Commit-Position: refs/heads/master@{#41265}
2016-11-24 13:50:07 +00:00
mstarzinger
22a2ae07af [runtime] Fix call-site rendering for inlined calls.
This makes sure call-site rendering for certain {TypeError} messages is
based on the correct underlying {JSFunction}, even when inlined frames
are present. Only the {FrameSummary} knows the exact function.

R=verwaest@chromium.org
TEST=message/regress/regress-crbug-661579
BUG=chromium:661579

Review-Url: https://codereview.chromium.org/2521103005
Cr-Commit-Position: refs/heads/master@{#41264}
2016-11-24 13:36:54 +00:00
hpayer
c63c34e12e Store buffer is used for writes that are coming from the mutator. Writes coming from the GC are directly added to the remembered set.
BUG=chromium:648568

Review-Url: https://codereview.chromium.org/2528563003
Cr-Commit-Position: refs/heads/master@{#41263}
2016-11-24 13:30:04 +00:00
neis
f447aeac4d [ast] Don't assume declaration scopes are never removed.
Because they sometimes are.

R=rossberg@chromium.org
BUG=v8:5648

Review-Url: https://codereview.chromium.org/2524333002
Cr-Commit-Position: refs/heads/master@{#41262}
2016-11-24 13:22:56 +00:00
jarin
cd0c259260 [turbofan] Use bounds checks to eliminate subsequent inc/dec overflow checks.
This has two parts:
- in redundancy elimination, if we see addition with left hand side that
  was bounds-checked, we reconnect the lhs to the bounds check if it has better
  type.
- in representation inference, eliminate overflow checks if the input types
  guarantee no overflow.

Review-Url: https://codereview.chromium.org/2527083002
Cr-Commit-Position: refs/heads/master@{#41260}
2016-11-24 12:58:20 +00:00
yangguo
abdbfc953d [debug] remove deprecated debug command message queue.
R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2524323002
Cr-Commit-Position: refs/heads/master@{#41259}
2016-11-24 12:56:21 +00:00
bmeurer
3313394fcf [turbofan] Ship escape analysis.
BUG=v8:4586,v8:5633
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2512733003
Cr-Commit-Position: refs/heads/master@{#41258}
2016-11-24 12:00:07 +00:00
neis
cde9f7bfed [modules] Propagate module status when creating ParseInfo from SFI.
In the ParseInfo constructor that takes a SharedFunctionInfo, we must
set the module flag when the function represents a module.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2525013002
Cr-Commit-Position: refs/heads/master@{#41257}
2016-11-24 10:49:03 +00:00
yangguo
21b0dbedfd Reimplement Number.prototype.toString with non-default radix.
The old algorithm produces unnecessary decimal digits. The new one
converts the significand of the input double into an uint64_t to be
just as precise as necessary.

R=tebbi@chromium.org
BUG=chromium:658712,chromium:666376

Review-Url: https://codereview.chromium.org/2520363002
Cr-Commit-Position: refs/heads/master@{#41255}
2016-11-24 10:30:46 +00:00
cbruni
244dd002c5 [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters
RuntimeTimerScopes always subtract their own time from the parent timer's
counter to properly account for the own time. Once a scope is destructed it
adds it own timer to the current active counter. However, if the current
counter is changed with CorrectCurrentCounterId we will attribute all the
subtimers to the previous counter, and add the own time to the new counter.
This way it is possible to end up with negative times in certain counters but
the overall would still be correct.

BUG=

Review-Url: https://codereview.chromium.org/2511093002
Cr-Commit-Position: refs/heads/master@{#41254}
2016-11-24 10:05:37 +00:00
neis
b481afd893 [parser] Fix scopes in rewriting of for-of and destructuring assignments.
The catch scopes were created with the wrong parent scope.

R=littledan@chromium.org
BUG=v8:5648

Committed: https://crrev.com/f385268d11d6da9508e481202b39f75f4b56afdd
Review-Url: https://codereview.chromium.org/2520883002
Cr-Original-Commit-Position: refs/heads/master@{#41222}
Cr-Commit-Position: refs/heads/master@{#41253}
2016-11-24 09:48:21 +00:00
hablich
3005cbd6f9 Revert of [cleanup] Refactor builtins-number.cc (patchset #2 id:40001 of https://codereview.chromium.org/2517833005/ )
Reason for revert:
Secondary dependency to revert https://codereview.chromium.org/2522393002/

Original issue's description:
> [cleanup] Refactor builtins-number.cc
>
> Introducing a TF_BUILTIN macro that wraps CodeStubAssembler usage
> into a convenient interface (using a subclass under the hood).
>
> Committed: https://crrev.com/cbf59c4c704e83a43b52c5ba6825df576fdaece8
> Cr-Commit-Position: refs/heads/master@{#41236}

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

Review-Url: https://codereview.chromium.org/2529873002
Cr-Commit-Position: refs/heads/master@{#41252}
2016-11-24 08:57:41 +00:00
hablich
474bbec73d Revert of [stubs] KeyedStoreGeneric: inline dictionary property stores (patchset #2 id:10002 of https://codereview.chromium.org/2524943002/ )
Reason for revert:
Blocks current roll:
https://codereview.chromium.org/2526753003/

Bisect results:
https://codereview.chromium.org/2531483002

Original issue's description:
> Reland of [stubs] KeyedStoreGeneric: inline dictionary property stores
>
> For dictionary-mode receivers, the KeyedStoreGeneric stub can store
> properties directly in most cases. Doing so avoids the need to have
> an entry in the stub cache for every map/property combination.
>
> Original review: https://codereview.chromium.org/2504403005/
>
> Committed: https://crrev.com/7a963deb85a0cc04623947a759534c48e2871901
> Cr-Commit-Position: refs/heads/master@{#41218}

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

Review-Url: https://codereview.chromium.org/2522393002
Cr-Commit-Position: refs/heads/master@{#41251}
2016-11-24 08:43:22 +00:00
hablich
e461facff2 Revert of [stubs] Fix AccessorInfo mixup in KeyedStoreGeneric (patchset #1 id:1 of https://codereview.chromium.org/2525913002/ )
Reason for revert:
Needed to revert 2661b3e8a5

Original issue's description:
> [stubs] Fix AccessorInfo mixup in KeyedStoreGeneric
>
> BUG=chromium:668101
>
> Committed: https://crrev.com/2661b3e8a5447773a23a219ba085454c459b654b
> Cr-Commit-Position: refs/heads/master@{#41223}

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

Review-Url: https://codereview.chromium.org/2525253002
Cr-Commit-Position: refs/heads/master@{#41250}
2016-11-24 08:41:29 +00:00
hablich
a87d252999 Revert of [cleanup] CodeStubAssembler: s/compiler::Node/Node/ (patchset #1 id:1 of https://codereview.chromium.org/2526803002/ )
Reason for revert:
Needed to revert https://codereview.chromium.org/2522393002/

Original issue's description:
> Reland of [cleanup] CodeStubAssembler: s/compiler::Node/Node/
>
> Reducing visual clutter.
>
> No changes since previous attempt; this was only reverted because it blocked another revert.
> Original review: https://codereview.chromium.org/2519093002/
>
> TBR=ishell@chromium.org
>
> Committed: https://crrev.com/c28bee0fdd297d2ef4fc88b5fe289cc9dbd664f6
> Cr-Commit-Position: refs/heads/master@{#41235}

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

Review-Url: https://codereview.chromium.org/2529863002
Cr-Commit-Position: refs/heads/master@{#41249}
2016-11-24 08:40:30 +00:00
bmeurer
76fd6f25a9 [turbofan] Remove inlining support for the deprecated pipeline.
The deprecated pipeline is used for asm.js only, where we forcibly
disable inlining anyways (for performance reasons), so inlining via
the AstGraphBuilder is essentially dead code by now, thus there's no
point in trying to keep that around in the code base.

Also nuke the test-run-inlining.cc file, which would require some heavy
surgery (for probably little benefit), and move the useful tests for
mjsunit tests instead.

BUG=v8:2206,v8:5657
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2527053002
Cr-Commit-Position: refs/heads/master@{#41245}
2016-11-24 07:59:59 +00:00
jgruber
f0d3cf5bae [inspector] Expose scopes for suspended generator objects
This exposes scopes for suspended generator objects by adding a
[[Scopes]] internal property to generator objects, similar to how
scopes for functions currently not on the stack are handled.

BUG=chromium:667286

Review-Url: https://codereview.chromium.org/2516973003
Cr-Commit-Position: refs/heads/master@{#41244}
2016-11-24 07:32:40 +00:00
machenbach
5e3e29d919 Revert of Use parenthesis in descriptions for array/map/set lengths/sizes (patchset #3 id:40001 of https://codereview.chromium.org/2521853003/ )
Reason for revert:
Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11595

https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> Use parenthesis in descriptions for array/map/set lengths/sizes
>
> Descriptions for (typed)arrays will use parenthesis instead of square brackets
> "Array(10)" instead of "Array[10]". This CL also adds size hints to descriptions
> of maps and sets.
>
> Related CL for DevTools: https://codereview.chromium.org/2524913002/
>
> BUG=405845
>
> Committed: https://crrev.com/92c77a57390e6a9ef726535b255a24359751992d
> Cr-Commit-Position: refs/heads/master@{#41237}

TBR=dgozman@chromium.org,kozyatinskiy@chromium.org,luoe@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=405845

Review-Url: https://codereview.chromium.org/2530803002
Cr-Commit-Position: refs/heads/master@{#41243}
2016-11-24 07:22:31 +00:00
bmeurer
3709108896 [turbofan] Infer proper type for calls to Date.now.
Recognize Date.now() calls in the Typer and assign the proper integer
type to them.

See Node issue https://github.com/nodejs/node/issues/9729 for more
information.

R=yangguo@chromium.org
BUG=v8:5267

Review-Url: https://codereview.chromium.org/2528853003
Cr-Commit-Position: refs/heads/master@{#41242}
2016-11-24 06:41:40 +00:00
bmeurer
9da894edcb [turbofan] Improve typed lowering rules for JSToBoolean.
Also lower JSToBoolean(x) where x is either some detectable receiver or
null, or any kind of receiver, null or undefined. Also fix a couple of
minor issues with the JSToBoolean lowering and tests.

R=yangguo@chromium.org
BUG=v8:5267

Review-Url: https://codereview.chromium.org/2530773002
Cr-Commit-Position: refs/heads/master@{#41241}
2016-11-24 06:37:14 +00:00
bmeurer
d66aaedd0e [turbofan] Assign appropriate types to RegExp builtins.
Recognize a couple of builtins on the RegExp.prototype in the Typer and
assign useful types to them, so we can optimize various checks on their
results.

R=yangguo@chromium.org
BUG=v8:5267

Review-Url: https://codereview.chromium.org/2531463002
Cr-Commit-Position: refs/heads/master@{#41240}
2016-11-24 06:02:11 +00:00
tebbi
14f81dd2d2 [turbofan] Fixed divergence in escape analysis.
This fixes a bug where the re-creation of phi nodes leads to divergence. The fix makes sure that once a node created a phi node, it sticks to it and does not forget about it, even if the inputs suddenly agree again. The bug appeared on the trybots in https://codereview.chromium.org/2512733003/.

Also I added a line to mark effect phi nodes on the queue. This is unrelated, but seems to be an obvious ommission.

R=bmeurer@chromium.org
BUG=v8:5633

Review-Url: https://codereview.chromium.org/2522253002
Cr-Commit-Position: refs/heads/master@{#41239}
2016-11-24 05:49:57 +00:00
jyan
5ae3dccad0 s390: introduce DUMY opcode for special use.
BUG=

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

Review-Url: https://codereview.chromium.org/2522283003
Cr-Commit-Position: refs/heads/master@{#41238}
2016-11-24 01:31:21 +00:00
luoe
92c77a5739 Use parenthesis in descriptions for array/map/set lengths/sizes
Descriptions for (typed)arrays will use parenthesis instead of square brackets
"Array(10)" instead of "Array[10]". This CL also adds size hints to descriptions
of maps and sets.

Related CL for DevTools: https://codereview.chromium.org/2524913002/

BUG=405845

Review-Url: https://codereview.chromium.org/2521853003
Cr-Commit-Position: refs/heads/master@{#41237}
2016-11-24 01:11:24 +00:00
jkummerow
cbf59c4c70 [cleanup] Refactor builtins-number.cc
Introducing a TF_BUILTIN macro that wraps CodeStubAssembler usage
into a convenient interface (using a subclass under the hood).

Review-Url: https://codereview.chromium.org/2517833005
Cr-Commit-Position: refs/heads/master@{#41236}
2016-11-24 00:41:54 +00:00
jkummerow
c28bee0fdd Reland of [cleanup] CodeStubAssembler: s/compiler::Node/Node/
Reducing visual clutter.

No changes since previous attempt; this was only reverted because it blocked another revert.
Original review: https://codereview.chromium.org/2519093002/

TBR=ishell@chromium.org

Review-Url: https://codereview.chromium.org/2526803002
Cr-Commit-Position: refs/heads/master@{#41235}
2016-11-24 00:04:41 +00:00
gdeepti
e108f90d5c [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
 - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
 - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
 - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
 - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.

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

Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
Review-Url: https://codereview.chromium.org/2471883003
Cr-Original-Original-Commit-Position: refs/heads/master@{#41121}
Cr-Original-Commit-Position: refs/heads/master@{#41198}
Cr-Commit-Position: refs/heads/master@{#41234}
2016-11-23 20:44:29 +00:00
cbruni
c3e0ef8b00 [gc] Add runtime timer for gc prologue and epilogue callbacks
BUG=

Review-Url: https://codereview.chromium.org/2524733007
Cr-Commit-Position: refs/heads/master@{#41233}
2016-11-23 18:00:17 +00:00
kozyatinskiy
019d446c1e [inspector] make console.assert much faster
New console.assert implementation is faster then custom user implementation.

BUG=chromium:663845
R=dgozman@chromium.org

Committed: https://crrev.com/f658e41d864267fb9e99ea76faa7758b0b63d5c9
Review-Url: https://codereview.chromium.org/2505493002
Cr-Original-Commit-Position: refs/heads/master@{#41227}
Cr-Commit-Position: refs/heads/master@{#41232}
2016-11-23 17:09:50 +00:00
machenbach
c1622945f7 Revert of [inspector] make console.assert much faster (patchset #3 id:40001 of https://codereview.chromium.org/2505493002/ )
Reason for revert:
Speculative revert as there seems to be a layout test crash:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11585

Please reland if it doesn't get green.

Original issue's description:
> [inspector] make console.assert much faster
>
> New console.assert implementation is faster then custom user implementation.
>
> BUG=chromium:663845
> R=dgozman@chromium.org
>
> Committed: https://crrev.com/f658e41d864267fb9e99ea76faa7758b0b63d5c9
> Cr-Commit-Position: refs/heads/master@{#41227}

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

Review-Url: https://codereview.chromium.org/2521323005
Cr-Commit-Position: refs/heads/master@{#41231}
2016-11-23 15:54:09 +00:00
machenbach
1a4294b181 Revert of [heap] Refactor heap object iteration (patchset #6 id:100001 of https://codereview.chromium.org/2516303006/ )
Reason for revert:
Breaks msan:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/12103

Original issue's description:
> [heap] Refactor heap object iteration
>
> BUG=
>
> Committed: https://crrev.com/d094fa76f3dd0bb5fc3f4c669762aa97d88e0f76
> Cr-Commit-Position: refs/heads/master@{#41226}

TBR=hpayer@chromium.org,mlippautz@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/2529663002
Cr-Commit-Position: refs/heads/master@{#41230}
2016-11-23 15:28:49 +00:00
machenbach
e4a15a7b4e Revert of [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (patchset #15 id:320001 of https://codereview.chromium.org/2511093002/ )
Reason for revert:
The test is very flaky on the bots, e.g.:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN/builds/17031
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20shared/builds/14776

Original issue's description:
> [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters
>
> RuntimeTimerScopes always subtract their own time from the parent timer's
> counter to properly account for the own time. Once a scope is destructed it
> adds it own timer to the current active counter. However, if the current
> counter is changed with CorrectCurrentCounterId we will attribute all the
> subtimers to the previous counter, and add the own time to the new counter.
> This way it is possible to end up with negative times in certain counters but
> the overall would still be correct.
>
> BUG=
>
> Committed: https://crrev.com/f6c74d964d9387df4bed3d8c1ded51eb9e8aa6e8
> Committed: https://crrev.com/491651792d7818aed04eaeffb9890b5a309b543e
> Cr-Original-Commit-Position: refs/heads/master@{#41142}
> Cr-Commit-Position: refs/heads/master@{#41214}

TBR=ishell@chromium.org,fmeawad@chromium.org,lpy@chromium.org,cbruni@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/2526843002
Cr-Commit-Position: refs/heads/master@{#41229}
2016-11-23 15:27:49 +00:00
machenbach
7edbd535a9 Revert of [parser] Fix scopes in rewriting of for-of and destructuring assignments. (patchset #6 id:100001 of https://codereview.chromium.org/2520883002/ )
Reason for revert:
Speculative revert: Seems to break jsfunfuzz:
https://build.chromium.org/p/client.v8/builders/V8%20Fuzzer/builds/14385

Original issue's description:
> [parser] Fix scopes in rewriting of for-of and destructuring assignments.
>
> The catch scopes were created with the wrong parent scope.
>
> R=littledan@chromium.org
> BUG=v8:5648
>
> Committed: https://crrev.com/f385268d11d6da9508e481202b39f75f4b56afdd
> Cr-Commit-Position: refs/heads/master@{#41222}

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

Review-Url: https://codereview.chromium.org/2519333005
Cr-Commit-Position: refs/heads/master@{#41228}
2016-11-23 15:23:17 +00:00
kozyatinskiy
f658e41d86 [inspector] make console.assert much faster
New console.assert implementation is faster then custom user implementation.

BUG=chromium:663845
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2505493002
Cr-Commit-Position: refs/heads/master@{#41227}
2016-11-23 14:20:30 +00:00
mlippautz
d094fa76f3 [heap] Refactor heap object iteration
BUG=

Review-Url: https://codereview.chromium.org/2516303006
Cr-Commit-Position: refs/heads/master@{#41226}
2016-11-23 13:58:13 +00:00
yangguo
47e30e4258 [debug] remove obsolete handling for suspended generator objects.
R=mstarzinger@chromium.org, neis@chromium.org

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2526763002
Cr-Commit-Position: refs/heads/master@{#41225}
2016-11-23 13:56:51 +00:00
vogelheim
da72a3176f Prevent read-after-buffer in SourcePositionTableIterator::Advance.
R=yangguo@chromium.org
BUG=chromium:667142

Review-Url: https://codereview.chromium.org/2525663003
Cr-Commit-Position: refs/heads/master@{#41224}
2016-11-23 13:48:49 +00:00
jkummerow
2661b3e8a5 [stubs] Fix AccessorInfo mixup in KeyedStoreGeneric
BUG=chromium:668101

Review-Url: https://codereview.chromium.org/2525913002
Cr-Commit-Position: refs/heads/master@{#41223}
2016-11-23 13:27:22 +00:00
neis
f385268d11 [parser] Fix scopes in rewriting of for-of and destructuring assignments.
The catch scopes were created with the wrong parent scope.

R=littledan@chromium.org
BUG=v8:5648

Review-Url: https://codereview.chromium.org/2520883002
Cr-Commit-Position: refs/heads/master@{#41222}
2016-11-23 13:25:35 +00:00
mvstanton
3d31d25152 [Turbofan]: generic lowering can use a constant vector
Since we are specializing on the native context, we don't have to load
the vector from the closure. For one thing, this reduces the machinery for
nodes that use a vector in their generic incarnation.

BUG=
R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2529463002
Cr-Commit-Position: refs/heads/master@{#41221}
2016-11-23 13:23:50 +00:00
mstarzinger
2b96c9d7c0 [turbofan] Fix exception message for non-constructables.
This fixes the message reported via the {TypeError} thrown when trying
to call a non-constructable function as a constructor. Also adds some
more related message tests for similar exceptions.

R=bmeurer@chromium.org
TEST=message/call-non-constructable
BUG=chromium:661579

Review-Url: https://codereview.chromium.org/2523803003
Cr-Commit-Position: refs/heads/master@{#41220}
2016-11-23 13:17:55 +00:00
clemensh
a127fffc1b Remove obsolete declaration of DumpBacktrace()
The implementation was removed in http://crrev.com/2248393002.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2522983004
Cr-Commit-Position: refs/heads/master@{#41219}
2016-11-23 12:53:45 +00:00
jkummerow
7a963deb85 Reland of [stubs] KeyedStoreGeneric: inline dictionary property stores
For dictionary-mode receivers, the KeyedStoreGeneric stub can store
properties directly in most cases. Doing so avoids the need to have
an entry in the stub cache for every map/property combination.

Original review: https://codereview.chromium.org/2504403005/

Review-Url: https://codereview.chromium.org/2524943002
Cr-Commit-Position: refs/heads/master@{#41218}
2016-11-23 12:43:48 +00:00
yangguo
418142b5a0 [profiler] collect more source positions when debugger is active.
In order for profiles of optimized code to have accurate source
positions, we need to prepare for this when compiling. If the profiler
is enabled late, this may be missing, leading to inaccurate profile
data. A compromise to solve this is to prepare for accurate positions if
the debugger (and therefore DevTools) is active, even if we are not
currently capturing a profile.

The alternative is to deopt everything upon profiling, but that would
affect the profile significantly.

R=alph@chromium.org, bmeurer@chromium.org, neis@chromium.org, tebbi@chromium.org

Review-Url: https://codereview.chromium.org/2519003002
Cr-Commit-Position: refs/heads/master@{#41217}
2016-11-23 12:42:51 +00:00
marja
db1cc0cf82 Parser / PreParser: remove dead code.
Eval calls are tracked by ParserBase::CheckPossibleEvalCall which
doesn't use (Pre)?Parser::IsDirectEvalCall.

Also we no longer seem to care about IsBinaryOperation (Parser didn't
have it either).

BUG=

Review-Url: https://codereview.chromium.org/2528603003
Cr-Commit-Position: refs/heads/master@{#41216}
2016-11-23 12:41:56 +00:00
cbruni
491651792d [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters
RuntimeTimerScopes always subtract their own time from the parent timer's
counter to properly account for the own time. Once a scope is destructed it
adds it own timer to the current active counter. However, if the current
counter is changed with CorrectCurrentCounterId we will attribute all the
subtimers to the previous counter, and add the own time to the new counter.
This way it is possible to end up with negative times in certain counters but
the overall would still be correct.

BUG=

Committed: https://crrev.com/f6c74d964d9387df4bed3d8c1ded51eb9e8aa6e8
Review-Url: https://codereview.chromium.org/2511093002
Cr-Original-Commit-Position: refs/heads/master@{#41142}
Cr-Commit-Position: refs/heads/master@{#41214}
2016-11-23 12:23:16 +00:00
ishell
b2f2f6ecf1 [ic] Don't enable property cell mode for a LoadGlobalIC if the holder is a different global object than the receiver.
Test contributed by crlf0710 <crlf0710@gmail.com>.

BUG=v8:5552

Review-Url: https://codereview.chromium.org/2523173002
Cr-Commit-Position: refs/heads/master@{#41213}
2016-11-23 12:17:01 +00:00
gsathya
a29b658eec [promises] Set promise context's closure to be an empty function
This is similar to how the native context has an empty function set up as it's closure field.

BUG=666984

Review-Url: https://codereview.chromium.org/2528603002
Cr-Commit-Position: refs/heads/master@{#41212}
2016-11-23 12:05:32 +00:00
cbruni
bbb74424ae Introduce set_the_hole(Isolate*, int) and friends
Passing in the isolate to retrieve the heap constants (undefine, the_hole, null)
has a positive performance impact.

BUG=

Review-Url: https://codereview.chromium.org/2517153002
Cr-Commit-Position: refs/heads/master@{#41210}
2016-11-23 09:44:07 +00:00
rmcilroy
5f5300a61b [compiler] Ensure code unsupported by Crankshaft goes to Ignition.
BUG=v8:4280,v8:5657

Review-Url: https://codereview.chromium.org/2505933008
Cr-Commit-Position: refs/heads/master@{#41209}
2016-11-23 09:30:34 +00:00
hablich
de330e13da Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #13 id:240001 of https://codereview.chromium.org/2471883003/ )
Reason for revert:
Test crashes after an unrelated revert: https://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7189

Reverting because of recommendation from WASM team.

Original issue's description:
> [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
>
> Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
>  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
>  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
>  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
>  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
>
>  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
> Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
> Cr-Original-Commit-Position: refs/heads/master@{#41121}
> Cr-Commit-Position: refs/heads/master@{#41198}

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

Review-Url: https://codereview.chromium.org/2529573002
Cr-Commit-Position: refs/heads/master@{#41208}
2016-11-23 09:08:43 +00:00
hablich
e3f5c515fa Revert of [stubs] KeyedStoreGeneric: inline dictionary property stores (patchset #5 id:100001 of https://codereview.chromium.org/2504403005/ )
Reason for revert:
Blocks roll: https://codereview.chromium.org/2526573002/

Original issue's description:
> [stubs] KeyedStoreGeneric: inline dictionary property stores
>
> For dictionary-mode receivers, the KeyedStoreGeneric stub can store
> properties directly in most cases. Doing so avoids the need to have
> an entry in the stub cache for every map/property combination.
>
> Committed: https://crrev.com/af168e330e95c4460fd1bb7734f0e9a750f2e748
> Cr-Commit-Position: refs/heads/master@{#41185}

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

Review-Url: https://codereview.chromium.org/2528583002
Cr-Commit-Position: refs/heads/master@{#41207}
2016-11-23 08:26:11 +00:00
hablich
cfc73c3cef Revert of [cleanup] CodeStubAssembler: s/compiler::Node/Node/ (patchset #2 id:20001 of https://codereview.chromium.org/2519093002/ )
Reason for revert:
Blocks revert of roll blocker: https://codereview.chromium.org/2528583002/

Original issue's description:
> [cleanup] CodeStubAssembler: s/compiler::Node/Node/
>
> Reducing visual clutter.
>
> Committed: https://crrev.com/36a17e87d86d2d978b64eb37044c9e9f98ebea67
> Cr-Commit-Position: refs/heads/master@{#41187}

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

Review-Url: https://codereview.chromium.org/2528593002
Cr-Commit-Position: refs/heads/master@{#41206}
2016-11-23 08:24:43 +00:00
jgruber
0dcc7a0e20 [debug] Add Eval scope type to inspector protocol
BUG=v8:5530,chromium:667218

Review-Url: https://codereview.chromium.org/2519773003
Cr-Commit-Position: refs/heads/master@{#41205}
2016-11-23 07:30:23 +00:00
zhengxing.li
3eff396ab0 X87: [fullcodegen] Remove deprecated generator implementation.
port 0925554111 (r41135)

  original commit message:
  This removes the deprecated generator support for resumable functions
  from {FullCodeGenerator}. The existing {AstNumbering} heuristic already
  triggers Ignition for most resumable functions, with this change we make
  said heuristic a hard choice and remove the deprecated code. This also
  has the advantage that any suspended {JSGeneratorObject} instance on the
  heap is guaranteed to have code based on a bytecode array.

BUG=

Review-Url: https://codereview.chromium.org/2522653003
Cr-Commit-Position: refs/heads/master@{#41204}
2016-11-23 07:09:19 +00:00
zhengxing.li
7d230e27bc X87: [x86] Also deal with holey arrays in the Apply builtin.
port d4f01b8a65 (r41108)

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

BUG=

Review-Url: https://codereview.chromium.org/2519303002
Cr-Commit-Position: refs/heads/master@{#41203}
2016-11-23 06:59:16 +00:00
bmeurer
c17e860569 [turbofan] Remove type feedback from AstGraphBuilder pipeline.
The AstGraphBuilder pipeline is only used for asm.js now, so the whole
type feedback mechanism is essentially dead code currently, thus we
better nuke it.

BUG=v8:5267,v8:5657

Review-Url: https://codereview.chromium.org/2523953002
Cr-Commit-Position: refs/heads/master@{#41201}
2016-11-23 06:10:35 +00:00
bjaideep
23193d394f s390: using correct type to fix gcc error
Wsign-compare exposed this error in s390 31-bit debug
build.

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

Review-Url: https://codereview.chromium.org/2523683003
Cr-Commit-Position: refs/heads/master@{#41200}
2016-11-23 05:05:37 +00:00
zhengxing.li
d135e764db X87: [turbofan] Advance bytecode offset after lazy deopt.
port 93c6595200 (r40887)

  original commit message:
  This changes {FrameState} nodes modeling "after" states to use bytecode
  offsets pointing to the deoptimizing bytecode. This is in sync with the
  normal execution, as the bytecode offset is advanced after operations
  complete in regular bytecode handlers.

  The change is necessary to ensure lazy deoptimized frames contain an
  accurate bytecode offset while they are on the stack. Such frames can be
  inspected by various stack walks. The continuation builtin will advance
  the bytecode offset upon return.

BUG=

Review-Url: https://codereview.chromium.org/2520203002
Cr-Commit-Position: refs/heads/master@{#41199}
2016-11-23 03:38:14 +00:00
gdeepti
3c98e33959 [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
 - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
 - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
 - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
 - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.

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

Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
Review-Url: https://codereview.chromium.org/2471883003
Cr-Original-Commit-Position: refs/heads/master@{#41121}
Cr-Commit-Position: refs/heads/master@{#41198}
2016-11-23 03:09:35 +00:00
kozyatinskiy
eb3551d0a3 Roll third_party/inspector_protocol to 4ad35c45aca9834b67ec2cb152c816ea1b7ceb48
This roll includes:
  - [inspector_protocol] Introduce protocol::Serializable [1]

[1] https://codereview.chromium.org/2526603002

BUG=chromium:350797
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2523583005
Cr-Commit-Position: refs/heads/master@{#41197}
2016-11-23 00:45:54 +00:00
bjaideep
9d1d3878dd s390: using uintptr to fix gcc error
Wsign-compare was recently added which exposed this
issue. Using the correct type fixes the error.

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

Review-Url: https://codereview.chromium.org/2528433003
Cr-Commit-Position: refs/heads/master@{#41196}
2016-11-22 23:07:47 +00:00
kozyatinskiy
211a6a8637 Roll third_party/inspector_protocol to 73028acaa3646789fd2a3bfd0d79eb2d91b696b3
This roll includes:
  - Support config.protocol.options which defines which part of protocol definition should be generated. [1]
  - [inspector_protocol] Allow custom json parser. [2]
  - [inspector_protocol] Allow overriding specific config values. [3]
  - [inspector_protocol] Fix NoneType error when parsing config_values. [4]
  - [inspector_protocol] Support chromium code style. [5]
  - [inspector_protocol] Support features for content/ generator. [6]
  - [inspector_protocol] Fixed domain_json["has_exports"] flag for exported domains [7]

[1] https://codereview.chromium.org/2482993002
[2] https://codereview.chromium.org/2490733002
[3] https://codereview.chromium.org/2482093004
[4] https://codereview.chromium.org/2490823002
[5] https://codereview.chromium.org/2495353004
[6] https://codereview.chromium.org/2509573006
[7] https://codereview.chromium.org/2515343005

BUG=none
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2523743003
Cr-Commit-Position: refs/heads/master@{#41195}
2016-11-22 18:57:37 +00:00
leszeks
292c4a0a2a [ignition] Replace branch+loop analysis with a single pass
Now that we have a JumpLoop bytecode, we can heavily simplify the
branch/loop analysis by assuming that only JumpLoop bytecodes are
backwards edges, and performing the loop analysis as a single
(backwards) pass.

This allows us to get rid of the branch analysis entirely, and builds a
framework to do liveness analysis in the same pass.

Review-Url: https://codereview.chromium.org/2519983002
Cr-Commit-Position: refs/heads/master@{#41194}
2016-11-22 18:05:18 +00:00
mtrofin
7a1ad0c581 [turbofan] Regalloc validator: support same block pending assessment
Previous fuzzer fix broke the case when the pending assessment came from the same
block. In that case, the assessments table does not have an entry yet for the block,
because we register only when we're done processing a block.

BUG=667745

Review-Url: https://codereview.chromium.org/2519973004
Cr-Commit-Position: refs/heads/master@{#41193}
2016-11-22 17:31:06 +00:00
clemensh
332b9b5842 [asmjs] Avoid truncation of error messages
We had error messages that exceeded the current limit of 100
characters, resulting in the newline being cut off.
This CL also reverts http://crrev.com/2503423006 since it did not fix
this issue.

BUG=chromium:660016
R=machenbach@chromium.org, titzer@chromium.org

Review-Url: https://codereview.chromium.org/2523703002
Cr-Commit-Position: refs/heads/master@{#41192}
2016-11-22 17:17:57 +00:00
clemensh
de52d865a0 [wasm] Move and refactor position to location translation
The GetPositionInfo function only operates on WasmCompiledModule, so it
should be a method of that class.
This CL also splits the method in two, such that I can reuse the
GetContainingFunction method for breakpoint support.

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

Review-Url: https://codereview.chromium.org/2521293002
Cr-Commit-Position: refs/heads/master@{#41191}
2016-11-22 17:16:23 +00:00
ahaas
339b0a093c [wasm] Do not create special wrappers for i64 imports on 32-bit platforms
Wrapper creation for import functions with i64 return values on 32-bit
platforms crashed because the number of return values of the wrapper
did not match the number of input nodes of the return node.

The issue is fixed by not creating special wrappers for 32-bit platforms
in the first place. This is valid because wrappers with i64 return
values are never actually executed.

R=titzer@chromium.org
BUG=v8:5661

Review-Url: https://codereview.chromium.org/2517173003
Cr-Commit-Position: refs/heads/master@{#41190}
2016-11-22 16:44:42 +00:00
jkummerow
5ef05d8e2c [cleanup] Drop handwritten KeyedStoreIC code
The handwritten-assembly implementations of both dispatcher and
generic stub have been replaced by Turbofan-generated stubs.

Review-Url: https://codereview.chromium.org/2523473002
Cr-Commit-Position: refs/heads/master@{#41188}
2016-11-22 15:43:59 +00:00
jkummerow
36a17e87d8 [cleanup] CodeStubAssembler: s/compiler::Node/Node/
Reducing visual clutter.

Review-Url: https://codereview.chromium.org/2519093002
Cr-Commit-Position: refs/heads/master@{#41187}
2016-11-22 15:39:09 +00:00
hpayer
69ea64b856 [heap] Force finalization of incremental MC when close to OOM.
BUG=chromium:667388

Review-Url: https://codereview.chromium.org/2521983002
Cr-Commit-Position: refs/heads/master@{#41186}
2016-11-22 15:21:06 +00:00
jkummerow
af168e330e [stubs] KeyedStoreGeneric: inline dictionary property stores
For dictionary-mode receivers, the KeyedStoreGeneric stub can store
properties directly in most cases. Doing so avoids the need to have
an entry in the stub cache for every map/property combination.

Review-Url: https://codereview.chromium.org/2504403005
Cr-Commit-Position: refs/heads/master@{#41185}
2016-11-22 14:51:59 +00:00
ulan
6e1aa65fa6 [heap] Ensure quick progress of incremental marking near OOM.
BUG=chromium:667388

Review-Url: https://codereview.chromium.org/2520963004
Cr-Commit-Position: refs/heads/master@{#41184}
2016-11-22 14:44:53 +00:00
marja
d2e90c5d81 Preparse inner functions: fix maybe_assigned
... but be less pessimistic about context allocation (see below).

We might have just (pessimistically) context-allocated a variable based
on references coming from an inner function, but after that we still
need to set maybe_assigned (pessimistically).

This makes test-parsing/InnerAssignment pass with
FLAG_lazy_inner_functions.

This was undetected until now because we didn't have lazy parsing enabled
for small scripts.

Less pessimistic approach: now that inner functions laziness decisions
are stable (if we have once compiled a piece of code with lazy inner
functions, we never compile the same code with eager inner functions),
we don't need to be as pessimistic with context allocation as before.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2521513004
Cr-Commit-Position: refs/heads/master@{#41183}
2016-11-22 14:18:16 +00:00
mstarzinger
5894d0e461 [wasm] Fix {InstantiateAsmJs} builtin on x64.
This makes sure the {kScratchRegister} is not used across macro
instructions (e.g. {LeaveFrame}) that would clobber its content.
Generally it is highly unsafe to use such scratch registers with a
life-range spanning macro instructions.

R=neis@chromium.org

Review-Url: https://codereview.chromium.org/2521973002
Cr-Commit-Position: refs/heads/master@{#41181}
2016-11-22 13:54:49 +00:00
neis
c051ef383d Remove some leftovers of full-codegen's generators implementation.
TBR=littledan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2517143003
Cr-Commit-Position: refs/heads/master@{#41180}
2016-11-22 13:49:01 +00:00
verwaest
30d2fb6b50 [runtime] Always normalize prototype maps that aren't marked as 'should be fast' yet
This makes the test in the bug ~10x faster. It could inadvertently make other things slower, so revert eagerly if included in a range where performance tanks.

BUG=chromium:666852

Review-Url: https://codereview.chromium.org/2525573002
Cr-Commit-Position: refs/heads/master@{#41178}
2016-11-22 13:25:17 +00:00
jgruber
a0e9160066 [debug-wrapper] Implement StepFrame through runtime
StepFrame is a combination of StepIn/StepOut, e.g. it breaks to the next
frame change. This is not part of the public API, but we want to keep it
for internal tests.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2514303003
Cr-Commit-Position: refs/heads/master@{#41177}
2016-11-22 13:14:53 +00:00
jgruber
facd6b9a4a [debug-wrapper] Migrate more tests
* Fix setting script-scope variables through inspector by internalizing
  their names.
* Reconstruct values of Number, String, and Boolean classes.
* Adapt a couple of tests for API restrictions.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2512963002
Cr-Commit-Position: refs/heads/master@{#41175}
2016-11-22 12:44:18 +00:00
titzer
5a1fbe24ba [d8] Do not try to verify zero-ness of failed virtual memory allocation.
BUG=chromium:667603
R=clemensh@chromium.org

Review-Url: https://codereview.chromium.org/2519363002
Cr-Commit-Position: refs/heads/master@{#41174}
2016-11-22 12:36:37 +00:00
jarin
d7aae405c7 [turbofan] Fix representation changes for unsigned values used as checked-signed values.
BUG=chromium:664117

Review-Url: https://codereview.chromium.org/2522883002
Cr-Commit-Position: refs/heads/master@{#41173}
2016-11-22 12:07:45 +00:00
clemensh
172f501233 [wasm] Implement official wasm text format
When disassembling functions for the inspector, we used an internal
text representation before. This CL implements the official text
format like it is understood by the spec interpreter.

Example output:
func $main (param i32) (result i32)
block i32
  get_local 0
  i32.const 2
  i32.lt_u
  if
    i32.const -2
    return
  end
  get_local 0
  call_indirect 0
end

R=rossberg@chromium.org, titzer@chromium.org
BUG=chromium:659715

Review-Url: https://codereview.chromium.org/2520943002
Cr-Commit-Position: refs/heads/master@{#41172}
2016-11-22 11:59:56 +00:00
mstarzinger
a90671f1b9 [interpreter] Fix stack unwinding of deoptimized frames.
This fixes stack unwinding to always recompute the stack pointer for
interpreted frames. For frames materialized by the deoptimizer we elide
the handler frame in between, hence arguments being pushed on the stack
will no longer be pushed into the handler frame but into the interpreted
frame directly.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-662830
BUG=chromium:662830

Review-Url: https://codereview.chromium.org/2517203003
Cr-Commit-Position: refs/heads/master@{#41170}
2016-11-22 11:28:45 +00:00
bmeurer
84c9360b82 [turbofan] Fix broken effect chain for instanceof.
BUG=chromium:667689
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2518313002
Cr-Commit-Position: refs/heads/master@{#41169}
2016-11-22 11:05:35 +00:00
tebbi
1b320d2039 [cpu-profiler] use new source position information for deoptimization in cpu profiler
The new SourcePosition class allows for precise tracking of source positions including the stack of inlinings. This CL makes the cpu profiler use this new information. Before, the cpu profiler used the deoptimization data to reconstruct the inlining stack. However, optimizing compilers (especially Turbofan) can hoist out checks such that the inlining stack of the deopt reason and the inlining stack of the position the deoptimizer jumps to can be different (the old cpu profiler tests and the ones introduced in this cl produce such situations for turbofan). In this case, relying on the deoptimization info produces paradoxical results, where the reported position is before the function responsible is called. Even worse, https://codereview.chromium.org/2451853002/ combines the precise position with the wrong inlining stack from the deopt info, leading to completely wrong results.

Other changes in this CL:
- DeoptInlinedFrame is no longer needed, because we can compute the correct inlining stack up front.
- I changed the cpu profiler tests back to test situations where deopt checks are hoisted out in Turbofan and made them robust enough to handle the differences between Crankshaft and Turbofan.
- I reversed the order of SourcePosition::InliningStack to make it match the cpu profiler convention.
- I removed CodeDeoptEvent::position, as it is no longer used.

R=alph@chromium.org

BUG=v8:5432

Review-Url: https://codereview.chromium.org/2503393002
Cr-Commit-Position: refs/heads/master@{#41168}
2016-11-22 10:14:59 +00:00
bmeurer
6ce39edc86 [ignition] Report NumberOrOddball feedback for relational comparisons.
TurboFan can indeed comsume NumberOrOddball feedback for abstract
relational comparisons, so we should just provide it from Ignition.

Drive-by-fix: Add a DCHECK to protect against abstract/strict equality
number comparison accidentially utilizing Oddball feedback.

BUG=v8:5267,v8:5400
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2518283002
Cr-Commit-Position: refs/heads/master@{#41166}
2016-11-22 09:44:39 +00:00
jbroman
9d524bd33d Fix out-of-range access in unibrow::Utf8::CalculateValue.
This code should not access bytes out of the permitted range in order to check
the range of a possible UTF-8 value. Instead, the length check should occur
before such checks.

BUG=chromium:667260, chromium:662822

Review-Url: https://codereview.chromium.org/2520053003
Cr-Commit-Position: refs/heads/master@{#41165}
2016-11-22 09:27:59 +00:00
yangguo
8c4988f738 [regexp] use C++ API for unicode set over C API.
R=jshin@chromium.org

Review-Url: https://codereview.chromium.org/2514333002
Cr-Commit-Position: refs/heads/master@{#41164}
2016-11-22 07:10:13 +00:00
bmeurer
5d4253ecfb [turbofan] Utilize String comparison feedback.
Make use of the previously introduced String feedback for compare
operations in TurboFan.

R=jarin@chromium.org
BUG=v8:5267,v8:5400

Review-Url: https://codereview.chromium.org/2523463002
Cr-Commit-Position: refs/heads/master@{#41163}
2016-11-22 06:23:26 +00:00
pfeldman
f0726837af v8 inspector: do not upon empty object ids in heap profiler.
BUG=chromium:651324

Review-Url: https://codereview.chromium.org/2522593005
Cr-Commit-Position: refs/heads/master@{#41161}
2016-11-22 01:43:11 +00:00
gdeepti
e60e961140 [simd] Disable Simd Scalar lowering for x64, enable tests for all other architectures.
- Simd Scalar lowering should be conditionally disabled if the architecture has a native SIMD implementation.
 - Enable scalar lowering tests on all architectures instead of only x64.

R=bbudge@chromium.org, aseemgarg@chromium.org

Review-Url: https://codereview.chromium.org/2514663002
Cr-Commit-Position: refs/heads/master@{#41160}
2016-11-21 23:03:26 +00:00
mtrofin
71144e5aa6 [turbofan] Use correct block when tracing pending assessments in regalloc verifier
The verifier needs to use the block and assessments in that block corresponding to
a predecessor of a "pending" assessment. Not doing that causes incorrect
assessments when 2 locations are swapped.

BUG=665402

Review-Url: https://codereview.chromium.org/2515803002
Cr-Commit-Position: refs/heads/master@{#41159}
2016-11-21 22:21:14 +00:00
eholk
d0fe942d23 [wasm] Throw a RangeError if Wasm memory could not be allocated.
This fixes a bug found by the fuzzer where we would attempt to
dereference a null handle if memory allocation failed. In this case,
the failure was because the amount of memory requested was above V8's
hardcoded limit.

BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=666741

Review-Url: https://codereview.chromium.org/2514983002
Cr-Commit-Position: refs/heads/master@{#41158}
2016-11-21 21:58:53 +00:00
ahaas
480a65738c [wasm] Add a flag to generate an mjsunit test out of a wasm-code fuzzer test case.
R=titzer@chromium.org
CC=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2520853003
Cr-Commit-Position: refs/heads/master@{#41155}
2016-11-21 18:00:28 +00:00
titzer
d96131ed9b [d8] Use virtual memory to allocate large array buffers.
R=mstarzinger@chromium.org,clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2520963002
Cr-Commit-Position: refs/heads/master@{#41154}
2016-11-21 17:59:31 +00:00
leszeks
f91178e823 [ignition] Add a reverse bytecode iterator
This pre-calculates and stores a vector of bytecode offsets, and then allows
one to iterate over it backwards. This could probably be adapted to a
bidirectional/random access iterator if we wanted to, but for now reverse
is all we need.

Review-Url: https://codereview.chromium.org/2518003002
Cr-Commit-Position: refs/heads/master@{#41153}
2016-11-21 17:21:13 +00:00
leszeks
ae8a77ea5f [ignition] Refactor array iterator to separate out access
Refactors the bytecode array iterator to separate the iteration and the
bytecode parameter access, placing the latter into a separate
super-class. This will allow us to have other forms of access, e.g.
reverse iteration.

Review-Url: https://codereview.chromium.org/2519923002
Cr-Commit-Position: refs/heads/master@{#41152}
2016-11-21 17:18:51 +00:00
tebbi
744a6f7422 [turbofan] increased precision of range types for bitshifts
BUG=v8:5296

Review-Url: https://codereview.chromium.org/2320753002
Cr-Commit-Position: refs/heads/master@{#41151}
2016-11-21 16:46:20 +00:00
cbruni
10a31136c4 Revert of [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (patchset #10 id:180001 of https://codereview.chromium.org/2511093002/ )
Reason for revert:
Wronged it even more.

Original issue's description:
> [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters
>
> RuntimeTimerScopes always subtract their own time from the parent timer's
> counter to properly account for the own time. Once a scope is destructed it
> adds it own timer to the current active counter. However, if the current
> counter is changed with CorrectCurrentCounterId we will attribute all the
> subtimers to the previous counter, and add the own time to the new counter.
> This way it is possible to end up with negative times in certain counters but
> the overall would still be correct.
>
> BUG=
>
> Committed: https://crrev.com/f6c74d964d9387df4bed3d8c1ded51eb9e8aa6e8
> Cr-Commit-Position: refs/heads/master@{#41142}

TBR=ishell@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/2519073002
Cr-Commit-Position: refs/heads/master@{#41150}
2016-11-21 16:00:56 +00:00
gsathya
5e5e87963f [promises] Do not export GlobalPromise
This is unused.

BUG=v8:5343
TBR=littledan@chromium.org

Review-Url: https://codereview.chromium.org/2513413002
Cr-Commit-Position: refs/heads/master@{#41148}
2016-11-21 15:00:51 +00:00
verwaest
768f22f6f6 [parser] Keep track of whether we are in a temp-zone in the parser, and don't lazy parse anymore once we are
This avoids entering a nested temp zone, and fixes up tracing and runtime callstats names.

BUG=

Review-Url: https://codereview.chromium.org/2514353002
Cr-Commit-Position: refs/heads/master@{#41147}
2016-11-21 14:59:02 +00:00
marja
0c92a6eb2b Scope cleanup: remove unneeded params.
BUG=

Review-Url: https://codereview.chromium.org/2517993002
Cr-Commit-Position: refs/heads/master@{#41145}
2016-11-21 14:24:19 +00:00
mstarzinger
2e5a90fd02 [test] Run module tests in all variants.
By now the compilation pipeline is flexible enough to run module tests
against all variants, we should no longer choose unsupported compilers
for modules. It also fixes the predicate checking for functions being
"resumable" in the {AstNumberingVisitor} heuristic.

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

Review-Url: https://codereview.chromium.org/2517143002
Cr-Commit-Position: refs/heads/master@{#41144}
2016-11-21 14:18:28 +00:00
ivica.bogosavljevic
591a7ce05b MIPS[64]: Disable Add/Shl to Lsa optimization if operand is immediate
Add/Shl to Lsa optimization doesn't yield any performance increase in case
one of the operand is immediate, because Lsa cannot use the immediate so
we use an extra instruction to load the immediate to register. On MIPSR2 and
less this optimization leads to performance degradation, since Lsa is not
supported on these architectures and it is emulated using Add/Shl which
do support immediate as operand for Add.

BUG=

Review-Url: https://codereview.chromium.org/2509203003
Cr-Commit-Position: refs/heads/master@{#41143}
2016-11-21 14:04:41 +00:00
cbruni
f6c74d964d [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters
RuntimeTimerScopes always subtract their own time from the parent timer's
counter to properly account for the own time. Once a scope is destructed it
adds it own timer to the current active counter. However, if the current
counter is changed with CorrectCurrentCounterId we will attribute all the
subtimers to the previous counter, and add the own time to the new counter.
This way it is possible to end up with negative times in certain counters but
the overall would still be correct.

BUG=

Review-Url: https://codereview.chromium.org/2511093002
Cr-Commit-Position: refs/heads/master@{#41142}
2016-11-21 13:45:29 +00:00
hablich
da783fa1ff Revert of [turbofan] Introduce LoadFunctionPrototype simplified operator. (patchset #1 id:1 of https://codereview.chromium.org/2517913002/ )
Reason for revert:
Blocks roll https://codereview.chromium.org/2517963002/

Original issue's description:
> [turbofan] Introduce LoadFunctionPrototype simplified operator.
>
> Add a LoadFunctionPrototype simplified operator, similar to what
> Crankshaft has, that loads the prototype property of a constructor
> function.
>
> R=jarin@chromium.org
> BUG=v8:5267
>
> Committed: https://crrev.com/1737b2c74b50168e96ef1263def0eb43505fa80c
> Cr-Commit-Position: refs/heads/master@{#41127}

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

Review-Url: https://codereview.chromium.org/2514363002
Cr-Commit-Position: refs/heads/master@{#41141}
2016-11-21 13:32:41 +00:00
mstarzinger
71c5904fb7 [runtime] Rename {JSGeneratorObject::operand_stack} field.
This renames the {operand_stack} field to {register_file}, to refelct
how said field is used on all {JSGeneratorObject} instances by now. This
is a pure refactoring CL, not changes in semantics.

R=neis@chromium.org

Review-Url: https://codereview.chromium.org/2520913002
Cr-Commit-Position: refs/heads/master@{#41140}
2016-11-21 13:31:35 +00:00
yangguo
5ebde77e3b [debugger] handle stack overflow. Fail silently.
R=jgruber@chromium.org
BUG=v8:5654

Review-Url: https://codereview.chromium.org/2511733002
Cr-Commit-Position: refs/heads/master@{#41139}
2016-11-21 13:28:37 +00:00
verwaest
4097c8503e [zone] Fix zone segment pooling size limits
BUG=chromium:655129

Review-Url: https://codereview.chromium.org/2520903002
Cr-Commit-Position: refs/heads/master@{#41138}
2016-11-21 13:22:29 +00:00
mstarzinger
2405ab11b5 [runtime] Ensure {JSGeneratorObject} is created for bytecode.
This removes some outdated code that allocates a {JSGeneratorObject} for
baseline code. We no longer support such a representation of generators
and can rely on bytecode being available for all generators.

R=neis@chromium.org

Review-Url: https://codereview.chromium.org/2515253003
Cr-Commit-Position: refs/heads/master@{#41137}
2016-11-21 13:02:32 +00:00
ishell
8ca50a8862 [ic] Ensure prototype validity cell guards global object's prototype changes for LoadGlobalIC.
BUG=chromium:666742, v8:5561

Review-Url: https://codereview.chromium.org/2512183002
Cr-Commit-Position: refs/heads/master@{#41136}
2016-11-21 12:46:44 +00:00
mstarzinger
0925554111 [fullcodegen] Remove deprecated generator implementation.
This removes the deprecated generator support for resumable functions
from {FullCodeGenerator}. The existing {AstNumbering} heuristic already
triggers Ignition for most resumable functions, with this change we make
said heuristic a hard choice and remove the deprecated code. This also
has the advantage that any suspended {JSGeneratorObject} instance on the
heap is guaranteed to have code based on a bytecode array.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2504223002
Cr-Commit-Position: refs/heads/master@{#41135}
2016-11-21 12:25:38 +00:00
rmcilroy
bd93fa6ee2 Revert of [Interpreter] Collect NumberOrOddball feedback in CompareOps. (patchset #2 id:20001 of https://codereview.chromium.org/2506283003/ )
Reason for revert:
Turbofan doesn't do proper ToNumber conversions on NumberOrOddball equality conversions.

BUG=v8:5660

Original issue's description:
> [Interpreter] Collect NumberOrOddball feedback in CompareOps.
>
> Collect feedback for oddballs in the interpreter compare operations handlers.
> This is important to ensure that we don't consider oddball comparisons as
> generic, which prevents optimization.
>
> BUG=chromium:660947
>
> Committed: https://crrev.com/721e74d9d942fd4f2e3392ea9626d9d404dbbbd0
> Cr-Commit-Position: refs/heads/master@{#41081}

TBR=bmeurer@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:660947

Review-Url: https://codereview.chromium.org/2517133002
Cr-Commit-Position: refs/heads/master@{#41134}
2016-11-21 12:14:49 +00:00
ishell
4513532f63 [ic] Don't check full prototype chain if name is a private symbol.
BUG=chromium:664974, chromium:664802, v8:5561

Review-Url: https://codereview.chromium.org/2513893003
Cr-Commit-Position: refs/heads/master@{#41133}
2016-11-21 11:21:43 +00:00
yangguo
416e423fdb [debugger] step-next across yield should not leave the generator.
Stepping in a generator now behaves similar to stepping inside an
async function. Stepping in or next at a yield expression will result in
a break inside the same generator when we return to the generator.
Behavior of step-out does not change.

R=jgruber@chromium.org, neis@chromium.org
BUG=chromium:496865

Review-Url: https://codereview.chromium.org/2519853002
Cr-Commit-Position: refs/heads/master@{#41132}
2016-11-21 11:05:08 +00:00
ishell
7d61ddfa91 [ic] Remove names table from type feedback metadata.
BUG=chromium:576312, v8:5561

Review-Url: https://codereview.chromium.org/2515233002
Cr-Commit-Position: refs/heads/master@{#41130}
2016-11-21 10:46:16 +00:00
jgruber
1834ab7246 [debug-wrapper] Adapt tests, breakpoint.actual_location
Adapted various tests to restrictions of inspector protocol:

* osr-typing-debug-change: Don't set function variable value.
* debug-evaluate-locals: Add variable introduced by eval, run typeof
  inside evaluate().
* regress-419663: Don't set duplicate breakpoints.
* regress-crbug-465298: Compare against function name instead of value.
* regress-crbug-621361: Make evaluate return string results.
* debug-script: Various counts were off due to new way tests are called.
                Added new inspector script type.

Breakpoints now contain the actual break position, and remote object
reconstruction has been extended a bit.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2505363002
Cr-Commit-Position: refs/heads/master@{#41129}
2016-11-21 09:29:17 +00:00
bmeurer
bd25a33129 [turbofan] Remove useless implication.
Since loop peeling was shipped, there's no need to have the implication
from --turbo to --turbo-loop-peeling.

BUG=v8:5267
TBR=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2517073002
Cr-Commit-Position: refs/heads/master@{#41128}
2016-11-21 08:13:32 +00:00
bmeurer
1737b2c74b [turbofan] Introduce LoadFunctionPrototype simplified operator.
Add a LoadFunctionPrototype simplified operator, similar to what
Crankshaft has, that loads the prototype property of a constructor
function.

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

Review-Url: https://codereview.chromium.org/2517913002
Cr-Commit-Position: refs/heads/master@{#41127}
2016-11-21 07:32:36 +00:00
caitp
d59c2cf1b4 [builtins] add CodeStubAssembler::IsDebugActive() helper
Utility used by Promise builtins implemented in TFJ/TFS

BUG=v8:5046
R=bmeurer@chromium.org, gsathya@chromium.org, yangguo@chromium.org, adamk@chromium.org

Review-Url: https://codereview.chromium.org/2517823002
Cr-Commit-Position: refs/heads/master@{#41123}
2016-11-20 17:57:10 +00:00
machenbach
682f6500ee Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #10 id:180001 of https://codereview.chromium.org/2471883003/ )
Reason for revert:
Breaks gc stress:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7114

Original issue's description:
> [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
>
> Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
>  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
>  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
>  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
>  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
>
>  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
> Cr-Commit-Position: refs/heads/master@{#41121}

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

Review-Url: https://codereview.chromium.org/2512323004
Cr-Commit-Position: refs/heads/master@{#41122}
2016-11-19 13:39:49 +00:00
gdeepti
30ef8e33f3 [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
 - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
 - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
 - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
 - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.

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

Review-Url: https://codereview.chromium.org/2471883003
Cr-Commit-Position: refs/heads/master@{#41121}
2016-11-19 03:31:35 +00:00
littledan
06f8e87726 Fix function name inference corruption for async functions
The code which pushes and pops to the function name inference stack
generally checks if the stack is active with the IsOpen method. One
piece of code pertaining to async functions was missing that check.
This patch adds it.

BUG=chromium:658267
R=gsathya,caitp

Review-Url: https://codereview.chromium.org/2514893002
Cr-Commit-Position: refs/heads/master@{#41120}
2016-11-18 18:31:54 +00:00
franzih
54e4b1fb5e [turbofan] Add JSStoreDataPropertyInLiteral operator.
BUG=v8:5624

Review-Url: https://codereview.chromium.org/2518513002
Cr-Commit-Position: refs/heads/master@{#41119}
2016-11-18 18:28:09 +00:00
caitp
e84f0adba9 [builtins] add context input to users of CreateKeyValueArray opcode
BUG=666622, v8:5388
R=bmeurer@chromium.org, mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2515683002
Cr-Commit-Position: refs/heads/master@{#41118}
2016-11-18 18:17:27 +00:00
mtrofin
824c075884 [turbofan] Print API for verifier
A simple Print API for debugging assessments in the regalloc
verifier.

BUG=

Review-Url: https://codereview.chromium.org/2512943003
Cr-Commit-Position: refs/heads/master@{#41117}
2016-11-18 17:44:29 +00:00
gsathya
764548e2cd [async-await] Don't create resolving callbacks for throwaway promises
This patch also cleans up NewPromiseCapability.

This patch results in a 20% improvement over 4 runs with the following micro
benchmark -

var x = Promise.resolve();

async function bar() {
    return x;
}

async function foo() {
    await bar();
}

var start = performance.now();
var count = 0;
var max = 10000;
for(var i = 0; i <= max; i++) {
    foo().then(() => {
        count++;
        if(count === max) print( performance.now() - start );
    })
}

BUG=v8:5639

Review-Url: https://codereview.chromium.org/2512103002
Cr-Commit-Position: refs/heads/master@{#41116}
2016-11-18 16:15:15 +00:00
clemensh
8ab945f2e0 [wasm] Translate locations to positions properly
... at least for the function which will remain after restructuring of
the debug interface. For some methods that will be removed anyway, we
just return zero / null for now.

I also refactored the ScriptLocationFromLine method to make it more
readable and reuse parts in other files (like ScriptLinePosition).

BUG=5655
R=titzer@chromium.org, jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2512833003
Cr-Commit-Position: refs/heads/master@{#41115}
2016-11-18 15:04:50 +00:00
vogelheim
eefe11a1e6 Treat a '!' preceding a function literal as eager-compile hint.
Some minifiers use the pattern !function ... () for JS code that should
be immediately executed. This change recognizes that pattern and treats
it equally to parenthesized functions.

A bit more background info is in the referenced bug.

R=verwaest@chromium.org
BUG=v8:5643

Review-Url: https://codereview.chromium.org/2509143003
Cr-Commit-Position: refs/heads/master@{#41114}
2016-11-18 14:56:59 +00:00
predrag.rudic
7724a25515 MIPS64: Port Reland [arm64] Improve some new builtins.
Port a1103a117c

Original commit message:
 - Simplify the variable-length pop sequence on entry. (It now uses
   smaller code with no branches.)
 - Use conditional compare to merge branches where appropriate.
 - Make use of Ldrsw + UntagSmiFieldMemOperand to load smis more
   efficiently.
 - Only load 'undefined' and 'null' once per builtin.
 - A few other small improvements.

Review-Url: https://codereview.chromium.org/2507683003
Cr-Commit-Position: refs/heads/master@{#41113}
2016-11-18 14:41:44 +00:00
ulan
5f06c1a1f3 [heap, runtime] Set upper limit on the size of fast fixed arrays that
are created using new Array(N) and setLength(N).

Currently the limit is based on max old generation size, which
will break with the upcoming change that allows large heaps.

BUG=chromium:652721

Review-Url: https://codereview.chromium.org/2513923002
Cr-Commit-Position: refs/heads/master@{#41112}
2016-11-18 14:31:30 +00:00
ishell
f7723ff512 [ic] Pass name to Runtime::kLoadGlobal_Miss and _Slow.
This is a next step towards removing names table from type feedback metadata.

BUG=chromium:576312, v8:5561

Review-Url: https://codereview.chromium.org/2514453002
Cr-Commit-Position: refs/heads/master@{#41111}
2016-11-18 14:22:03 +00:00
marja
4a5b7e32c4 Remove FLAG_min_preparse_length.
It originates from the era where we used to run a separate preparse step
before parsing and store the function data. Now the usage of preparser
is something completely different, so this flag doesn't make sense any
more.

In addition, this way we get more test coverage for preparser (for small
scripts).

BUG=

Review-Url: https://codereview.chromium.org/2513563002
Cr-Commit-Position: refs/heads/master@{#41110}
2016-11-18 14:06:49 +00:00
ulan
b9f8ad002e [heap] Reland "Add a guard for restarting the memory reducer after mark-compact."
This reverts commit 3c96c5e232.

The CL was reverted to see its impact on UMA memory counters.
There was no impact, so we can safely reland the CL.

BUG=

Review-Url: https://codereview.chromium.org/2507293004
Cr-Commit-Position: refs/heads/master@{#41109}
2016-11-18 13:50:22 +00:00
bmeurer
d4f01b8a65 [x86] Also deal with holey arrays in the Apply builtin.
Add fast paths for holey smi and object arrays to
Function.prototype.apply, Reflect.apply and Reflect.construct.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2510043004
Cr-Commit-Position: refs/heads/master@{#41108}
2016-11-18 13:31:25 +00:00
mlippautz
80339771e3 [heap] ExternalStringTable: Separate Iterate and CleanUp methods
This way we can just process new space strings when needed.

BUG=chromium:651354

Review-Url: https://codereview.chromium.org/2515643002
Cr-Commit-Position: refs/heads/master@{#41107}
2016-11-18 13:01:31 +00:00
ishell
cfd1dd2f95 [ic] Pass globals' names to Runtime::kDeclareGlobals.
This is a next step towards removing names table from type feedback metadata.

BUG=chromium:576312, v8:5561

Review-Url: https://codereview.chromium.org/2507143003
Cr-Commit-Position: refs/heads/master@{#41106}
2016-11-18 12:58:36 +00:00
verwaest
0c70f3729e [crankshaft] Don't inline the fast path for instanceof if the function has a non-instance .prototype
BUG=chromium:666308

Review-Url: https://codereview.chromium.org/2516603002
Cr-Commit-Position: refs/heads/master@{#41105}
2016-11-18 12:57:37 +00:00
mlippautz
7e5755cbc5 [heap] Minor MC: Add marking
Adds the marking logic to mark the young generation.

BUG=chromium:651354

Review-Url: https://codereview.chromium.org/2498583002
Cr-Commit-Position: refs/heads/master@{#41104}
2016-11-18 12:56:16 +00:00
clemensh
18084f17bb [wasm] Implement frame printing for debug
This makes wasm frames show up nicely in stack traces generated e.g. by
Isolate::PrintStack() and Isolate::PrintCurrentStackTrace().
With this CL, we print the script name, function index, function name,
pc and source position.

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

Review-Url: https://codereview.chromium.org/2509323002
Cr-Commit-Position: refs/heads/master@{#41102}
2016-11-18 12:18:16 +00:00
franzih
f7795cbf6e [interpreter] Bytecode for StaDataPropertyInLiteral.
Add bytecode for defining data properties, which initially just calls the runtime function.

BUG=v8:5624

Review-Url: https://codereview.chromium.org/2510743002
Cr-Commit-Position: refs/heads/master@{#41101}
2016-11-18 12:13:47 +00:00
machenbach
572b643b47 Revert of [interpreter] Properly collect rhs feedback for comparisons with oddballs. (patchset #1 id:1 of https://codereview.chromium.org/2513903002/ )
Reason for revert:
Seems to break layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11452

Original issue's description:
> [interpreter] Properly collect rhs feedback for comparisons with oddballs.
>
> Ignition skipped collecting NumberOrOddball feedback if the right hand
> side of a relational comparison is undefined, thus leading to a
> deoptimization loop, because it reported Number feedback to TurboFan.
>
> This was caught on 3d-raytrace test of SunSpider.
>
> R=rmcilroy@chromium.org
>
> Committed: https://crrev.com/d240ffec32ae034e50c006f7d5715171b32bbbc4
> Cr-Commit-Position: refs/heads/master@{#41094}

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

Review-Url: https://codereview.chromium.org/2511243004
Cr-Commit-Position: refs/heads/master@{#41100}
2016-11-18 12:02:31 +00:00
clemensh
a00e1a5733 Refactor StringStream Add methods
Instead of having functions for 0 to 5 arguments, we now have a
variadic template, allowing for an arbitrary number of arguments.
I also refactored the internal FmtElm class to only include the type
field if building for debug, because it is only used in this setting.

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

Review-Url: https://codereview.chromium.org/2507093004
Cr-Commit-Position: refs/heads/master@{#41099}
2016-11-18 12:01:33 +00:00
ulan
d3f2213b61 [heap] Simplify adjusting of live bytes.
We never increment live bytes concurrent to the sweeper.

BUG=

Review-Url: https://codereview.chromium.org/2504193002
Cr-Commit-Position: refs/heads/master@{#41097}
2016-11-18 11:11:52 +00:00
bmeurer
30db83a3b5 [crankshaft] The array protector is a PropertyCell, not a Cell.
There's a typo in a couple of lithium backends, where we assume that the
array protector on the Isolate is a Cell instead of a PropertyCell. This
could lead to unnecessary deoptimizations.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2512943002
Cr-Commit-Position: refs/heads/master@{#41096}
2016-11-18 11:10:02 +00:00
ulan
0283d550c9 [heap] Add a flag guard for concurrent store buffer processing.
BUG=v8:5580

Review-Url: https://codereview.chromium.org/2460873003
Cr-Commit-Position: refs/heads/master@{#41095}
2016-11-18 10:08:46 +00:00
bmeurer
d240ffec32 [interpreter] Properly collect rhs feedback for comparisons with oddballs.
Ignition skipped collecting NumberOrOddball feedback if the right hand
side of a relational comparison is undefined, thus leading to a
deoptimization loop, because it reported Number feedback to TurboFan.

This was caught on 3d-raytrace test of SunSpider.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2513903002
Cr-Commit-Position: refs/heads/master@{#41094}
2016-11-18 10:04:17 +00:00
mstarzinger
28d7c1fb4a [ast] Fix typo in {Scope::set_asm_function} method.
This fixes the bogus implementation of the function in question and adds
test coverage for the deserialization of the corresponding flags from
the serialized scope info. Note that the tests so far only cover cases
where the module and the function contain context-allocated variables.

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

Review-Url: https://codereview.chromium.org/2507063004
Cr-Commit-Position: refs/heads/master@{#41093}
2016-11-18 09:26:51 +00:00
bmeurer
241c024c10 [turbofan] Properly optimize instanceof (even in the presence of @@hasInstance).
This is the TurboFan counterpart of http://crrev.com/2504263004, but it
is a bit more involved, since in TurboFan we always inline the appropriate
call to the @@hasInstance handler, and by that we can optimize a lot more
patterns of instanceof than Crankshaft, and even yield fast instanceof
for custom @@hasInstance handlers (which we can now properly inline as
well).

Also we now properly optimize Function.prototype[@@hasInstance], even if
the right hand side of an instanceof doesn't have the Function.prototype
as its direct prototype.

For the baseline case, we still rely on the global protector cell, but
we can address that in a follow-up as well, and make it more robust in
general.

TEST=mjsunit/compiler/instanceof
BUG=v8:5640
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2511223003
Cr-Commit-Position: refs/heads/master@{#41092}
2016-11-18 06:31:42 +00:00
yangguo
5beb5ee7e6 [regexp] implement latest spec draft for property class.
See https://github.com/mathiasbynens/es-regexp-unicode-property-escapes

Changes:
- only allow General Category, binary properties, Script, and Script_Extensions.
- implement Script_Extensions.

R=littledan@chromium.org
BUG=v8:4743

Review-Url: https://codereview.chromium.org/2502933002
Cr-Commit-Position: refs/heads/master@{#41091}
2016-11-18 06:10:14 +00:00
eholk
eaed31c5f5 [wasm] Add guard regions to end of WebAssembly.Memory buffers
With this change, WebAssembly.Memory objects have backing stores allocated as an
8GB region where everything beyond the size of the Wasm heap is inaccessible.

GrowMemory is now implemented by changing the protection on the guard regions to
make the new portions of the heap accessible.

Guard pages are not enabled by default, but this change adds a flag and a test
variant to make sure we get test coverage on them.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277

Review-Url: https://codereview.chromium.org/2396433008
Cr-Commit-Position: refs/heads/master@{#41089}
2016-11-17 20:29:13 +00:00
verwaest
932a865ee3 [counters] Fix runtime-call-stats wrt background parsing
BUG=

Review-Url: https://codereview.chromium.org/2507293003
Cr-Commit-Position: refs/heads/master@{#41088}
2016-11-17 16:52:23 +00:00
kozyatinskiy
afd49054ac [inspector] removed embbeder debugger script flag
After moving inspector from blink to V8, inspector can use DebugInterface to compile and mark internal scripts.

BUG=v8:5530
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2502173002
Cr-Commit-Position: refs/heads/master@{#41087}
2016-11-17 16:51:23 +00:00
clemensh
a80d4d0314 [wasm] Remove two obsolete functions
With the new wasm object types, the GetCompiledModule and GetWasmBytes
functions are not needed any more. The same functions are already
public on the wasm objects.
In order to use them properly, I changed a few more locations to make
use of the new types.

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

Review-Url: https://codereview.chromium.org/2503403005
Cr-Commit-Position: refs/heads/master@{#41085}
2016-11-17 16:16:52 +00:00
alph
b46bdcd5c3 [profiler] Add extra CHECK to catch a crash in profiler.
BUG=chromium:665398

Review-Url: https://codereview.chromium.org/2509753002
Cr-Commit-Position: refs/heads/master@{#41084}
2016-11-17 16:03:12 +00:00
titzer
5e00cb5f08 [wasm] Introduce performance testing options.
Adds --wasm-no-bounds-checks and --wasm-no-stack-checks which
help in diagnosing potential sources of slowdown in WASM code.

R=ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2511113002
Cr-Commit-Position: refs/heads/master@{#41083}
2016-11-17 16:02:13 +00:00
clemensh
200cbe9235 [wasm] Quick-fix gc error
R=titzer@chromium.org
NOTRY=true
NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2511763002
Cr-Commit-Position: refs/heads/master@{#41082}
2016-11-17 15:36:21 +00:00
rmcilroy
721e74d9d9 [Interpreter] Collect NumberOrOddball feedback in CompareOps.
Collect feedback for oddballs in the interpreter compare operations handlers.
This is important to ensure that we don't consider oddball comparisons as
generic, which prevents optimization.

BUG=chromium:660947

Review-Url: https://codereview.chromium.org/2506283003
Cr-Commit-Position: refs/heads/master@{#41081}
2016-11-17 15:21:59 +00:00
clemensh
8b306c6336 [wasm] Refactor interface to WasmCompiledModule
The ptr_to_* methods do (often unnecessary) type checks, and can
return nullptr. This is problematic since the handlified getter
uses them, and assumes the result to be non-null. So change
them to only to a DCHECK and never return nullptr, and introduce
maybe_ptr_to_* with the old semantics.

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

Review-Url: https://codereview.chromium.org/2509053003
Cr-Commit-Position: refs/heads/master@{#41079}
2016-11-17 15:10:14 +00:00
rmcilroy
5369874042 [Interpreter] Collect String feedback on CompareOps.
Collect string feedback for compare operations. Without this,
functions which have a lot of string compare operations end up with
a high generic type percentage, and don't get optimized until very
late.

Currently TurboFan doesn't use this String feedback for compare
operations, but this could be done in future work if it is useful.

BUG=chromium:660947

Review-Url: https://codereview.chromium.org/2506013005
Cr-Commit-Position: refs/heads/master@{#41078}
2016-11-17 14:45:31 +00:00
vegorov
29745ee927 [regexp] Fix matching of regexps that are both sticky and anchored at end.
V8 was applying incorrect optimization to them advancing the start position.

This would cause /foo$/y too match "barfoo", which it should not.

BUG=

Review-Url: https://codereview.chromium.org/2510743003
Cr-Commit-Position: refs/heads/master@{#41077}
2016-11-17 13:59:00 +00:00
yangguo
1fe704e113 [fuzzing] consistently honor --abort-on-stack-overflow.
R=machenbach@chromium.org
BUG=chromium:664068

Review-Url: https://codereview.chromium.org/2509843005
Cr-Commit-Position: refs/heads/master@{#41075}
2016-11-17 13:28:34 +00:00
ishell
937b8cb684 [ic] Support data handlers in LoadGlobalIC.
Also fixed handling of load non-existent handlers outside typeof.

BUG=v8:5561, chromium:662854

Review-Url: https://codereview.chromium.org/2511603002
Cr-Commit-Position: refs/heads/master@{#41073}
2016-11-17 12:18:40 +00:00
neis
48bbd1a7fe [parser,ast] Simplify MarkExpressionAsAssigned.
There's no need to return anything.

Also add a DCHECK to make sure that we never mark a variable proxy as assigned
that is already resolved (to avoid potential inconsistency with the variable's
maybe_assigned status).

R=littledan@chromium.org
CC=mstarzinger@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2504613002
Cr-Commit-Position: refs/heads/master@{#41072}
2016-11-17 12:10:03 +00:00
ahaas
020e2c8d26 [wasm] Break a cycle with a loop node in the int64-lowering.
The control edges in a TurboFan graph can form a cycle. To break this cycle in the int64-lowering we add special handling for loop nodes. Similar handling already exists for phi nodes and effectphi nodes, which breaks cycles formed by value edges and effect edges, respectively.

Review-Url: https://codereview.chromium.org/2511503002
Cr-Commit-Position: refs/heads/master@{#41071}
2016-11-17 11:51:32 +00:00