Commit Graph

34661 Commits

Author SHA1 Message Date
titzer
ff6941966e [wasm] Canonicalize function signature indices for matching in indirect calls.
R=bradnelson@chromium.org, ahaas@chromium.org, clemensh@chromium.org
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2403093002
Cr-Commit-Position: refs/heads/master@{#40169}
2016-10-11 12:40:33 +00:00
heimbuef
826451f078 Added zone tracing
Added PrintF output whenever a zone is created or destroyed. Also
enables setting of a name for each zone, which can then be shown
in the v8-heap-stats tool: https://github.com/mlippautz/v8-heap-stats/pull/2

BUG=v8:5489

Review-Url: https://codereview.chromium.org/2397573007
Cr-Commit-Position: refs/heads/master@{#40168}
2016-10-11 12:37:09 +00:00
verwaest
14bf19af64 Allow lazy parsing of functions nested in eager compiled functions
This is blocked on https://bugs.chromium.org/p/v8/issues/detail?id=5484

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2405813002
Cr-Commit-Position: refs/heads/master@{#40167}
2016-10-11 12:13:53 +00:00
heimbuef
91a3517e24 Added zone pool metrics to gc-trace.
Can be displayed in the external tool as well.

BUG=v8:5489

Review-Url: https://codereview.chromium.org/2392183004
Cr-Commit-Position: refs/heads/master@{#40166}
2016-10-11 11:49:43 +00:00
petermarshall
08217e45a7 [builtins] Move StringStartsWith to a C++ builtin.
BUG=v8:5364

Review-Url: https://codereview.chromium.org/2407173002
Cr-Commit-Position: refs/heads/master@{#40165}
2016-10-11 11:36:12 +00:00
petermarshall
5af6ec76b2 [builtins] Move StringEndsWith to a C++ builtin.
BUG=v8:5364

Review-Url: https://codereview.chromium.org/2406873002
Cr-Commit-Position: refs/heads/master@{#40164}
2016-10-11 11:28:12 +00:00
bmeurer
001926cdec [fullcodegen] Don't count CallIC calls as patching ICs.
In fullcodegen we used to count CallICs as patching ICs, and thus the
heuristics are currently off by the number of calls in a code object.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2408103002
Cr-Commit-Position: refs/heads/master@{#40163}
2016-10-11 11:24:22 +00:00
bmeurer
9192db2037 [stubs] Simplify the ArrayConstructorStub.
Remove the special side channel from the CallICStub to the
ArrayConstructorStub and make the CallICStub always use the
general entry point.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2405203002
Cr-Commit-Position: refs/heads/master@{#40162}
2016-10-11 11:18:02 +00:00
jgruber
05a5599234 [regexp] Port split
This CL ports RegExp.prototype[@@split] to C++. Performance
regressions are expected due to:

* Slow RegExpImpl::Exec implementation instead of RegExpExec
  stub. We should be able to improve this by straight-lining
  RegExpImpl::Exec.
* Slow Factory::NewSubString instead of SubStringStub.
* Slow elements access to lastMatchInfo.

These points will be addressed in a follow-up CL.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2401643002
Cr-Commit-Position: refs/heads/master@{#40161}
2016-10-11 10:38:14 +00:00
verwaest
86ec092318 Get rid of ParseInfo::lazy
BUG=v8:5501

Review-Url: https://codereview.chromium.org/2406803003
Cr-Commit-Position: refs/heads/master@{#40160}
2016-10-11 10:37:09 +00:00
clemensh
4f9976aa68 [wasm] Decouple function name and exported name in WasmFunctionBuilder
This is needed for the asm.js -> WASM pipeline. A single exported
function is exported as __single_function__, but we still want to see
the correct function name on the stack, so the underlying wasm function
has to carry the original name.

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

Review-Url: https://codereview.chromium.org/2406133003
Cr-Commit-Position: refs/heads/master@{#40159}
2016-10-11 10:36:02 +00:00
mstarzinger
1c1138388c [interpreter] Preserve bytecode by default.
This enables preservation of bytecode by default. Thus far bytecode was
cleared during tier-up by default and was only preserved in the staging
configuration.

R=rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2384063010
Cr-Commit-Position: refs/heads/master@{#40158}
2016-10-11 09:15:53 +00:00
clemensh
dde9c073bf [wasm] Implement decoding of i32v values
I use it in a follow-up commit to delta-encode asm.js source positions.

This commit also removes the redundant consume_bytes function.

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

Review-Url: https://codereview.chromium.org/2406163002
Cr-Commit-Position: refs/heads/master@{#40157}
2016-10-11 09:03:37 +00:00
clemensh
1b58614135 [wasm] Use WasmCompiledModule type in interfaces
Just a minor refactoring. We have the type for compiled modules, so use
it where possible for better type safety.

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

Review-Url: https://codereview.chromium.org/2405173002
Cr-Commit-Position: refs/heads/master@{#40156}
2016-10-11 08:28:51 +00:00
mlippautz
f2c0f97ad8 [heap] MemoryAllocator: Use size_t consistently
BUG=chromium:652721
R=ulan@chromium.org

Review-Url: https://codereview.chromium.org/2406913002
Cr-Commit-Position: refs/heads/master@{#40155}
2016-10-11 08:25:08 +00:00
epertoso
a863620fbc [stubs] Fix some CodeStubAssembler macros and adds a bitcast in the ToObjectStub.
This makes the MachineGraphVerifier happy with the stub.

R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2394193002
Cr-Commit-Position: refs/heads/master@{#40154}
2016-10-11 08:23:28 +00:00
vogelheim
8f43d74827 Speedup access to global_proxy.* attributes/accessors.
Using a global proxy (e.g. 'window.f', 'w.f' or 'this.f') is considerably slower than evaluating just 'f'. This CL aims to perform the necessary checks at compile time and inline the accesses.

This is a follow-on CL to crrev.com/2369933005:
- The initial upload is crrev.com/2369933005 + a rebase.
- The remaining issues are the fixes requested by the reviewers on that CL.

BUG=chromium:634276

Review-Url: https://codereview.chromium.org/2403003002
Cr-Commit-Position: refs/heads/master@{#40153}
2016-10-11 08:22:21 +00:00
jochen
515873cc9b Don't lazy-parse arrow functions if we eager compile them
R=verwaest@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2404913002
Cr-Commit-Position: refs/heads/master@{#40152}
2016-10-11 08:16:10 +00:00
machenbach
4e0b685acc [test] Bump timeout for js-test Strings on Android
The test still runs into the 240s timeout on Nexus5 and
Nexus7.

NOTRY=true
TBR=adamk, caitp

Review-Url: https://codereview.chromium.org/2406173002
Cr-Commit-Position: refs/heads/master@{#40151}
2016-10-11 07:29:08 +00:00
jgruber
effb8def76 [regexp] Skip regexp-property-lu-ui test in gc-stress
This test is timing out in gc-stress mode since RegExp.prototype.test
was moved to C++. RE.proto.test will be improved shortly, and this test
should be reenabled then.

BUG=v8:5339
NOTRY=true

Review-Url: https://codereview.chromium.org/2407133002
Cr-Commit-Position: refs/heads/master@{#40150}
2016-10-11 07:19:45 +00:00
yangguo
0d8e52123e [Math] implement Math.random as TFJ builtin.
R=bmeurer@chromium.org
BUG=v8:5049, v8:5086

Review-Url: https://codereview.chromium.org/2402363002
Cr-Commit-Position: refs/heads/master@{#40149}
2016-10-11 06:47:15 +00:00
v8-autoroll
3d5ae0f7d3 Update V8 DEPS.
Rolling v8/base/trace_event/common: b403fa6..98499f3

Rolling v8/build: 17093d4..83eadac

Rolling v8/third_party/catapult: c47d2e1..f1eba76

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

Review-Url: https://codereview.chromium.org/2410723002
Cr-Commit-Position: refs/heads/master@{#40148}
2016-10-11 03:39:37 +00:00
zhengxing.li
90ebb7b4dd X87: Reland "[turbofan] Discard the shared code entry in the optimized code map.".
port ec132e05ec (r40086)

  original commit message:
  (GcStress failure was unrelated.)

  At one time, we hoped to generate the same code for different
  native contexts. But in truth, much performance comes from optimizing
  on the native context. Now we abandon this pathway.

BUG=

Review-Url: https://codereview.chromium.org/2404843002
Cr-Commit-Position: refs/heads/master@{#40147}
2016-10-11 02:38:32 +00:00
zhengxing.li
ecc7d969ea [X87] [crankshaft] Set Floating-point precision in Math.Cos/Math.Sin to standard double precision.
This CL set Floating-point precision in Math.Cos/Math.Sin in Crankshaft compiler to standard double precision which is expected by v8.

BUG=

Review-Url: https://codereview.chromium.org/2403803002
Cr-Commit-Position: refs/heads/master@{#40146}
2016-10-11 02:13:59 +00:00
adamk
127798897f Revert of [modules] Store Module metadata in per-Context EmbedderData (patchset #7 id:120001 of https://codereview.chromium.org/2393303002/ )
Reason for revert:
Fails under LeakSanitizer on auto-roll fyi bot:

https://build.chromium.org/p/client.v8.fyi/builders/Auto-roll%20-%20release%20process/builds/49447

Original issue's description:
> [modules] Store Module metadata in per-Context EmbedderData
>
> Unifies the approaches used for storing the specifier -> module mapping
> and the module -> directory mapping, using std::unordered_maps for both
> and storing them per-Context.
>
> This requires adding a method to the v8::Module API to get a hash code
> for a Module, but allows slimming down the API in return: gone are
> SetEmbedderData/GetEmbedderData, along with the fourth argument
> to ResolveModuleCallback.
>
> Besides a simpler API, this allows d8 to get closer to the HTML loader,
> which requires each Realm to have a persistent module map (though this
> capability is not yet exercised by any tests).
>
> BUG=v8:1569
>
> Committed: https://crrev.com/9cf8fce74cf6e7afd6aea3f3545f6bb61572f277
> Cr-Commit-Position: refs/heads/master@{#40133}

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

Review-Url: https://codereview.chromium.org/2406973003
Cr-Commit-Position: refs/heads/master@{#40145}
2016-10-11 00:25:12 +00:00
adamk
9da6f1203f Revert of [d8] Fix LeakSanitizer failures on the bots due to ModuleEmbedderData (patchset #2 id:20001 of https://codereview.chromium.org/2403303002/ )
Reason for revert:
Still failing on auto-roll fyi bot

Original issue's description:
> [d8] Fix LeakSanitizer failures on the bots due to ModuleEmbedderData
>
> BUG=v8:1569
> TBR=jochen@chromium.org
>
> Committed: https://crrev.com/cd6f1c98f989ef991da3ff465f183c1caa070918
> Cr-Commit-Position: refs/heads/master@{#40143}

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

Review-Url: https://codereview.chromium.org/2403103004
Cr-Commit-Position: refs/heads/master@{#40144}
2016-10-11 00:24:04 +00:00
adamk
cd6f1c98f9 [d8] Fix LeakSanitizer failures on the bots due to ModuleEmbedderData
BUG=v8:1569
TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2403303002
Cr-Commit-Position: refs/heads/master@{#40143}
2016-10-10 23:53:27 +00:00
gsathya
1f80f66de0 [promises] update deferred reactions symbol
The behavior was changed in https://codereview.chromium.org/2357423002

Review-Url: https://codereview.chromium.org/2403163002
Cr-Commit-Position: refs/heads/master@{#40142}
2016-10-10 22:59:48 +00:00
littledan
6e95a8f0a6 Enable previously DCHECK-failing test
R=adamk
BUG=v8:5337

Review-Url: https://codereview.chromium.org/2313873003
Cr-Commit-Position: refs/heads/master@{#40141}
2016-10-10 22:20:38 +00:00
adamk
c0550b4cf4 Remove now-unused string_iterator symbols
These were used by the JS implementation, but are now dead code.

R=caitp@igalia.com
BUG=v8:5388

Review-Url: https://codereview.chromium.org/2410533002
Cr-Commit-Position: refs/heads/master@{#40140}
2016-10-10 19:46:34 +00:00
kozyatinskiy
085a445775 [inspector] fix minor issue in test/inspector.gyp
* Inspector should depend on v8_libbase, v8 depedency is added in conditions section.
* Inlined sources since they aren't used outside of this gyp file.

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

Review-Url: https://codereview.chromium.org/2408833002
Cr-Commit-Position: refs/heads/master@{#40139}
2016-10-10 19:08:46 +00:00
heimbuef
a96c2129af Replaced different means of zone pooling/reusing by one zone segment pool
BUG=v8:5409

Committed: https://crrev.com/a124feb0760896c8be61de08004a08c3bc9b4b3f
Committed: https://crrev.com/fc840361e357a571c709e0239ae82cc089800b3f
Review-Url: https://codereview.chromium.org/2348303002
Cr-Original-Original-Commit-Position: refs/heads/master@{#39633}
Cr-Original-Commit-Position: refs/heads/master@{#40048}
Cr-Commit-Position: refs/heads/master@{#40138}
2016-10-10 19:00:55 +00:00
heimbuef
f29f3e3208 Pool implementation for zone segments
BUG=v8:5409

Committed: https://crrev.com/37c688a24578e787d3d8941093563ed049c3497e
Committed: https://crrev.com/316669f62ea3834395bf4caab7bc3d7c32f6bbc6
Review-Url: https://codereview.chromium.org/2335343007
Cr-Original-Original-Commit-Position: refs/heads/master@{#39631}
Cr-Original-Commit-Position: refs/heads/master@{#40044}
Cr-Commit-Position: refs/heads/master@{#40137}
2016-10-10 18:03:55 +00:00
bradnelson
b884a51ff2 Re-enable fasta on gc_stress.
BUG=v8:5053
TEST=None
R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2395333003
Cr-Commit-Position: refs/heads/master@{#40136}
2016-10-10 17:59:32 +00:00
titzer
d46c790ef3 [asmjs] Move switch-logic.h to asmjs/ directory.
R=bradnelson@chromium.org,aseemgarg@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2408823002
Cr-Commit-Position: refs/heads/master@{#40135}
2016-10-10 17:57:47 +00:00
neis
8c575ac64c [modules] Update test262 config and status file.
- Make testcfg.py ignore files ending in "_FIXTURE.js", which are not supposed
  to be tested standalone but only as imports to other modules.

- Refine test262.status to match where we are with the modules implementation.

BUG=v8:1569
R=adamk@chromium.org

Review-Url: https://codereview.chromium.org/2400713004
Cr-Commit-Position: refs/heads/master@{#40134}
2016-10-10 17:38:56 +00:00
adamk
9cf8fce74c [modules] Store Module metadata in per-Context EmbedderData
Unifies the approaches used for storing the specifier -> module mapping
and the module -> directory mapping, using std::unordered_maps for both
and storing them per-Context.

This requires adding a method to the v8::Module API to get a hash code
for a Module, but allows slimming down the API in return: gone are
SetEmbedderData/GetEmbedderData, along with the fourth argument
to ResolveModuleCallback.

Besides a simpler API, this allows d8 to get closer to the HTML loader,
which requires each Realm to have a persistent module map (though this
capability is not yet exercised by any tests).

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2393303002
Cr-Commit-Position: refs/heads/master@{#40133}
2016-10-10 17:37:51 +00:00
mlippautz
e37fbcc3ea [heap] Remove dead write write barrier counter code
R=ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2409553003
Cr-Commit-Position: refs/heads/master@{#40132}
2016-10-10 17:02:23 +00:00
adamk
ed45f5903c Fix bad reinterpret_cast of StringFromCodePointOperator
StringFromCodePointOperator needed to derive from Operator1<UnicodeEncoding>
rather than plain old Operator. This was thankfully caught by the CFI build.

R=bmeurer@chromium.org, caitp@chromium.org
BUG=v8:5498

Review-Url: https://codereview.chromium.org/2398403003
Cr-Commit-Position: refs/heads/master@{#40131}
2016-10-10 16:59:03 +00:00
gsathya
7d336218bf [regexp] Remove unused InternalPackedArray
Review-Url: https://codereview.chromium.org/2397373004
Cr-Commit-Position: refs/heads/master@{#40130}
2016-10-10 16:57:57 +00:00
neis
9606a938a6 [modules] Extend a namespace test.
Extend a test of namespace imports such that it accesses the object inside a
with statement (inside a sloppy function).

Drive-by-fix: remove duplicate initialization of embedder data (probably due to
bad merge).

R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2405603003
Cr-Commit-Position: refs/heads/master@{#40129}
2016-10-10 16:56:36 +00:00
mythria
853e176f29 Revert of [Interpreter] Collect feedback about Oddballs in Subtract Stub. (patchset #2 id:20001 of https://codereview.chromium.org/2406843002/ )
Reason for revert:
breaks win32-debug bot.

Original issue's description:
> [Interpreter] Collect feedback about Oddballs in Subtract Stub.
>
> BUG=v8:4280, v8:5400
> LOG=N
>
> Committed: https://crrev.com/d5d283b27d406486e2f8d7b44c6d2b3db4f98458
> Cr-Commit-Position: refs/heads/master@{#40124}

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

Review-Url: https://codereview.chromium.org/2407923002
Cr-Commit-Position: refs/heads/master@{#40128}
2016-10-10 16:39:16 +00:00
petermarshall
8b48aa1cda [builtins] Move StringIncludes to a builtin.
Also add a test for when the first argument is null or undefined, as there are no tests that cover this currently.

BUG=v8:5364

Review-Url: https://codereview.chromium.org/2399423003
Cr-Commit-Position: refs/heads/master@{#40127}
2016-10-10 15:01:32 +00:00
mtrofin
b75a0c4a55 [wasm] Fix wasm instantiation flakes
The spurious failures were caused by the compiled module
template and its corresponding owning object getting out of
sync due to memory allocations (which may trigger GC)
between the points each were fetched.

Specifically, the {original} was first obtained; then a GC
may happen when cloning the {code_table}. At this point,
the {original}'s owner may have been collected, getting us
down the path of not cloning. When time comes to patch up
globals, we incorrectly try to patch them assuming the
global start is at 0 (nullptr), which in fact it isn't.

This change roots early, in a GC-free area, both objects.
Additionally, it avoids publishing to the instances chain
the new instance until the very end. This way:
- the objects used to create the new instance offer a
consistent view
- the instances chain does not see the object we try to
form. If something fails, we can safely retry.
- since the owner is rooted, the state of the front of the
instances chain stays unchanged - with the same compiled
module we started from. So the early belief that we needed
to clone is not invalidated by any interspersed GC.

This situation suffers from a sub-optimality discussed in
the design document, in that, in a memory constrained
system, the following snippet may surprisingly fail:

var m = new WebAssembly.Module(...);
var i1 = new WebAssembly.Instance(m);
i1 = null;
var i2 = new WebAssembly.Instance(m); //may fail.

This will be addressed subsequently.

BUG=v8:5451

Review-Url: https://codereview.chromium.org/2395063002
Cr-Commit-Position: refs/heads/master@{#40126}
2016-10-10 14:53:58 +00:00
titzer
d20dabb090 [wasm] Base address for data segments can also be the value of a global variable.
R=rossberg@chromium.org
BUG=chromium:575167
CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux64_msan_rel

Committed: https://crrev.com/640ae3f9d20dcae915dbfa978bf48944cd4d0dc3
Review-Url: https://codereview.chromium.org/2403823002
Cr-Original-Commit-Position: refs/heads/master@{#40121}
Cr-Commit-Position: refs/heads/master@{#40125}
2016-10-10 14:42:10 +00:00
mythria
d5d283b27d [Interpreter] Collect feedback about Oddballs in Subtract Stub.
BUG=v8:4280, v8:5400
LOG=N

Review-Url: https://codereview.chromium.org/2406843002
Cr-Commit-Position: refs/heads/master@{#40124}
2016-10-10 14:22:26 +00:00
machenbach
a6fb296a78 Revert of [wasm] Base address for data segments can also be the value of a global variable. (patchset #1 id:1 of https://codereview.chromium.org/2403823002/ )
Reason for revert:
msan not happy:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/11332

Original issue's description:
> [wasm] Base address for data segments can also be the value of a global variable.
>
> R=rossberg@chromium.org
> BUG=chromium:575167
>
> Committed: https://crrev.com/640ae3f9d20dcae915dbfa978bf48944cd4d0dc3
> Cr-Commit-Position: refs/heads/master@{#40121}

TBR=rossberg@chromium.org,titzer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2402373002
Cr-Commit-Position: refs/heads/master@{#40123}
2016-10-10 14:12:52 +00:00
jgruber
80f3c6ce77 [regexp] Port test, match, and search
This CL ports RegExp.prototype.test, RegExp.prototype.match
and RegExp.prototype.search to C++.

Performance regressions are expected but should be improved
in an upcoming CL.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2394713003
Cr-Commit-Position: refs/heads/master@{#40122}
2016-10-10 13:57:20 +00:00
titzer
640ae3f9d2 [wasm] Base address for data segments can also be the value of a global variable.
R=rossberg@chromium.org
BUG=chromium:575167

Review-Url: https://codereview.chromium.org/2403823002
Cr-Commit-Position: refs/heads/master@{#40121}
2016-10-10 13:26:26 +00:00
jochen
879fac3b56 Always use FinalizeUnoptimizedCompilationJob
Before, some code paths just invoked job->FinalizeJob() and then
manually installed the compilation result. Unify these.

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

Review-Url: https://codereview.chromium.org/2399203003
Cr-Commit-Position: refs/heads/master@{#40120}
2016-10-10 13:12:40 +00:00