Commit Graph

33931 Commits

Author SHA1 Message Date
bbudge
5d5efc662d [Turbofan] Fix IsSlot function in MoveOptimizer.
LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2328423002
Cr-Commit-Position: refs/heads/master@{#39389}
2016-09-13 16:16:54 +00:00
leszeks
5a9eac3a64 [Interpreter] Add an unsigned immediate operand type
Review-Url: https://codereview.chromium.org/2336203002
Cr-Commit-Position: refs/heads/master@{#39388}
2016-09-13 14:49:10 +00:00
hpayer
526f4dc676 [heap] Remove old_gen_exhausted_ state.
The AllocationResult already carries the information in which space the allocation failure happened.
BUG=

Review-Url: https://codereview.chromium.org/2333293002
Cr-Commit-Position: refs/heads/master@{#39387}
2016-09-13 14:18:17 +00:00
ulan
2b1753ac94 Fix a race condition in simulator that happens when flushing icache.
During GC multiple threads can request icache flush when evacuating
code space in parallel.

Simulator::FlushICache updates Isolate::simulator_icache hashmap,
which leads to a race.

This patch adds a lock for simulator_icache.

BUG=

Review-Url: https://codereview.chromium.org/2338793002
Cr-Commit-Position: refs/heads/master@{#39386}
2016-09-13 14:12:10 +00:00
mstarzinger
85289749f4 [interpreter] Add regression test for bogus OSR entry.
This adds a regression test for a bug where {OsrPoll} instructions
within the bytecode stream ended up outside of actual loops. This has
been fixed already, by merging {OsrPoll} into the backwards branch.

R=rmcilroy@chromium.org
TEST=mjsunit/regress/regress-crbug-645888
BUG=chromium:645888

Review-Url: https://codereview.chromium.org/2337033002
Cr-Commit-Position: refs/heads/master@{#39385}
2016-09-13 13:23:21 +00:00
mstarzinger
c9864173f1 [interpreter] Merge {OsrPoll} with {Jump} bytecode.
This introduces a new {JumpLoop} bytecode to combine the OSR polling
mechanism modeled by {OsrPoll} with the actual {Jump} performing the
backwards branch. This reduces the overall size and also avoids one
additional dispatch. It also makes sure that OSR polling is only done
within real loops.

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

Review-Url: https://codereview.chromium.org/2331033002
Cr-Commit-Position: refs/heads/master@{#39384}
2016-09-13 13:07:36 +00:00
franzih
26f3e304a1 Fix function name in error message and use correct interceptor if an error occurs.
BUG=

Review-Url: https://codereview.chromium.org/2338773002
Cr-Commit-Position: refs/heads/master@{#39383}
2016-09-13 12:56:26 +00:00
hpayer
1ccc742dc3 [heap] Enable black allocation when finalizing incremental marking.
BUG=chromium:630386

Review-Url: https://codereview.chromium.org/2239733002
Cr-Commit-Position: refs/heads/master@{#39382}
2016-09-13 12:38:37 +00:00
bmeurer
0fb92f2735 [turbofan] Properly use MachineRepresentation for field access.
When lowering DataField accesses, we should pay attention to the
MachineRepresentation reported by the AccessInfo. This doesn't
yet change the rest of the pipeline to take full advantage of
the representations.

Drive-by-fix: Make the code more robust, especially the part that
deals with mutable heap number access.

R=mvstanton@chromium.org
BUG=v8:5267,v8:5270

Review-Url: https://codereview.chromium.org/2334193002
Cr-Commit-Position: refs/heads/master@{#39381}
2016-09-13 12:24:58 +00:00
hpayer
047977c53d [heap] Abort black allocation when aborting incremental marking.
BUG=chromium:630386

Review-Url: https://codereview.chromium.org/2337943002
Cr-Commit-Position: refs/heads/master@{#39380}
2016-09-13 12:07:16 +00:00
bmeurer
97b330ada5 [turbofan] Avoid unnecessary JSConvertReceiver nodes.
When inlining sloppy functions try to find some witness in the effect
chain that the receiver is already a JSReceiver and thereby avoid
inserting the JSConvertReceiver node, which we currently cannot really
optimize away most of the time.

Middle-term we may want to change the way CheckMaps works and have some
unified mechanism to deal with effect chain walks to find witnesses for
various map related facts. Also we may want to consider doing this
optimization later, although that requires some more refactorings since
we already promised that JSConvertReceiver gives a Type::Receiver.

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

Review-Url: https://codereview.chromium.org/2333213002
Cr-Commit-Position: refs/heads/master@{#39379}
2016-09-13 11:45:59 +00:00
leszeks
1c0c5fda26 [Interpreter] Move context chain search loop to handler
Moves the context chain search loop out of generated bytecode, and into
the (Lda|Ldr|Sda)ContextSlot handler, by passing the context depth in as
an additional operand. This should decrease the bytecode size and
increase performance for deep context chain searches, at the cost of
slightly increasing bytecode size for shallow context access.

Review-Url: https://codereview.chromium.org/2336643002
Cr-Commit-Position: refs/heads/master@{#39378}
2016-09-13 11:09:33 +00:00
mvstanton
2ab3fcf42f Record call counts also for megamorphic calls.
To make better inlining decisions, it's good to have call counts for poly/mega-morphic cases. This CL makes it work for calls, and another will follow to better unify the code between constructor calls and normal calls (and thence, to record megamorphic call counts there as well).

BUG=

Review-Url: https://codereview.chromium.org/2325083003
Cr-Commit-Position: refs/heads/master@{#39377}
2016-09-13 11:04:22 +00:00
ishell
6b000846a8 [stubs] Port LoadScriptContextFieldStub and StoreScriptContextFieldStub to TurboFan.
BUG=v8:5269

Review-Url: https://codereview.chromium.org/2325013004
Cr-Commit-Position: refs/heads/master@{#39376}
2016-09-13 09:47:33 +00:00
ivica.bogosavljevic
28bd118148 MIPS64: Add support for DINS to disassembler
BUG=

Review-Url: https://codereview.chromium.org/2331843004
Cr-Commit-Position: refs/heads/master@{#39375}
2016-09-13 09:21:02 +00:00
ulan
672d079ccb [heap] Decouple old generation allocation limit from external memory.
We check for external memory limit in Heap::ReportExternalMemoryPressure.

BUG=chromium:616434

Review-Url: https://codereview.chromium.org/2329993002
Cr-Commit-Position: refs/heads/master@{#39374}
2016-09-13 08:54:10 +00:00
mstarzinger
069fcf4cbb [turbofan] Decouple OSR entry from {OsrPoll} bytecode.
This makes sure OSR entry points can be added without having special
{OsrPoll} instructions in the bytecode stream. Eventually we might end
up merging back-branches and OSR polls together. Any loop header can be
used as an OSR entry point.

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

Review-Url: https://codereview.chromium.org/2329933003
Cr-Commit-Position: refs/heads/master@{#39373}
2016-09-13 08:42:04 +00:00
ishell
b9b350cb12 [stubs] Port KeyedLoadSloppyArgumentsStub and KeyedStoreSloppyArgumentsStub to TurboFan.
BUG=v8:5269

Review-Url: https://codereview.chromium.org/2327103002
Cr-Commit-Position: refs/heads/master@{#39372}
2016-09-13 08:24:59 +00:00
bmeurer
ae9a39b010 [turbofan] Make the inlining heuristic deterministic.
Don't sort inline candidates by comparing Node pointers, where the order
depends on the allocation order and the concrete Zone memory layout at
runtime. Instead sort based on NodeId, which is deterministic.

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

Review-Url: https://codereview.chromium.org/2336113002
Cr-Commit-Position: refs/heads/master@{#39371}
2016-09-13 08:19:37 +00:00
machenbach
086f566ed8 [gn] Switch mipsel and mips64el bots to gn
BUG=chromium:474921
NOTRY=true

Review-Url: https://codereview.chromium.org/2328233002
Cr-Commit-Position: refs/heads/master@{#39370}
2016-09-13 07:42:09 +00:00
machenbach
a482ab5c82 [gn] Add gn configs for mips to match old behavior
BUG=chromium:474921
NOTRY=true

Review-Url: https://codereview.chromium.org/2322163003
Cr-Commit-Position: refs/heads/master@{#39369}
2016-09-13 07:33:11 +00:00
bmeurer
e786ef2474 [turbofan] Do constant folding for Float64Pow.
Also unify the Pow implementation somewhat. There are still some
inconsistencies with the FPU version for x64/ia32, but that has
to be resolved separately.

R=ahaas@chromium.org, mvstanton@chromium.org
BUG=v8:5086

Review-Url: https://codereview.chromium.org/2333663002
Cr-Commit-Position: refs/heads/master@{#39368}
2016-09-13 07:10:40 +00:00
machenbach
9f42d6c2c0 [gn] Switch arm cross-compile bots to gn
BUG=chromium:474921
NOTRY=true

Review-Url: https://codereview.chromium.org/2328293002
Cr-Commit-Position: refs/heads/master@{#39367}
2016-09-13 06:37:36 +00:00
bmeurer
dfc4b47f66 [turbofan] Strength reduce CheckTaggedSigned/Pointer with checked inputs.
Add strength reduction rules to optimize

 CheckTaggedSigned(CheckTaggedSigned(x)) -> CheckTaggedSigned(x)

and

 CheckTaggedPointer(CheckTaggedPointer(x)) -> CheckTaggedPointer(x)

where we do some cleanup optimizations after loop peeling and redundancy
elimination, which can generate these constructs.

BUG=v8:5267

Review-Url: https://codereview.chromium.org/2336093002
Cr-Commit-Position: refs/heads/master@{#39366}
2016-09-13 06:32:08 +00:00
bmeurer
a63997599e [unittests] Reduce compilation overhead of opcodes-unittest.cc.
Reduce compilation time (with clang) for opcodes-unittest.cc from
1m38s to roughly 1s by not overusing the macro expansion magic.

TBR=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2331413002
Cr-Commit-Position: refs/heads/master@{#39365}
2016-09-13 05:16:18 +00:00
bmeurer
fe952ee169 [turbofan] Avoid shadowing of local variables.
Cleanup fix addressing the comment on crrev.com/2325943002.

TBR=jarin@chromium.org,brucedawson@chromium.org

Review-Url: https://codereview.chromium.org/2335083002
Cr-Commit-Position: refs/heads/master@{#39364}
2016-09-13 04:11:17 +00:00
kozyatinskiy
456cf5e1cd [inspector] replaced std::snprintf with base::OS::SNPrintf
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2336023002
Cr-Commit-Position: refs/heads/master@{#39363}
2016-09-13 02:39:11 +00:00
kozyatinskiy
eb9dc6328f [inspector] disallow usage of non public api methods in inspector
Going forward we may relax this, but it is a conscious decision to be made.

BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2337523003
Cr-Commit-Position: refs/heads/master@{#39362}
2016-09-13 00:01:44 +00:00
mtrofin
b4dc310aab [wasm] reuse the first compiled module.
This change avoids needing to keep around an unused compiled
module. Instead, the result of compiling the wasm bytes is
given to the first instance. The module object and that instance object
point to the same compiled module. Instances are, then, cloned from
the compiled module the module object points to. When an instance is
collected, we make sure that the module object still has a clone
available, and, if the last instance is GC-ed, we also reset the compiled
module so that it does not reference its heap, so that it (==heap) may
be collected.

This is achieved by linking the clones in a double-linked list and
registering a finalizer for each. When we create an instance, we tie it
in the front of the list, making the module object point to it (O(1)). When
the finalizer is called, we relink the list over the dying object (O(1)). The
costliest operation is finalizing the last instance, since we need to visit
all wasm functions and reset heap references.

BUG=v8:5316

Committed: https://crrev.com/01f5af515728aebe6c5246f4f7dd6c573e8748af
Review-Url: https://codereview.chromium.org/2305903002
Cr-Original-Commit-Position: refs/heads/master@{#39153}
Cr-Commit-Position: refs/heads/master@{#39361}
2016-09-12 23:13:19 +00:00
mtrofin
8e5ac62ddf [wasm] Compilation/Instantiation pipeline works off module object
Moved the compilation/instantiation pipeline to work off the
module object (JSObject), making the compiled module data (the
FixedArray) an implementation detail. This:
- simplifies the code by removing duplicate decode->compile->instantiate
sequences
- sets up the stage for "dressing up" the runtime model with
stronger typed APIs
- helps relanding this CL: https://codereview.chromium.org/2305903002/.
  It turns out that GCs during the cloning/instantiation events cause
trouble, and centering the source of truth on the module object helps
address this issue.

In the process, clarified cctest setup for wasm-capable isolates,
and changed signatures for consistency (using ModuleOrigin througout).

BUG=

Review-Url: https://codereview.chromium.org/2320723005
Cr-Commit-Position: refs/heads/master@{#39360}
2016-09-12 22:11:56 +00:00
cbruni
621f4af720 [elements] Handlify SloppyArguments IndexOfValueImpl
The raw pointer to the parameter_map might get stale in case of accessors present on
the arguments object.
Drive-by-fix: use nullptr instead of the_hole with isolate access.

BUG=chromium:645680

Review-Url: https://codereview.chromium.org/2332503002
Cr-Commit-Position: refs/heads/master@{#39359}
2016-09-12 17:32:09 +00:00
jarin
e031451cd7 [turbofan] Another fix for induction variable typing monotonicity.
BUG=chromium:645851

Review-Url: https://codereview.chromium.org/2332633002
Cr-Commit-Position: refs/heads/master@{#39358}
2016-09-12 17:05:11 +00:00
adamk
58325e616d [turbofan] Switch from a whitelist to a blacklist for NeedsFrameStateInput
The whitelist is populated with those inline intrinsics that are lowered
in JSIntrinsicInlining and were not previously blacklisted. Thus the only
additional FrameStates this CL adds are those where the caller tries to
call the INLINE version of an intrinsic but ends up calling the RUNTIME
version instead.

R=bmeurer@chromium.org
BUG=chromium:644631

Review-Url: https://codereview.chromium.org/2331543002
Cr-Commit-Position: refs/heads/master@{#39357}
2016-09-12 16:12:57 +00:00
bjaideep
bc752a0977 AIX: Disable backtrace API call
Backtrace() and backtrace_symbols() API are not supported on
AIX and there are no user-mode equivalent API for the same.
For now, disabling the call to those API.
Currently this is preventing V8 to build on AIX.
This debug functionality was added in
https://codereview.chromium.org/2248393002

R=rmcilroy@chromium.org

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2324453002
Cr-Commit-Position: refs/heads/master@{#39356}
2016-09-12 15:32:16 +00:00
v8-autoroll
87c4a7c80f Update V8 DEPS.
Rolling v8/base/trace_event/common to 26eac53e73b09625e9b8f783b479e54fcae85f58

Rolling v8/build to 9d601d07a9adaa2719d114290e79084d429a7dab

Rolling v8/third_party/WebKit/Source/platform/inspector_protocol to f9c1216417fe8e8f99d861a4d9cf360ae1d8645e

Rolling v8/tools/clang to 4ac706a04b38c05a8012257dc657e069134902c7

TBR=machenbach@chromium.org,vogelheim@chromium.org,hablich@chromium.org

Review-Url: https://codereview.chromium.org/2331963002
Cr-Commit-Position: refs/heads/master@{#39355}
2016-09-12 14:34:27 +00:00
ishell
2136adbd96 [stubs] Port StoreGlobalStub to TurboFan.
BUG=v8:5269

Review-Url: https://codereview.chromium.org/2322373002
Cr-Commit-Position: refs/heads/master@{#39354}
2016-09-12 14:29:17 +00:00
ulan
a26769629b Reland "[heap] Fix a formatting bug in --trace-incremental-marking. (patchset #2 id:20001 of https://codereview.chromium.org/2324623004/ )"
This reverts commit 6c2a217ef7.

The performance regression in crbug.com/645411 was not caused
by the original CL.

TBR=mlippautz@chromium.org

Review-Url: https://codereview.chromium.org/2329983002
Cr-Commit-Position: refs/heads/master@{#39353}
2016-09-12 13:04:26 +00:00
neis
21cb110547 [modules] Basic support of exports
This adds partial support of exports to the runtime system and
to the interpreter. It introduces a new HeapObject JSModule that
maps each of the module's export names to a Cell containing the
exported value.

Several aspects of this implementation are subject to change in
follow-up CLs.

BUG=v8:1569

Committed: https://crrev.com/241a0412eed919395a2e163b30b9b66071ce5c17
Review-Url: https://codereview.chromium.org/2302783002
Cr-Original-Commit-Position: refs/heads/master@{#39341}
Cr-Commit-Position: refs/heads/master@{#39352}
2016-09-12 12:55:37 +00:00
ahaas
1521fe9c3c [wasm] Call the wasm interpreter from the wasm-code-fuzzer.
With this CL the wasm-code-fuzzer first decodes and interprets the test
case generated by the fuzzer. It then compiles the test case, but only
executes the compiled instance if the interpretation of the test case
was successful. If the compiled instance is executed, then the result of
the execution is compared with the result of the interpretation.

Additionally this CL refactors the CompileAndRunWasmModule function in
wasm-module.cc to resuse code in the call to the interpreter.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2321443002
Cr-Commit-Position: refs/heads/master@{#39351}
2016-09-12 12:26:46 +00:00
ishell
93fc4fea7b [stubs] Port StoreFieldStub to TurboFan.
BUG=v8:5269

Review-Url: https://codereview.chromium.org/2325013003
Cr-Commit-Position: refs/heads/master@{#39350}
2016-09-12 12:19:14 +00:00
bmeurer
4cf5ee6b38 [turbofan] Properly emit vsqrtsd if AVX is enabled.
We shall not mix AVX and SSE instructions as that can cause performance
regressions in some areas, so make sure to emit vsqrtsd instead of
sqrtsd when AVX is enabled.

R=ahaas@chromium.org

Review-Url: https://codereview.chromium.org/2335603002
Cr-Commit-Position: refs/heads/master@{#39349}
2016-09-12 11:51:02 +00:00
ulan
6a1b49d79c [heap] Do more incremental marking work in tasks.
This patch changes incremental marking work scheduling from combination
of idle/delayed tasks to ordinary short-running tasks and moves
more marking work from V8.Execute to tasks by accounting how much
bytes were marked in tasks.

BUG=chromium:616434
LOG=NO

Review-Url: https://codereview.chromium.org/2321553002
Cr-Commit-Position: refs/heads/master@{#39348}
2016-09-12 11:46:30 +00:00
petermarshall
8ffbd333bb [builtins] Move StringLocaleCompare to a builtin.
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng

BUG=v8:5364

Review-Url: https://codereview.chromium.org/2313393005
Cr-Commit-Position: refs/heads/master@{#39347}
2016-09-12 11:40:33 +00:00
rmcilroy
d15f45d4db [Parser] Avoid on-the-fly internalization for natives_syntax.
Rework Runtime::FunctionForName to take a c-string instead of a v8::String
so that the parser can parse native syntax runtime calls without doing
on-the-fly internalization.

Also adds a c-string variant of IntrinsicIndexForName for the same reasons.

BUG=v8:5215,chromium:634953

Review-Url: https://codereview.chromium.org/2324803002
Cr-Commit-Position: refs/heads/master@{#39346}
2016-09-12 11:35:58 +00:00
neis
429ff47e2b Revert of [modules] Basic support of exports (patchset #10 id:180001 of https://codereview.chromium.org/2302783002/ )
Reason for revert:
Failures related to deopt.

Original issue's description:
> [modules] Basic support of exports
>
> This adds partial support of exports to the runtime system and
> to the interpreter. It introduces a new HeapObject JSModule that
> maps each of the module's export names to a Cell containing the
> exported value.
>
> Several aspects of this implementation are subject to change in
> follow-up CLs.
>
> BUG=v8:1569
>
> Committed: https://crrev.com/241a0412eed919395a2e163b30b9b66071ce5c17
> Cr-Commit-Position: refs/heads/master@{#39341}

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

Review-Url: https://codereview.chromium.org/2328283002
Cr-Commit-Position: refs/heads/master@{#39345}
2016-09-12 11:34:24 +00:00
neis
153dde4f86 [interpreter] Use clearer names for context related functions.
R=rmcilroy@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2331913002
Cr-Commit-Position: refs/heads/master@{#39344}
2016-09-12 11:25:39 +00:00
Alexander.Gilday2
278b9f800b [builtins] Migrate ToNumber to TurboFan.
Migrate ToNumber platform builtin to TurboFan. Also move
NonNumberToNumber builtin implementation to helper function.

BUG=v8:5049

Review-Url: https://codereview.chromium.org/2327703003
Cr-Commit-Position: refs/heads/master@{#39343}
2016-09-12 11:01:10 +00:00
petermarshall
e7b7ba8edd [builtins] Move StringNormalize to a cpp builtin.
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng

BUG=v8:5364

Committed: https://crrev.com/7f84a6a2e7000bebba49354b4648346ff606ca34
Review-Url: https://codereview.chromium.org/2315343002
Cr-Original-Commit-Position: refs/heads/master@{#39331}
Cr-Commit-Position: refs/heads/master@{#39342}
2016-09-12 10:54:27 +00:00
neis
241a0412ee [modules] Basic support of exports
This adds partial support of exports to the runtime system and
to the interpreter. It introduces a new HeapObject JSModule that
maps each of the module's export names to a Cell containing the
exported value.

Several aspects of this implementation are subject to change in
follow-up CLs.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2302783002
Cr-Commit-Position: refs/heads/master@{#39341}
2016-09-12 10:51:27 +00:00
mstarzinger
d2189c6362 [turbofan] Solidify OSR deconstruction code a bit.
It is invalid for OSR deconstruction to leave a graph with a node
representing the OSR normal entry (and no OSR loop entry). Subsequent
lowering phases will not handle {OsrNormalEntry} operators and hence
will lead to serious clogging further down the pipeline.

R=bmeurer@chromium.org
BUG=chromium:641893

Review-Url: https://codereview.chromium.org/2336543002
Cr-Commit-Position: refs/heads/master@{#39340}
2016-09-12 10:46:25 +00:00