Commit Graph

55401 Commits

Author SHA1 Message Date
Clemens Hammacher
bfc8afdbd1 [wasm][gc] Add code ref scope for fuzzers
A testing method was missing a code ref scope, making fuzzers fail.

R=mstarzinger@chromium.org

Bug: chromium:952759
Change-Id: Ib9d485fad85f66ca358a769a4e52777f68367991
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571605
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60909}
2019-04-17 15:43:46 +00:00
Irina Yatsenko
92d239b808 Make EnumCache derive directly from Struct and add a new instance type for it.
Bug: v8:9136
Change-Id: I9c0b4b662c2d061a13ee22df728fbee5df01b89e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1568106
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60908}
2019-04-17 15:42:16 +00:00
Clemens Hammacher
d1068b4f91 Revert "[Interpreter] Ensure Test*Handler don't allocate a frame for fast-path."
This reverts commit d6121fd1a3.

Reason for revert: Fails cctest/test-cpu-profiler/Inlining2 on arm64-sim: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim/17702

Original change's description:
> [Interpreter] Ensure Test*Handler don't allocate a frame for fast-path.
> 
> Avoids allocating a frame for the fast-path in TestEqual, TestEqualStrict and
> TestLess/GreaterThan bytecode handlers. Also changes how feedback is tracked
> to try and avoid needing to keep feedback to "combine" with if it's unecessary
> which reduces the liveranges of the registers holding this data.
> 
> This reduces the time needed for a tight loop in Ignition (e.g.,
> while (i < 1000000000) ++i;) from 12.8s to 10.8s.
> 
> BUG=v8:9133
> 
> Change-Id: I686b9da89541d15d233635db3276de3dad2fa282
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570020
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60906}

TBR=rmcilroy@chromium.org,jgruber@chromium.org

Change-Id: I5e53138929bf1fae9f57f9dd023d258bb7d557ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9133
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571418
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60907}
2019-04-17 13:48:47 +00:00
Ross McIlroy
d6121fd1a3 [Interpreter] Ensure Test*Handler don't allocate a frame for fast-path.
Avoids allocating a frame for the fast-path in TestEqual, TestEqualStrict and
TestLess/GreaterThan bytecode handlers. Also changes how feedback is tracked
to try and avoid needing to keep feedback to "combine" with if it's unecessary
which reduces the liveranges of the registers holding this data.

This reduces the time needed for a tight loop in Ignition (e.g.,
while (i < 1000000000) ++i;) from 12.8s to 10.8s.

BUG=v8:9133

Change-Id: I686b9da89541d15d233635db3276de3dad2fa282
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570020
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60906}
2019-04-17 13:00:16 +00:00
Peter Marshall
f528509be9 [cleanup] Don't cast ScopeInfo twice in inferred_name()
Change-Id: Id34b9dbe07871fc8e25bcb73d908b5b155a9f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571407
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60905}
2019-04-17 12:00:16 +00:00
Clemens Hammacher
c2835df621 [wasm] Remove trap handler fallback
The trap handler fallback is flaky, and was never enabled since it
never worked reliably. This CL removes
a) the --wasm-trap-handler-fallback flag,
b) the distinction between soft and hard address space limit,
c) methods to check whether memory has guard regions (it will always
  have them on 64 bit architectures),
d) associated runtime functions,
e) the trap handler fallback tests,
f) recompilation logic for the fallback.

R=titzer@chromium.org

Bug: v8:8746
Change-Id: I7f4682b8cd5470906dd8579ff1fdc9b1a3c0f0e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570023
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60904}
2019-04-17 11:55:36 +00:00
Santiago Aboy Solanes
dd29683f53 [Turbofan][ptr-compr] Change native context specialisation for CompressedSigned
This CL adds the representation changes from/to CompressedSigned to the other
data types (excluding Tagged, which was done in a previous CL).

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:8977, v8:7703
Change-Id: If967a1a0fc669c45a2764cf950cf02d8c06b08b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547859
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60903}
2019-04-17 11:51:45 +00:00
Clemens Hammacher
75e2bea3a8 [wasm] Remove code to be logged when native module dies
We have very few tests for this currently, and it's hard to test
this, since code logging happens soon after scheduling the task and
stack guard. If the timing is just right, it can happen though that a
{NativeModule} dies while {WasmCode} objects of that {NativeModule} are
still part of the {code_to_log} vector. In that case, we need to remove
those code objects from the vector to avoid use after free.

R=mstarzinger@chromium.org

Change-Id: I16c7098bf11c54700cc650dad965106af2e39157
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566519
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60902}
2019-04-17 11:14:26 +00:00
Jakob Gruber
104a030f15 [build] Include trap handler files in iOS simulator builds
iOS simulator builds have x64 as the target architecture. This extends
BUILD.gn to properly include trap handler files in this case.

Bug: v8:9140
Change-Id: If6e90a720effdebe8b1f4e4e37eb8b3a3dbae20e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570022
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60901}
2019-04-17 11:02:56 +00:00
Michael Starzinger
76f09525ce [wasm][x64] Improve jump table slot sequence.
R=clemensh@chromium.org

Change-Id: I367bb962d422e570b51c82bc7b3ebbd3fbedfd2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570018
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60900}
2019-04-17 10:44:56 +00:00
Clemens Hammacher
4863551111 Reland "[wasm] Add stack guard for logging code"
This is a reland of 067ba2a0c6.
Unchanged reland, hence TBR.

Original change's description:
> [wasm] Add stack guard for logging code
>
> Benchmarks or worker threads might never return to the event queue,
> hence they will never execute the scheduled foreground task to log
> compiled and published wasm code.
> This CL adds a stack guard to log the code, to ensure that we also log
> it for wasm code that never returns to the event queue.
>
> R=mstarzinger@chromium.org
>
> Bug: v8:9104
> Change-Id: I176959cadb4ab3a60153d0717530c032272ad3e8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1561073
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60879}

TBR=mstarzinger@chromium.org

Bug: v8:9104
Change-Id: I105b37ef8429d16ef5b983919ba8bca615e347c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570017
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60899}
2019-04-17 10:10:25 +00:00
Jakob Gruber
5a6953fe07 [libsampler] Add iOS support in libsampler
This adds support for iOS builds in libsampler. Both iOS simulator
builds (target architecture x64) and iOS device builds (arm64) are
supported.

Note that this is mostly untested since we neither have iOS bots nor
an iOS test runner. This CL was thus only tested by compiling V8 for
both iOS simulator & device targets.

Bug: v8:9140
Change-Id: Ib618bf793771f4be84d1979a968d2b3ef9f6ff86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569436
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60898}
2019-04-17 08:56:05 +00:00
Jakob Gruber
5de852c989 [build] Add iOS detection
Add OS detection for iOS builds. If we are building for an iOS target,
the following V8 OS defines will be set:

V8_OS_BSD
V8_OS_MACOSX
V8_OS_POSIX
V8_OS_IOS  // This one is new.

The detection code is taken from Chromium's build_config.h file.

Bug: v8:9140
Change-Id: I435a8931dc0ae0eefdb893bc838a04470bcc57db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569435
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60897}
2019-04-17 08:53:35 +00:00
tzik
f41f6d7416 Fix D8 Realm.navigate after Realm.detachGlobal
Realm.navigate hits a UAF when it's called after Realm.detachGlobal, and
that's hit a clusterfuzz test.

Bug: chromium:952749
Change-Id: Icf0f0d0b845bc5a2d1ddd80ab52756dae97b982f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1567583
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60896}
2019-04-17 08:11:19 +00:00
Clemens Hammacher
468e36bab8 [profiler] Quick-fix for illegal source positions
For some unknown reasons, the profiler starts seeing illegal source
positions (see referenced bug).

This CL quick-fixes that by just ignoring them for now. This might
regress profiling, and should be fixed mid-term.

R=mstarzinger@chromium.org

Bug: chromium:953309
Change-Id: I10db7e5ad24e8470e319fc9418cd3a684f614c26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569845
Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60895}
2019-04-17 08:10:14 +00:00
Peter Marshall
d1c7007984 [tracing] Add no_chromium_code config and suppress warning in protobuf
Add no_chromium_code config - this is required when removing the
chromium_code config.

Fix a warning that occurs when compiling protobuf_full by suppressing
warnings for not marking overriding functions with override.

Change-Id: I7f71a24b95dc3ef7d327481581aaa217407ee2cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569441
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60894}
2019-04-17 08:09:09 +00:00
Ross McIlroy
66ed7761b3 [Interpreter] Ensure Inc/DecHandler doesn't allocate a frame for fast-path.
Avoids allocating a frame for the fast-path in IncHandler by marking some calling
branches as Deferred. Also avoid loading feedback slot and vector until it's needed
to reduce live range.

This reduces the time needed for a tight loop in Ignition (e.g.,
while (i < 1000000000) ++i;) from 15.5s to 12.8s.

BUG=v8:9133

Change-Id: I0a62efdaefca7f3024b3ae05c61631a63cb01390
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570005
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60893}
2019-04-17 08:04:39 +00:00
Z Duong Nguyen-Huu
0fbf170821 Porting ProxyConstructor to Torque
Spec: https://tc39.github.io/ecma262/#sec-proxy-constructor
Bug: v8:6664
Change-Id: Ia8b5ed75841d813babd1db4743c3bb9d25658b51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1553007
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60892}
2019-04-17 07:57:29 +00:00
Jakob Gruber
d97ceb2798 [libsampler] Remove support for old OS X versions
OS X has been a UNIX 03 registered product since version 10.5,
released in October 2007.

Bug: v8:8834
Change-Id: I64ca5512a9999b6eb7b4003a6758081a06eb6529
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569437
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60891}
2019-04-17 07:33:29 +00:00
Michael Hablich
6ce63fd81c Revert "[wasm] Add stack guard for logging code"
This reverts commit 067ba2a0c6.

Reason for revert: blocks roll: https://chromium-review.googlesource.com/c/chromium/src/+/1570208

21:26:22.251 27507   # Fatal error in ../../v8/src/profiler/profile-generator.cc, line 19
21:26:22.251 27507   # Debug check failed: line > 0 (0 vs. 0).
21:26:22.251 27507   #
21:26:22.251 27507   #
21:26:22.251 27507   #
21:26:22.252 27507   #FailureMessage Object: 0x7ffe851046a0#0 0x56532cb371f9 base::debug::CollectStackTrace()
21:26:22.252 27507   #1 0x56532ca70863 base::debug::StackTrace::StackTrace()
21:26:22.252 27507   #2 0x56532e99610b gin::(anonymous namespace)::PrintStackTrace()
21:26:22.252 27507   #3 0x56532e989468 V8_Fatal()
21:26:22.252 27507   #4 0x56532e9891c5 v8::base::(anonymous namespace)::DefaultDcheckHandler()
21:26:22.252 27507   #5 0x56532b2bb876 v8::internal::SourcePositionTable::SetPosition()
21:26:22.252 27507   #6 0x56532b2c2268 v8::internal::ProfilerListener::CodeCreateEvent()
21:26:22.252 27507   #7 0x56532ae25275 v8::internal::(anonymous namespace)::LogFunctionCompilation()
21:26:22.252 27507   #8 0x56532ae26008 v8::internal::OptimizedCompilationJob::RecordFunctionCompilation()
21:26:22.252 27507   #9 0x56532ae32a08 v8::internal::Compiler::FinalizeOptimizedCompilationJob()
21:26:22.252 27507   #10 0x56532ae228eb v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions()
21:26:22.252 27507   #11 0x56532af14e4a v8::internal::StackGuard::HandleInterrupts()
21:26:22.252 27507   #12 0x56532b35f2ec v8::internal::__RT_impl_Runtime_StackGuard()
21:26:22.252 27507   #13 0x56532bba6720 <unknown>

Original change's description:
> [wasm] Add stack guard for logging code
> 
> Benchmarks or worker threads might never return to the event queue,
> hence they will never execute the scheduled foreground task to log
> compiled and published wasm code.
> This CL adds a stack guard to log the code, to ensure that we also log
> it for wasm code that never returns to the event queue.
> 
> R=​mstarzinger@chromium.org
> 
> Bug: v8:9104
> Change-Id: I176959cadb4ab3a60153d0717530c032272ad3e8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1561073
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60879}

TBR=mstarzinger@chromium.org,clemensh@chromium.org

Change-Id: I63dc56a41747caf683b14869a2d62017fd0301c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9104
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570012
Reviewed-by: Michael Hablich <hablich@chromium.org>
Commit-Queue: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60890}
2019-04-17 06:44:42 +00:00
v8-ci-autoroll-builder
1d59bfe5b7 Update wasm-spec.
Rolling v8/test/wasm-js/data: 2a28a92..d14d538

[spec] More precise Unicode terminology (#1002) (Andreas Rossberg)
https://chromium.googlesource.com/external/github.com/WebAssembly/spec/+/d14d538

[test] Alignment and offset with overlong leb128 (#998) (Wanming Lin)
https://chromium.googlesource.com/external/github.com/WebAssembly/spec/+/4dce956

[spec] Add paragraph break for more emphasis (#1001) (Andreas Rossberg)
https://chromium.googlesource.com/external/github.com/WebAssembly/spec/+/3099a7b

TBR=ahaas@chromium.org,clemensh@chromium.org

Change-Id: Ifc803d75840ee8389f5634ed090992f4d6934837
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571126
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#60889}
2019-04-17 05:12:19 +00:00
v8-ci-autoroll-builder
dd94e67444 Update V8 DEPS.
Rolling v8/build: f202325..a0b2e3b

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/2f423f7..acbf095

Rolling v8/third_party/depot_tools: 4b79c38..7e7523b

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

Change-Id: Iee7a9a297113146826638a1674a9c29e8e06c176
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570584
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#60888}
2019-04-17 03:28:29 +00:00
Paolo Severini
c949f1eba6 [torque] Convert a few class layout definitions to torque.
Converted WeakFixedArray, PromiseReactionJobTask, PromiseResolveThenableJobTask,
PropertyCell, RegExpMatchInfo, WasmModuleObject, WasmTableObject,
WasmMemoryObject, WasmGlobalObject, WasmExceptionObject, AsmWasmData to torque.

Bug: v8:8952
Change-Id: Iddc8b7bc50f93f1a75b4a96667237eed57de236b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1536991
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60887}
2019-04-17 01:59:19 +00:00
Yu Yin
79972136e6 [MIPS32][liftoff] Introduce emit_{i64,i32}_add with immediate
This is port for https://crrev.com/c/1524482
Original commit message:
    This allows immediates to be encoded directly into instructions, rather than
    mov-ing constants to registers first.

    This patch only changes emit_{i64,i32}_add, other emit_ functions will be changed once
    this approach has been approved.

Bug: v8:9038
Change-Id: I4f35498ccf89306f12601df5ce91e1748975b11b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1568710
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#60886}
2019-04-17 00:59:09 +00:00
Ben Smith
34c8443c88 [wasm][bulk-memory] Check segment bounds lazily
The bulk memory proposal changed behavior of segment initialization
during instantiation. Previously, all segments would be bounds-checked,
after which the segments would be initialized.

The bulk memory proposal removes the up-front check, and always
initializes active segments in order, starting with element segments and
then continuing with data segments. Each active segment is initialized
as-if they were being initialized with the `memory.init` and
`table.init` instructions, so an out-of-bounds initialization may still
modify the memory or table partially.

Bug: v8:8892
Change-Id: I472fca2401e07d60b288f0cc745629a451b31088
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1565033
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60885}
2019-04-16 22:43:11 +00:00
Z Duong Nguyen-Huu
3f88ea39b2 Increase length for packed sealed object will transition to dictionary mode
Increase length of packed sealed array will create holes in packed array so transition to dictionary elements for now.
Later we can consider transitioning to holey sealed array.

Bug: chromium:952382
Change-Id: Ibe26ce56918859a114fccc1933f9c966c47c4112
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566968
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60884}
2019-04-16 20:01:51 +00:00
Johannes Henkel
5af26d8a2e [DevTools] Roll inspector_protocol for v8.
To Revision 16b370abe6f4b59efea00377473b5dddb438defb.

Also make roll.py executable (chmod u+x roll.py).

Change-Id: Ib3b3767f7fc9c3eef044779c142f62f3d6923242
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1568651
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60883}
2019-04-16 19:49:11 +00:00
Joshua Litt
96e3b97b37 Tweak how v8 preallocates instance fields
Currently v8 ignores class instance fields when determining how many
properties to preallocate for a given function. This cl changes v8's
behavior to start preallocating for instance fields in addition to
properties.

Bug: v8:8774
Change-Id: If598c2ba8a1b14bd0293f36bae7d35e2d85f7898
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1560216
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60882}
2019-04-16 18:07:00 +00:00
Z Duong Nguyen-Huu
d0f18e9af1 Reland of fix array.concat with double for sealed, frozen object
Just update merge conflict.
The reverted CL is https://chromium-review.googlesource.com/c/v8/v8/+/1565470.
Treat packed sealed, frozen element as packed element.
Also rename to IsPackedFrozenOrSealedElementsKind.

Bug: chromium:951988
Change-Id: I4e7cc0a0d43e1e1c109fa08231dd5396901f9614
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566235
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60881}
2019-04-16 17:42:30 +00:00
Sathya Gunasekaran
3a3b6b40f3 [ast] Add gsathya to ast/OWNERS
Change-Id: Ic771d1981fcf382697d15b3d8b288861b982484c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569799
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60880}
2019-04-16 17:38:14 +00:00
Clemens Hammacher
067ba2a0c6 [wasm] Add stack guard for logging code
Benchmarks or worker threads might never return to the event queue,
hence they will never execute the scheduled foreground task to log
compiled and published wasm code.
This CL adds a stack guard to log the code, to ensure that we also log
it for wasm code that never returns to the event queue.

R=mstarzinger@chromium.org

Bug: v8:9104
Change-Id: I176959cadb4ab3a60153d0717530c032272ad3e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1561073
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60879}
2019-04-16 15:59:10 +00:00
Paolo Severini
e654b5d804 [torque] Convert a few class layout definitions to torque.
Converted InterpreterData, JSDataView, StackTraceFrame, WasmDebugInfo,
WasmExportedFunctionData to torque.

Bug: v8:8952
Change-Id: I424edc04fd3f7a62d72f546dee898919d7a726df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1542504
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60878}
2019-04-16 15:47:00 +00:00
Dan Elphick
23eec7c5ad [cleanup] Remove unused function Isolate::GetMessageLocation
Bug: v8:8834
Change-Id: Ief3c02a05252d3e234e524e9fa3582280f70ae22
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569439
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60877}
2019-04-16 15:17:10 +00:00
Frederik Gossen
bd8fb77f72 [wasm-hints] Test Compilation With Hints
Extend test coverage for Wasm compilation with compilation hints. Tests
cover, in particular, error handling in streaming compilation and
asynchronous compilation.

Bug: v8:9003
Change-Id: Id46e02904a3a5df60c2617b11445bdc04c8b3b1d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566520
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60876}
2019-04-16 15:13:30 +00:00
Sergiy Belozorov
3295fb7350 [tools] Add timestamps to each log line
We've originally added them in https://crrev.com/c/1159361 and then removed
again in https://crrev.com/c/1291370 since they were implemented in LogDog
Viewer. However, looks like logs from the swarming tasks are all dumped into
step stdout at the same time and thus logdog assigns idential timestamp to all
lines making it fairly useless.

TBR=machenbach@chromium.org

No-Try: true
No-Tree-Checks: true
Bug: chromium:841700
Change-Id: I49bfb23f8007e4a0facdfea6a09cde911f8e5a51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569432
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60875}
2019-04-16 15:09:40 +00:00
Santiago Aboy Solanes
46327dda4d [turbofan][cleanup] Avoiding the GetXXXRepresentationFor chain for kCompressed
This is a cleanup CL that stemmed from the CompressedSigned one
https://chromium-review.googlesource.com/c/v8/v8/+/1547859

Bug: v8:8977, v8:7703
Change-Id: Icd217c43cc3430579dd79387d680205ef4440962
Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569428
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60874}
2019-04-16 14:44:31 +00:00
Santiago Aboy Solanes
1d567568f6 [ptr-compr][csa] Loading CompressedXXX (+ Change node) instead of TaggedXXX
We translate loads with TaggedXXX (XXX in {"", "Signed", "Pointer"})
representation in CSA into loads of CompressedXXX +
ChangeCompressedXXXToTaggedXXX in the raw-machine-assembler.

This way, CSA doesn't need to know about Compressed values since we
are introducing an explicit "decompress" node.

Also updating tests that were checking for the load nodes.

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng

Bug: v8:8977, v8:7703
Change-Id: Ie22ca8123a25ef005c1ff7383776f9355020fa42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1565897
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60873}
2019-04-16 14:28:20 +00:00
Georg Neis
e02ca14a0d [turbofan] Prepare for precomputing PropertyAccessInfo
We'll eventually map each relevant map to a PropertyAccessInfo at
serialization time.

Bug: v8:7790
Change-Id: I739075af3629359f43acfdeb609112f355f1bd38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1565899
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60872}
2019-04-16 13:12:30 +00:00
Jakob Gruber
81b6c6dfb1 [build] Add support for is_ios in BUILD.gn
Builds for an iOS target were left unhandled in the v8_libbase
component inside BUILD.gn. This adds the appropriate source files to
the build for iOS targets.

Tbr: machenbach@chromium.org
Bug: v8:9140
Change-Id: I853e9a39727d80f0f281c8ac2da4eeb465e188e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569430
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60871}
2019-04-16 13:03:00 +00:00
Jakob Gruber
9e9def0631 [arm64] Remove x18 from allocatable registers
The arm64 ABI defines x18 as a platform register, and as such
platforms may reserve it for their own purposes.

This CL unconditionally removes x18 from the allocatable register list
(previously it was only excluded from arm64 Windows). If, for some
reason, we want to keep x18 allocatable on some platforms, we can
explicitly enable it for specific platforms in the future.

Bug: v8:8940,v8:9140
Change-Id: I28c4f6aad714e21a0a54bab6041c13a1b28fd467
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564194
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60870}
2019-04-16 12:50:21 +00:00
Clemens Hammacher
1a482540c6 [wasm] Move code logging management to engine
This moves the vector of {WasmCode} to log (per isolate) from the
{LogCodesTask} to the {WasmEngine}, where lifetime is more clear.
This makes it harder to mess up the ref count of the stored {WasmCode}
objects.

R=mstarzinger@chromium.org

Bug: v8:8217
Change-Id: I07131f95391bfabee3c376378179d8bcdc1555b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566518
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60869}
2019-04-16 12:27:50 +00:00
Sergiy Belozorov
9e9fb65ef2 Increase timeout for JSTests/Array test and fix Michael's username
The test is currently passing at over 90% of its timeout both on desktop and
Android devices and already occasionally failing due to timeouts on Android.

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

No-Try: true
No-Tree-Checks: true
Bug: chromium:841700
Change-Id: Id1ba078d6a730d304935407426bdbfd0588a138b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569429
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60868}
2019-04-16 12:24:10 +00:00
Simon Zünd
724d6586f9 [torque] Refactor compiler interface to not 'leak' contextuals
The Torque compiler makes heavy use of scoped globals (contextuals).
This created a problem for the design of the compiler interface:

    - Either the compiler provides all the necessary scopes itself,
      disallowing callers any access to the contextuals, which might
      contain data the caller is interested in (such as the
      compilation result).
    - Or the caller provides all the necessary scopes.

This design was fine when the compiler executable was the only user.
With the recent addition of unit tests and the language server, this
interface became brittle, as missing scopes are only detected at
runtime.

This CL refactors the compiler interface to not leak contextual
scopes past the interface boundary. Content of contextuals is
collected and returned, providing access for the caller and freedom
to either use the data directly or move it into the callers own scopes.

R=sigurds@chromium.org

Bug: v8:7793
Change-Id: Ieb988522d08fc6026b3fb74d976008e566146770
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529000
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60867}
2019-04-16 12:19:30 +00:00
Andrew Comminos
8b3cd48db8 [cpu-profiler] Add method for controlling sampler busy-waiting
Adds CpuProfiler::SetUsePreciseSampling, which provides a hint whether
to sacrifice CPU cycles to reduce the level of sampling interval
variance. On Windows, this controls whether or not busy waiting is
performed for sample rates < 100ms. Defaults to enabled (old behaviour).

Bug: v8:3967
Change-Id: Iee84c3ae8132541c78b1f78bf294ec7c718bb19b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1510577
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60866}
2019-04-16 12:16:30 +00:00
Simon Zünd
c8206043e1 [stack-trace] Use ErrorStack accessor for formatted stack traces
When a stack trace is captured, it is stored in a private symbol on
the respective Error object. The first access to "Error.stack"  will
then format the stack trace, with a possible call into user JS via
the Error.prepareStackTrace callback.

Until now, the accessor converted ".stack" to a normal data
property containing the formatted stack trace. This causes a new Map
with a new DescriptorArray to be created, which will not be shared
with anything else (also not other error objects with formated
stack traces).

This CL changes the accessor to store the formatted stack trace in
the same symbol (stack_trace_symbol) as the structured data. The
result is that an error object will have the same Map before and
after "Error.stack" is accessed.

Bug: v8:9115
Change-Id: I7d6bf49be76d63b57fbbaf904cc6ed7dbdbfb96b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564061
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60865}
2019-04-16 12:02:40 +00:00
tzik
9fc0fbf1ab Use default MicrotaskQueue for MicrotasksScope when nullptr is given
After this CL, MicrotasksScope allows null MicrotaskQueue parameter,
so that the user can migrate one-by-one from the default microtask
queue to the finer grained one.

Change-Id: Id519920a9d57e80e279026ad05a14422fb72b050
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559678
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60864}
2019-04-16 11:42:40 +00:00
Joyee Cheung
9ace845f6c [ast] simplify ClassScope::ResolvePrivateNamesPartially
Previously when an unresolved private name is not found
in the current scope but found in an outer class scope,
we forget to push it to the outer class scope so the
name would never get bound.

This patch simplifies ClassScope::ResolvePrivateNamesPartially()
and removes the search in outer class scopes since they are incomplete
at this point. Instead just push any private name that can't be
resolved in the current scope to the outer class scope so that it
gets handled later when the outer class scope is complete.

Bug: chromium:952722
Change-Id: Ia0dda74cac57a0a1e25a9a09575f55633c6093b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1567709
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#60863}
2019-04-16 11:08:40 +00:00
tzik
1ab717db84 Expose the depth of MicrotasksScope per MicrotaskQueue
Blink used to use v8::MicrotasksScope::GetCurrentDepth() to get the
number of nested MicrotasksScope for the default microtask queue.
However, there was no corresponding one for non-default queues.

Change-Id: I1c2472ba19b1a11cb968f02119d91d92867c6e02
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1567705
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60862}
2019-04-16 10:53:20 +00:00
peterwmwong
886c6583b9 [builtins] Port ReplaceSimpleStringFastPath and RegExpMatchInfo to Torque.
Bug: v8:8976
Change-Id: I2d5131c2a1d96e5d5e0114efac3b1b2c3497351d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566249
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#60861}
2019-04-16 10:47:40 +00:00
Simon Zünd
2d8f2e86ee Reland^3 "[torque] Throw exception instead of aborting if something goes wrong"
This is a reland of ffe6940fbc

The UBSan issue is fixed with https://crrev.com/c/1566511

TBR=tebbi@chromium.org

Original change's description:
> Reland^2 "[torque] Throw exception instead of aborting if something goes wrong"
>
> This is a reland of 251d1623f3
>
> The reland fixes ASAN component builds by adding RTTI build config to both
> torque executables. Big thanks to sigurds for finding the fix.
>
> Original change's description:
> > Reland "[torque] Throw exception instead of aborting if something goes wrong"
> >
> > This is a reland of 3bd49f9b90
> >
> > The issue on the windows bot is apparently a compiler bug in MSVC related to
> > move construction. The fix seems to be to change the order of the fields in
> > "JsonParseResult" (go figure).
> >
> > Drive-by-change: Fix LS on windows by emitting correct line endings and
> > enabling exceptions for the LS executable as well.
> >
> > Original change's description:
> > > [torque] Throw exception instead of aborting if something goes wrong
> > >
> > > This CL enables exceptions for the Torque compiler and Torque language
> > > server. Instead of aborting when something goes wrong during
> > > compilation, a TorqueError is thrown, containing the error message
> > > and a source position. The compiler executable still prints the error
> > > and aborts, while the language server will pass this information
> > > along to the client (not included in this CL).
> > >
> > > R=danno@chromium.org
> > >
> > > Bug: v8:8880
> > > Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> > > Reviewed-by: Daniel Clifford <danno@chromium.org>
> > > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#60512}
> >
> > Bug: v8:8880
> > Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
> > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60736}
>
> Bug: v8:8880
> Change-Id: Iba198d771169283e83e74324f27aa9e90b8d8975
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1563770
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60804}

Bug: v8:8880
Change-Id: I5b7e40ad27bff8f7bfa22240954c2cb75083ad82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564065
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60860}
2019-04-16 10:41:20 +00:00