Commit Graph

19355 Commits

Author SHA1 Message Date
Sathya Gunasekaran
294dbf49bc [intl] Add GetOption
This patch ports over the spec defined operation `GetOption` from
JavaScript to C++:
https://tc39.github.io/ecma402/#sec-getoption

The JS implementation will be deleted once all it's
users are migrated.

Refactors LocaleConstructor to use this method which fixes some test262
tests. The test262 test status file is updated to reflect this.

Bug: v8:5751, v8:7684
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ief5eae9b69dcea50062825163ca7658ed20bd0cf
Reviewed-on: https://chromium-review.googlesource.com/1094201
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53652}
2018-06-11 22:19:22 +00:00
Joyee Cheung
a229e12101 [builtins] set DataView.length to 1
Refs: https://github.com/tc39/ecma262/pull/1131
Test: test262/built-ins/DataView/length
Bug: v8:7816
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I66a06734bd32cd2043a8d04728b2185f6093bd69
Reviewed-on: https://chromium-review.googlesource.com/1094980
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53649}
2018-06-11 18:42:34 +00:00
Bill Budge
bcb4fbd4ad [wasm simd] Handle more shuffles
- Shuffle canonicalization improved to reverse operands to match
  more architectural shuffles.
- Handles shuffles where the order of operands is reversed.
- Adds tests for non-canonical shuffles, and for swizzles.
- Improves TryMatchConcat method.
- Substantially rewrites shuffles on ia32 to better handle swizzles
  and fix bugs on reversed shuffles where source registers are
  overwritten.
- Adds Palignr macro-assembler instructions for ia32.

Bug: v8:6020
Change-Id: I8e43a1e7650057c66690af1504b67509a1437d75
Reviewed-on: https://chromium-review.googlesource.com/1070934
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Martyn Capewell <martyn.capewell@arm.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53648}
2018-06-11 18:40:24 +00:00
Hannes Payer
43886bc305 [heap] Cleanup heap creation a bit.
Change-Id: I7f2d0ba0e544267a9f97838e2904d8dfeecd9a99
Reviewed-on: https://chromium-review.googlesource.com/1095615
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53647}
2018-06-11 18:21:36 +00:00
Michael Achenbach
6ac38bb07e [test] Skip flaky test
TBR=gsathya@chromium.org
NOTRY=true

Bug: v8:7841
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Idb77549e6ede9ea903bfd706db10f6d7ce701a97
Reviewed-on: https://chromium-review.googlesource.com/1095038
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53634}
2018-06-11 11:58:26 +00:00
Sigurd Schneider
394d53d1b8 [turbofan] Add inlining for RegExp#test
This CL adds a TFS stub for RegExp#test and moves several checks to
the JSCallReducer. In particular, the JSCallReducer checks that
 - property {exec} on the regexp is still the original exec
 - property {lastIndex} on the regexp is a non-negative smi
The stub does not repeat these checks in release mode.

This effectively means that if the regexp is known, we can perform these
checks at compile time, and get away with a map dependency.

Bug: v8:7779, v8:7200

Change-Id: I0c6d711d4f1d2f6f325a1c02855b0e1b62e014c8
Reviewed-on: https://chromium-review.googlesource.com/1074654
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53630}
2018-06-11 11:29:56 +00:00
Leszek Swirski
d6c49a7251 [GetIsolate] Remove GetIsolate in simple cases
Whenever an Isolate is available on a variable, field, or method
parameter, use that instead of GetIsolate(). Also convert simple
cases of the one-argument handle constructor to either use an
available Isolate, or use GetIsolate() if their first parameter
is a variable.

Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I52805905a9ca8729615ead78859f43d5e8f605f1
Reviewed-on: https://chromium-review.googlesource.com/1092853
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53629}
2018-06-11 11:02:59 +00:00
Sigurd Schneider
6fd25bc6b4 [js-perf-test] Remove flaky perf test from mjsunittest...
...and add a js-perf-test instead.

Bug: v8:7726
Change-Id: I0cd17642c76887a5a24f54792625d62b9cee3667
Reviewed-on: https://chromium-review.googlesource.com/1094637
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53627}
2018-06-11 09:52:58 +00:00
Clemens Hammacher
c87793977f [test] Fix output of assertSame
For errors, it just printed "Failure: expected <Error()> found
<Error()>" and completely omitted the specific error type and the
message.

The new output is:
Failure:
expected:
Error(Error: my explicit error)
found:
Error(ReferenceError: ffi is not defined)

R=mstarzinger@chromium.org

Change-Id: Ie17a97e4413c4585b9560fd1c408018ee8c06701
Reviewed-on: https://chromium-review.googlesource.com/1092746
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53625}
2018-06-11 09:01:38 +00:00
Matheus Marchini
b20faffb07 [log] fix ExistingCodeLogger behavior on edge case
ExistingCodeLogger was behaving incorrectly when the CodeEventHandler
API was used in combination with --interpreted-frames-native-stack.
Instead of collecting copied trampolines as InterpretedFunction:functionName,
they were being collected as Builtin:IntepreterEntryTrampolines.
This patch adds special handling for copied trampolines when
using ExistingCodeLogger.

R=yangguo@google.com

Change-Id: I3ee4be03800122d28d53b51b20c60dcf6263e4c1
Reviewed-on: https://chromium-review.googlesource.com/1087813
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53624}
2018-06-11 08:32:13 +00:00
jgruber
41b2d783e5 [builtins] Disallow internal references in embedded builtins
Internal references create absolute pointers within the code and must
therefore be disallowed for embedded builtins to remain
position-independent.

Drive-by: remove related cctest. This test used to be relevant before
embedding was fully implemented, but by now it is useless and rather
misleading since it gives a false sense of safety.

Bug: v8:6666
Change-Id: I57a62274b57c3ef1303d5114c68e2a9b1f92bda4
Reviewed-on: https://chromium-review.googlesource.com/1092732
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53623}
2018-06-11 07:41:58 +00:00
Sathya Gunasekaran
da02f095d3 [hash-table] Introduce OrderedHashTableHandler
OrderedHashTableHandler (to be renamed to OrderedHashTable) is the
interface that abstracts away the two different ordered hash tables.

All operations on the two ordered hash tables must be performed
through this new interface so that we can seamlessly migrate from one
table to another behind the scenes.

Bug: v8:6443, v8:7569
Change-Id: Ifc0a38974605b63e0a2a36b4aafb8dc68a081f4a
Reviewed-on: https://chromium-review.googlesource.com/1059865
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53622}
2018-06-11 00:22:12 +00:00
Sathya Gunasekaran
5760586ed6 Test262 roll
Bug: v8:7834
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I1fcbcf0b019a0fbf0f17a676bd31a686a6d5377d
Reviewed-on: https://chromium-review.googlesource.com/1091880
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53618}
2018-06-08 16:53:31 +00:00
Rodrigo Bruno
748e33944d [heap ]Added test to verify the output of CalculateOldGenerationAllocationLimit.
Bug: chromium:845409
Change-Id: Id8b89e6dac48bba9065ac9f04ce48f951aa2186b
Reviewed-on: https://chromium-review.googlesource.com/1092860
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53617}
2018-06-08 16:45:41 +00:00
Ulan Degenbaev
7f442da6d8 Fix Linux64_TSAN-concurrent_marking bot after 7a9e3ec
The mock histogram functions cannot be cleared and can be called on
isolate tear down if incremental marking is in progress.

Bug: chromium:850508
Tbr: mlippautz@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I99e52aaa81c863f71e195aeed691b37da9e71da6
Reviewed-on: https://chromium-review.googlesource.com/1093073
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53616}
2018-06-08 15:46:44 +00:00
Ulan Degenbaev
65ba1cb618 Fix jumbo build after 7a9e3ec
Bug: chromium:850508

Tbr: mlippautz@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I99adf68c4b3e26decf3b68c8062ce74cbf27874d
Reviewed-on: https://chromium-review.googlesource.com/1093071
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53615}
2018-06-08 15:31:45 +00:00
Ulan Degenbaev
7a9e3ec98d [heap] Record histograms for Mark-Compact phases.
This adds the following histograms recorded corresponding to
V8.GCFinalizeMC phases:
- V8.GCFinalizeMC.Clear
- V8.GCFinalizeMC.Epilogue
- V8.GCFinalizeMC.Evacuate
- V8.GCFinalizeMC.Finish
- V8.GCFinalizeMC.Mark
- V8.GCFinalizeMC.Prologue
- V8.GCFinalizeMC.Sweep

Bug: chromium:850508
Change-Id: I47adc125a9a28436d09e35db68a8e8198cbee2dd
Reviewed-on: https://chromium-review.googlesource.com/1091311
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53614}
2018-06-08 14:23:09 +00:00
Clemens Hammacher
d5d116af63 [wasm] [cleanup] Refactor and clean up {DisjointAllocationPool}
Since we never extract pools from a {DisjointAllocationPool}, the
{Allocate} method can just return an {AddressRange}, and also {Merge}
just needs to merge a single {AddressRange}.

Drive-by: Make {AddressRange} a proper struct, for DCHECKs and better
accessors.

R=mstarzinger@chromium.org

Bug: v8:7754
Change-Id: I19fd02b2c6d8eb5316a5e994835b89be9cfa792b
Reviewed-on: https://chromium-review.googlesource.com/1090723
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53610}
2018-06-08 12:10:53 +00:00
Igor Sheludko
a17041d022 [test] Make IsValidPositiveSmi test independent of Smi representation.
Change-Id: I308c05feace7b1bb69d12a35243340724a96a49b
Reviewed-on: https://chromium-review.googlesource.com/1090491
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53605}
2018-06-08 09:15:23 +00:00
Aseem Garg
63b32e2747 [wasm] disable SIMD interpreter tests for mips
The globals tests for simd are failing on mips big endian. Will re-enable
after fixing.

R=clemensh@chromium.org
BUG=v8:6020

Change-Id: I8a8a17c4e947b69ccc2eb6bbe79c308b1129d1af
Reviewed-on: https://chromium-review.googlesource.com/1089814
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53595}
2018-06-07 19:53:57 +00:00
Joyee Cheung
ca489d39da [esnext] Implement Symbol.prototype.description
Proposal repo: https://github.com/tc39/proposal-symbol-description

Add new Builtin SymbolPrototypeDescriptionGetter.

Bug: v8:7807
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I7353bd00b172e91d8624e3373d2a4b55aced8b5c
Reviewed-on: https://chromium-review.googlesource.com/1088871
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53592}
2018-06-07 18:26:46 +00:00
Vasili Skurydzin
81e75305de s390: assembler-s390 instruction format cleanup
Change-Id: I7736314257bba44b4336d584020744c05874aa64
Reviewed-on: https://chromium-review.googlesource.com/1067607
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#53591}
2018-06-07 18:23:01 +00:00
Junliang Yan
8fcd3f8f4d PPC/s390: skip regress-2185 on ppc and s390
R=szuend@google.com, cbruni@chromium.org, jgruber@chromium.org

Bug: v8:7382,v8:7806,chromium:849293
Change-Id: I95874713038d14fa6ae294a23679dfaff70c65ba
Reviewed-on: https://chromium-review.googlesource.com/1089141
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#53585}
2018-06-07 14:48:34 +00:00
Simon Zünd
3896cdc25c Reland "[array] Use random middle element to determine pivot during sorting"
This is a reland of 91bab5588c

This CL contains two major changes w.r.t to the original CL:

The random state is removed from the Smi root list and we pre-seed the RNG
on each sort with the length of the array.

To cut down on the length of the arguments list and to keep track of the
random state across recursive calls, we move most of the sort arguments into
a FixedArray and reload from the array for each recursion.

Original change's description:
> [array] Use random middle element to determine pivot during sorting
>
> This CL adds a "random state" to the Smi Root list and implements a
> basic Linear congruential pseudo random number generator in Torque.
>
> The RNG is used to determine the pivot element for sorting. This will
> prevent the worst cases for certain data layouts.
>
> Drive-by-fix: Make sorting of ranges and execution pauses for profviz
> deterministic by adding a secondary sorting criteria.
>
> Bug: v8:7382
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ieb871e98e74bdb803f821b0cd35d2f67ee0f2868
> Reviewed-on: https://chromium-review.googlesource.com/1082193
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Simon Zünd <szuend@google.com>
> Cr-Commit-Position: refs/heads/master@{#53524}

Bug: v8:7382
Change-Id: Ia7bef7ed1c0e904ffe43bc428e702f64f9c6a60b
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1087888
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#53583}
2018-06-07 13:33:14 +00:00
Rodrigo Bruno
db4b7e7598 [heap] Refactoring heap growing strategy from Heap to HeapController class.
Bug: chromium:845409
Change-Id: I377d6f9d26a193f7fd829f7b74f9fdabc1337dc0
Reviewed-on: https://chromium-review.googlesource.com/1089053
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53580}
2018-06-07 12:38:34 +00:00
Leszek Swirski
b6888b63ca Revert "[sfi] Remove SFI function literal id field"
This reverts commit ceb9c8127f.

Reason for revert: Tanks compile time

Original change's description:
> [sfi] Remove SFI function literal id field
> 
> SharedFunctionInfos store their original function literal's id. This is
> also their index in the Script's SFI list.
> 
> Since the function literal id is only needed for lazy compilation and live
> edit, we can calculate it on-the-fly by linear search in the Script SFI list,
> and save a field on the SFI.
> 
> If this regresses compile performance, we could alternatively store the
> function literal id on the preparsed scope data as future work.
> 
> Bug: chromium:818642
> Change-Id: I5468cea0e115921f1c864d94e567d749a4349882
> Reviewed-on: https://chromium-review.googlesource.com/1082480
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53523}

TBR=hpayer@chromium.org,leszeks@chromium.org,verwaest@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:818642
Bug: chromium:850417
Change-Id: If2fd21331b7062532c04004a51e705f7e9d0a151
Reviewed-on: https://chromium-review.googlesource.com/1090494
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53573}
2018-06-07 09:21:27 +00:00
Dominik Inführ
3db0672cc4 Use EphemeronHashTable as backing store for JSWeakCollection
JSWeakCollection should use EphemeronHashTable as backing store instead of
ObjectHashTable such that the GC can handle these structures differently in
the future.

Bug: chromium:844008
Change-Id: Icc6df60c975a942877e2507ef45e0d235e5f72be
Reviewed-on: https://chromium-review.googlesource.com/1089063
Commit-Queue: Dominik Inführ <dinfuehr@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53572}
2018-06-07 09:04:37 +00:00
Jaroslav Sevcik
6ee715264c [turbofan] Introduce JS heap broker.
As a first step towards moving accesses to the broker, this moves
heap accesses from BitsetType::Lub to the broker.

Bug: v8:7790
Change-Id: Ie240b84b979717caae42cb8aa06ee8d9877a446d
Reviewed-on: https://chromium-review.googlesource.com/1088695
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53571}
2018-06-07 07:45:16 +00:00
Hannes Payer
5e31f9ffdf [heap] Cleanup Heap SetUp/TearDown a bit.
Change-Id: Ieec4dccdf8a5241f439bde9fffc75f4f300930e1
Reviewed-on: https://chromium-review.googlesource.com/1089333
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53567}
2018-06-07 06:37:54 +00:00
Eric Holk
b984b70c3a [wasm] Fall back on bounds checks when guarded memory unavailable
This CL adds the simplest version of a trap handler fallback. At
instantiation time, we check whether the module was compiled to use
trap handlers and the memory is guarded. If the memory is not guarded
but the module is supposed to use trap handlers, we recompile the
module with bounds checks so that we can use an unguarded memory.

The compiled module is replaced with a bounds checking version, meaning
future instances from this module will also use bounds checks.

Some likely desirable features that are current missing but can be
added future CLs include:
* Disabling trap handler mode entirely.
* Recompiling all old instances so that trap handler and bounds checked
  code does not coexist in the same process.

Bug: v8:7143

Change-Id: I161fc0d544133b07dc4a93cc6af813369aaf3efe
Reviewed-on: https://chromium-review.googlesource.com/1018182
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53566}
2018-06-07 01:29:53 +00:00
Andreas Haas
86a2720763 [test] Make assertThrowsEquals use assertSame
The typical use of assertThrowsEquals is to check that a specific
object is thrown. However, assertEquals only does a proper equality
check for primitive types, not for complex types. Using assertSame
does a reference equality check on objects, which is more what you
would expect from assertThrowsEquals. For exception kind testing,
assertThrowsEquals actually did not work correctly, assertThrows is
better for that case.

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

Change-Id: I24fb22e75fa33ebe90eb4bae40825119a054bba5
Reviewed-on: https://chromium-review.googlesource.com/1087952
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53556}
2018-06-06 14:17:12 +00:00
Bill Budge
3252af39f2 Revert "[async] Expose async hooks to d8"
This reverts commit 3c4d0316e4.

Reason for revert: Breaks MSAN on ARM64

https://ci.chromium.org/buildbot/client.v8/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/21425

'enabled' field not initialized in constructor?

Original change's description:
> [async] Expose async hooks to d8
> 
> This implementation follows the Node.js API as a guideline.
> 
> Change-Id: I09274ea25ccdbb9794a7440d6c14f26b9febb4f4
> Reviewed-on: https://chromium-review.googlesource.com/1065818
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Ali Ijaz Sheikh <ofrobots@google.com>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53551}

TBR=ofrobots@google.com,gsathya@chromium.org,bmeurer@chromium.org,mslekova@chromium.org

Change-Id: I8b2bedb51cba18c77578d4e223474015d819e428
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/1088811
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53555}
2018-06-06 13:51:12 +00:00
Maya Lekova
3c4d0316e4 [async] Expose async hooks to d8
This implementation follows the Node.js API as a guideline.

Change-Id: I09274ea25ccdbb9794a7440d6c14f26b9febb4f4
Reviewed-on: https://chromium-review.googlesource.com/1065818
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53551}
2018-06-06 13:06:12 +00:00
Ivica Bogosavljevic
57f0e26fa9 Fix ThreadTicks.ThreadNow on systems with low resolution timers
Test ThreadTicks.ThreadNow fails on systems with low resolution
thread timers because the tests detects that no time elapsed
since the beginning of the test.
This CL adds a counting loop that makes sure the thread
timer has progressed by at least one tick.

TEST=unittests/ThreadTicks.ThreadNow

Change-Id: I910309208b3a154798cbc43813d41d3755ab819d
Reviewed-on: https://chromium-review.googlesource.com/1082352
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53548}
2018-06-06 11:47:41 +00:00
Camillo Bruni
cb29d62068 [CSA] Fix assertion in CallOrConstructDoubleVarargs with empty FixedArray
Bug: chromium:850005
Change-Id: I287a274b86941e7d29705a24e479e4a02ecdfb07
Reviewed-on: https://chromium-review.googlesource.com/1088608
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53546}
2018-06-06 11:01:11 +00:00
Anna Henningsen
555c811c0d [api] Switch from SetBuildEmbedderGraphCallback to AddBuildEmbedderGraphCallback
`SetBuildEmbedderGraphCallback`, unlike `SetWrapperClassInfoProvider`,
assumes a monolithic embedder that can provide all necessary information.
That is not the case for e.g. Node.js, which can e.g. provide multiple Node.js
instances per V8 Isolate, as well as native addons that may allocate resources
on their own.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib53dfde82416dd69934b08623e27d674a483ac2d
Reviewed-on: https://chromium-review.googlesource.com/1082441
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53545}
2018-06-06 09:46:57 +00:00
jgruber
fc683744e5 Re-enable embedded builtins
Enabling once again post-branch point. This CL is expected to come
with major memory improvements and slight performance regressions.

Recent work on performance improvements has focused on x64, hence only
enabling there for now.

Bug: v8:6666
Change-Id: I29dc55eb4e592465073559647e280f74253b73e1
Reviewed-on: https://chromium-review.googlesource.com/1076247
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53544}
2018-06-06 08:47:57 +00:00
Michael Achenbach
1c40429844 Revert "[array] Use random middle element to determine pivot during sorting"
This reverts commit 91bab5588c.

Reason for revert: Seems to break a layout test:
https://ci.chromium.org/buildbot/client.v8.fyi/V8-Blink%20Linux%2064/23895

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original change's description:
> [array] Use random middle element to determine pivot during sorting
> 
> This CL adds a "random state" to the Smi Root list and implements a
> basic Linear congruential pseudo random number generator in Torque.
> 
> The RNG is used to determine the pivot element for sorting. This will
> prevent the worst cases for certain data layouts.
> 
> Drive-by-fix: Make sorting of ranges and execution pauses for profviz
> deterministic by adding a secondary sorting criteria.
> 
> Bug: v8:7382
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ieb871e98e74bdb803f821b0cd35d2f67ee0f2868
> Reviewed-on: https://chromium-review.googlesource.com/1082193
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Simon Zünd <szuend@google.com>
> Cr-Commit-Position: refs/heads/master@{#53524}

TBR=hpayer@chromium.org,cbruni@chromium.org,jgruber@chromium.org,szuend@google.com

Change-Id: I54f5d3f719428fd089ff12ff217d1c819f9ad1f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7382
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1088506
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53542}
2018-06-06 08:16:48 +00:00
Clemens Hammacher
dd8356020f [wasm] Add test for printing wasm code after deserialization
R=mstarzinger@chromium.org

Bug: chromium:849656
Change-Id: I4c1990e10905969c94913f434ec0013e5cbbfb19
Reviewed-on: https://chromium-review.googlesource.com/1087273
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53535}
2018-06-05 19:15:15 +00:00
Clemens Hammacher
423b8a2011 [ia32] Add disassembler support for 'pause'
R=mstarzinger@chromium.org

Bug: chromium:849656
Change-Id: I34effca4770f732216b93b5e4e8c28383f2f9963
Reviewed-on: https://chromium-review.googlesource.com/1087271
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53534}
2018-06-05 19:12:14 +00:00
Alexey Kozyatinskiy
0b3e8e184c [inspector] postpone API interrupts during creation of injected script
DevTools may process another protocol message during API interrupt this
API may lead to createInjectedScript reentrance and will fail.
Let's postpone interrupts.

Bug: chromium:846099
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia06e034a6287087e4674559d8911d2f4a0b1b459
Reviewed-on: https://chromium-review.googlesource.com/1086372
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53531}
2018-06-05 18:04:44 +00:00
Alexey Kozyatinskiy
8205786a4b [inspector] decouple debugger delegate and async stacks delegate
Currently we enable instrumentation if debugger is active. With this
approach we can not:
- capture async stack when debugger is disabled,
- avoid async instrumentation overhead when debugger is enabled and
  async stacks are disabled.

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

Bug: none
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I19400c4c4e12b6c9b5a980fb6bd3293bac6e6a64
Reviewed-on: https://chromium-review.googlesource.com/1081494
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53530}
2018-06-05 17:39:22 +00:00
Mathias Bynens
0a237ffe5b Remove always-true --harmony-optional-catch-binding runtime flag
It was shipped in Chrome 66.

Bug: v8:6889
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I6333ee20ab913b281674b911d525d2851f4694c9
Reviewed-on: https://chromium-review.googlesource.com/1086928
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53527}
2018-06-05 16:24:20 +00:00
jgruber
eca6c5bbb9 [date] Fix double-to-int conversion in MakeDay
`date` could be outside the int32_t range and thus FastD2I may not be
used.

Bug: chromium:849663
Change-Id: I96a012b40d35ec8f80e449e4e687b0ce7b572d5e
Reviewed-on: https://chromium-review.googlesource.com/1087063
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53526}
2018-06-05 16:15:20 +00:00
Simon Zünd
91bab5588c [array] Use random middle element to determine pivot during sorting
This CL adds a "random state" to the Smi Root list and implements a
basic Linear congruential pseudo random number generator in Torque.

The RNG is used to determine the pivot element for sorting. This will
prevent the worst cases for certain data layouts.

Drive-by-fix: Make sorting of ranges and execution pauses for profviz
deterministic by adding a secondary sorting criteria.

Bug: v8:7382
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ieb871e98e74bdb803f821b0cd35d2f67ee0f2868
Reviewed-on: https://chromium-review.googlesource.com/1082193
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#53524}
2018-06-05 14:11:37 +00:00
Leszek Swirski
ceb9c8127f [sfi] Remove SFI function literal id field
SharedFunctionInfos store their original function literal's id. This is
also their index in the Script's SFI list.

Since the function literal id is only needed for lazy compilation and live
edit, we can calculate it on-the-fly by linear search in the Script SFI list,
and save a field on the SFI.

If this regresses compile performance, we could alternatively store the
function literal id on the preparsed scope data as future work.

Bug: chromium:818642
Change-Id: I5468cea0e115921f1c864d94e567d749a4349882
Reviewed-on: https://chromium-review.googlesource.com/1082480
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53523}
2018-06-05 13:45:11 +00:00
Simon Zünd
e3190c2156 [torque] Fix int32 literals
This CL changes the behaviour of number literals. Large integer
literals (bigger than Smi, but fit into int32) should have
type "constexpr int32" instead of "constexpr float64".

R=tebbi@chromium.org

Change-Id: I3a83c617c7d257451d299670c891fac5b21d045c
Reviewed-on: https://chromium-review.googlesource.com/1084991
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53522}
2018-06-05 12:33:23 +00:00
Tobias Tebbi
a938ab5685 [torque] add hex literals
Bug: v8:7793
Change-Id: I69e27cb1e8477ca0d64ad7a96ab256cae96339f4
Reviewed-on: https://chromium-review.googlesource.com/1086801
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53521}
2018-06-05 11:48:53 +00:00
Camillo Bruni
62b714e237 [tests] Fix JSTests
Bug: chromium:848622
Change-Id: I8fff648fc4867cfbad1ee762652a5e628c66aeaa
Reviewed-on: https://chromium-review.googlesource.com/1086929
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53520}
2018-06-05 11:38:43 +00:00
Igor Sheludko
d123f30b6d [ptr-compr] Support 31-bit Smis in lower half-word on 64-bit architectures.
This CL introduces a new gn argument: v8_enable_pointer_compression which is
false by default. All the changes done in this CL are made under this flag.

Upper half-word of a Smi word must be properly sign-extended according to the
sign of the lower-half containing the actual Smi value.

Bug: v8:7703
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2b52ab49cd18c7c613130705de445fef44c30ac5
Reviewed-on: https://chromium-review.googlesource.com/1061175
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53519}
2018-06-05 11:37:35 +00:00