Commit Graph

30235 Commits

Author SHA1 Message Date
bmeurer
0231a7efa2 [turbofan] Introduce TruncateTaggedToWord32 simplified operator.
This allows us to get rid of the "push TruncateFloat64ToInt32 into Phi"
trick that was used in the MachineOperatorReducer to combine the
ChangeTaggedToFloat64 and TruncateFloat64ToInt32 operations. Instead of
doing that later, we can just introduce the proper operator during the
representation selection directly.

Also separate the TruncateFloat64ToInt32 machine operator, which had two
different meanings depending on a flag (either JavaScript truncation or
C++ style round to zero). Now there's a TruncateFloat64ToWord32 which
represents the JavaScript truncation (implemented via TruncateDoubleToI
macro + code stub) and the RoundFloat64ToInt32, which implements the C++
round towards zero operation (in the same style as the other WebAssembly
driven Round* machine operators).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35743}
2016-04-24 11:41:20 +00:00
mtrofin
5ae587cfb3 [turbofan] Single entry into deferred
If a deferred block has multiple predecessors, they have to be
all deferred. Otherwise, we can run into a situation where if a range
that spills only in deferred blocks inserts its spill in the block, and
other ranges need moves inserted by ResolveControlFlow in the predecessors,
the register of the range spilled in the deferred block may be clobbered.

To avoid that, when a deferred block has multiple predecessors, and some
are not deferred, we add a non-deferred block to collect all such edges.

This CL addresses the validator assertion failure the referenced issue, as well
as the greedy allocator failure - which was caused by the situation described
above.

BUG=v8:4940
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35742}
2016-04-23 16:58:10 +00:00
mbrandy
b0530dc96b Fix hash field access for 64-bit big-endian architectures.
Need to use the kHashFieldSlot rather than kHashFieldOffset for
pointer-sized memory accesses.

(Fix for "[builtins] Migrate String.prototype.charCodeAt and String.prototype.charAt to TurboFan.")

R=bmeurer@chromium.org, epertoso@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35741}
2016-04-22 18:42:08 +00:00
Adam Klein
f6c09c893a Remove non-existent object-observe test from mjsunit.status
TBR=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35740}
2016-04-22 18:31:44 +00:00
bjaideep
6d9c4c8663 PPC: [interpreter] Heal closures when bytecode array is gone.
Port 5c8609de9d

Original commit message:

    This ensures the InterpreterEntryTrampoline heals code entry fields
    inside closures when being called without a valid bytecode array. This
    is preparatory work to allow removal of bytecode when switching some
    functions to other types of code.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35739}
2016-04-22 17:57:26 +00:00
jarin
316d506297 [turbofan] Only connect the exception edge in to-number conversion.
Review URL: https://codereview.chromium.org/1914493002

Cr-Commit-Position: refs/heads/master@{#35738}
2016-04-22 17:57:25 +00:00
mbrandy
d0f414dbe6 Reland "Fix interpreter unittest for embedded constant pools."
The offset from fp to the register file is based on the frame size
-- which is one slot larger when embedded constant pools are enabled.

TEST=unittests/DecodeBytecodeAndOperands
TBR=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35735}

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

Cr-Commit-Position: refs/heads/master@{#35737}
2016-04-22 15:32:22 +00:00
mbrandy
2a113b8e2e Revert of Fix interpreter unittest for embedded constant pools. (patchset #2 id:20001 of https://codereview.chromium.org/1906963002/ )
Reason for revert:
Need to fix the #undef logic.

Original issue's description:
> Fix interpreter unittest for embedded constant pools.
>
> The offset from fp to the register file is based on the frame size
> -- which is one slot larger when embedded constant pools are enabled.
>
> TEST=unittests/DecodeBytecodeAndOperands
> R=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
> BUG=

TBR=bmeurer@chromium.org,mstarzinger@chromium.org,oth@chromium.org,rmcilroy@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/1909323003

Cr-Commit-Position: refs/heads/master@{#35736}
2016-04-22 15:04:50 +00:00
mbrandy
074320ac2d Fix interpreter unittest for embedded constant pools.
The offset from fp to the register file is based on the frame size
-- which is one slot larger when embedded constant pools are enabled.

TEST=unittests/DecodeBytecodeAndOperands
R=rmcilroy@chromium.org, bmeurer@chromium.org, oth@chromium.org, mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35735}
2016-04-22 14:50:02 +00:00
rossberg
f8f551ae9a Stage harmony-for-in
TBR=hablich@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35734}
2016-04-22 14:07:11 +00:00
mbrandy
e7d521fb5f PPC64: [turbofan] Word32 loads should be unsigned.
TEST=cctest/test-run-load-store/*
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, bjaideep@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35733}
2016-04-22 14:05:04 +00:00
mstarzinger
8e03bdefc0 [turbofan] Allocate SourcePositionTable inside a Zone.
This also removes the destructor of the class in question, which removed
any added decorator from the graph. However the adding of the decorator
happens explicitly, so symmetry suggests that removal should also happen
explicitly instead of implicitly in the destructor.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35732}
2016-04-22 13:58:48 +00:00
epertoso
339000bf3b [turbofan] Add the Verifier to the pipeline for code stubs.
Removes some control edges added from the RawMachineAssembler to the end of the graph.
Adds a parameter that tells the Verifier to ignore effect and control inputs.

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

Cr-Commit-Position: refs/heads/master@{#35731}
2016-04-22 13:56:36 +00:00
mike
b86ec74395 [modules] Infer strict mode from within scope object
Refactor the Scope object to automatically enable strict mode when
initialized as a "module" scope, relieving the caller of this
responsibility.

BUG=v8:4941
LOG=N
R=adamk@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35730}
2016-04-22 13:38:15 +00:00
yangguo
4b580cad0c [debugger,interpreter] fix source position of compare operation.
R=mstarzinger@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35729}
2016-04-22 13:11:48 +00:00
jarin
fcbe95c8dc Introduce approximate mode for StandardFrame::Summarize.
The approximate mode enables taking an approximate stack trace from GC,
where the top frames might be missing if inlined. Note that in that case,
the frame summary will refer to optimized code, so it will not be possible
to take source position. (The user of the summary will have to handle the
case frame_summary.abstract_code()->kind() == AbstractCode::OPTIMIZED_CODE
specially.)

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

Cr-Commit-Position: refs/heads/master@{#35728}
2016-04-22 12:39:00 +00:00
bmeurer
530cf26bb2 [turbofan] Don't run SimplifiedOperatorReducer in late optimization.
There's no point in running the SimplifiedOperatorReducer also during
the late optimization pass, as it will not do any useful work at that
point.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35727}
2016-04-22 12:16:46 +00:00
rossberg
9ce87d6772 Add flag for disallowing for-in initializers
This does not affect use counters.

R=nikolaos@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35726}
2016-04-22 12:04:15 +00:00
jochen
0714485cbb Revert of [GN] Define USE_EABI_HARDFLOAT=1 when arm_float_abi=="hard". (patchset #1 id:1 of https://codereview.chromium.org/1839763003/ )
Reason for revert:
Appears to break Android crbug.com/604422

Original issue's description:
> [GN] Define USE_EABI_HARDFLOAT=1 when arm_float_abi=="hard".
>
> Add this define to the config used for mksnapshot. This fixes a bug
> where certain applications would fail at runtime on Chromecast.
>
> BUG=592660
> LOG=Y
> Bug: internal b/27495984
>
> Test: Formerly broken Cast apps load and run as expected.
>
> Committed: https://crrev.com/86357d5235ceba61c151f0b6e509bcb365860454
> Cr-Commit-Position: refs/heads/master@{#35183}

TBR=dpranke@chromium.org,alokp@chromium.org,titzer@chromium.org,slan@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=592660,604422
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35725}
2016-04-22 11:19:49 +00:00
mstarzinger
5c8609de9d [interpreter] Heal closures when bytecode array is gone.
This ensures the InterpreterEntryTrampoline heals code entry fields
inside closures when being called without a valid bytecode array. This
is preparatory work to allow removal of bytecode when switching some
functions to other types of code.

R=rmcilroy@chromium.org
BUG=v8:4280
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35724}
2016-04-22 11:13:28 +00:00
bmeurer
550c0f9f55 [turbofan] Move more type checks to the representation selector.
Get rid of further typing checks from ChangeLowering and put them into
the representation selection pass instead (encoding the information in
the operator instead).

Drive-by-change: Rename ChangeSmiToInt32 to ChangeTaggedSignedToInt32
for consistency about naming Tagged, TaggedSigned and TaggedPointer.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35723}
2016-04-22 11:03:17 +00:00
lpy
ff7e6defff Get rid of UnsafeCurrent in Sampler
Currently we are using UnsafeCurrent in async signal handler to acquire the
isolate of VM thread, but we want to get rid of that since it prevents V8 from
being thread agnostic.

This patch replaces UnsafeCurrent with a static map, where we store a map of
samplers for threads, and makes it accessible by signal handler.

BUG=v8:4889
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35722}
2016-04-22 10:54:53 +00:00
yangguo
672983830f [debugger] Hide scopes that originate from desugaring.
Some scopes are introduced by the parser for desugaring and do not
have any positions associated. The debugger should not make them
visible.

Also add some missing source positions.

R=kozyatinskiy@chromium.org, rossberg@chromium.org
BUG=chromium:604458
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#35721}
2016-04-22 10:48:45 +00:00
rmcilroy
c58f328581 [Interpreter] Introduce IncStub and DecStub.
Adds IncStub and DecStub TurboFan code stubs and hooks them up to the
interpreter's Inc and Dec bytecodes (which are used for count
operations, e.g. i++).

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35720}
2016-04-22 10:36:33 +00:00
rmcilroy
11e3ba34f5 [Interpreter] Fix incorrect Register OperandSize calculation for ExtraWide.
Fixes a mistake made in r35618 for register OperandSize calculations.

BUG=605470
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35719}
2016-04-22 10:32:14 +00:00
machenbach
6d21841ec3 [test] Print how test runner is called on swarming.
BUG=chromium:605516
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35718}
2016-04-22 10:28:05 +00:00
ulan
8d24472acf Check for semaphore alignment on posix platforms.
BUG=chromium:605349
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#35717}
2016-04-22 10:15:56 +00:00
neis
b090715250 Introduce bytecodes for assisting generator suspend and resume.
The new bytecodes replace two runtime functions. They are still unsupported by the bytecode graphbuilder, though.

BUG=v8:4907
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35716}
2016-04-22 09:19:00 +00:00
jkummerow
f4a9a50147 [tests] Add testcase for r35397
This is a follow-up to 58429beb7b
"Fix KeyedStore stub selection for STRING_WRAPPER_ELEMENTS".

BUG=chromium:602184
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35715}
2016-04-22 09:08:46 +00:00
adamk
6a370a6f01 Remove support for Object.observe
The feature was deprecated in M49 and flagged off in M50.
This patch removes it entirely from the codebase.

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

Cr-Commit-Position: refs/heads/master@{#35714}
2016-04-22 09:02:41 +00:00
bmeurer
861295bf16 [turbofan] Optimize tagged conversion based on type.
If we have to convert a float64 value to tagged representation and we
already know that the value is either in Signed31/Signed32 or
Unsigned32 range, then we can just convert the float64 to word32 and
use the fast word32 to tagged conversion. Doing this in
ChangeLowering (or the effect linearization pass) would be unsound, as
the types on the nodes are no longer usable.

This removes all Type uses from effect linearization. There's still some
work to be done for ChangeLowering tho.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35713}
2016-04-22 08:40:05 +00:00
yangguo
fa8bac650f [interpreter] Fix stack trace printers for debugging.
This is pretty useful when debugging. There is no easy way to find the
bytecode arrays on the stack.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35712}
2016-04-22 08:09:13 +00:00
mtrofin
81c965d475 [turbofan] store block id with instruction
GetInstructionBlock shows up in some compile time-intensive profiles.
Changing it to a O(1) operation. The compile benchmark confirms the
improvement.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35711}
2016-04-21 23:08:17 +00:00
mstarzinger
82a7c53e97 [interpreter] Enable webkit test that no longer fails.
R=machenbach@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35710}
2016-04-21 16:35:20 +00:00
baptiste.afsa
04239cfeb8 [turbofan] Properly handle deoptimizations in the instruction scheduler.
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35709}
2016-04-21 14:54:30 +00:00
nikolaos
fa43f4c99b Synchronize scopes between parser/preparser
This patch introduces new scopes in the preparser, just like they
are introduced by the parser, in the following places:

-   blocks
-   try statement
-   switch statement
-   scoped statements, in several places
-   for statement
-   eager function bodies

R=rossberg@chromium.org
BUG=
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35708}
2016-04-21 13:43:09 +00:00
bmeurer
9bac40157f [turbofan] Make pure JS operators effectful before first scheduler.
This way the first scheduler can properly wire them to the effect chain,
as otherwise the second scheduler could schedule them such that they
would be able to read uninitialized memory (once we drop the region
protection in the first scheduler).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35707}
2016-04-21 13:30:51 +00:00
jkummerow
9bebebd909 [ic] Restore PROPERTY key tracking in keyed ICs
Non-vectorized KeyedLoadICs used to remember whether they had seen Names
as keys; Crankshaft uses this information to avoid emitting elements
accesses which would always deopt. This CL restores that functionality
for vector ICs.

BUG=chromium:594183
LOG=y
R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35706}
2016-04-21 13:18:28 +00:00
mstarzinger
6f43e1f544 [profiler] Remove obsolete CompilationInfo argument.
This removes the CompilationInfo argument from one of the logging
functions where it is unused. The long-term goal is to not pass around
the CompilationInfo at all. The assumption that the CompilationInfo is
available is incompatible with serialized code, where compilation has
happened during building time of V8 itself.

R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35705}
2016-04-21 13:18:27 +00:00
yangguo
ff2a04bbb9 [debugger] fix mjsunit/es6/debug-promises/stepin-constructor.js for ignition.
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35704}
2016-04-21 13:16:04 +00:00
Ilija.Pavlovic
71dd5c4380 MIPS64: [regexp] do not assume short external strings have a minimum size.
Fix for execution tests on simulator.
Port 3518e492c0

Original commit message:
    Short external strings do not cache the resource data, and may be used
    for compressible strings. The assumptions about their lengths is
    invalid and may lead to oob reads.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35703}
2016-04-21 13:16:03 +00:00
bmeurer
5e11acc9dc [turbofan] Reorganize the pipeline around the 2nd scheduler approach.
The JavaScript pipeline now consists of the following steps:

 1. Typed lowering.
 2. Representation selection (actually SimplifiedLowering).
 3. Early optimization pass (incl. JSGenericLowering).
 4. Effect control linearization (not for asm.js).
 5. Late optimization pass (incl. ChangeLowering).
 6. Real scheduling.

We should further cleanup the passes and restrict type and
representation information usage to appropriate parts of the pipeline.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35702}
2016-04-21 11:50:55 +00:00
yangguo
4d824551c7 [debugger] fix mjsunit/debug-allscopes-on-debugger.js for ignition.
R=vogelheim@chromium.org
BUG=v8:4690
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35701}
2016-04-21 11:30:44 +00:00
bmeurer
33c717fba4 [turbofan] Introduce dedicated BitcastWordToTagged machine operator.
This operator doesn't generate any actual code, but teaches the register
allocator that a certain computed pointer value is tagged. This is
required to safely implement InnerAllocate (and we also use this for
Allocate to be sure that we don't suddenly leak a dangling pointer into
the heap somewhere).

R=epertoso@chromium.org
BUG=v8:4939
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35700}
2016-04-21 11:26:39 +00:00
verwaest
7dfb5beeec Fix 'typeof null' canonicalization in crankshaft
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35699}
2016-04-21 11:24:31 +00:00
titzer
b3cf031eb8 [wasm] Enforce strict ordering of WASM module sections.
R=jfb@chromium.org,rossberg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35698}
2016-04-21 11:20:15 +00:00
verwaest
4a6a0f5530 Make sure we always try to make prototypes fast again when transitioning accessors
BUG=chromium:605060
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35697}
2016-04-21 11:18:08 +00:00
epertoso
e8caf78ff2 [ignition] Inline the binary op TurboFan code stubs in the bytecode handlers.
Adds a Generate method to the stubs that can be used to embed the graph directly in the bytecode handlers.

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

Cr-Commit-Position: refs/heads/master@{#35696}
2016-04-21 10:17:36 +00:00
titzer
727c7df035 [wasm] Extra LEB utilities to leb-helper.h
R=bradnelson@chromium.org,aseemgarg@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35695}
2016-04-21 10:15:16 +00:00
mstarzinger
c323d2a64e [compiler] Remove obsolete check for debug break slots.
This check whether a function is being debugged is obsolete. For the
optimization path it is covered by a bailout further down. The lookup
within the optimized code map doesn't need to be covered, because that
map is guaranteed to stay empty while break slots are present.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35694}
2016-04-21 10:15:15 +00:00