Commit Graph

38547 Commits

Author SHA1 Message Date
georgia.kouveli
9e07494509 [turbofan] Try to allocate preferred register after splitting range.
This shows an improvement in the code size of the bytecode handlers.
When a range is split (because for example the preferred register gets
clobbered by a call and is not available for the whole range), trying
to allocate the preferred register for the first range that results
from the split avoids some extra register moves.

BUG=

Review-Url: https://codereview.chromium.org/2749023005
Cr-Commit-Position: refs/heads/master@{#43905}
2017-03-17 14:37:59 +00:00
jkummerow
94efcfe01b [tools] gm.py: start goma when it isn't running
NOTRY=true

Review-Url: https://codereview.chromium.org/2754253002
Cr-Commit-Position: refs/heads/master@{#43904}
2017-03-17 14:10:23 +00:00
Wiktor Garbacz
54db0236ce [parser] Parse tasks: make them pass all tests.
Parse tasks are still WIP so there is really no benefit turning them on.

Turn off irrelevant tests.
Fix duplicate parameters inverted logic.
Fix use_counts tracking.
Fix language mode, super_property, evals.
Fix modules and stack overflow.

BUG=v8:6093

Change-Id: I8567b36eef7b9de6799789e7520810bde9c86e5b
Reviewed-on: https://chromium-review.googlesource.com/455916
Commit-Queue: Wiktor Garbacz <wiktorg@google.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43903}
2017-03-17 14:06:24 +00:00
Michael Starzinger
ac4a77cc87 [turbofan] Remove obsolete helpers from graph builder.
R=jarin@chromium.org

Change-Id: Ib8f657957895f703189f2347f5d8017e16de05ae
Reviewed-on: https://chromium-review.googlesource.com/455798
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43902}
2017-03-17 14:04:07 +00:00
Leszek Swirski
65f25e1c3c [tools/logreader] Print overflow drops to stderr
Don't trash stdout with "dropped: overflow" messages (or other errors)
in the log reader, which then cause generated json files to fail to be
read by other tools.

Change-Id: Ie27639dbbee6fc9e8da0bc6901667c3a2835fbef
Reviewed-on: https://chromium-review.googlesource.com/456499
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43901}
2017-03-17 13:42:14 +00:00
titzer
72e539360e [rename] Rename internal field to embedder field.
This CL renames all occurrences of "internal field" to "embedder field"
to prevent confusion. As it turns out, these fields are not internal to
V8, but are actually embedder provided fields that should not be mucked
with by the internal implementation of V8.

Note that WASM does use these fields, and it should not.

BUG=v8:6058

Review-Url: https://codereview.chromium.org/2741683004
Cr-Commit-Position: refs/heads/master@{#43900}
2017-03-17 13:26:05 +00:00
Michael Starzinger
22372f5aa8 [turbofan] Prototype of property access early lowering.
This is a first stab at extending the existing early lowering approach
to property access operations. Currently we only handle the case where
named property loads are lowered to a soft deoptimize operation, due to
insufficient type feedback.

R=jarin@chromium.org

Change-Id: I779ffb99978023237da5ad9eaf0241fe74243882
Reviewed-on: https://chromium-review.googlesource.com/456316
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43899}
2017-03-17 13:21:41 +00:00
Yang Guo
76abde14d9 Fix code dependency change assertion.
During bootstapping installing native functions may cause
map transitions. There are no dependent code groups, but
the assertion still triggers.

BUG=chromium:617892

Change-Id: Id7cb87575a0fe176e7aff785d4dd249db44deec8
Reviewed-on: https://chromium-review.googlesource.com/457036
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43898}
2017-03-17 12:24:34 +00:00
jgruber
338257509d [string] Optimize ToDirectStringAssembler for sequential strings
ToDirectStringAssembler is used in StringCharCodeAt and SubString
(which uses StringCharCodeAt internally). SubString is used all over the
place (e.g. RegExp result construction), and is critical for benchmark
performance.

The CL introducing ToDirectStringAssembler caused a couple of
regressions which this is intended to fix by adding a fast path for
sequential strings.

BUG=chromium:702246

Review-Url: https://codereview.chromium.org/2754933003
Cr-Commit-Position: refs/heads/master@{#43897}
2017-03-17 12:19:29 +00:00
Toon Verwaest
50e1019dce [ic] Support data-driven accessor pairs
The ForDeopt stub isn't actually necessary anymore; but I don't want to fix the deoptimizer in the same CL.

BUG=v8:5561

Change-Id: I7101cec4b783949bcfbf1ebdb80541d1b558e2e2
Reviewed-on: https://chromium-review.googlesource.com/455858
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43896}
2017-03-17 12:14:32 +00:00
Marja Hölttä
ab4233e38a [parser|cleanup] Add tests for duplicate parameters.
There are at least 3 mechanisms for detecting duplicate parameters.
- ExpressionClassifier
- Scope::DeclareParameter checking IsDeclaredParameter
- PatternRewriter::VisitVariableProxy failing to declare a duplicate parameter

The conditions for when duplicate parameters are allowed and when not are pretty
involved too. They are allowed when
- the function is not an arrow function and not a concise method *and*
- when the parameter list is simple *and*
- we're in sloppy mode (incl. the function doesn't declare itself strict).

In addition, we don't recognize some of the early errors, and it's 
non-trivial to see which ones are recognized and which not (see bug
v8:6108). E.g., (dup, dup) => {}; is recognized but (dup, [dup]) => {} is
not. And (dup, [dup]) => 1; is.

We do have tests for some aspects of duplicate parameters (e.g., arrow function
duplicate parameters are included in arrow function tests), but it's hard to see
whether all combinations of the relevant conditions are tested.

This CL adds more structured tests which hopefully enables reducing the
duplicate parameter detection mechanisms to 2 or maybe even to 1.

BUG=v8:6092

Change-Id: Idd3db43b380aae4b9a89be5f1ed0755d39bfb36d
Reviewed-on: https://chromium-review.googlesource.com/456336
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43895}
2017-03-17 12:10:35 +00:00
Leszek Swirski
64746e5fed [profview] Show all variants of a function in the timeline
When displaying a single function's timeline, display all its variants
(colour-coded by kind) instead of just the ones with the same code-id.
This allows us to see all optimised versions of a function, as well as
changes between optimised and unoptimised.

Drive-by -- Do some rounding to get rendering pixel-perfect.

Change-Id: I385c83b39414ac5e59208b7a25b488d6a283e2b0

NOTRY=true

Change-Id: I385c83b39414ac5e59208b7a25b488d6a283e2b0
Reviewed-on: https://chromium-review.googlesource.com/455833
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43894}
2017-03-17 12:09:32 +00:00
clemensh
29877f5ae0 Revert of MIPS[64]: Fix unaligned arguments storage in Wasm-to-interpreter entry (patchset #3 id:40001 of https://codereview.chromium.org/2705293011/ )
Reason for revert:
Did not fix the issue.

Original issue's description:
> MIPS[64]: Fix unaligned arguments storage in Wasm-to-interpreter entry
>
> In Wasm-to-interpeter entry creation, arguments for the interpreter
> are stored in an argument buffer. Depending on the order of the
> arguments some arguments may be misaligned and this causes crashes
> on those architectures that do not support unaligned memory access.
>
> TEST=cctest/test-wasm-interpreter-entry/TestArgumentPassing_AllTypes
> BUG=
>
> Review-Url: https://codereview.chromium.org/2705293011
> Cr-Commit-Position: refs/heads/master@{#43476}
> Committed: 84ff6e4c19

TBR=titzer@chromium.org,ivica.bogosavljevic@imgtec.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2760603002
Cr-Commit-Position: refs/heads/master@{#43893}
2017-03-17 12:07:31 +00:00
Jochen Eisinger
876725d5d5 Enable the embedder to provide stack trace printing
BUG=none
R=yangguo@chromium.org

Change-Id: I53811859efacee9126ba1bdbe5690793833c96e1
Reviewed-on: https://chromium-review.googlesource.com/456338
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43892}
2017-03-17 12:07:25 +00:00
bmeurer
6934d92220 Revert of [ignition] Decrease code size multiiplier to 24. (patchset #1 id:1 of https://codereview.chromium.org/2758503002/ )
Reason for revert:
Doesn't seem to help with peak performance, and seems to hurt startup performance a bit, so reverting for now

Original issue's description:
> [ignition] Decrease code size multiplier to 24.
>
> BUG=
>
> Review-Url: https://codereview.chromium.org/2758503002
> Cr-Commit-Position: refs/heads/master@{#43861}
> Committed: b880309bc7

TBR=rmcilroy@chromium.org,jarin@chromium.org,danno@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2751913007
Cr-Commit-Position: refs/heads/master@{#43891}
2017-03-17 11:20:13 +00:00
neis
94b088ca3c Disentangle assembler from isolate.
This is a first step towards moving Turbofan code generation off the main thread.

Summary of the changes:
- AssemblerBase no longer has a pointer to the isolate. Instead, its
  constructor receives the few things that it needs from the isolate (on most
  architectures this is just the serializer_enabled flag).
- RelocInfo no longer has a pointer to the isolate. Instead, the functions
  that need it take it as an argument.  (There are currently still a few that
  implicitly access the isolate through a HeapObject.)
- The MacroAssembler now explicitly holds a pointer to the isolate (before, it
  used to get it from the Assembler).
- The jit_cookie also moved from AssemblerBase to the MacroAssemblers, since
  it's not used at all in the Assemblers.
- A few architectures implemented parts of the Assembler with the help
  of a Codepatcher that is based on MacroAssembler.  Since the Assembler no
  longer has the isolate, but the MacroAssembler still needs it, this doesn't
  work anymore.  Instead, these Assemblers now use a new PatchingAssembler.

BUG=v8:6048

Review-Url: https://codereview.chromium.org/2732273003
Cr-Commit-Position: refs/heads/master@{#43890}
2017-03-17 11:18:06 +00:00
jgruber
10f7b7ecc6 [regexp] Add slow exec stub to reduce code size
CSA builtins can become very large, and the RegExp builtins are currently the
main offender (e.g. @@match's code size is over 50k). This is due to the fact
that most RegExp builtins rely on RegExpBuiltinExec (fairly large itself),
which is then inlined multiple times in many builtins.

This CL reduces the snapshot size for an x64 release build by 80k by turning
slow-path RegExpBuiltinExec calls into stub calls (i.e. removing code
duplication through inlining) and completely removing the code path for fast
RegExp instances in RegExpExec (it is never taken).

BUG=v8:5339,v8:5737

Review-Url: https://codereview.chromium.org/2745053003
Cr-Commit-Position: refs/heads/master@{#43889}
2017-03-17 10:48:47 +00:00
Toon Verwaest
162553a12a [ic] Support js accessors on slow-mode objects
BUG=v8:5561

Change-Id: Ib344479dac691bc418fbedffffbfbc1380ddd369
Reviewed-on: https://chromium-review.googlesource.com/455937
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43888}
2017-03-17 10:31:49 +00:00
Andreas Haas
87354ade6b [wasm] Remove the WasmTrapHelper
Since TrapIf has been implemented on all platforms, there is no need
anymore for the old WasmTrapHelper code. This CL also removes
TrapIf-specific tests.

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

Change-Id: Ic069598441b7bd63bde2e66f4e536abea5ecebe6
Reviewed-on: https://chromium-review.googlesource.com/452380
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43887}
2017-03-17 10:30:31 +00:00
jgruber
ad75ded221 [cctest] Fix invalid assumption in test-unboxed-doubles
test-unboxed-doubles/WriteBarrierObjectShiftFieldsRight recently started
failing on arm64-nosnapshot builds due to a broken CHECK.

# Fatal error in ../../test/cctest/test-unboxed-doubles.cc, line 1417
# Check failed: heap->InNewSpace(*obj_value).

It expects the result of Factory::NewJSArray() to be in new
space; but NewJSArray encapsulates two allocations so the return value can
actually be in old space. Fix it by ensuring only one allocation occurs.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2759433002
Cr-Commit-Position: refs/heads/master@{#43886}
2017-03-17 10:16:54 +00:00
neis
877d9758eb [compiler] Add more tests for monotonicity of typing.
R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2753543009
Cr-Commit-Position: refs/heads/master@{#43885}
2017-03-17 09:17:10 +00:00
Clemens Hammacher
86fa01c74a Add code flag for non-tagged parameters
The WasmCompileLazy builtin creates an internal frame, thus the garbage
collector will visit all pointers in the stack frame.
However, we will call this builtin from compiled wasm code, and it
receives raw (untagged) arguments. This is because this builtin is
later exchanged by compiled wasm code, so the ABI needs to be
compatible.

This CL introduces the has_tagged_params code flag, which is true by
default and false for each WASM_FUNCTION, JS_TO_WASM_FUNCTION and
the WasmCompileLazy builtin.
The gargabe collector just ignores the parameters for each frame
whose code object has this flag set to false. For internal frames,
all pointers in the whole stack frame are ignored if the flag is set.

R=titzer@chromium.org, mstarzinger@chromium.org
BUG=v8:5991

Change-Id: I12a15157db344725bcc280e2041fd5bcad2ba700
Reviewed-on: https://chromium-review.googlesource.com/451400
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43884}
2017-03-17 09:15:35 +00:00
Jochen Eisinger
215a2fa4d0 Correctly annotate v8::Message API methods
Retrieving information from a message should never execute script or
throw exceptions.

BUG=v8:5830
R=mmoroz@chromium.org,yangguo@chromium.org

Change-Id: Ie8a84ca2cc14eb41ceaf4162d8a5381a20d559bc
Reviewed-on: https://chromium-review.googlesource.com/455740
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43883}
2017-03-17 08:39:25 +00:00
littledan
3fa2633841 [intl] Fix debug-evaluate-no-side-effect-builtins test
String case conversion is known to debug-evaluate to not have a side
effect in noi18n mode, but debug-evaluate thinks it has a side effect
in i18n mode. Update the tests accordingly.

Verified locally that the test passes in i18n and noi18n mode (not sure
whether the noi18n trybot executes this test).

CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng

Review-Url: https://codereview.chromium.org/2750403004
Cr-Commit-Position: refs/heads/master@{#43882}
2017-03-17 07:18:07 +00:00
v8-autoroll
266ca8215b Update V8 DEPS.
Rolling v8/build: 81c2772..72004d5

Rolling v8/third_party/catapult: d49bf81..7b2dc0f

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

Change-Id: I4a4903fd29b31585e184d9a5ccb5a4a941e7756c
Reviewed-on: https://chromium-review.googlesource.com/456461
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43881}
2017-03-17 03:21:14 +00:00
gdeepti
1fce7d604a [wasm] Fix DetachArrayBuffer for WebAssembly.Memory on grow
DetachArrayBuffer makes incorrect assumptions about the state of the ArrayBuffer. It assumes that that the ArrayBuffer is internal to wasm unless guard pages are enabled, this is not the case as the ArrayBuffer can be externalized outside of wasm, in this case through gin.

BUG=chromium:700384

Review-Url: https://codereview.chromium.org/2754153002
Cr-Commit-Position: refs/heads/master@{#43880}
2017-03-17 01:12:07 +00:00
allada
3e1e90dec2 [Devtools] Add stacktrace to protocol for scriptParsed event
Stacktrace data is now passed when scriptParsed event is triggered.

R=kozyatinskiy@chromium.org,dgozman
BUG=chromium:646849

Review-Url: https://codereview.chromium.org/2755863002
Cr-Commit-Position: refs/heads/master@{#43879}
2017-03-16 23:34:11 +00:00
aseemgarg
82b5c8c944 [Atomics] Make Atomics.compareExchange a builtin using TF
BUG=v8:4614
R=binji@chromium.org

Review-Url: https://codereview.chromium.org/2649703002
Cr-Commit-Position: refs/heads/master@{#43878}
2017-03-16 22:29:02 +00:00
bjaideep
469b632e65 PPC/s390: [regexp] Port RegExpExecStub to CSA (mostly)
Port 5cc6189677

Minor fix to the original CL's port of ppc/s390

Original Commit Message:

    This moves most of the logic contained in RegExpExecStub to CSA.  Benefits are
    mostly easier readability and hackability, and removal of a large chunk of
    platform-specific assembly.

    Exit frame construction and the final call remain in RegExpExecStub.

R=jgruber@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:5339,v8:592
LOG=N

Review-Url: https://codereview.chromium.org/2757673004
Cr-Commit-Position: refs/heads/master@{#43877}
2017-03-16 20:02:54 +00:00
jyan
0e893511b3 s390: Unify Visit(Word/Float)(32/64)(Unary/Bin)Op
R=joransiu@ca.ibm.com, bjaideep@ca.ibm.com, michael_dawson@ca.ibm.com

Review-Url: https://codereview.chromium.org/2756733002
Cr-Commit-Position: refs/heads/master@{#43876}
2017-03-16 18:55:05 +00:00
titzer
3bbd81afbc [testing] Add the notion of a wait count to allow tests to robustly wait on asynchronous tasks.
Note that this also modifies mjsunit.js to allow the {failWithMessage} method to be monkey-patched by a test. This is necessary because assertions which fail in a promise's then-clause would normally only throw an exception, which is swallowed by the promise, causing the test to silently pass. Instead, patching this {failWithMessage} functionality allows then clauses to use the full assertion machinery of mjsunit.js.

R=ulan@chromium.org, gsathya@chromium.org

BUG=

Review-Url: https://codereview.chromium.org/2752043002
Cr-Commit-Position: refs/heads/master@{#43875}
2017-03-16 18:20:19 +00:00
bradnelson
4c3217e132 [wasm][asm.js] Adding custom asm.js lexer.
Adding a custom lexer for asm.js parsing.
It takes advantage of a number of asm.js properties to simply things:
* Assumes 'use asm' is the only string.
* Does not handle unicode for now (tools don't emit it).
* Combines global + local string table with lexer.

R=marja@chromium.org,vogelheim@chromium.org,kschimpf@chromium.org

BUG=v8:4203
BUG=v8:6090

Review-Url: https://codereview.chromium.org/2751693002
Cr-Commit-Position: refs/heads/master@{#43874}
2017-03-16 18:10:45 +00:00
Eric Holk
18c77ce51b Fixing Android x64 build.
BUG= chromium:701590

Change-Id: Ia0a3a7a532a8acd001cb1dc79991f7cc08fc973d
Reviewed-on: https://chromium-review.googlesource.com/456456
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43873}
2017-03-16 18:08:56 +00:00
Daniel Vogelheim
dee16f8600 [parser] Simplify DuplicateFinder.
The current incarncation of DuplicateFinder does work that
AstValueFactory already does. All that remains is that
DuplicateFinder wraps a container.

Adding const-ness changes were necessary to have IsDuplicateSymbol
be const.

BUG=v8:6092

Change-Id: I8081cfeef363717405d5b6325e290fe7725390dc
Reviewed-on: https://chromium-review.googlesource.com/456317
Commit-Queue: Marja Hölttä <marja@chromium.org>
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43872}
2017-03-16 17:44:14 +00:00
yangguo
cd640d225b [debug] whitelist Object and Symbol builtins for debug-evaluate.
R=jgruber@chromium.org
BUG=v8:5821

Review-Url: https://codereview.chromium.org/2747243006
Cr-Commit-Position: refs/heads/master@{#43871}
2017-03-16 17:10:34 +00:00
cwhan.tunz
da1bddcd75 [typedarrays] Implement %TypedArray%.prototype.lastIndexOf in C++
- Implement C++ builtins and ElementsAccessor for
  %TypedArray%.prototype.lastIndexOf
- Remove TypedArrayLastIndexOf in src/js/typedarray.js
- Combine InnerArrayLastIndexOf and ArrayLastIndexOf in src/js/array.js

BUG=v8:5929

Review-Url: https://codereview.chromium.org/2744283002
Cr-Commit-Position: refs/heads/master@{#43870}
2017-03-16 16:28:00 +00:00
Igor Sheludko
17ac7c5f4d [runtime] Ensure that canonical empty dictionaries reallocate upon addition.
BUG=chromium:699166

Change-Id: Ifd460a454d2bf36cff6b114ecd9163ef4fbdc79e
Reviewed-on: https://chromium-review.googlesource.com/456416
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43869}
2017-03-16 16:22:26 +00:00
franzih
815d82376c [object] Add Script::IsUserJavaScript().
Extract script->type() == TYPE_NORMAL into
a function.

BUG=

Review-Url: https://codereview.chromium.org/2744613006
Cr-Commit-Position: refs/heads/master@{#43868}
2017-03-16 16:03:03 +00:00
danno
7de21c4d3b [builtins] Separate Array.prototype.* CSA builtins into two parts
Previous to this CL, CSA-optimized Array builtins--like forEach, some, and
every--were written in a single, monolithic block of CSA code.

This CL teases the code for each of these builtins apart into two chunks, a main
body with optimizations for fast cases, and a "continuation" builtin that
performs a spec-compliant, but slower version of the main loop of the
builtin. The general idea is that when the "fast" main body builtin encounters
an unexpected condition that invalidates assumptions allowing fast-case code, it
tail calls to the slow, correct version of the loop that finishes the builtin
execution.

This separation currently doens't really provide any specific advantage over the
combined version. However, it paves the way to TF-optimized inlined Array
builtins. Inlined Array builtins may trigger deopts during the execution of the
builtin's loop, and those deopt must continue execution from the point at which
they failed. With some massaging of the deoptimizer, it will be possible to make
those deopt points create an extra frame on the top of the stack which resumes
execution in the slow-loop builtin created in this CL.

BUG=v8:1956
LOG=N

Review-Url: https://codereview.chromium.org/2753793002
Cr-Commit-Position: refs/heads/master@{#43867}
2017-03-16 15:34:01 +00:00
franzih
947a043766 Collect type profile for DevTools
Collect type information for JavaScript variables and display it
in Chrome DevTools.
Design Doc: https://docs.google.com/a/google.com/document/d/1O1uepXZXBI6IwiawTrYC3ohhiNgzkyTdjn3R8ysbYgk/edit?usp=sharing

When debugging JavaScript, it’s helpful to know the type of
a variable, parameter, and return values. JavaScript is
dynamically typed, and for complex
source code it’s often hard to infer types. With type profiling, we
can provide type information to JavaScript developers.

This CL is a proof of concept. It collects type profile for
assignments and simply prints the types to stdout.

The output looks something like this:

#my_var1
  #Object
  #number
  #string
  #number
  #undefined
  #string
  #Object
  #Object

We use an extra slot in the feedback vector of assignments to
carry the list of types for that assignment. The extra slot is
only added when the flag --type-profile is given.

Missing work:
* Collect data for parameters and return values (currently only assignments).
* Remove duplicates from the list of collected types and use a common base class.
* Add line numbers or source position instead of the variable name.

For now, has a test that compares the stdout of --type-profile in test/message. We
will remove this test when --type-profile is fully integrated in
the debugger protocol. Adding
the test in test/inspector does not work, because the inspector
test itself consists of JavaScript code that would convolute the
output and be non-deterministic under stress.

BUG=v8:5935

Review-Url: https://codereview.chromium.org/2707873002
Cr-Commit-Position: refs/heads/master@{#43866}
2017-03-16 15:01:31 +00:00
jgruber
a4c73fa704 [csa] Add CSA::CallBuiltin and Builtins::CallableFor
This is another step towards making calls to builtins more convenient.

Builtins::CallableFor is an automatically generated Callable accessor for TFS
builtins (whereas previously we had to manually add an accessor to
code-factory.{h,cc}).

CSA::CallBuiltin is a convenience wrapper around CallStub for TFS builtins.

We can begin removing accessors for TFS builtins from CodeFactory in an
upcoming commit.

BUG=v8:5737

Review-Url: https://codereview.chromium.org/2752213002
Cr-Commit-Position: refs/heads/master@{#43865}
2017-03-16 14:22:12 +00:00
bbudge
11f69171c3 [WASM] Fix SIMD test that fails on ARM hardware.
- Change test to avoid adding denormalized numbers. This flushes to
  zero on ARM hardware when using Neon.

LOG=N
BUG=v8:6020

Review-Url: https://codereview.chromium.org/2754543007
Cr-Commit-Position: refs/heads/master@{#43864}
2017-03-16 14:06:49 +00:00
Michael Lippautz
0c0a4f0e3c [heap] Remove IsSweepingCompleted(AllocationSpace)
Adjusting the count requires us to call into Semaphore::WaitFor which
even on a z840 introduces a pause of at least 50us. We often call in
here from the unmapper that tries to add pages. E.g. for reducing the
new space size of 8M we call this for 16x2 pages, resulting in a pause
of 1.6ms for just checking the status of the sweeper tasks.

Avoiding reducing the count reduces the epilogue times. Example: FB
infinite scroll:

Before:
  heap.epilogue
    len: 102
    min: 0.01
    max: 4.83
    avg: 0.140196078431
    [0,5[: 102
After:
  heap.epilogue
    len: 106
    min: 0.01
    max: 0.24
    avg: 0.0260377358491
    [0,5[: 106

BUG=

Change-Id: I296c20ae3ac4b65218e4e038a9dbce504160a764
Reviewed-on: https://chromium-review.googlesource.com/455839
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43863}
2017-03-16 13:44:07 +00:00
yangguo
c5a46b7987 Add missing sub-repository in update_node.py.
NOTRY=true
R=machenbach@chromium.org
BUG=v8:6091

Review-Url: https://codereview.chromium.org/2757593002
Cr-Commit-Position: refs/heads/master@{#43862}
2017-03-16 12:54:55 +00:00
bmeurer
b880309bc7 [ignition] Decrease code size multiplier to 24.
BUG=

Review-Url: https://codereview.chromium.org/2758503002
Cr-Commit-Position: refs/heads/master@{#43861}
2017-03-16 12:19:55 +00:00
Clemens Hammacher
2b3fbd8208 Cleanup Isolate::UnwindAndFindHandler
Before adding stack unwinding of interpreted wasm frames, clean up the
respective method a bit.
Replace if-cascade by a switch, and inline the (previously public)
RemoveMaterializedObjectsOnUnwind method.

R=mstarzinger@chromium.org, jarin@chromium.org
BUG=v8:5822

Change-Id: Icf80c4adadc2f43551656ced8e92a67752d5c471
Reviewed-on: https://chromium-review.googlesource.com/453898
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43860}
2017-03-16 12:03:00 +00:00
Clemens Hammacher
783f68c53b [wasm] [interpreter] Throw exception on trap
This behaviour was missing before. If a trap is encountered in the
interpreter, we now throw the right error. With test.

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

Change-Id: I09c23d15fcde32ec586fb6d3094a5ec49155a9a2
Reviewed-on: https://chromium-review.googlesource.com/453839
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43859}
2017-03-16 12:01:15 +00:00
jkummerow
b3507ff022 [refactor] Separate generated builtins and C++ builtins into separate files
This is in preparation for linking the former only into mksnapshot.
Just shuffling code around, no changes in functionality.

BUG=v8:6055

Review-Url: https://codereview.chromium.org/2752143004
Cr-Commit-Position: refs/heads/master@{#43858}
2017-03-16 11:32:01 +00:00
Clemens Hammacher
24b9ffa487 [wasm] [cleanup] Avoid creation of temporary String objects
We were converting an int to a Smi, calling ToString to create a String
object, then appending this String to an IncrementalStringBuilder.
It's much easier and more efficient to just sprintf to a local buffer
and append that instead.

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

Change-Id: I9302a07971cfd32350d69b1b8f182d0ba7245b77
Reviewed-on: https://chromium-review.googlesource.com/454018
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43857}
2017-03-16 11:25:59 +00:00
Michael Lippautz
bba1bc414c [heap] Add tracer scopes to GC prologue and epilogue
BUG=

Change-Id: I51278784c2303419155abbfe6e36a1dc78c53527
Reviewed-on: https://chromium-review.googlesource.com/455835
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43856}
2017-03-16 11:03:02 +00:00