Commit Graph

719 Commits

Author SHA1 Message Date
oth
22983f71f9 [Intepreter] Extend and move Register class.
Add methods for converting parameter index to a register and vice-versa.

Move Register class into bytecodes.h.

Update Bytecodes::Decode to pretty print parameters.

BUG=v8:4280
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#30549}
2015-09-02 17:48:24 +00:00
rmcilroy
d8df7468b4 [Interpreter] Add support for property load operations.
Adds support for property load operations via Load/KeyedLoad ICs. Adds the
following bytecodes:
 - LoadIC
 - KeyedLoadIC
Also adds support to the interpreter assembler for loading the type feedback
vector from the function on the stack, and calling ICs.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30543}
2015-09-02 13:03:22 +00:00
pcc
e70f23f959 Fix type errors in unit test utilities.
Fixes all bad casts associated with operands of call and select operators
in the test suite.

Cleanup for cfi_vptr=1; see https://www.chromium.org/developers/testing/control-flow-integrity

BUG=chromium:457523
R=bmeurer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30531}
2015-09-02 04:55:27 +00:00
mstarzinger
c87bd340af [turbofan] Remove obsolete unique.h includes in TurboFan.
Now that it is no longer needed, this also removes the invalid inclusion
of "object-inl.h" within the "unique.h" header file.

Note that this change still leaves 2 violations of that rule in the
code, checked with the "tools/check-inline-includes.sh" tool.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30503}
2015-09-01 10:30:57 +00:00
mstarzinger
5f57ebe222 Make isolate.h usable without objects-inl.h header.
This CL us a pure refactoring that makes an empty compilation unit
including just "isolate.h" or "contexts.h" but not "objects-inl.h"
compile without warnings or errors. This is needed to further reduce
the header dependency tangle.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30500}
2015-09-01 09:25:27 +00:00
mtrofin
d940690bb5 [turbofan] Live Range unit tests.
Unit tests for split/splinter/merge.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#30475}
2015-08-31 13:27:12 +00:00
machenbach
4abfa4e43f [test] Remove unused code.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30469}
2015-08-31 11:52:33 +00:00
mtrofin
9987734fe5 [turbofan] Factored out the test live range builder.
I plan to reuse this for live range splitting/splintering/merging tests.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#30461}
2015-08-31 09:57:48 +00:00
mstarzinger
6e65e6db6c [turbofan] Remove usage of Unique<T> from graph.
The usage of Unique<T> throughout the TurboFan IR does not have any
advantage. There is no single point in time when they are initialized
and most use-sites looked through to the underlying Handle<T> anyways.
Also there already was a mixture of Handle<T> versus Unique<T> in the
graph and this unifies the situation to use Handle<T> everywhere.

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

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

Cr-Commit-Position: refs/heads/master@{#30458}
2015-08-31 08:25:05 +00:00
rmcilroy
b416475435 [Interpreter] Add support for loading literals from the constant pool.
Adds support to the interpreter for loading literals from the constant pool.
Adds the LoadConstant bytecode and makes use of it for loading large Smis and
HeapObject literals.

Also removes unused HandleVector from utils.h.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30450}
2015-08-28 15:41:07 +00:00
rmcilroy
5d975694e4 [Interpreter] Add support for parameter variables.
Adds support for parameters to the BytecodeArrayBuilder and BytecodeGenerator.
Parameters are accessed as negative interpreter registers.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30403}
2015-08-27 10:32:39 +00:00
yangguo
b42c4459e6 Move (uppercase) JS builtins from js builtins object to native context.
R=bmeurer@chromium.org, mstarzinger@chromium.org, rmcilroy@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30402}
2015-08-27 10:18:42 +00:00
mstarzinger
aca4a411e7 Move runtime helper for JSArrayBuffer onto objects.
R=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30387}
2015-08-26 13:59:50 +00:00
mtrofin
0ee4b47368 [turbofan] Separate LiveRange and TopLevelLiveRange concepts
A TopLevelLiveRange is the live range of a virtual register. Through
register allocation, it may end up being split in a succession of child
live ranges, where data flow is handled through moves from
predecessor to successor child.

Today, the concepts of "top level" and "child" live ranges are conflated
under the LiveRange class. However, a good few APIs pertain solely
to TopLevelLiveRanges. This was communicated through comments or
DCHECKs - but this makes for poor code comprehensibility and maintainability.

For example, the worklist of the register allocator (live_ranges()) needs
to only contain TopLevelLiveRanges; spill range concerns are associated
only with the top range; phi-ness; certain phases in the allocation pipeline;
APIs on LiveRange used for initial construction - before splitting;
splintering - these are all responsibilities associated to TopLevelLiveRanges,
and not child live ranges.

This change separates the concepts.

An effect of this change is that child live range allocation need not involve
RegisterAllocationData. That's "a good thing" (lower coupling), but it has
the side-effect of not having a good way to construct unique identifiers for
child live ranges, relative to a given InstructionSequence.

LiveRange Id are used primarily for tracing/output-ing, and debugging.

I propose a 2-component identifier: a virtual register (vreg) number,
uniquely identifying TopLevelLiveRanges; and a relative identifier, which
uniquely identifies children of a given TopLevelLiveRange. "0" is reserved
for the TopLevel range. The relative identifier does not necessarily
indicate order in the child chain, which is no worse than the current state
of affairs.

I believe this change should make it easier to understand a trace output
(because the virtual register number is readily available). I plan to formalize
with a small structure the notion of live range id, and consolidate tracing
around that, as part of a separate CL. (there are seemingly disparate ways
to trace - printf or stream-based APIs - so this seems like an opportune
change to consolidate that)

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

Cr-Commit-Position: refs/heads/master@{#30370}
2015-08-26 05:22:36 +00:00
mtrofin
5d954d6506 [turbofan] Deferred blocks splintering.
This change encompasses what is necessary to enable stack checks in loops without suffering large regressions.

Primarily, it consists of a new mechanism for dealing with deferred blocks by "splintering", rather than splitting, inside deferred blocks.

My initial change was splitting along deferred block boundaries, but the regression introduced by stackchecks wasn't resolved conclusively. After investigation, it appears that just splitting ranges along cold block boundaries leads to a greater opportunity for moves on the hot path, hence the suboptimal outcome.

The alternative "splinters" ranges rather than splitting them. While splitting creates 2 ranges and links them (parent-child), in contrast, splintering creates a new independent range with no parent-child relation to the original. The original range appears as if it has a liveness hole in the place of the splintered one. All thus obtained ranges are then register allocated with no change to the register allocator.

The splinters (cold blocks) do not conflict with the hot path ranges, by construction. The hot path ones have less pressure to split, because we remove a source of conflicts. After allocation, we merge the splinters back to their original ranges and continue the pipeline. We leverage the previous changes made for deferred blocks (determining where to spill, for example).

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

Cr-Commit-Position: refs/heads/master@{#30357}
2015-08-25 14:47:38 +00:00
rmcilroy
b5502099b7 [Interpreter] Add implementations of arithmetic binary op bytecodes.
Adds implementations and tests for the following bytecodes:
  - Add
  - Sub
  - Mul
  - Div
  - Mod

Also adds the Mod bytecode and adds support to BytecodeGenerator and
BytecodeArrayBuilder to enable it's use.

The current bytecodes always call through to the JS builtins. This also adds
LoadObjectField and CallJSBuiltin operators to the InterpreterAssembler.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30352}
2015-08-25 11:31:20 +00:00
rmcilroy
bfdc22d7fc [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot
Passes the current context to bytecode interpreter handlers. This is held in the
context register on all architectures except for ia32 where there are too few
registers and it is instead spilled to the stack.

Also changes Load/StoreRegister to use kMachAnyTagged representation since they
should only ever hold tagged values.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30325}
2015-08-24 10:25:50 +00:00
rmcilroy
f36cc258ff [Interpreter] Add implementations for load immediate bytecodes.
Adds implementations and tests for the following bytecodes:
  - LdaZero
  - LdaSmi8
  - LdaUndefined
  - LdaNull
  - LdaTheHole
  - LdaTrue
  - LdaFalse
  - LdaLdar
  - LdaStar

Also adds  Smi tagging / untagging and OperandType typed
BytecodeOperand operations to InterpreterAssembler.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30226}
2015-08-18 15:29:39 +00:00
bradnelson
a2462683b7 Allowing optional build of a WASM prototype behind a gyp define.
Place a copy of the v8-native-prototype in third_party/wasm.
GYP_DEFINES='v8_wasm=1' gclient runhooks

BUG=None
TEST=None
R=titzer@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30225}
2015-08-18 15:04:11 +00:00
rmcilroy
00df60d1c6 [interpreter]: Changes to interpreter builtins for accumulator and register file registers.
Makes the following modifications to the interpreter builtins and
InterpreterAssembler:
 - Adds an accumulator register and initializes it to undefined()
 - Adds a register file pointer register and use it instead of FramePointer to
   access registers
 - Modifies builtin to support functions with 0 regiters in the register file
 - Modifies builtin to Call rather than TailCall to first bytecode handler.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30219}
2015-08-18 12:41:58 +00:00
vogelheim
c69e2eae54 Rework startup-data-util.
- Make the API look like v8::V8::InitializeICU.
  (That is: A static method call, not an object to be created on the stack.)
- Fix path separator on Windows, by calling base::OS::isPathSeparator.
- Move into API, so that it can be called by hello-world & friends.
- Actually call it from hello-world and friends.

R=jochen@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30174}
2015-08-14 12:11:46 +00:00
oth
93f906d89e [Interpreter] Register conversion fix and test.
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30163}
2015-08-13 17:11:36 +00:00
bmeurer
96e331e2f2 Revert of [runtime] Remove useless IN builtin. (patchset #2 id:20001 of https://codereview.chromium.org/1295433002/ )
Reason for revert:
Breaks win32 nosnap

Original issue's description:
> [runtime] Remove useless IN builtin.
>
> Similar to DELETE, the IN builtin is just a thin wrapper for %HasElement
> and %HasProperty anyway, and cannot be optimized, plus it had a weird
> special fast case (which also involved at least one LOAD_IC plus some
> intrinsic magic).
>
> R=yangguo@chromium.org,jarin@chromium.org
>
> Committed: https://crrev.com/72d60a1e80e81e2e68ca402665e2acbc46c5e471
> Cr-Commit-Position: refs/heads/master@{#30154}

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

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

Cr-Commit-Position: refs/heads/master@{#30155}
2015-08-13 13:06:58 +00:00
bmeurer
72d60a1e80 [runtime] Remove useless IN builtin.
Similar to DELETE, the IN builtin is just a thin wrapper for %HasElement
and %HasProperty anyway, and cannot be optimized, plus it had a weird
special fast case (which also involved at least one LOAD_IC plus some
intrinsic magic).

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

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

Cr-Commit-Position: refs/heads/master@{#30154}
2015-08-13 12:39:21 +00:00
rmcilroy
9b56924df2 [interpreter]: Update BytecodeArrayBuilder register handling.
Modifies the BytecodeArrayBuilder to create register operands which are
negative. This reduces the number of instructions to access registers
by the interpreter and allows us to use positive register operands to
access parameter values.

Adds a Register class to keep register usage typesafe and simplify the
convertion to bytecode operand values.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30151}
2015-08-13 11:28:00 +00:00
bmeurer
6db78c8065 [turbofan] Drop V8_TURBOFAN_BACKEND and V8_TURBOFAN_TARGET defines.
TurboFan is now a requirement and supported by all backends, so we don't
need those macros (plus all the machinery on top) anymore.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30082}
2015-08-10 07:17:34 +00:00
titzer
8b56ec9ccc [turbofan] Remove kInterpreterDispatch CallDescriptor kind in favor of flag.
Rationale: The {kind} of a call descriptor describes what the {target} being
called is--i.e. a JSFunction, code object, or address. That kind materially
dictates the instruction(s) generated for an outgoing call.

The other flags on a call descriptor should describe specific properties
(like whether a roots register is valid or not) so that backend logic doesn't
have to switch over the kind, but is informed directly of what it wants to
know.

R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30065}
2015-08-07 11:46:19 +00:00
mtrofin
5202facf9e Stand-alone deferred block splitting. This continues 1256313003.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30050}
2015-08-06 16:21:38 +00:00
hpayer
9df592c1c5 When allocation rate is low and we are close to the new space limit, we should perform a scavenge during idle time.
BUG=chromium:517395
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#30044}
2015-08-06 12:10:42 +00:00
ulan
d8ad147944 Grow heap slowly after running memory reducer.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29987}
2015-08-03 18:45:53 +00:00
martyn.capewell
9bf532350f [turbofan] Merge dependent Word32Equal on ARM64
Improve code generated for flag materialization.

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

Cr-Commit-Position: refs/heads/master@{#29954}
2015-07-31 12:46:09 +00:00
yangguo
1667c15e37 Debugger: move implementation to a separate folder.
R=cbruni@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29951}
2015-07-31 11:08:15 +00:00
ulan
b4cfd60e07 Ensure the memory reduces makes progress.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29950}
2015-07-31 10:28:16 +00:00
danno
3c9f69d399 [turbofan]: Add better encapsulation to LinkageLocation
Add factory methods for different types of LinkageLocations, and ensure that
accesses to the underlying data in the location are classified by type and
funneled through explicit accessors.

Also change the representation of LinkageLocation to use a BitField rather
than using a reserved section of the integer range.

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

Cr-Commit-Position: refs/heads/master@{#29938}
2015-07-30 14:52:30 +00:00
oth
4da6cbd9ee [Interpreter] Add more bytecode definitions and add operand types.
BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29934}
2015-07-30 13:57:03 +00:00
rmcilroy
c5dd553cf3 [interpreter] Add Interpreter{Entry,Exit}Trampoline builtins.
Adds interpreter entry and exit trampoline builtins. Also implements the
Return bytecode handler and fixes a few bugs in InterpreterAssembler
highlighted by running on other architectures.

MIPS and MIPS64 port contributed by Paul Lind (paul.lind@imgtec.com)

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29929}
2015-07-30 11:36:43 +00:00
rmcilroy
597da50322 [interpreter] Change interpreter to use an BytecodeArray pointer and and offset.
Changes the interpreter to use a BytecodeArray pointer and an offset to avoid
having an inner pointer to a BytecodeArray object in registers during dispatch.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29910}
2015-07-30 08:18:28 +00:00
mbrandy
270dd554b7 Update PPC OWNERS
R=michael_dawson@ca.ibm.com, danno@chromium.org, yangguo@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29884}
2015-07-27 21:37:55 +00:00
rmcilroy
7877c4e0c7 [interpreter] Add basic framework for bytecode handler code generation.
Adds basic support for generation of interpreter bytecode handler code
snippets. The InterpreterAssembler class exposes a set of low level,
interpreter specific operations which can be used to build a Turbofan
graph. The Interpreter class generates a bytecode handler snippet for
each bytecode by assembling operations using an InterpreterAssembler.

Currently only two simple bytecodes are supported: LoadLiteral0 and Return.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29814}
2015-07-23 14:21:39 +00:00
danno
d1a6dfaf4d [turbofan]: Fix tail calls edge cases and add tests
Review URL: https://codereview.chromium.org/1245523002

Cr-Commit-Position: refs/heads/master@{#29791}
2015-07-22 18:27:35 +00:00
mtrofin
3e3608cdd5 Unit tests for the live range conflict detection mechanism (CoalescedLiveRanges) in the Greedy Allocator.
Consolidated conflict detection and traversal logic in CoalescedLiveRanges to avoid duplication in both code and testing. In addition, this change achieves better separation between CoalescedLiveRanges and other register allocator components, improving testability and maintainability.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29783}
2015-07-22 04:50:22 +00:00
rmcilroy
fbe085fd75 [turbofan] Change RawMachineAssembler to take a CallDescriptor instead of a MachineSignature.
The InterpreterAssembler needs to specify a specific CallDescriptor type
instead of using the SimplifiedCDescriptor type. This CL makes it possible
to specify the CallDescriptor used by the RawMachineAssembler instead of
specifying a MachineSignature.

Also removes instruction-selector-tester.h which was erroneously resurrected
at some point.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29777}
2015-07-21 15:54:27 +00:00
danno
cca5e74a58 [turbofan]: Add a context relaxation Reducer
In many cases, the context that TurboFan's ASTGraphBuilder or subsequent
reduction operations attaches to nodes does not need to be that exact
context, but rather only needs to be one with the same native context,
because it is used internally only to fetch the native context, e.g. for
creating and throwing exceptions.

This reducer recognizes common cases where the context that is specified
for a node can be relaxed to a canonical, less specific one. This
relaxed context can either be the enclosing function's context or a specific
Module or Script context that is explicitly created within the function.

This optimization is especially important for TurboFan-generated code stubs
which use context specialization and inlining to generate optimal code.
Without context relaxation, many extraneous moves are generated to pass
exactly the right context to internal functions like ToNumber and
AllocateHeapNumber, which only need the native context. By turning context
relaxation on, these moves disappear because all these common internal
context uses are unified to the context passed into the stub function, which
is typically already in the correct context register and remains there for
short stubs. It also eliminates the explicit use of a specialized context
constant in the code stub in these cases, which could cause memory leaks.

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

Cr-Commit-Position: refs/heads/master@{#29763}
2015-07-20 17:16:14 +00:00
jochen
b8a4978110 Unittests don't use deprecated APIs. Yay!
Make sure it stays that way

BUG=v8:4134
R=yangguo@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#29741}
2015-07-20 06:55:06 +00:00
epertoso
e6e53390cc Let the second pass phantom callbacks run in a separate task on the foreground thread.
R=jochen@chromium.org
LOG=y
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29680}
2015-07-15 12:26:11 +00:00
ishell
fec3c9cba6 TypeofMode replaces TypeofState and ContextualMode.
NON_CONTEXTUAL ~> INSIDE_TYPEOF
CONTEXTUAL ~> NOT_INSIDE_TYPEOF

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

Cr-Commit-Position: refs/heads/master@{#29611}
2015-07-13 13:39:43 +00:00
rmcilroy
d02f62484e Move SmartPointer to base.
Review URL: https://codereview.chromium.org/1221433021

Cr-Commit-Position: refs/heads/master@{#29604}
2015-07-13 12:38:17 +00:00
ishell
f87286e2db Loads and stores to global vars are now made via property cell shortcuts installed into parent script context.
This CL also adds hydrogen stubs for global loads and global stores, full-codegen and TurboFan now uses this machinery.

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

Cr-Commit-Position: refs/heads/master@{#29592}
2015-07-13 09:18:57 +00:00
bmeurer
b19f118c16 [turbofan] Optimize string "length" property access based on types.
Optimize string "length" property access based on static type
information if possible, but also optimistically optimize the access
based on type feedback from the LoadIC.

R=jarin@chromium.org

Committed: https://crrev.com/17add22ff4b9c5ca638502e7708f0d9d99baca40
Cr-Commit-Position: refs/heads/master@{#29543}

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

Cr-Commit-Position: refs/heads/master@{#29588}
2015-07-13 06:02:22 +00:00
martyn.capewell
ad7f35c49a [turbofan] Reduce Float64 comparison to Float32.
Reduce Float64 comparison to Float32 when both inputs are conversions from
Float32.

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

Cr-Commit-Position: refs/heads/master@{#29586}
2015-07-13 05:23:53 +00:00
adamk
54572281e9 Revert of [turbofan] Optimize string "length" property access based on types. (patchset #2 id:20001 of https://codereview.chromium.org/1216593003/)
Reason for revert:
Causes crash when running benchmarks/octane/regexp.js on ARM:
http://build.chromium.org/p/client.v8/builders/V8%20Arm/builds/2492/steps/Benchmarks/logs/regexp

Original issue's description:
> [turbofan] Optimize string "length" property access based on types.
>
> Optimize string "length" property access based on static type
> information if possible, but also optimistically optimize the access
> based on type feedback from the LoadIC.
>
> R=jarin@chromium.org
>
> Committed: https://crrev.com/17add22ff4b9c5ca638502e7708f0d9d99baca40
> Cr-Commit-Position: refs/heads/master@{#29543}

TBR=mstarzinger@chromium.org,jarin@chromium.org,bmeurer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#29544}
2015-07-08 21:30:14 +00:00
bmeurer
17add22ff4 [turbofan] Optimize string "length" property access based on types.
Optimize string "length" property access based on static type
information if possible, but also optimistically optimize the access
based on type feedback from the LoadIC.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29543}
2015-07-08 19:12:58 +00:00
bmeurer
4b38c15817 [turbofan] Add TruncationMode for TruncateFloat64ToInt32.
We actually need round to zero truncation to implement the counterpart
of LDoubleToI in TurboFan, which tries to convert a double to an integer
as required for keyed load/store optimizations.

Drive-by-cleanup: Reduce some code duplication in the InstructionSelector
implementations.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29527}
2015-07-08 06:49:00 +00:00
rmcilroy
ea560a9be9 [turbofan] Move RawMachineAssembler back to src/compiler.
The RawMachineAssembler will be used to build the interpreter, so it needs
to move back to src/compiler.

This reverts commit b5b00cc031.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29519}
2015-07-07 15:02:51 +00:00
ulan
fe8c8c3bc5 Start incremental marking in long idle notification for background tab
disregarding the allocation throughput.

BUG=chromium:506132
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#29515}
2015-07-07 12:30:58 +00:00
ulan
a7f62edb71 Reland "Replace reduce-memory mode in idle notification with delayed clean-up GC."
This reverts commit 269918927a.
This reverts commit 435b3c873a.

The failing test is fixing in chromium.

BUG=chromium:490559
LOG=NO
TBR=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29512}
2015-07-07 11:37:53 +00:00
machenbach
269918927a Revert of Replace reduce-memory mode in idle notification with delayed clean-up GC. (patchset #17 id:320001 of https://codereview.chromium.org/1218863002/)
Reason for revert:
[Sheriff] Looks like it blocks the roll (bisected). Speculative revert.
https://codereview.chromium.org/1210293003/

Original issue's description:
> Replace reduce-memory mode in idle notification with delayed clean-up GC.
>
> BUG=490559
> LOG=NO
>
> Committed: https://crrev.com/0ecd9e1bd2c6b519d4e7285f46cb7e844bc2235c
> Cr-Commit-Position: refs/heads/master@{#29451}

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

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

Cr-Commit-Position: refs/heads/master@{#29470}
2015-07-05 18:19:03 +00:00
bmeurer
5f288c201c [turbofan] Right hand side of shifts needs ToUint32.
Currently we lower shifts directly to machine operators, and add an
appropriate Word32And to implement the & 0x1F operation on the right
hand side required by the specification. However for Word32And we assume
Int32 in simplified lowering, which is basically changes the right hand
side bit interpretation for the shifts from Uint32 to Int32, which is
obviously wrong. So now we represent that explicitly by proper
simplified operators for the shifts, which are lowered to machine in
simplified lowering.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29465}
2015-07-03 11:42:00 +00:00
titzer
0a5b6ad755 [turbofan] Add Uint64LessThanOrEqual to 64-bit TurboFan backends.
Also add control inputs to 64-bit integer divide and modulus operations.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29460}
2015-07-03 05:14:13 +00:00
ulan
0ecd9e1bd2 Replace reduce-memory mode in idle notification with delayed clean-up GC.
BUG=490559
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#29451}
2015-07-02 15:41:36 +00:00
ulan
3f5d39a1d6 Fix memory-leak in default platform implementation of delayed tasks.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29446}
2015-07-02 14:37:32 +00:00
martyn.capewell
1297a51e30 [turbofan] Support cmp with shift/extend on ARM64.
Support 32-bit cmp with shift/extend by reusing the existing add/sub shift and
extend code.

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

Cr-Commit-Position: refs/heads/master@{#29435}
2015-07-02 04:32:15 +00:00
conradw
7281f80151 [strong] Implement strong property access semantics
Revert "Revert relanded strong property access CL"

Regression issues should be solved. Initial patchset is the original, subsequent patchsets are the fixing modifications.

This reverts commit 4ac7be5656.

BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29384}
2015-06-30 15:24:43 +00:00
martyn.capewell
7374e6dc89 [turbofan] Move MulHigh asr onto add on ARM64
Move the arithmetic shift from Int32MulHigh to a following Int32Add on ARM64.
This graph is commonly generated on reduction of signed integer division.

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

Cr-Commit-Position: refs/heads/master@{#29380}
2015-06-30 13:40:06 +00:00
akos.palfi
b4275a70eb [turbofan] Add CalleeSavedFPRegisters to CallDescriptor.
This change makes possible to save and restore the FP registers
in the Prologue and Return parts for the CallAddress kind functions.

TEST=test-simplified-lowering/RunNumberDivide_2_TruncatingToUint32,
     test-simplified-lowering/RunNumberMultiply_TruncatingToUint32

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

Cr-Commit-Position: refs/heads/master@{#29378}
2015-06-30 13:22:50 +00:00
bmeurer
722e2e2b36 [turbofan] Remove unused constructor function matching from typer.
This optimization never triggers currently, and is inherently native
context dependent for no real reason (for example it will not properly
detect those constructors in the case of cross native context inlining),
plus it is slow and awkward.  In case we really need this functionality
at some point, we should find a way to make it work with the builtin
function id mechanism that is already in place to match other builtins.

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

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

Cr-Commit-Position: refs/heads/master@{#29365}
2015-06-30 07:36:28 +00:00
bmeurer
ce0431d665 [turbofan] Also update the BranchHint when merging a BooleanNot.
R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29324}
2015-06-26 12:08:26 +00:00
bmeurer
7337021e54 [turbofan] Add support for pushing returns into merges.
This will enable tail call optimization even across inlining. Plus it
might enable some other interesting optimizations as well. In order to
avoid blowing up the generated code, we can still canonicalize the
epilogue in the CodeGenerator, similar to what fullcodegen does.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29311}
2015-06-26 08:21:01 +00:00
bmeurer
35eb3a0260 [turbofan] Optimize BooleanNot conditions to Branch nodes.
Also remove the weird work-around for this missing optimization in
CHECK_DATE in macros.py.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29288}
2015-06-25 11:07:09 +00:00
Benedikt Meurer
a58ba8d801 [turbofan] Add basic support for calling to (a subset of) C functions.
This introduces some initial building blocks for calling out to
C/C++ functions directly from TurboFan generated code objects.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29279}
2015-06-25 08:32:32 +00:00
bmeurer
5056c8219a [turbofan] Revive the useful parts of the SimplifiedOperatorReducer.
This partially reverts https://codereview.chromium.org/1162563002
because we might actually be able to optimize certain combinations
now due to dead code elimination.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29277}
2015-06-25 04:47:16 +00:00
danno
c019d7f498 Use big-boy Types to annotate interface descriptor parameters
- Thread Type::FunctionType through stubs and the TF pipeline.
- Augment Typer to decorate parameter nodes with types from
  a Type::FunctionType associated with interface descriptors.
- Factor interface descriptors into platform-specific and
  platform-independent components so that all descriptors share
  a common Type::FunctionType for all platforms.

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

Cr-Commit-Position: refs/heads/master@{#29248}
2015-06-24 06:22:04 +00:00
mstarzinger
7f5a2d9ed5 [turbofan] Make global variable loads and stores explicit.
This is a precursor to using specialized LoadIC and StoreIC stubs for
global variable access. It also removes the need to keep track of the
global object in the type system, hence freeing up one bit.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29231}
2015-06-23 13:34:06 +00:00
Benedikt Meurer
64d6ab455d [turbofan] Run DeadCodeElimination together with the advanced reducers.
This will immediately remove dead code from the graph once any of
the advanced reducers inserts it. Also changes the GraphReducer to
use the canonical Dead node for ReplaceWithValue.

R=jarin@chromium.org

Committed: https://crrev.com/88a40c5fb381924b1c0b2403dc582bceb2abe5da
Cr-Commit-Position: refs/heads/master@{#29217}

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

Cr-Commit-Position: refs/heads/master@{#29225}
2015-06-23 11:22:12 +00:00
titzer
deb5dcea5c [turbofan] Make an OptionalOperator for MachineOperatorBuilder.
This makes usage of the MachineOperatorBuilder more robust, as it will be
an error to request an unsupported operator.

Along the way, I noticed that all 7 platforms support Float32Abs and
Float64Abs. Should make them non-optional in another CL?

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29223}
2015-06-23 10:35:43 +00:00
bmeurer
a5af5127ec Revert of [turbofan] Run DeadCodeElimination together with the advanced reducers. (patchset #1 id:1 of https://codereview.chromium.org/1206533002/)
Reason for revert:
Looks like this breaks Tests262.

Original issue's description:
> [turbofan] Run DeadCodeElimination together with the advanced reducers.
>
> This will immediately remove dead code from the graph once any of
> the advanced reducers inserts it. Also changes the GraphReducer to
> use the canonical Dead node for ReplaceWithValue.
>
> R=jarin@chromium.org
>
> Committed: https://crrev.com/88a40c5fb381924b1c0b2403dc582bceb2abe5da
> Cr-Commit-Position: refs/heads/master@{#29217}

TBR=jarin@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#29220}
2015-06-23 09:39:23 +00:00
mvstanton
e9445d7d48 Vector ICs: Additional Turbofan support
Lowering of stores need the vector and slot if --vector-stores is true.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29219}
2015-06-23 09:09:19 +00:00
bmeurer
88a40c5fb3 [turbofan] Run DeadCodeElimination together with the advanced reducers.
This will immediately remove dead code from the graph once any of
the advanced reducers inserts it. Also changes the GraphReducer to
use the canonical Dead node for ReplaceWithValue.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29217}
2015-06-23 08:48:37 +00:00
jarin
de62b486e3 [turbofan] Factor out the function specific part from the frame state operator.
This also threads through the parameter count and local count to the instruction selector. This will be later used to allow merging of various StateValues vector (and prepare for differential encoding which will not distinguish between parameters, locals and expression stack).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29214}
2015-06-23 07:17:25 +00:00
bmeurer
f2ac852015 [date] Use explicit control flow to replace %_ThrowIfNotADate.
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29211}
2015-06-23 06:43:40 +00:00
bmeurer
d4f70f8ce8 [turbofan] Revive the VectorSlotPair and also put feedback on JSCallFunction.
We resurrect the VectorSlotPair in order to be able to separate the
feedback input for the compiler from the actual type feedback vector
that is required to meet the IC requirements at runtime. This will allow
us to for example use feedback from a different context or divide the
type feedback vector into two separate vectors, without having to touch
the compiler. It'll allow use to load the vector from the shared
function info at runtime, while still consuming feedback in the
compiler (i.e. we don't rely on the feedback vector node to be a heap
constant).

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29185}
2015-06-22 12:08:20 +00:00
mvstanton
17c8ffeaa3 Vector ICs: Turbofan vector store ic support
Turbofan needs to pass vector slots around for named and keyed stores.
Also, the CL addresses a missing slot for ClassLiterals.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29173}
2015-06-21 13:55:30 +00:00
conradw
4ac7be5656 Revert relanded strong property access CL
Reason:
Regressions in various benchmarks.

Revert "Revert of Revert of [strong] Implement strong mode restrictions on property access (patchset #1 id:1 of https://codereview.chromium.org/1189153002/)"

This reverts commit 41405c0470.

Revert "X87: Revert of Revert of [strong] Implement strong mode restrictions on property access."

This reverts commit 48de5f4d6b.

Revert "Fix overlapping KeyedLoadIC bitfield."

This reverts commit 4e6c956abf.

Revert "MIPS64: Fix 'Revert of Revert of [strong] Implement strong mode restrictions on property access'."

This reverts commit 74f97b0d2a.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29166}
2015-06-19 19:00:53 +00:00
bmeurer
1021ed85cb [ubsan] Fix HeapObjectMatcher to avoid invalid casts.
BUG=v8:3809
LOG=n
R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29147}
2015-06-19 12:49:13 +00:00
bmeurer
733a246386 [turbofan] Proper dead code elimination as regular reducer.
The three different concerns that the ControlReducer used to deal with
are now properly separated into

  a.) DeadCodeElimination, which is a regular AdvancedReducer, that
      propagates Dead via control edges,
  b.) CommonOperatorReducer, which does strength reduction on common
      operators (i.e. Branch, Phi, and friends), and
  c.) GraphTrimming, which removes dead->live edges from the graph.

This will make it possible to run the DeadCodeElimination together with
other passes that actually introduce Dead nodes, i.e. typed lowering;
and it opens the door for general inlining without two stage fix point
iteration.

To make the DeadCodeElimination easier and more uniform, we basically
reverted the introduction of DeadValue and DeadEffect, and changed the
Dead operator to produce control, value and effect. Note however that
this is not a requirement, but merely a way to make dead propagation
easier and more uniform. We could always go back and decide to have
different Dead operators if some other change requires that.

Note that there are several additional opportunities for cleanup now,
i.e. OSR deconstruction could be a regular reducer now, and we don't
need to use TheHole as dead value marker in the GraphReducer. And we can
actually run the dead code elimination together with the other passes
instead of using separate passes over the graph.  We will do this in
follow up CLs.

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

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

Cr-Commit-Position: refs/heads/master@{#29146}
2015-06-19 12:07:26 +00:00
conradw
41405c0470 Revert of Revert of [strong] Implement strong mode restrictions on property access (patchset #1 id:1 of https://codereview.chromium.org/1189153002/)
Reason for revert:
Issue was ultimately caused/fixed by https://codereview.chromium.org/1194673002/

Original issue's description:
> Revert of [strong] Implement strong mode restrictions on property access (patchset #23 id:460001 of https://codereview.chromium.org/1168093002/)
>
> Reason for revert:
> Speculative revert, maybe breaks GC-stress
>
> http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/808
>
> Original issue's description:
> > [strong] Implement strong mode restrictions on property access
> >
> > Implements the strong mode proposal's restrictions on property access.
> >
> > To be fully explored in a followup: proxies, interceptors, access checks, load from super
> >
> > BUG=v8:3956
> > LOG=N
> >
> > Committed: https://crrev.com/85dbfb9a389e7b21bd2a63862202ee97fc5d7982
> > Cr-Commit-Position: refs/heads/master@{#29109}
>
> TBR=rossberg@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:3956
>
> Committed: https://crrev.com/407657b706711fd5f8d417841e24b284886f3776
> Cr-Commit-Position: refs/heads/master@{#29115}

TBR=rossberg@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29122}
2015-06-18 17:17:07 +00:00
conradw
407657b706 Revert of [strong] Implement strong mode restrictions on property access (patchset #23 id:460001 of https://codereview.chromium.org/1168093002/)
Reason for revert:
Speculative revert, maybe breaks GC-stress

http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/808

Original issue's description:
> [strong] Implement strong mode restrictions on property access
>
> Implements the strong mode proposal's restrictions on property access.
>
> To be fully explored in a followup: proxies, interceptors, access checks, load from super
>
> BUG=v8:3956
> LOG=N
>
> Committed: https://crrev.com/85dbfb9a389e7b21bd2a63862202ee97fc5d7982
> Cr-Commit-Position: refs/heads/master@{#29109}

TBR=rossberg@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3956

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

Cr-Commit-Position: refs/heads/master@{#29115}
2015-06-18 13:40:20 +00:00
conradw
85dbfb9a38 [strong] Implement strong mode restrictions on property access
Implements the strong mode proposal's restrictions on property access.

To be fully explored in a followup: proxies, interceptors, access checks, load from super

BUG=v8:3956
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#29109}
2015-06-18 11:55:45 +00:00
bmeurer
92e6bcf13c [turbofan] Improve interplay of ControlReducer and CommonOperatorReducer.
This turns the CommonOperatorReducer into an AdvancedReducer and makes
it independent of JSGraph (which was used only because it was convienent),
and let's the CommonOperatorReducer run together with the ControlReducer.

The ControlReducer is still not able to run together with other reducers,
but we're getting closer. The plan is to split the ControlReducer into
two parts: The dead code elimination part and the common operator
reduction part. This separation will help to avoid tricky bugs in the
future and should make testing a *lot* easier.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29105}
2015-06-18 09:15:42 +00:00
mstarzinger
eb0e7437d3 [turbofan] Introduce DeadValue and DeadEffect operators.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29104}
2015-06-18 08:17:17 +00:00
bmeurer
a3106d228e [turbofan] Remove another premature optimization from ControlReducer.
We never hit the phi case for DecideCondition in practice, since a more
general optimization is already performed by typing and constant
propagation.

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

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

Cr-Commit-Position: refs/heads/master@{#29102}
2015-06-18 07:13:47 +00:00
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
Benedikt Meurer
9af9f1d026 [turbofan] Add new Float32Abs and Float64Abs operators.
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).

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27662}
2015-04-08 11:55:04 +00:00
titzer
2b59959c71 [turbofan] Match selects in control reducer (configurable).
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27658}
2015-04-08 11:13:49 +00:00
mstarzinger
2d281e71ac Make --always-opt also optimize top-level code.
This enables eager optimization of top-level code with TurboFan and
extends test coverage by triggering it with the --always-opt flag.
Script contexts are now also properly allocated in TurboFan.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27633}
2015-04-07 15:44:23 +00:00
martyn.capewell
8e846a6166 ARM64: Support sign extend for add and subtract
Support sxtb and sxth extend operators on add and subtract, as we've
done for ubtx/h. This is similar to ARM support for sxtab/h.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27624}
2015-04-07 11:34:41 +00:00
titzer
0b4dfc2312 [turbofan] Rework handling of loop exits in loop peeling.
This CL primarily makes the loop peeling algorithm more robust; it no longer damages the graph if the loops are improperly closed.

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27620}
2015-04-07 11:00:47 +00:00
bmeurer
49bb6617ab [ia32] Match -0 - x with sign bit flip.
We can use xorps/xorpd on Intel CPUs to flip the sign bit. Ideally we'd
use an absolute 128-bit constant in the code object, as OCaml/GCC
does, however that requires 128-bit alignment for code objects,
which is not yet implemented. So for now we materialize the mask
inline.

As drive-by-fix, don't hardcode xmm0 as scratch double register.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27618}
2015-04-07 10:44:03 +00:00
titzer
13d6de4986 [turbofan] Introduce BranchMatcher and DiamondMatcher helpers.
R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27613}
2015-04-07 09:03:37 +00:00
baptiste.afsa
ba41489da5 [turbofan][arm64] Match add with shifted operand for mult by a power of 2 plus 1.
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27612}
2015-04-07 08:48:24 +00:00
bmeurer
a1b2c275b7 [x64] Match -0 - x with sign bit flip.
We can use xorps/xorpd on Intel CPUs to flip the sign bit. Ideally we'd
use a RIP-relative 128-bit constant in the code object, as OCaml/GCC
does, however that requires 128-bit alignment for code objects, which is
not yet implemented. So for now we materialize the mask inline.

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27611}
2015-04-07 07:35:03 +00:00
titzer
fa7c34764c [turbofan] Improve branch folding over phis and ranges.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27591}
2015-04-02 15:18:40 +00:00
svenpanne
1592870822 Fixed the range information for string lengths.
Currently, this doesn't really help to generate better code,
nevertheless this is the right thing to do. When our type system(s)
are fixed, this should avoid falling back to floating point operations
in various cases.

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

Cr-Commit-Position: refs/heads/master@{#27578}
2015-04-02 08:32:51 +00:00
mstarzinger
48c185fe75 [turbofan] Fix properties of IrOpcode::kThrow operator.
This changes the IrOpcode::kThrow operator to have kNoThrow property,
which sounds unintuitive, but holds for our graphs. The operators is
used to indicate exceptional control flow out of the function, but in
itself does not throw, the throwing is done by a runtime call.

R=titzer@chromium.org
TEST=unittests/CommonOperatorTest/CommonSharedOperatorTest.Properties

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

Cr-Commit-Position: refs/heads/master@{#27541}
2015-03-31 13:44:04 +00:00
svenpanne
677f3d5fd7 Added %_Likely/%_Unlikely intrinsics (special cases of GCC's __builin_expect).
Currently this only sets branch hints, so we get unlikely code "out of
the way", but in the long run the register allocator needs some love
to treat the unlikely code as, well, unlikely. :-)

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

Cr-Commit-Position: refs/heads/master@{#27540}
2015-03-31 13:23:23 +00:00
dcarney
e39750a26e [turbofan] smash GapInstruction into Instruction
R=titzer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27538}
2015-03-31 13:06:43 +00:00
mstarzinger
e9e8ac7afc [turbofan] Project exception value out of calls.
TEST=cctest/test-run-jsexceptions

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

Cr-Commit-Position: refs/heads/master@{#27537}
2015-03-31 12:26:39 +00:00
rmcilroy
00477a5d72 Ensure that GC idle notifications either make progress or stop requesting more GCs.
The V8::IdleNotification will only return 'True' when the gc idle time handler
thinks there is no more GC which can be done. However, the gc idle task handler
can end up repeatedly making no progress (e.g., if it can't finalize a sweep)
which causes idle tasks to be repeatedly scheduled in Chrome which do nothing
but wake up Chrome. Fix this by returning Done if we can't make any progress
within an Idle Round.

BUG=chromium:470615
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27529}
2015-03-30 17:05:02 +00:00
vogelheim
ee9c738929 Re-work the 'external snapshot' related build rules.
This prepares for re-landing crrev.com/956373002

This pulls all decision about the snapshot [no|internal|external] into one rule. Previously, this logic was in separate places and not /quite/ the same, which causes build problems.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27523}
2015-03-30 14:54:27 +00:00
hpayer
bffde6f4ab Allow more scavenges in idle notification by increasing the new space limit distance.
BUG=chromium:468554
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27517}
2015-03-30 11:40:06 +00:00
baptiste.afsa
f5a6f73ce6 Reland "Match fneg for -0.0 - x pattern."
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27516}
2015-03-30 10:53:02 +00:00
hpayer
eda9a88f2f Finalize sweeping in idle notification when all pages are swept.
A follow-up CL will implement incremental sweeping during idle time.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27513}
2015-03-30 10:05:35 +00:00
bmeurer
8dad78cdbd [turbofan] Add backend support for float32 operations.
This adds the basics necessary to support float32 operations in TurboFan.
The actual functionality required to detect safe float32 operations will
be added based on this later. Therefore this does not affect production
code except for some cleanup/refactoring.

In detail, this patchset contains the following features:
- Add support for float32 operations to arm, arm64, ia32 and x64
  backends.
- Add float32 machine operators.
- Add support for float32 constants to simplified lowering.
- Handle float32 representation for phis in simplified lowering.

In addition, contains the following (related) cleanups:
- Fix/unify naming of backend instructions.
- Use AVX comparisons when available.
- Extend ArchOpcodeField to 9 bits (required for arm64).
- Refactor some code duplication in instruction selectors.

BUG=v8:3589
LOG=n
R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27509}
2015-03-30 07:34:04 +00:00
yangguo
98580e4b83 Revert of [turbofan][arm64] Match fneg for -0.0 - x pattern. (patchset #1 id:1 of https://codereview.chromium.org/1013743006/)
Reason for revert:
Revert due to crash.

Original issue's description:
> [turbofan][arm64] Match fneg for -0.0 - x pattern.
>
> Note that this patch add an extra bit to the ArchOpcodeField.
>
> R=bmeurer@chromium.org
>
> Committed: https://crrev.com/fe7441225100660d01e66ce3bcaefe368f62df81
> Cr-Commit-Position: refs/heads/master@{#27494}

TBR=bmeurer@chromium.org,baptiste.afsa@arm.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#27495}
2015-03-27 09:12:07 +00:00
baptiste.afsa
fe74412251 [turbofan][arm64] Match fneg for -0.0 - x pattern.
Note that this patch add an extra bit to the ArchOpcodeField.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27494}
2015-03-27 08:32:30 +00:00
hpayer
c293448f3e Simplified garbage collection idle handler.
The current GC idle time handling heuristics are getting too complicated. Moreover, with longer idle time we are getting more full garbage collections. This CL shrinks the idle round window and reduces complexity in the case where we cause a full garbage collection.

BUG=chromium:468554
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27493}
2015-03-27 08:00:51 +00:00
mstarzinger
1a1e53a311 [turbofan] Remove obsolete JSDebugger operator.
R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27437}
2015-03-25 12:43:47 +00:00
titzer
9ac4ab799c [turbofan] Remove Instruction::IsControl() and Instruction::MarkAsControl()
R=dcarney@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27409}
2015-03-24 14:05:35 +00:00
dcarney
0a835afb29 [turbofan] add non fixed slot constraint to register allocator
R=jarin@chromium.org

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27373}
2015-03-23 16:03:21 +00:00
balazs.kilvady
86a6b6ff91 MIPS: [turbofan] Turn Math.clz32 into an inlinable builtin.
Port 3aa206b865

BUG=v8:3952
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27343}
2015-03-20 14:05:36 +00:00
bmeurer
ff89876bb9 [turbofan] Fix lowering of Math.max for integral inputs.
R=jarin@chromium.org
BUG=chromium:468162
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#27341}
2015-03-20 12:05:19 +00:00
Benedikt Meurer
3aa206b865 [turbofan] Turn Math.clz32 into an inlinable builtin.
R=dcarney@chromium.org, yangguo@chromium.org
BUG=v8:3952
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27329}
2015-03-20 08:37:34 +00:00
Benedikt Meurer
c16b91e84a [turbofan] Fix unit test coverage for JSIntrinsicLowering.
R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27328}
2015-03-20 08:26:56 +00:00
titzer
cd33978480 [turbofan] Remove last_use_ field from Node.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27319}
2015-03-19 15:44:35 +00:00
jarin
b7dc9c580a [turbofan] Remember types for deoptimization during simplified lowering.
With this change, we remember the types of frame state inputs (in a new
operator, called TypedStateValues). Instead of inferring the value types
when building translations, we used the recorded types.

The original approach was not reliable because the passes after
simplified lowering can change node types, and this in turn confuses
the translation builder.

BUG=chromium:468727
LOG=n
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27310}
2015-03-19 14:00:33 +00:00
jacob.bramley
3fdfe613f8 [ARM64] [turbofan] Support uxtb/uxth for add/sub.
Add support for appending extend modes uxtb or uxth to add and subtract
instructions, and using them in the instruction selector.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27303}
2015-03-19 12:44:23 +00:00
Benedikt Meurer
a75e4cea8f [turbofan] Remove indirection in JSToBoolean/JSUnaryNot lowering.
This reduces the overhead of typed lowering, because we lower
JSToBoolean/JSUnaryNot directly if possible, instead of first lowering
to AnyToBoolean, and then letting the SimplifiedOperatorReducer do the
further lowering.

Also remove some obsolete tests from the cctest suite that have since
been removed by proper unittests. And improve unitttest coverage for the
typed lowering cases.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27295}
2015-03-19 10:13:12 +00:00
bmeurer
ed082f2adc [turbofan] Eliminatable JS/call nodes should not have a control input.
The control input is only relevant for operations that may "write" (to
prevent hoisting) or "throw" (because they are part of the control chain).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27288}
2015-03-19 07:47:55 +00:00
jarin
0cde253c9e [turbofan] Support lazy deopt for truncating store to a typed array.
The change introduces a second frame state (for the state before
the operation) for the StoreProperty nodes. If the store writes
into a typed array, the frame state is used for lazy deopt from
the to-number conversion that is performed by the store.

BUG=v8:3963
LOG=n
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27285}
2015-03-19 05:46:30 +00:00
svenpanne
736fa1d21e Add IBM people to PPC owners.
Review URL: https://codereview.chromium.org/1014063002

Cr-Commit-Position: refs/heads/master@{#27278}
2015-03-18 16:12:14 +00:00
bmeurer
45434d575e [turbofan] Improve ChangeLowering.
- Use representation information provided by the type system to skip SMI
  checks.
- Fix combining of ChangeTaggedToFloat64 with JSToNumber now that JS
  operators can produce control.
- Remove the unnecessary abstraction of smi/field offsets.
- Improve unit test coverage.
- Various cosmetic fixes.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27250}
2015-03-18 07:27:44 +00:00
titzer
c6004a3211 [turbofan] Clean up TRACE macros and use variadic macros.
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27248}
2015-03-17 18:51:19 +00:00
jarin
ca3abde2fa [turbofan] Variable liveness analysis for deopt.
This change introduces a liveness analyzer for local variables in frame states.

The main idea is to use the AstGraphBuilder::Environment class to build the control flow graph, and record local variable loads, stores and checkpoints in the CFG basic blocks (LivenessAnalyzerBlock class).

After the graph building finishes, we run a simple data flow analysis over the CFG to figure out liveness of each local variable at each checkpoint. Finally, we run a pass over all the checkpoints and replace dead local variables in the frame states with the 'undefined' value.

Performance numbers for Embenchen are below.

----------- box2d.js
Current --turbo-deoptimization: EmbenchenBox2d(RunTime): 11265 ms.
d8-master --turbo-deoptimization: EmbenchenBox2d(RunTime): 11768 ms.
d8-master: EmbenchenBox2d(RunTime): 10996 ms.
----------- bullet.js
Current --turbo-deoptimization: EmbenchenBullet(RunTime): 17049 ms.
d8-master --turbo-deoptimization: EmbenchenBullet(RunTime): 17384 ms.
d8-master: EmbenchenBullet(RunTime): 16153 ms.
----------- copy.js
Current --turbo-deoptimization: EmbenchenCopy(RunTime): 4877 ms.
d8-master --turbo-deoptimization: EmbenchenCopy(RunTime): 4938 ms.
d8-master: EmbenchenCopy(RunTime): 4940 ms.
----------- corrections.js
Current --turbo-deoptimization: EmbenchenCorrections(RunTime): 7068 ms.
d8-master --turbo-deoptimization: EmbenchenCorrections(RunTime): 6718 ms.
d8-master: EmbenchenCorrections(RunTime): 6858 ms.
----------- fannkuch.js
Current --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4167 ms.
d8-master --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4608 ms.
d8-master: EmbenchenFannkuch(RunTime): 4149 ms.
----------- fasta.js
Current --turbo-deoptimization: EmbenchenFasta(RunTime): 9981 ms.
d8-master --turbo-deoptimization: EmbenchenFasta(RunTime): 9848 ms.
d8-master: EmbenchenFasta(RunTime): 9640 ms.
----------- lua_binarytrees.js
Current --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 11571 ms.
d8-master --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 13089 ms.
d8-master: EmbenchenLuaBinaryTrees(RunTime): 10957 ms.
----------- memops.js
Current --turbo-deoptimization: EmbenchenMemOps(RunTime): 7766 ms.
d8-master --turbo-deoptimization: EmbenchenMemOps(RunTime): 7346 ms.
d8-master: EmbenchenMemOps(RunTime): 7738 ms.
----------- primes.js
Current --turbo-deoptimization: EmbenchenPrimes(RunTime): 7459 ms.
d8-master --turbo-deoptimization: EmbenchenPrimes(RunTime): 7453 ms.
d8-master: EmbenchenPrimes(RunTime): 7451 ms.
----------- skinning.js
Current --turbo-deoptimization: EmbenchenSkinning(RunTime): 15564 ms.
d8-master --turbo-deoptimization: EmbenchenSkinning(RunTime): 15611 ms.
d8-master: EmbenchenSkinning(RunTime): 15583 ms.
----------- zlib.js
Current --turbo-deoptimization: EmbenchenZLib(RunTime): 10825 ms.
d8-master --turbo-deoptimization: EmbenchenZLib(RunTime): 11180 ms.
d8-master: EmbenchenZLib(RunTime): 10823 ms.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27232}
2015-03-17 09:38:43 +00:00
jarin
cd67e97a7e [turbofan] Cache for reusing parts of value vector nodes in frame states.
Instead of the current approach of storing flat vectors in frame states (and possibly reusing the last vector in AST graph builder), this change list builds a tree for the values and tries to reuse the nodes for different frame states. At the moment, we only use this for the local variable part of frame state, but nothing prevents us from using this for all parts.

This change provides two new classes: one for creating the tree (StateValuesCache) and one for iterating the trees (StateValuesAccess).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#27222}
2015-03-16 13:43:13 +00:00
dusan.milosavljevic
17ada20c17 MIPS64: Unify and improve Word32 compares to use same instructions as Word64 compares.
The CL enables the same instructions are selected for Word32 and Word64 compare
operations which is possible due to a fact 32-bit inputs and produced values
are always sign-extended.

TEST=
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27212}
2015-03-16 11:00:12 +00:00
bmeurer
83f157bc18 [turbofan] Use builtin inlining mechanism for Math.abs and Math.sqrt.
Reduces the amount of custom support code for Math functions in TurboFan
and allows for more general inlining (i.e. independent of parameter
types).

BUG=v8:3952
LOG=n
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27172}
2015-03-13 07:06:15 +00:00
bmeurer
99f8d57f3c [turbofan] Introduce optional Float64Min and Float64Max machine operators.
Basically recognize certain x < y ? x : y constructs and turn that into
Float64Min/Float64Max operations, if the target machine supports that.
On x86 we lower to (v)minsd/(v)maxsd.

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27160}
2015-03-12 14:07:39 +00:00
bmeurer
1982186b6f [turbofan] Use builtin inlining mechanism for Math.floor.
BUG=v8:3952
LOG=n
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27098}
2015-03-10 11:59:31 +00:00
bmeurer
022ea7e057 [turbofan] Unify Math.floor / Math.ceil optimization.
Provide an intrinsic %MathFloor / %_MathFloor that is used to optimize
both Math.ceil and Math.floor, and use the JS inlining mechanism to
inline Math.ceil into TurboFan code. Although we need to touch code
outside of TurboFan to make this work, this does not affect the way we
handle Math.ceil and/or Math.floor in CrankShaft, because for CrankShaft
the old-style builtin function id based inlining still kicks in first.

Once this solution is stabilized, we can use it for Math.floor as well.
And once that is settled, we can establish it as the unified way to
inline builtins, and get rid of the specialized builtin function id
based inlining at some point.

Note that "builtin" applies to basically every piece of internal
JavaScript/intrinsics based code, so this also applies to the yet to be
defined JavaScript based code stubs and handlers.

BUG=v8:3953
LOG=n
R=yangguo@chromium.org,svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27086}
2015-03-10 08:42:53 +00:00
Benedikt Meurer
d18bfa1130 [x86] Faster/shorter code for stack checks.
Avoid loading the stack pointer and the stack limit into allocatable
registers first, but generate a cmp rsp,[limit] instead.

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27065}
2015-03-09 11:06:45 +00:00
Jaroslav Sevcik
02e318517f [turbofan] Add an extra frame state for deoptimization before binary op.
BUG=
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27060}
2015-03-09 08:37:17 +00:00
svenpanne
4e7acce180 Merged INLINE_OPTIMIZED intrinsic type into INLINE.
BUG=v8:3947
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27039}
2015-03-06 11:01:52 +00:00
bmeurer
4436c2642a [turbofan] Support for %_DoubleHi, %_DoubleLo and %_ConstructDouble.
This adds support for the double bits intrinsics to TurboFan, and is
a first step towards fast Math functions inlined into TurboFan code
or even compiled by themselves with TurboFan.

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

Cr-Commit-Position: refs/heads/master@{#27006}
2015-03-05 09:22:38 +00:00
bmeurer
8df194c14a [turbofan] Fix ControlFlowOptimizer to also handle non-control nodes in the control chain.
Review URL: https://codereview.chromium.org/971223002

Cr-Commit-Position: refs/heads/master@{#26949}
2015-03-03 06:11:52 +00:00
Benedikt Meurer
e1c2c9016e [turbofan] Strength reduction of Word32And with Int32Mul.
- (x * (K << L)) & (-1 << L) => x * (K << L)
- ((K << L) * x) & (-1 << L) => x * (K << L)

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26942}
2015-03-02 13:54:09 +00:00
Benedikt Meurer
5f3914fc19 [turbofan] Use the typer to statically detect Smis.
R=rossberg@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26939}
2015-03-02 13:10:42 +00:00
bmeurer
936ae2b814 [turbofan] Avoid generating dead BooleanNot nodes in typed lowering.
Without this shortcut we generate one BooleanNot per JSUnaryNot with
number input, which is quite common in asm.js. These dead nodes then
survive until the late control reducer runs, and may prevent
optimizations in the mean time.

R=dcarney@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26911}
2015-02-27 10:25:05 +00:00
bmeurer
0f783c676b [turbofan] Fix bogus covering of Word64Equal w/ zero.
Review URL: https://codereview.chromium.org/960783002

Cr-Commit-Position: refs/heads/master@{#26870}
2015-02-26 07:18:42 +00:00
dcarney
e928c9d52b [turbofan] remove dependence of InstructionBlock on BasicBlock
BUG=

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

Cr-Commit-Position: refs/heads/master@{#26859}
2015-02-25 16:37:58 +00:00
bmeurer
b1c2a34956 [turbofan] Don't introduce additional computation when hoisting out of loops.
Review URL: https://codereview.chromium.org/958533002

Cr-Commit-Position: refs/heads/master@{#26841}
2015-02-25 08:11:48 +00:00
dcarney
95df1bc266 [turbofan] optimize moves into merges
BUG=

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

Cr-Commit-Position: refs/heads/master@{#26819}
2015-02-24 12:49:33 +00:00