Commit Graph

478 Commits

Author SHA1 Message Date
ulan
31e3177bb0 Add V8 platform API to call delayed task.
Delayed tasks can be used to perform non-urgent clean up work.

BUG=chromium:490559
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#29084}
2015-06-17 12:09:40 +00:00
bmeurer
80a6e53935 [turbofan] Move graph trimming functionality to dedicated GraphTrimmer.
Up until now that was still mixed with control reduction in the
ControlReducer. This separation allows us to remove the horrible
Reducer::Finish hack and also do graph trimming at more appropriate
places in the pipeline (i.e. trim dead nodes after generic lowering,
which can also make nodes dead).

R=jarin@chromium.org,mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29077}
2015-06-17 10:56:37 +00:00
bmeurer
ad6e739165 [turbofan] Remove ineffective optimization from ControlReducer.
This optimization just duplicates part of the ToBoolean rule in the
Typer, and it doesn't make sense to have adhoc partial typing rules in
the ControlReducer anyway.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29064}
2015-06-17 06:11:55 +00:00
mstarzinger
3161cb550c [turbofan] Ensure lazy bailout point in exception handler.
This ensures there is a lazy bailout point at the entry of every
exception handler so that deoptimized code is not re-entered through
caught exceptions.

R=jarin@chromium.org
TEST=cctest/test-run-deopt/DeoptExceptionHandler

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

Cr-Commit-Position: refs/heads/master@{#29061}
2015-06-17 05:40:42 +00:00
littledan
350a70e5ef Inline code generation for %_IsTypedArray
This patch implements %_IsTypedArray in fullcodegen, Hydrogen and
Turbofan in order to implement fast type checks to enable ES6
TypedArray features and semantics efficiently.

R=adamk,titzer
LOG=Y
BUG=v8:4085

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

Cr-Commit-Position: refs/heads/master@{#29033}
2015-06-15 22:16:43 +00:00
wingo
9efb230d36 Fix -Wsign-compare errors in TF tests under GCC 4.9.2
R=jkummerow@chromium.org
LOG=N
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29023}
2015-06-15 12:03:45 +00:00
ulan
143a9e0431 Compute the heap growing factor based on mutator utilization and allocation throughput.
Doc: https://goo.gl/LLGvBs

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29015}
2015-06-15 08:32:59 +00:00
wingo
103fcfaa40 Add script context with context-allocated "const this"
This is a reapplication of https://codereview.chromium.org/1173333004.

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

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

Cr-Commit-Position: refs/heads/master@{#28998}
2015-06-12 12:34:24 +00:00
bmeurer
c487aba74c [turbofan] Use appropriate type for NodeId.
Up until now we used int32_t for NodeId, but that was not ideal because
negative values are invalid for NodeId and we use it as an array index
for example in the NodeMarker class, where C++ compilers on x64 have to
generate code that does proper sign extension for the indices, which is
completely unnecessary.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28997}
2015-06-12 12:03:19 +00:00
wingo
7063ed2de6 Revert of Add script context with context-allocated "const this" (patchset #2 id:20001 of https://codereview.chromium.org/1173333004/)
Reason for revert:
nosnap failure

Original issue's description:
> Add script context with context-allocated "const this"
>
> This is a reapplication of https://codereview.chromium.org/1179893002/.
>
> R=rossberg@chromium.org,mstarzinger@chromium.org
> LOG=N
> BUG=498811
>
> Committed: https://crrev.com/cfc764f4050edc74aef92daa4c39ccc113893968
> Cr-Commit-Position: refs/heads/master@{#28994}

TBR=mstarzinger@chromium.org,rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=498811

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

Cr-Commit-Position: refs/heads/master@{#28996}
2015-06-12 11:53:11 +00:00
wingo
cfc764f405 Add script context with context-allocated "const this"
This is a reapplication of https://codereview.chromium.org/1179893002/.

R=rossberg@chromium.org,mstarzinger@chromium.org
LOG=N
BUG=498811

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

Cr-Commit-Position: refs/heads/master@{#28994}
2015-06-12 11:11:28 +00:00
bmeurer
b5b00cc031 [turbofan] Move RawMachineAssembler to unittests.
R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28993}
2015-06-12 10:33:19 +00:00
machenbach
32e6455c1a Revert of Add script context with context-allocated "const this" (patchset #7 id:120001 of https://codereview.chromium.org/1179893002/)
Reason for revert:
[Sheriff] Breaks gc mole:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gcmole/builds/2435

Original issue's description:
> Add script context with context-allocated "const this"
>
> R=rossberg@chromium.org
> LOG=N
> BUG=498811
>
> Committed: https://crrev.com/fa32d461c16a053cc6d48d3fb326016bc2765765
> Cr-Commit-Position: refs/heads/master@{#28988}

TBR=rossberg@chromium.org,mstarzinger@chromium.org,wingo@igalia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=498811

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

Cr-Commit-Position: refs/heads/master@{#28992}
2015-06-12 10:07:34 +00:00
wingo
fa32d461c1 Add script context with context-allocated "const this"
R=rossberg@chromium.org
LOG=N
BUG=498811

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

Cr-Commit-Position: refs/heads/master@{#28988}
2015-06-12 09:35:57 +00:00
jacob.bramley
065b2374aa Reland [arm64][turbofan]: Handle any immediate shift.
With this patch, we can generate simple immediate-shift instructions for
immediates outside the range "0 <= imm < width". Several related
instruction selectors have also been updated accordingly.

Example of generated code:

    ---- Before ---         ---- After ----
    movz w0, #33            lsr w0, w1, #1
    lsr  w0, w1, w0

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28977}
2015-06-12 05:03:18 +00:00
martyn.capewell
b702cd97d4 [turbofan] Prefer add/shift over madd on ARM64
Before selecting multiply-accumulate for a multiplication with add operation,
check that the multiply can't be reduced to add-with-shift. This prevents
simple multiplications by 3, 5, etc turning into register moves and madd
instructions.

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

Cr-Commit-Position: refs/heads/master@{#28976}
2015-06-12 05:01:07 +00:00
martyn.capewell
1f876f245a [turbofan] Merge sar/shr into MulHigh on ARM64
Merge a following arithmetic or logical right shift into the existing shift
of ARM64's Int32MulHigh or Uint32MulHigh code.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28945}
2015-06-11 14:50:13 +00:00
jacob.bramley
14755c0a2d Revert of [arm64][turbofan]: Handle any immediate shift. (patchset #1 id:1 of https://codereview.chromium.org/1179733004/)
Reason for revert:
Breaks InstructionSelectorTest.Word64ShrWithWord64AndWithImmediate on debug builds (but not optdebug builds). I'll investigate.

Original issue's description:
> [arm64][turbofan]: Handle any immediate shift.
>
> With this patch, we can generate simple immediate-shift instructions for
> immediates outside the range "0 <= imm < width". Several related
> instruction selectors have also been updated accordingly.
>
> Example of generated code:
>
>     ---- Before ---         ---- After ----
>     movz w0, #33            lsr w0, w1, #1
>     lsr  w0, w1, w0
>
> BUG=
>
> Committed: https://crrev.com/36d771bbfa4af5efcc1c1dcf5b234445cb7ee722
> Cr-Commit-Position: refs/heads/master@{#28943}

TBR=bmeurer@chromium.org,ulan@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28944}
2015-06-11 14:46:42 +00:00
jacob.bramley
36d771bbfa [arm64][turbofan]: Handle any immediate shift.
With this patch, we can generate simple immediate-shift instructions for
immediates outside the range "0 <= imm < width". Several related
instruction selectors have also been updated accordingly.

Example of generated code:

    ---- Before ---         ---- After ----
    movz w0, #33            lsr w0, w1, #1
    lsr  w0, w1, w0

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28943}
2015-06-11 13:51:03 +00:00
mstarzinger
3548c5c6f1 [turbofan] Make IfException projections consume effects.
This is needed in order to allow expansion of a throwing node into a
set of nodes that produce different effects for the successful and the
exceptional continuation.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28918}
2015-06-11 04:22:11 +00:00
mstarzinger
23d7123cff [turbofan] Deprecate NodeProperties::ReplaceWithValue.
This deprecates the aforementioned mutator in favor of a simpler
NodeProperties::ReplaceUses that doesn't perform any relaxation.
Preparation for enabling support for try-catch statements.

R=bmeurer@chromium.org
TEST=unittests/NodePropertiesTest

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

Cr-Commit-Position: refs/heads/master@{#28897}
2015-06-10 09:14:03 +00:00
mvstanton
662a5585ee Turbofan: Make type feedback vector a Node.
This improves code generation. Before, it was a constant loaded in a register
every time.

R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28874}
2015-06-09 16:02:33 +00:00
mstarzinger
5ca1f24dd5 [turbofan] Optimized lowering of DYNAMIC_LOCAL lookup slot loads.
This adds handling of JSLoadDynamicContext nodes to JSTypedLowering to
perform extension checks and an inline fast path. The fast path is a
context slot load targeting a specific context.

R=bmeurer@chromium.org
BUG=v8:4131
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28823}
2015-06-08 08:59:05 +00:00
mstarzinger
5cefb367ce [turbofan] Turn LoadElimination into an AdvancedReducer.
This in turn allows usage of AdvancedReducer::ReplaceWithValue which
has access to the underlying graph reducer.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28817}
2015-06-05 16:40:58 +00:00
mstarzinger
a6f23850a5 [turbofan] Turn JSBuiltinReducer into an AdvancedReducer.
This in turn allows usage of AdvancedReducer::ReplaceWithValue which
has access to the underlying graph reducer. It will allow us to deal
with exception continuations correctly.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28813}
2015-06-05 12:37:48 +00:00
mstarzinger
8f4d9a0a1e [turbofan] Allow ReplaceWithValue to kill control.
This allows any AdvancedReducer to remove exception projections from
graphs. This is the common case when JS-operators are being replaced
with pure values. The old NodeProperties::ReplaceWithValue is being
deprecated in favor of AdvancedReducer::ReplaceWithValue.

R=titzer@chromium.org
TEST=unittests/AdvancedReducerTest

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

Cr-Commit-Position: refs/heads/master@{#28810}
2015-06-05 12:02:09 +00:00
paul.lind
21585d55c1 Fix more -Wsign-compare bugs with GCC 4.9.2.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28798}
2015-06-04 01:28:27 +00:00
bmeurer
e0fa875858 [turbofan] Use reference equal to zero instead of a smi check.
In typed lowering we can use the ReferenceEqual simplified operator
instead of ObjectIsSmi to check for context extensions. This generates
the desired code.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28776}
2015-06-03 05:10:55 +00:00
martyn.capewell
afd0367f5d [arm64] Use ubfiz in ARM64 instruction selector
Select ubfiz for (x & mask) << imm where mask is contiguous and imm is non-zero.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28755}
2015-06-02 10:57:44 +00:00
mstarzinger
440d099c5c [turbofan] Optimized lowering of DYNAMIC_GLOBAL lookup slot loads.
This adds handling of JSLoadDynamicGlobal nodes to JSTypedLowering to
perform extension checks and an inline fast path. The fast path is a
global variable load from the global object.

R=bmeurer@chromium.org
BUG=v8:4131
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28750}
2015-06-02 09:37:59 +00:00
bmeurer
86b30420a8 [turbofan] Enable typed lowering of string addition.
Unfortunately StringAdd is not pure in V8 because we might throw an
exception if the resulting string length is outside the valid bounds, so
there's no point in having a simplified StringAdd operator.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28747}
2015-06-02 08:50:53 +00:00
mstarzinger
d8b94f34cc [turbofan] Introduce prediction for exception handlers.
This introduces a conservative prediction for each exception handler
whether it will locally catch an exception or re-throw it to outside
the code bondaries. It will allow for a more intuitive prediction of
whether an exception is considered "caught" or "uncaught".

R=bmeurer@chromium.org,yangguo@chromium.org
BUG=chromium:492522
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28681}
2015-05-28 13:23:03 +00:00
bmeurer
b77df02713 [turbofan] Remove the JSGraph dependency from the ControlFlowOptimizer.
The control flow optimization should work independent of the JSGraph. We
used the JSGraph there because it was convinient, not because it was
necessary.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28674}
2015-05-28 09:13:05 +00:00
bmeurer
19482d29e5 [turbofan] Remove the useless SimplifiedOperatorReducer.
The SimplifiedOperatorReducer is (mostly) unused, except for the very
rough store elimination, and just eats compilation time.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28673}
2015-05-28 08:38:13 +00:00
bmeurer
b66226a9d9 [turbofan] Optimize strict equality of unique values.
If both inputs to JSStrictEqual/JSStrictNotEqual are unique values (i.e.
values with a canonical representation), we can lower the comparison to
ReferenceEqual instead of StringEqual or CompareIC.

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

Cr-Commit-Position: refs/heads/master@{#28646}
2015-05-27 04:23:41 +00:00
bmeurer
f6fb5eb197 [turbofan] Connect loops to end via Terminate during graph building.
This way we don't need to connect (potentially) non-terminating loops
later during control reduction, which saves one forward pass over the
control graph.  Long term we will move the trimming functionality of
the control reducer to the GraphReducer, and get rid of the Finish
method again.

As a bonus, this change also properly rewires Terminate, Throw and
Deoptimize during inlining.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28625}
2015-05-26 12:18:07 +00:00
bmeurer
2b93b8aa41 [turbofan] Change End to take a variable number of inputs.
This simplifies the handling of the End node. Based on this CL we will
finally fix terminating every loop from the beginning (via Terminate
nodes) and fix inlining of Throw, Deoptimize and Terminate.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28620}
2015-05-26 10:32:10 +00:00
titzer
65b66634de [turbofan] Rework Node guts to save space.
This reduces the storage per-Node storage from 7 words to 6 and per-edge
storage from 6 words to 4.
On average this is about 10%-15% space savings over the whole graph.

Remove the use of std::deque as the out-of-line storage for inputs.
Reduce size of Use links and use pointer arithmetic to find Node
from Use.

R=mstarzinger@chromium.org,jarin@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28583}
2015-05-22 11:12:47 +00:00
titzer
41795b8ae2 [turbofan] Add bounds check to Node::InputAt(index) and fix tests that go out of bounds.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28540}
2015-05-21 10:59:40 +00:00
bmeurer
4a1ab1cac4 [turbofan] Pass deoptimization mode to type feedback specializer.
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28524}
2015-05-20 17:01:17 +00:00
bmeurer
8236bfbae3 [turbofan] Pass deoptimization mode to intrinsic lowering.
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28515}
2015-05-20 13:11:24 +00:00
ulan
f2f8001f1b Take freed handles into account when scheduling idle GCs.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28508}
2015-05-20 12:09:52 +00:00
ulan
39491c5168 Restore NothingOrDone action in idle time handler.
This also adjusts transitioning between modes so that crbug.com/460090 remains fixed.

BUG=chromium:489323, chromium:460090
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#28490}
2015-05-19 18:12:07 +00:00
mstarzinger
c06b1e05ca [turbofan] Turn JSIntrinsicLowering into an AdvancedReducer.
This in turn allows usage of AdvancedReducer::ReplaceWithValue which
has access to the underlying graph reducer. It will allow us to deal
with exception continuations correctly.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28485}
2015-05-19 15:10:23 +00:00
mstarzinger
329a3f220c [turbofan] Turn JSTypedLowering into an AdvancedReducer.
This in turn allows usage of AdvancedReducer::ReplaceWithValue which
has access to the underlying graph reducer. It will allow us to deal
with exception continuations correctly.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28468}
2015-05-19 09:57:42 +00:00
titzer
178c0f5f05 [turbofan] Fix Node::TrimInputCount() followed by Node::AppendInput() bug.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28452}
2015-05-18 15:49:04 +00:00
titzer
029a2d61a6 [turbofan] JSTypeFeedbackSpecializer is now an AdvancedReducer.
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28441}
2015-05-18 11:54:00 +00:00
hpayer
6ead193b51 Make sure that idle scavenges are just performed when enough objects are allocated in new space.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28428}
2015-05-15 16:06:08 +00:00
bmeurer
1643671f1b [turbofan] Pass closure as node to FrameState.
First step towards support for inlining based on SharedFunctionInfo
instead of JSFunction.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28419}
2015-05-15 12:17:05 +00:00
hpayer
bc9e53406e When context disposal rate is high and we cannot perform a full GC, we do nothing until the context disposal rate becomes lower.
BUG=chromium:473351
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#28416}
2015-05-15 07:48:07 +00:00
martyn.capewell
cdc43bc5fd ARM64: Enable shorten-64-to-32 warning
Enable clang's shorten-64-to-32 warning flag on ARM64, and fix the warnings
that arise.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28412}
2015-05-15 05:13:11 +00:00
titzer
29e15dad16 [turbofan] Add FrameStates before all property accesses.
R=jarin@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28392}
2015-05-13 12:29:32 +00:00
bmeurer
2111d18dba [turbofan] Add frame state before JavaScript comparisons.
Use these check points to optimize comparisons where we already know
that one side cannot be a String (or turn into a string via
ToPrimitive).

Also remove bunch of useless DoNotCrash tests for the scheduler that are
painful to maintain and add almost no value.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28383}
2015-05-13 07:38:35 +00:00
ulan
bbca83c398 Make transition to reduce memory mode more conservative in idle time handler.
BUG=chromium:486005
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#28378}
2015-05-12 17:24:58 +00:00
titzer
e5d5cac7d9 [turbofan] Add AdvancedReducer::ReplaceWithValue() method and convert JSInlining to an AdvancedReducer.
Note that this is just a duplication for now. We'll want to get rid of the
NodeProperties::ReplaceWithValue() method in the long run.

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28363}
2015-05-12 12:41:36 +00:00
wingo
004bb77ec5 Fix more -Werror=sign-compare bugs with GCC 4.9.2
R=svenpanne@chromium.org
LOG=N
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28337}
2015-05-11 11:07:15 +00:00
martyn.capewell
6e6d956e11 [turbofan] Use sbfx in ARM64 instruction selector
Select sbfx for ((x << k) >> k) in ARM64 instruction selector, and similarly
for ubfx. This is a more generic version of the previous sxtb/h selector.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28318}
2015-05-08 12:51:43 +00:00
bmeurer
189609e197 [turbofan] Float32Abs and Float64Abs are supported by all backends.
The Float32Abs and Float64Abs operators are supported by all TurboFan
backends, so we no longer need the flags for them.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28310}
2015-05-08 08:25:05 +00:00
ulan
ae6a0b8075 Add mode to reduce memory usage in idle notification.
While the mutator is active, the idle time handler optimizes for latency by doing only incremental steps and scavenges.

When the mutator becomes inactive, the idle time handler forces few incremental GCs to reclaim memory and then stops until mutator is active again.

BUG=460090
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28300}
2015-05-07 14:41:54 +00:00
ulan
d77839fd01 Add aggregated memory histograms.
This introduces V8.MemoryHeapCommitted and V8.MemoryHeapUsed histograms.

In contrast to the existing memory histograms, the new histograms are uniform in time, i.e. their samples happen at regular time intervals. The --histogram-interval specifies the length of the interval.

We implement this by linearly interpolating memory stats between GC and idle notification events.

BUG=chromium:485472
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#28292}
2015-05-07 10:03:41 +00:00
bmeurer
203438d9bc [turbofan] Connect non-terminating loops via Terminate.
This revives the Terminate operator and removes the weird Always
operator. As a first step we let the ControlReducer connect non
terminating loops via Terminate. The next step will be to change the
graph builder to insert Terminate nodes into every loop.

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

Cr-Commit-Position: refs/heads/master@{#28259}
2015-05-06 12:51:44 +00:00
bmeurer
7b33409ba3 [turbofan] Add support for advanced reducers.
An AdvancedReducer is basically a regular Reducer with an editor
that can perform graph editing operations beyond changing or
replacing the node that is currently being reduced. The GraphReducer
is the default implementation of the AdvancedReducer::Editor interface.

The ControlReducerImpl is now just an AdvancedReducer, which
temporarily requires a Finish method in the reducer to implement
the dead node trimming until we move that to the GraphReducer
(which in turn requires that all loops are connected to End).

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

Cr-Commit-Position: refs/heads/master@{#28251}
2015-05-06 10:12:52 +00:00
bmeurer
d21de2a48b [turbofan] Fix tail call optimization.
Tail calls are matched on the graph, with a dedicated tail call
optimization that is actually testable. The instruction selection can
still fall back to a regular if the platform constraints don't allow to
emit a tail call (i.e. the return locations of caller and callee differ
or the callee takes non-register parameters, which is a restriction that
will be removed in the future).

Also explicitly limit tail call optimization to stubs for now and drop
the global flag.

BUG=v8:4076
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#28219}
2015-05-05 09:43:02 +00:00
mstarzinger
d6945db703 [turbofan] Add SimplifiedOperator::Allocate operator.
This introduces a simplified allocation operator which can be used to
model inline allocations in TurboFan. It is currently used for context
allocations, but still disabled because change lowering introduces
floating allocations outside the effect chain that interfere.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28195}
2015-05-04 12:07:12 +00:00
dcarney
4fe546c785 [test] make instruction sequence test emit cfgs more like the scheduler
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28167}
2015-04-30 13:39:16 +00:00
bmeurer
b9d583d581 [turbofan] Don't spread global flag checks all over the compiler code.
Better encapsulate the source position handling in TurboFan.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28153}
2015-04-30 09:56:31 +00:00
svenpanne
4b122b7504 Detect simple tail calls
This CL contains the first steps towards tail call optimization:

  * Structurally detect tail calls during instruction selection,
    looking for special return/call combinations.

  * Added new architecture-specific instructions for tail calls which
    jump instead of call and take care of frame adjustment.

  * Moved some code around.

Currently we restrict tail calls to callees which only use registers
for arguments/return value and to call sites which are explicitly
marked as being OK for tail calls. This excludes, among other things,
call sites in sloppy JS functions and our IC machinery (both need in
general to be able to access the caller's frame).

All this is behind a flag --turbo-tail-calls, which is currently off
by default, so it can easily be toggled.

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

Cr-Commit-Position: refs/heads/master@{#28150}
2015-04-30 09:10:28 +00:00
michael_dawson
41cb1e51b9 Switch to larger TOC on AIX for unitttests
Switch to larger TOC on AIX for unitttests as the size has grown
such that it no longer compiles with the default TOC size

	modified:   unittests.gyp

R=danno@chromium.org, svenpanne@chromium.org, mbrandy@us.ibm.com

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28144}
2015-04-30 07:50:27 +00:00
dcarney
81345f1a2c Reland: [turbofan] add MachineType to AllocatedOperand
- allows the optimization of emitted gap move code since the representation of the value in the register is known
- necessary preparation for vector register allocation
- prepare for slot sharing for any value of the same byte width

TBR=jarin@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28140}
2015-04-29 19:36:25 +00:00
machenbach
7eccb18148 Revert of [turbofan] add MachineType to AllocatedOperand (patchset #17 id:310001 of https://codereview.chromium.org/1087793002/)
Reason for revert:
[Sheriff] Breaks compile on chromium asan and v8 msan:
http://build.chromium.org/p/client.v8/builders/Linux%20ASAN%20Builder/builds/3446
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/2085

Original issue's description:
> [turbofan] add MachineType to AllocatedOperand
>
> - allows the optimization of emitted gap move code since the representation of the value in the register is known
> - necessary preparation for vector register allocation
> - prepare for slot sharing for any value of the same byte width
>
> BUG=
>
> Committed: https://crrev.com/3a025d1ab6437559f86a464767aa03d2d9789f6f
> Cr-Commit-Position: refs/heads/master@{#28137}

TBR=jarin@chromium.org,dcarney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28139}
2015-04-29 18:28:47 +00:00
dcarney
3a025d1ab6 [turbofan] add MachineType to AllocatedOperand
- allows the optimization of emitted gap move code since the representation of the value in the register is known
- necessary preparation for vector register allocation
- prepare for slot sharing for any value of the same byte width

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28137}
2015-04-29 14:46:19 +00:00
mstarzinger
4bc2beab97 [test] Turn compiler/test-node-cache into a unit test.
R=jarin@chromium.org
TEST=unittests/NodeCacheTest

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

Cr-Commit-Position: refs/heads/master@{#28136}
2015-04-29 14:40:05 +00:00
jochen
9ba5fe028f Pass ArrayBuffer::Allocator via Isolate::CreateParams
We shouldn't have shared state between isolates by default. The embedder
is free to pass the same allocator to all isolates it creates.

BUG=none
R=dcarney@chromium.org
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#28127}
2015-04-29 09:54:43 +00:00
jochen
b584bab2f5 Remove support for malloc'd typed arrays
All typed arrays should be allocated through the array buffer allocator

BUG=none
R=dcarney@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#28105}
2015-04-28 11:24:55 +00:00
conradw
6988aec61f [strong] Disallow implicit conversions for bitwise ops, shifts
See https://codereview.chromium.org/1092353002/

Due to parser rewrites, also implements restrictions for unary ~.

Still to come, implementing restrictions for binary + and comparison.

BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28104}
2015-04-28 11:19:49 +00:00
chunyang.dai
e31f5ec7eb Disable two test cases for turbofan unsupported platform.
These two test cases "InlineCreateArrayLiteral" and "InlineCreateObjectLiteral" are
  added in d1597b7d22. They invokes Linkage::GetStubCallDescriptor
  which is unimplemented for turbofan unsupported platform.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28090}
2015-04-27 17:02:27 +00:00
titzer
6e82fbfbaf [turbofan] Reland: Optimize loads from the global object in JSTypeFeedbackSpecializer.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28073}
2015-04-27 12:15:06 +00:00
Benedikt Meurer
2d827809e0 [turbofan] Add language mode to JSCallFunction operator.
Also do some drive-by-cleanup to the unittests.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28066}
2015-04-27 10:44:30 +00:00
machenbach
fbf300802f Revert of [turbofan] Optimize loads from the global object in JSTypeFeedbackSpecializer. (patchset #10 id:180001 of https://codereview.chromium.org/1063513003/)
Reason for revert:
[sheriff] Breaks nosnap debug:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug%20-%201/builds/156

Original issue's description:
> [turbofan] Optimize loads from the global object in JSTypeFeedbackSpecializer.
>
> Uses lazy deoptimization and code dependencies to introduce loads
> from property cells and also to promote globals to constants.
>
> R=mstarzinger@chromium.org
> BUG=
>
> Committed: https://crrev.com/aae4a62d07e839455b1d0ad4fa512cc5d48a1a68
> Cr-Commit-Position: refs/heads/master@{#28057}

TBR=mstarzinger@chromium.org,titzer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28063}
2015-04-27 10:07:08 +00:00
mstarzinger
d6e99a7f52 [turbofan] Introduce explicit JSCreateLiteral[Array|Object].
This uses explicit operators instead of intrinsic runtime calls to
create literals froms boilerplates. It allows for easier access of
static parameters and syncs it with other allocating operators.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28062}
2015-04-27 09:57:22 +00:00
Benedikt Meurer
ecf499ef8e [turbofan] Sanitize language mode for JSStoreProperty operator.
R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28061}
2015-04-27 09:33:38 +00:00
Benedikt Meurer
f13f949361 [turbofan] Sanitize language mode for javascript operators.
R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28059}
2015-04-27 09:12:43 +00:00
mstarzinger
a38f9dddd1 [turbofan] Use FastNewClosureStub if possible.
This introduces a JSCreateClosure operator which can be lowered by the
typed pipeline to the aforementioned stub. It also allows for further
optimizations of closure creation.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28058}
2015-04-27 09:07:57 +00:00
titzer
aae4a62d07 [turbofan] Optimize loads from the global object in JSTypeFeedbackSpecializer.
Uses lazy deoptimization and code dependencies to introduce loads
from property cells and also to promote globals to constants.

R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28057}
2015-04-27 09:06:41 +00:00
conradw
ae7ce701ae [strong] Disallow implicit conversions for binary arithmetic operations
Implements the strong mode proposal's restrictions on
implicit conversions for binary arithmetic operations, not
including the + special case. Adds some infrastructure
for future implementation of the restrictions for other
operators.

BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#28045}
2015-04-24 12:32:41 +00:00
bmeurer
4940c0bd42 [turbofan] Unify frame state inputs.
Now all nodes that care about deoptimization always take frame state
inputs no matter whether deoptimization is enabled for a particular
function. In case that deoptimization is off, the AstGraphBuilder just
inserts the empty frame state. This greatly simplifies the logic in
various places and makes testing easier as well, and is probably the
first step towards enabling --turbo-deoptimization by default.

There seems to be no noticable performance impact on asm.js programs.

Also fix the graph replay in order to regenerate the scheduler unittests.

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

Cr-Commit-Position: refs/heads/master@{#28026}
2015-04-23 09:04:19 +00:00
mstarzinger
d1597b7d22 [turbofan] Use FastCloneShallow[Array|Object]Stub if possible.
This allows the JSIntrinsicLowering to optimize the cloning of literal
boilerplate objects using either the FastCloneShallowArrayStub or the
FastCloneShallowObjectStub when applicable.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27974}
2015-04-21 15:43:15 +00:00
svenpanne
4d3044e161 Removed src/{isolate,property-details,utils}-inl.h
Baby steps towards saner #includes...

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

Cr-Commit-Position: refs/heads/master@{#27958}
2015-04-21 10:21:37 +00:00
jochen
53cc6486df Remove support for externally backed elements from the API
Embedders should use ArrayBuffers instead

BUG=v8:3996
LOG=y
R=verwaest@chromium.org,dslomov@chromium.org,kbr@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27939}
2015-04-20 13:31:27 +00:00
Ross McIlroy
063fc25122 Replace OVERRIDE->override and FINAL->final since we now require C++11.
R=jochen@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27937}
2015-04-20 13:08:14 +00:00
dcarney
00aec79079 [turbofan] cleanup ParallelMove
- make ParallelMove into a ZoneVector, removing an annoying level of indirection
- make MoveOperands hold InstructionOperands instead of pointers, so there's no more operand aliasing for moves
- opens up possibility of storing MachineType in allocated operands

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27842}
2015-04-15 12:36:27 +00:00
svenpanne
83bc009d46 Added Donald Stence to PPC owners.
Review URL: https://codereview.chromium.org/1065443004

Cr-Commit-Position: refs/heads/master@{#27830}
2015-04-15 07:00:11 +00:00
titzer
069e6b2f5f [turbofan] Optimize loads of global constants in JSTypedLowering.
R=mstarzinger@chromium.org,verwaest@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27792}
2015-04-13 16:22:05 +00:00
Weiliang Lin
38e764f7ac [x86] Introduce vandps/vandpd/vxorps/vxorpd.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27768}
2015-04-11 00:58:38 +00:00
machenbach
7898475e92 Revert of Make full GC reduce memory footprint an explicit event in the idle notification handler. (patchset #2 id:20001 of https://codereview.chromium.org/1072363002/)
Reason for revert:
[Sheriff] breaks nosnap with timeouts:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap/builds/2513
http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20nosnap%20-%20shared/builds/6220

Original issue's description:
> Make full GC reduce memory footprint an explicit event in the idle notification handler.
>
> BUG=
>
> Committed: https://crrev.com/845705aa99b6bfa8d264cfda1c3b5f1229802ab5
> Cr-Commit-Position: refs/heads/master@{#27753}

TBR=ulan@chromium.org,rmcilroy@chromium.org,hpayer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27755}
2015-04-10 18:21:43 +00:00
hpayer
845705aa99 Make full GC reduce memory footprint an explicit event in the idle notification handler.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27753}
2015-04-10 14:06:46 +00:00
bmeurer
35f6c0fdbf [turbofan] Optimize silent hole checks on legacy const context slots.
Currently we always generate a diamond in the graph builder for every
legacy const context slot, which we cannot get rid of until late control
reduction, even if we know after context specialization that the slot is
already initialized.

Now we generate a select instead, which the CommonOperatorReducer
happily removes during typed lowering. This greatly speeds up asm.js
code generated by Emscripten with the new POINTER_MASKING mode.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27739}
2015-04-10 10:28:12 +00:00
dcarney
572196f6c2 [turbofan] support small immediates
R=titzer@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27709}
2015-04-09 14:06:24 +00:00
dcarney
07ff6d9f22 [turbofan] cleanup InstructionOperand a little
- ConstantOperand was using a too-small field too store its virtual register
- drop ConvertTo, replace it with simple copy
- split AllocatedOperand off from Immediate and Constant to make assignment clearer, also paving the way for small Immediates
- put zone first in *Operand::New
- driveby: drop delayed ssa deconstruction experiment

R=titzer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27692}
2015-04-09 09:15:32 +00:00
balazs.kilvady
8c3af6ca03 MIPS: [turbofan] Add new Float32Abs and Float64Abs operators.
Port 9af9f1d026

Original commit message:
These operators compute the absolute floating point value of some
arbitrary input, and are implemented without any branches (i.e. using
vabs on arm, and andps/andpd on x86).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27679}
2015-04-08 19:30:11 +00:00