Commit Graph

36978 Commits

Author SHA1 Message Date
eholk
037200e625 [wasm] Fix codegen issue for i64.add and i64.sub on ia32
The IA32AddPair and IA32SubPair instructions were using an input register as a
temporary value, which led to registers sometimes being clobbered when they
shouldn't have been. This led to problems, for example, in calling printf to
format doubles:

printf("%f", 1.2345) => 0.61725 (on x86)

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

Review-Url: https://codereview.chromium.org/2637583002
Cr-Commit-Position: refs/heads/master@{#42486}
2017-01-19 01:16:19 +00:00
littledan
9f545ea96f [test] Remove local-tests from test262 archive and add to .isolate
This might help fix the bots, which are broken in e.g.,
https://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel_ng_triggered/builds/14011

The archive was added in order to transmit test262 tests more rapidly.
It doesn't serve much of a purpose for local-tests. I naively added
local-tests there out of symmetry. However, the BUILD.gn file does not
regenerate an archive when files are only deleted and not added or
changed. Since the performance concern is not present for the small
volume of local-tests, this patch reverts to the more normal mechanism
for sending over dependencies, with test262.isolate.

R=adamk

Review-Url: https://codereview.chromium.org/2643983002
Cr-Commit-Position: refs/heads/master@{#42485}
2017-01-19 01:14:00 +00:00
ofrobots
89b7a4d7d0 Revert I+TF for lexical variables
This reverts the following commits to fix a Node.js regression:
* 5529430dec "[compiler] Consistently use Ignition+TurboFan for lexical variables."
* 7869136716 "[compiler] Improve let+const decision in AstNumbering."

R=adamk@chromium.org, bmeurer@chromium.org, hablich@chromium.org
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/2647523002
Cr-Commit-Position: refs/heads/master@{#42484}
2017-01-19 00:39:25 +00:00
kozyatinskiy
f3dcdf8862 [inspector] introduced debug::SetBreakEventListener,SetExceptionEventListener
Inspector is moved to per-event-type callbacks instead of general v8::debug::SetDebugEventListener. It allows to:
- remove any usage of v8::Debug::EventDetails in debug-interface,
- avoid redundant JS call on each event to get properties of event objects,
- introduce better pure C++ API for these events later.

BUG=v8:5510
R=yangguo@chromium.org,jgruber@chromium.org,dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2622253004
Cr-Commit-Position: refs/heads/master@{#42483}
2017-01-18 23:31:07 +00:00
bjaideep
ea4f834c7e PPC/s390: [Turbofan] Implement super calls with spread bytecode in assembly code.
Port 0b8200c766

R=petermarshall@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:5659
LOG=N

Review-Url: https://codereview.chromium.org/2645683002
Cr-Commit-Position: refs/heads/master@{#42482}
2017-01-18 22:39:40 +00:00
binji
66ae5f7d71 Implement ldrex/strex instructions in ARM simulator
This CL implements ldrex, ldrexb, ldrexh, strex, strexb, and strexh in the
Simulator. These instructions provide "exclusive" access, which provides mutual
exclusion for concurrent threads of execution.

The ARM specification gives some leeway to implementors, but essentially
describes each processor as having Local Monitor and Global Monitor. The Local
Monitor is used to check the exclusivity state without having to synchronize
with other processors. The Global Monitor is shared between processors. We
model both to make it easier to match behavior with the spec.

When running with multiple OS threads, each thread has its own isolate, and
each isolate has its own Simulator. The Local Monitor is stored directly on the
Simulator, and the Global Monitor is stored as a lazy singleton. The Global
Monitor maintains a linked-list of all Simulators.

All loads/stores (even non-exclusive) are guarded by the Global Monitor's mutex.

BUG=v8:4614

Review-Url: https://codereview.chromium.org/2006183004
Cr-Commit-Position: refs/heads/master@{#42481}
2017-01-18 22:17:46 +00:00
kozyatinskiy
9662547c15 [inspector] unconditionally pause on OOM
Currently V8 context just crashes on OOM, with this CL backend will send paused notification with OOM reason before OOM and will increase heap limits to allow further debugging on pause.

BUG=chromium:675911

Review-Url: https://codereview.chromium.org/2624543004
Cr-Commit-Position: refs/heads/master@{#42480}
2017-01-18 21:35:09 +00:00
bradnelson
51a4b9f914 [wasm][asm.js] Disable asm->wasm for the M57 branch.
BUG=v8:4203
R=hablich@chromium.org

Review-Url: https://codereview.chromium.org/2641983002
Cr-Commit-Position: refs/heads/master@{#42479}
2017-01-18 21:21:05 +00:00
bmeurer
ff46966d2d [turbofan] Also recognize 'type' === typeof x.
So far we only recognized

  typeof x == 'type'
  typeof x != 'type'
  typeof x === 'type'
  typeof x !== 'type'

but some people seem to prefer it the other way around, i.e.

  'type' == typeof x
  'type' != typeof x
  'type' === typeof x
  'type' !== typeof x

as spotted in some Ember.js code, so we should obviously handle that as
well and reduce it to a quick check on x instead of calling the TypeOf
builtin and comparing the resulting string.

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

Review-Url: https://codereview.chromium.org/2642743003
Cr-Commit-Position: refs/heads/master@{#42478}
2017-01-18 20:18:21 +00:00
kozyatinskiy
b0577a3d3d [inspector] introduced debug::SetCompileEventListener
Listener is called instead of event listener for v8::AfterCompile and v8::CompileError events if installed.
- removed v8::debug::Script::Wrap.

BUG=v8:5510
R=yangguo@chromium.org,jgruber@chromium.org,dgozman@chromium.org,clemensh@chromium.org, alph@chromium.org,

Review-Url: https://codereview.chromium.org/2626283002
Cr-Commit-Position: refs/heads/master@{#42477}
2017-01-18 20:16:27 +00:00
ofrobots
80234ee31f Revert remove dead hole check logic
This reverts commits
* 45c1188792 "[fullcodegen] Remove dead hole check logic"
* 2aaf217bd0 "[crankshaft] Remove dead Variable hole-checking code"
* f40a3817e1 "[crankshaft] Fix mips/mips64 build: remove unused variable"

BUG=
R=adamk@chromium.org,bmeurer@chromium.org,hablich@chromium.org

Review-Url: https://codereview.chromium.org/2640793004
Cr-Commit-Position: refs/heads/master@{#42476}
2017-01-18 19:27:41 +00:00
mattloring
0ecc6b0600 FFI Compiler outline based on code stub assembler. We are looking to land this frame to allow specific type translation implementations to proceed in parallel.
BUG=v8:4456

Review-Url: https://codereview.chromium.org/2607993003
Cr-Commit-Position: refs/heads/master@{#42475}
2017-01-18 19:13:49 +00:00
mtrofin
970d90767d [turbofan] Regalloc was assuming "blocked" register can't be "used"
When attempting to allocate a blocked register, in the absence of
aliasing, it was possible to assume that a register that was
blocked - by either belonging to an active fixed register, or to
an active unspillable range - could not have possibly be allocated
to another active range (because there'd be an interference otherwise).

With aliasing, that changes. The range we're trying to allocate
may be a double, while the 2 or more active ranges in the paragraph
above may be singles aliasing to the same double slot.

Opportunistically refactored for readability an optimization, and
added some comments.

BUG=681529

Review-Url: https://codereview.chromium.org/2632373004
Cr-Commit-Position: refs/heads/master@{#42474}
2017-01-18 19:01:08 +00:00
titzer
aa3cd2cd07 [wasm] Some simplifications in function-body-decoder.cc.
R=rossberg@chromium.org,clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2640013003
Cr-Commit-Position: refs/heads/master@{#42473}
2017-01-18 18:59:58 +00:00
neis
538f848ddf [parsing] Clarify a comment.
R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2645503002
Cr-Commit-Position: refs/heads/master@{#42472}
2017-01-18 18:00:46 +00:00
adamk
656880510b [heap] VerifyPointersVisitor should check that non-HeapObjects are Smis
This brings VerifyPointersVisitor into line with Object::VerifyPointer.

R=hpayer@chromium.org
BUG=v8:5854

Review-Url: https://codereview.chromium.org/2640623002
Cr-Commit-Position: refs/heads/master@{#42471}
2017-01-18 17:37:47 +00:00
petermarshall
75b861210f Revert of [Ignition/turbo] Add a CallWithSpread bytecode. (patchset #10 id:170001 of https://codereview.chromium.org/2629363002/ )
Reason for revert:
Causes a few bugs caught by clusterfuzz.

Original issue's description:
> [Ignition/turbo] Add a CallWithSpread bytecode.
>
> Also, emit a NewWithSpread bytecode for CallNew AST nodes where possible, rather than desugaring in the parser.
>
> BUG=v8:5511
>
> Review-Url: https://codereview.chromium.org/2629363002
> Cr-Commit-Position: refs/heads/master@{#42455}
> Committed: 4bae43471d

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

Review-Url: https://codereview.chromium.org/2642843002
Cr-Commit-Position: refs/heads/master@{#42470}
2017-01-18 17:06:17 +00:00
kozyatinskiy
51740cc16a [inspector] expose V8InspectorSession::breakProgram in test harness.
V8InspectorSession::schedulePauseOnNextStatement and V8InspectorSession::cancelPauseOnNextStatement are now exposed in inspector tests. These methods are required at least for better blackboxing tests.

BUG=v8:5842
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2636613002
Cr-Commit-Position: refs/heads/master@{#42469}
2017-01-18 16:57:00 +00:00
bjaideep
d794ef7db5 PPC/s390: Check for overflow when SubI IntMin
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2639853002
Cr-Commit-Position: refs/heads/master@{#42468}
2017-01-18 16:51:12 +00:00
machenbach
dd789d87f9 [foozzie] Stop using asm validator until results are more stable
The results are too noisy ATM. This switches off validate-asm for
default comparisons. We can add back dedicated jobs later that switch
it on.

BUG=chromium:663714
NOTRY=true
TBR=bradnelson@chromium.org,titzer@chromium.org

Review-Url: https://codereview.chromium.org/2640743004
Cr-Commit-Position: refs/heads/master@{#42467}
2017-01-18 15:54:20 +00:00
caitp
4173fda417 [builtins] introduce AsyncBuiltinsAssembler for ES2016 features and beyond
First step in splitting apart https://codereview.chromium.org/2622833002/ to
land piece by piece.

Porting src/js/async-await.js to TF builtins using this boilerplate is
now very straightforward.

BUG=v8:4483, v8:5855
R=jgruber@chromium.org, gsathya@chromium.org

Review-Url: https://codereview.chromium.org/2635353002
Cr-Commit-Position: refs/heads/master@{#42466}
2017-01-18 15:41:03 +00:00
rossberg
d62914f6e9 [wasm] check that there is at most 1 table
R=titzer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2643783002
Cr-Commit-Position: refs/heads/master@{#42465}
2017-01-18 15:36:22 +00:00
machenbach
c69a40fc57 [foozzie] Add ignition as baseline comparison
The new ignition config will be used as baseline comparison in new
jobs, e.g. against ignition_turbo. We'll keep --validate-asm off
in ignition_turbo for now as it is very chatty.

BUG=chromium:673246
NOTRY=true

Review-Url: https://codereview.chromium.org/2640043002
Cr-Commit-Position: refs/heads/master@{#42464}
2017-01-18 15:23:53 +00:00
bbudge
ac620154ee [ARM] Refactor NEON binary ops in assembler.
- Refactors many FP, integer, and signed integer instructions where
possible.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2639443002
Cr-Commit-Position: refs/heads/master@{#42463}
2017-01-18 15:11:35 +00:00
machenbach
761f373b52 [foozzie] Use stronger suppression for crbug.com/681806
BUG=chromium:681806
NOTRY=true
TBR=bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/2644573002
Cr-Commit-Position: refs/heads/master@{#42462}
2017-01-18 14:53:49 +00:00
epertoso
bc857f9dfd [csa] Fix the bound & used condition check for RawMachineLabel and CodeAssemblerLabel.
CodeAssemblerLabel's destructor was not calling RawMachineLabel's destructor, because label_ is zone-allocated. RawMachineLabel's destructor contains a DCHECK that would make debugging easier. If the DCHECK is not triggered, things will go awry in the register allocation phase, making it harder to debug the issue.

BUG=

Review-Url: https://codereview.chromium.org/2641863002
Cr-Commit-Position: refs/heads/master@{#42461}
2017-01-18 14:39:01 +00:00
rossberg
485fdde23c [wasm] LinkError on imported i64 global
R=titzer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2640823002
Cr-Commit-Position: refs/heads/master@{#42460}
2017-01-18 14:33:07 +00:00
cbruni
5f7af3cd0f [collections] Shuffle OrderedHashTable fields around for future optimization
A future linear version of the hash table will only need the element count and
deleted element count. Hence moving them to the beginning of the underlying
fixed array makes the transition easier.

BUG=v8:5717

Review-Url: https://codereview.chromium.org/2630373002
Cr-Commit-Position: refs/heads/master@{#42459}
2017-01-18 14:26:56 +00:00
bjaideep
d9adbc0fb2 AIX: Define Power9 macro
Power9 support was originally added in CL
https://codereview.chromium.org/2625013002

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

Review-Url: https://codereview.chromium.org/2637213002
Cr-Commit-Position: refs/heads/master@{#42458}
2017-01-18 14:24:54 +00:00
jochen
29526d96a6 Suppress linker warnings for cctests
R=machenbach@chromium.org,eholk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2641873002
Cr-Commit-Position: refs/heads/master@{#42457}
2017-01-18 14:14:43 +00:00
mvstanton
80c9b69d92 Back strongly rooted literals CLs out of the tree for branch cut
Due to outstanding performance issues, it's safer to revert these
changes.

Revert "PPC/s390: [TypeFeedbackVector] DeclareGlobals needs a literals array"
Revert "[TypeFeedbackVector] DeclareGlobals needs a literals array"
Revert "PPC/s390: [builtins] CompileLazy bailed out to the runtime entirely too often."
Revert "[builtins] CompileLazy bailed out to the runtime entirely too often."

Another CL is to follow that removes the main part of this work
(after that revert, performance regressions should disappear.

TBR=mstarzinger@chromium.org, leszeks@chromium.org, bmeurer@chromium.org
BUG=680637

Review-Url: https://codereview.chromium.org/2645543002
Cr-Commit-Position: refs/heads/master@{#42456}
2017-01-18 13:39:53 +00:00
petermarshall
4bae43471d [Ignition/turbo] Add a CallWithSpread bytecode.
Also, emit a NewWithSpread bytecode for CallNew AST nodes where possible, rather than desugaring in the parser.

BUG=v8:5511

Review-Url: https://codereview.chromium.org/2629363002
Cr-Commit-Position: refs/heads/master@{#42455}
2017-01-18 12:58:58 +00:00
cbruni
6c7d51c296 [keys] Make for-in great again.
This CL fixes the check for empty elements in keys.cc. Previously we would
accidentally bail out of the fast path because the check would always fail.
As a consequence for-in loops that would initialize the enum-cache of an object
with own-only fast properties would never be optimized properly.

Review-Url: https://codereview.chromium.org/2638323002
Cr-Commit-Position: refs/heads/master@{#42454}
2017-01-18 12:32:22 +00:00
bmeurer
2af52484cd [turbofan] Lower JSLoadMessage/JSStoreMessage earlier.
Lower JSLoadMessage and JSStoreMessage in JSTypedLowering to allow for
optimizations across try-catch, try-finally, for-of, destructuring,
etc.

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

Review-Url: https://codereview.chromium.org/2641843002
Cr-Commit-Position: refs/heads/master@{#42453}
2017-01-18 12:09:12 +00:00
rossberg
b86ef5ce8a [wasm] Fix and tighten memory validation
Makes us pass the spec's memory.wast test.

R=titzer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2640453003
Cr-Commit-Position: refs/heads/master@{#42452}
2017-01-18 12:07:57 +00:00
clemensh
3c89788373 [wasm] Skip serialization of breakpoints and certion stubs
Breakpoints are always re-set by the embedder after compilation, so we
don't want to store the corresponding breakpoint objects.
Also don't serialize WASM_INTERPRETER_ENTRY stubs as they are replaced
by ordinary WASM_FUNCTION code at instantiation anyway, and skip
WASM_TO_JS wrappers which are recompiled on each instantiation.
Instead, we serialize the Illegal builtin, and also use that one
instead of the placeholder when compiling the wasm code initially.

R=titzer@chromium.org, yangguo@chromium.org
BUG=v8:5822

Review-Url: https://codereview.chromium.org/2629853004
Cr-Commit-Position: refs/heads/master@{#42451}
2017-01-18 11:44:58 +00:00
clemensh
4f91cee321 [wasm] Improve pimpl implementation in WasmInterpreter::Thread
As no one will ever try to allocate a Thread directly, we can just make
Thread a proxy of ThreadImpl by reinterpret_casting between both types.
This allows to not mention ThreadImpl in the header at all, and to
define it in an anonymous namespace in the implementation, allowing for
more optimizations.
It also saves runtime, as no memory load is needed to forward from
Thread to ThreadImpl, and we do not need to allocate ThreadImpl objects
on the heap.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2643443002
Cr-Commit-Position: refs/heads/master@{#42450}
2017-01-18 11:40:29 +00:00
bmeurer
977038516b [turbofan] Properly assign types to Array/String iterators.
When inlining allocations for Array and String iterators, make sure the
allocations have proper types on it (rather than just Type::Any). This
allows us to escape analyze the iterators in a couple of more cases,
i.e. in this very simple case:

  function f(a) {
    const it = a[Symbol.iterator]();
    return it.next().value;
  }

R=jarin@chromium.org
BUG=v8:4586,v8:5448

Review-Url: https://codereview.chromium.org/2640743003
Cr-Commit-Position: refs/heads/master@{#42449}
2017-01-18 11:24:00 +00:00
clemensh
a45fa2d856 [wasm] Remove unused variable
TBR=titzer@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2639903003
Cr-Commit-Position: refs/heads/master@{#42448}
2017-01-18 10:56:29 +00:00
jarin
9091eb19be [deoptimizer] Materialize array iterators in the deoptimizer.
This also introduces exhaustive switch-cases for instance types.

BUG=chromium:681383

Review-Url: https://codereview.chromium.org/2646433002
Cr-Commit-Position: refs/heads/master@{#42447}
2017-01-18 10:55:22 +00:00
machenbach
e1fbcce8af [foozzie] Fix suppressions and add one for crbug.com/681241
BUG=chromium:681241
NOTRY=true
TBR=bradnelson@chromium.org,titzer@chromium.org

Review-Url: https://codereview.chromium.org/2644503002
Cr-Commit-Position: refs/heads/master@{#42446}
2017-01-18 10:49:39 +00:00
petermarshall
4064c41eaa [MIPS64] Fix tagged vs. untagged SMI comparison in Apply builtin.
This fast path check compared a tagged smi and an untagged one, meaning that the slow path was always taken.

Review-Url: https://codereview.chromium.org/2641823002
Cr-Commit-Position: refs/heads/master@{#42445}
2017-01-18 10:43:47 +00:00
petermarshall
0b8200c766 [Turbofan] Implement super calls with spread bytecode in assembly code.
BUG=v8:5659

Review-Url: https://codereview.chromium.org/2571563004
Cr-Commit-Position: refs/heads/master@{#42444}
2017-01-18 10:34:24 +00:00
clemensh
2f3de27e11 [wasm] Set and store breakpoints in wasm
Store breakpoint positions in the WasmSharedModuleData in order to set
them on new instantiations. Also redirect them to all live instances at
the time the breakpoint is set.

Inside the WasmDebugInfo, we store the BreakPointInfo objects to find
hit breakpoints.

R=titzer@chromium.org, yangguo@chromium.org
BUG=v8:5822

Review-Url: https://codereview.chromium.org/2626253002
Cr-Commit-Position: refs/heads/master@{#42443}
2017-01-18 10:28:40 +00:00
clemensh
7634b0eb13 [wasm] Use pimpl idiom for interpreter thread implementation
We used dynamic dispatch before, which has considerable runtime
overhead. Pimpl (a.k.a. opaque pointer) has the same memory overhead
of one additional pointer, but less runtime overhead.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2639013002
Cr-Commit-Position: refs/heads/master@{#42442}
2017-01-18 10:23:20 +00:00
machenbach
c5caaf8921 [foozzie] Add stronger failures suppression for crbug.com/681088
BUG=chromium:681088
NOTRY=true
TBR=bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/2637423002
Cr-Commit-Position: refs/heads/master@{#42441}
2017-01-18 09:37:43 +00:00
bradnelson
5c8022e638 [wasm][asm.js] Cancel exception and rethrow on parse failure.
BUG=674089
R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2614563002
Cr-Commit-Position: refs/heads/master@{#42440}
2017-01-18 09:23:13 +00:00
epertoso
48eabdcf72 [turbofan] Refactor IsSame into NodeProperties.
BUG=

Review-Url: https://codereview.chromium.org/2635243002
Cr-Commit-Position: refs/heads/master@{#42439}
2017-01-18 09:19:53 +00:00
neis
98dbae7903 [parsing] Fix a comment.
R=adamk@chromium.org
BUG=
NOTRY=true
NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2634313002
Cr-Commit-Position: refs/heads/master@{#42438}
2017-01-18 09:06:15 +00:00
yangguo
cbb7145221 [debugger] temporarily re-implement --expose-debug-as.
This is done out of courtesy for Node.js and will be
removed as soon as we branch for version 5.8.

R=jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2636423002
Cr-Commit-Position: refs/heads/master@{#42437}
2017-01-18 08:58:58 +00:00