Commit Graph

54123 Commits

Author SHA1 Message Date
Tobias Tebbi
722f7139e1 [csa] re-enable release build FixedArray bounds checks
To address previously observed regressions, this CL also introduces
unchecked FixedArray accessors and uses them to access collections.

Bug: v8:8029
Change-Id: I6bcd8db2b89b29b7acb3b8431ec5405b737bcef2
Reviewed-on: https://chromium-review.googlesource.com/c/1473033
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59631}
2019-02-15 13:54:46 +00:00
Sigurd Schneider
2f8a5f595f [api] Add enum type to RAILMode to allow forward-declaration of enum
This allows removing some v8.h includes in blink, and replacing them by
forward declarations.

Change-Id: I3f55669f551e29038918f54a26a0ab032ffb252a
Bug: v8:8788
Reviewed-on: https://chromium-review.googlesource.com/c/1475394
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59630}
2019-02-15 13:08:56 +00:00
Farazmand
305b2e0d29 PPC/s390: [wasm] No longer copy runtime stubs into each module.
Port a4b19dcc91

Original Commit Message:

    This switches from copying entire runtime stubs into each module to only
    having small jump table slots in each module that act as a trampoline to
    the actual embedded builtin representing the runtime stub. This reduces
    the memory footprint of modules.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com, miladfar@ca.ibm.com
BUG=
LOG=N

Change-Id: Ibbe5fdf4d926b45582748ae8b15eb316107409dc
Reviewed-on: https://chromium-review.googlesource.com/c/1470455
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#59629}
2019-02-15 12:54:36 +00:00
Toon Verwaest
a94c91ca48 [parser] Fix escaped contextual keyword handling
Escaped contextual keywords are simply valid identifiers if they do not occur
in the context where they are a keyword. Escape sequences of the form \uNNNN
or \u{NNNNNN} must be consumed as part of the identifier.

If such escaped contextual keywords do occur in a context where they are a
keyword, they are a syntax error. In that case we manually check locally
whether they are escaped.

Bug: v8:6543, v8:6541

Change-Id: I7e1557963883e722310b9078d7d7636ec94aa603
Reviewed-on: https://chromium-review.googlesource.com/c/1473293
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59628}
2019-02-15 12:28:26 +00:00
Peter Marshall
5d1d079538 [cleanup] Use unique_ptr for MemoryAllocator in Heap
Also drive-by cleanup the TestMemoryAllocatorScope class so that it
takes ownership of the old allocator while it holds onto it, and so
that the MemoryAllocator for testing is constructed inside the scope
rather than passed into it. This means users don't need to explicitly
call TearDown() and delete the allocator as the scope does it for them.

Change-Id: Id7da3c074618a376d2edfe3385bb185ba8287cea
Reviewed-on: https://chromium-review.googlesource.com/c/1392194
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59627}
2019-02-15 11:53:46 +00:00
Leszek Swirski
54e515220d [parser] Force func decl allocation for non-block code coverage
In addition to the previous change enabling forced FunctionDeclaration
allocation when block code coverage is enabled, enable it now for all
(non-best-effort) code coverage by reading off the coverage mode from
the isolate (rather than relying on the presence of a source range map).

Bug: chromium:927464
Change-Id: I26f86c9fbebc0df52d5cdeff3ca1095215a6d912
Reviewed-on: https://chromium-review.googlesource.com/c/1456041
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59626}
2019-02-15 11:49:26 +00:00
Tobias Tebbi
93c1371425 [torque] make overload resolution robust concerning branching contexts
This changes the behavior of overload resolution to not consider if the
call happens in a branching context (i.e., with implicit True and False
labels from a conditional operator or statement).
That way, it is not possible to get different behavior accidentially
by using an operator in the wrong context. Instead, there will be a
compile error because the call happened in a non-branching context, or
because it is ambiguous without this information.

The test doesn't perfectly fit the issue (impossible until we have
negative tests), but instead tests that equality on HeapNumber's works
in boolean contexts, which is something Peter fixed already in
https://crrev.com/c/1432596.


Bug: v8:8737 v8:7793
Change-Id: I08a3801891587aac705dc93b1c65b0c6cf164107
Reviewed-on: https://chromium-review.googlesource.com/c/1456093
Reviewed-by: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59625}
2019-02-15 10:04:36 +00:00
Benedikt Meurer
e17e46fde6 [isolate] Move ThreadLocalTop into IsolateData.
This refactors the ThreadLocalTop into separate header and
implementation files, and moves it from the Isolate to the
IsolateData (with some tweaks to make the layout of the class
predictable). This has the advantage that all external references
referring to addresses in the ThreadLocalTop (like js_entry_sp,
c_function, c_entry_fp, etc.) need only a single memory access
to reach them. For example the CallApiCallback can now use

```
mov %rbp,0x8e40(%r13)
mov %rsi,0x8de0(%r13)
mov %rbx,0x8e50(%r13)
```

to setup the information about context, frame pointer, and C++
function pointer in the ThreadLocalTop instead of the previously
generated code

```
mov 0x2e28(%r13),%r10
mov %rbp,(%r10)
mov 0x2e38(%r13),%r10
mov %rsi,(%r10)
mov 0x2e30(%r13),%r10
mov %rbx,(%r10)
```

which always had to load the scratch register %r10 with the actual
address first. This has interesting performance impact. On the
test case mentioned in v8:8820 (with the `d8` patch applied), the
performance goes from

```
console.timeEnd: fnMono, 2290.012000
console.timeEnd: fnCall, 2604.954000
```

to

```
console.timeEnd: fnMono, 2062.743000
console.timeEnd: fnCall, 2477.556000
```

which is a pretty solid **10%** improvement for the monomorphic API
accessor case, and a **5%** improvement for calling into the API
accessor instead.

But there might as well be other places besides API callback calls
that will benefit from this change, which I haven't tested explicitly.

Although this change is supposed to be as minimal as possible without
any functional effects, some changes were necessary/logical. Eventually
we should reconsider changing the layout and the types for the fields
in the ThreadLocalTop to be more consistent with the other IsolateData
entities. But this can be done in separate follow-up CLs, as this will
be quite a bit of churn on the code base, depending on how we do that
exactly, and is orthogonal to this optimization.

Bug: v8:8820, v8:8848, chromium:913553
Change-Id: I4732c8e60231f0312eb7767358c48bae0338220d
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1474230
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59624}
2019-02-15 09:55:56 +00:00
Michael Achenbach
08fa19f3dd Fix typo in OWNERS file
TBR=sergiyb@chromium.org
NOTRY=true

Change-Id: I95b677f5f1d0d3de815ad8d1d56301b1dcbbcd52
Reviewed-on: https://chromium-review.googlesource.com/c/1475391
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59623}
2019-02-15 09:29:26 +00:00
Michael Achenbach
2324bbbd73 Make tmrts an infra OWNER
This also cleans up some OWNERS files.

NOTRY=true

Change-Id: Ic49ecee02bb3e339dc4c0de4ba69f00c36c076aa
Reviewed-on: https://chromium-review.googlesource.com/c/1475470
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59622}
2019-02-15 09:02:24 +00:00
Jaroslav Sevcik
0f6f064c9e Relax a too-strict DCHECKs.
This allows updates to SLOW_STRING_WRAPPER_ELEMENTS elements kind
for non-extensible map (so far only dictionary elements and typed-array
elements were allowed).

Bug: chromium:932101
Change-Id: Id532684aa94f908eb14f3451aa823f282342668b
Reviewed-on: https://chromium-review.googlesource.com/c/1475390
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59621}
2019-02-15 07:44:11 +00:00
Igor Sheludko
634a29a0ff [cleanup][ia32] Fix kPointerSize in ia32 builtins
Bug: v8:8477, v8:8834
Change-Id: If613bc4a32cdce68d9bcf747bf0bf528e3c2a90c
Reviewed-on: https://chromium-review.googlesource.com/c/1473290
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59620}
2019-02-15 07:43:09 +00:00
Igor Sheludko
b3e0efc7a1 [cleanup][x64] Fix times_pointer_size in x64 builtins
Bug: v8:8477, v8:8834
Change-Id: I5ff2df3988cde5f806cecc9e40259ba02f6265d2
Reviewed-on: https://chromium-review.googlesource.com/c/1473291
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59619}
2019-02-15 07:42:04 +00:00
Jaroslav Sevcik
c4366c8ced Check value equality on store to const field.
If StoreIC stores into a kConst field, only take the slow path
if the value is different from the current value.

This recovers the ObjectAssign regression in crbug.com/930680.

Bug: v8:8361, chromium:930680
Change-Id: Ie27d15d624b07ab1dcb58b244a46b87eec34bd0f
Reviewed-on: https://chromium-review.googlesource.com/c/1470134
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59618}
2019-02-15 06:28:33 +00:00
Jakob Kummerow
6cac1382f4 [cleanup] #include heap-inl.h less often
This takes heap-inl.h out of the "Giant Include Cluster".
Naturally, that means adding a bunch of explicit includes
in a bunch of places that relied on transitively including
them before.
As of this patch, no header file outside src/heap/ includes
heap-inl.h.

Bug: v8:8562,v8:8499
Change-Id: I65fa763f90e66afc30d105b9277792721f05a6d4
Reviewed-on: https://chromium-review.googlesource.com/c/1459659
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59617}
2019-02-15 06:22:53 +00:00
Jaroslav Sevcik
4c2a3c027d Enable in-place update of constness for all root maps
... as opposed to prototype maps only.

This recovers the
JSTests/ObjectLiteralSpread/ObjectSpreadAndOverwrite regression.

Bug: chromium:930680, v8:8361
Change-Id: I71510f0ac76b19d16aaf3249a5cf533adf425a20
Reviewed-on: https://chromium-review.googlesource.com/c/1472632
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59616}
2019-02-15 06:00:53 +00:00
Frank Tang
889769b4df [Intl] Add String toLocale(Lower|Upper)Case perf benchmark
$ python -u tools/run_perf.py --binary-override-path   out/x64.release/d8 --filter "JSTests/Strings/StringToLocaleCase"  test/js-perf-test/JSTests.json
INFO      >>> Running suite: JSTests/Strings/StringToLocaleCase
INFO      >>> Stdout (#1):
StringToLocaleUpperCaseTR-Strings(Score): 622
StringToLocaleLowerCaseTR-Strings(Score): 728
StringToLocaleUpperCase-Strings(Score): 1129
StringToLocaleLowerCase-Strings(Score): 1548

Bug: v8:8839
Change-Id: I35e20c84614e99cb84ae51c175ac6b1cd53ad3a6
Reviewed-on: https://chromium-review.googlesource.com/c/1469327
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59615}
2019-02-15 05:53:04 +00:00
Andrey Kosyakov
6703647b93 DevTools protocol roll
... to revision c40253f87c475880d1bdad4a90cf21c38dadf4ac

Also, preseve binary protocol when restoring session.

Bug: chromium:929862
Change-Id: Icb1cb04b42ca7238b46e2978337b36e32398665f
Reviewed-on: https://chromium-review.googlesource.com/c/1474556
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59614}
2019-02-14 23:41:43 +00:00
Hannu Trey
f781f522af Re-detect the host time zone if requested by an embedder
Add an enum argument to DateTimeConfigurationChangeNotification to
control whether or not to redetect the host time zone. The default value
kSkip doesn't cause redetecting so that callers do not need to change if
they want the current behavior (e.g. Chromium).

Note that the host time zone detection does not work when v8 is run
inside a sandbox as in Chromium so that Chromium detects the host time
zone outside the sandbox before calling
DateTimeConfigurationChangeNotification. OTOH, other v8 embedders may
find it more convenient for v8 to do the host time zone detection on
their behalf. In that case, they can call the function with the new
argument set to value kRedetect.

Test:
With PHP+V8Js on linux, execute:
php -r '
  putenv("TZ=Europe/Helsinki");
  $v8 = new V8Js();
  $v8->executeString("print((new Date(0)).toString()+\"\\n\");");
  putenv("TZ=America/New_York");
  $v8->executeString("print((new Date(0)).toString()+\"\\n\");");'

Result before modification:
Thu Jan 01 1970 02:00:00 GMT+0200 (Eastern European Standard Time)
Thu Jan 01 1970 02:00:00 GMT+0200 (Eastern European Standard Time)

Result after modification:
Thu Jan 01 1970 02:00:00 GMT+0200 (Eastern European Standard Time)
Thu Jan 01 1970 02:00:00 GMT+0200 (Eastern European Standard Time)

Result after V8JS is modified to use value kRedetect when calling

Thu Jan 01 1970 02:00:00 GMT+0200 (Eastern European Standard Time)
Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Standard Time)

DateTimeConfigurationChangeNotification: 
Change-Id: I005192dd42669a94f606a49baa9eafad3475b9fd
Reviewed-on: https://chromium-review.googlesource.com/c/1449637
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59613}
2019-02-14 23:40:23 +00:00
Frank Tang
e15586e779 [Intl] Performance benchmark for String.normalize
$ python -u tools/run_perf.py --binary-override-path   out/x64.release/d8 --filter "JSTests/Strings/StringNormalize"  test/js-perf-test/JSTests.json
INFO      >>> Running suite: JSTests/Strings/StringNormalize
INFO      >>> Stdout (#1):
StringNormalize-Strings(Score): 4014
StringNormalizeNFD-Strings(Score): 742
StringNormalizeNFKC-Strings(Score): 3066
StringNormalizeNFKD-Strings(Score): 739

Bug: v8:8844
Change-Id: Ic941bafa82cead9cd0110ad7ac46e528d481189b
Reviewed-on: https://chromium-review.googlesource.com/c/1470964
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59612}
2019-02-14 22:31:23 +00:00
Frank Tang
d595e22558 [Intl] Cleans up intl-list-format flag
Part 2 after part 1 removed flags from all tests.

Bug: v8:8705
Change-Id: Id2e299cc574228548460a562496d7905b834dc6b
Reviewed-on: https://chromium-review.googlesource.com/c/1461800
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59611}
2019-02-14 22:17:13 +00:00
Benedikt Meurer
aa00ee22f8 [v8-extras] Harden resolvePromise() and rejectPromise().
The V8 Extras API provides `resolvePromise()` and `rejectPromise()`
functions that bypass the safety net of the resolve/reject closures
that you get from using the Promise constructor. So it's the
responsibility of the user to make sure that the promises are still
pending. This adds release mode checking and hard aborts to make
sure we catch misuse of these APIs early.

This also turns the DCHECK's in the C++ implementation into actual
CHECK's to make sure we crash hard if the invariants are violated.

Bug: chromium:931949, chromium:931640
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I98a6f424d2a3cfbb608fed21036caff6e2510ec3
Reviewed-on: https://chromium-review.googlesource.com/c/1472291
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59610}
2019-02-14 20:40:50 +00:00
Johannes Henkel
ee0e4c33bb Add script for rolling the inspector protocol to V8.
This is a tweaked version of the script that I just added to Chromium:

https://cs.chromium.org/chromium/src/third_party/inspector_protocol/roll.py

Change-Id: I21566f2472c20ecfd713996974c0833b7988a122
Reviewed-on: https://chromium-review.googlesource.com/c/1469376
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59609}
2019-02-14 18:44:08 +00:00
Michael Achenbach
0e229b9dbe Revert "Reland "[build] disable C++ optimization for mksnapshot code.""
This reverts commit a6b95a6acf.

Reason for revert:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Clusterfuzz%20Win64%20ASAN%20-%20release%20builder/6984

Original change's description:
> Reland "[build] disable C++ optimization for mksnapshot code."
> 
> This is a reland of cee2f772c7
> 
> Original change's description:
> > [build] disable C++ optimization for mksnapshot code.
> > 
> > By disabling C++ optimizations for code that's only run in mksnapshot,
> > that is, CSA and Torque-generated code, we can save compile time.
> > I observed up to 2x improvements of compile time for some files,
> > while the mksnapshot time did not increase significantly.
> > 
> > Bug: v8:7629
> > Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
> > Reviewed-on: https://chromium-review.googlesource.com/c/1460941
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#59585}
> 
> Bug: v8:7629
> Change-Id: I8330f93173ab3d7b400e15ea4935bbe8256b250f
> Reviewed-on: https://chromium-review.googlesource.com/c/1473292
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59606}

TBR=yangguo@chromium.org,sigurds@chromium.org,tebbi@chromium.org

Change-Id: Ifdad207913a1814580c3055e57c6bfc2c6a53ae6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7629
Reviewed-on: https://chromium-review.googlesource.com/c/1473294
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59608}
2019-02-14 17:18:19 +00:00
Alexei Filippov
4cc4c2bc7a Add myself to src/libsampler/OWNERS test/cctest/OWNERS
Change-Id: I4f7c80f89ad4d023f96a9113ebb6628df44fb61c
Reviewed-on: https://chromium-review.googlesource.com/c/1469325
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59607}
2019-02-14 17:14:27 +00:00
Tobias Tebbi
a6b95a6acf Reland "[build] disable C++ optimization for mksnapshot code."
This is a reland of cee2f772c7

Original change's description:
> [build] disable C++ optimization for mksnapshot code.
> 
> By disabling C++ optimizations for code that's only run in mksnapshot,
> that is, CSA and Torque-generated code, we can save compile time.
> I observed up to 2x improvements of compile time for some files,
> while the mksnapshot time did not increase significantly.
> 
> Bug: v8:7629
> Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
> Reviewed-on: https://chromium-review.googlesource.com/c/1460941
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59585}

Bug: v8:7629
Change-Id: I8330f93173ab3d7b400e15ea4935bbe8256b250f
Reviewed-on: https://chromium-review.googlesource.com/c/1473292
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59606}
2019-02-14 16:59:58 +00:00
Clemens Hammacher
4f69c46aa8 [wasm][test] Turn EXPECT_LENGTH macros into method
This removes another two macros and introduces a templatized function
instead.
Note that there is only one instantiation per input length, not per
input.

R=titzer@chromium.org

Bug: v8:8562
Change-Id: I47ad274e68d26b962cbd582e90995d30b1d09d39
Reviewed-on: https://chromium-review.googlesource.com/c/1460938
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59605}
2019-02-14 16:52:03 +00:00
Clemens Hammacher
15a621a2f9 [wasm][test] Check streaming decoder error messages
In the wasm streaming decoder error position test, do also check the
error messages generated. This revealed messages that were not quite
fitting and some that were formatted differently than the majority.

R=ahaas@chromium.org

Bug: v8:8814
Change-Id: If157f1083a104413bf14797ac56e756baac98c17
Reviewed-on: https://chromium-review.googlesource.com/c/1463780
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59604}
2019-02-14 16:06:43 +00:00
Sigurd Schneider
2fa546d6bd [cleanup] Remove unnecessary includes
Change-Id: Ic60f74a60480ea4a74e039c5c87e8c1995e60453
Bug: v8:8834
Reviewed-on: https://chromium-review.googlesource.com/c/1473032
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59603}
2019-02-14 15:54:23 +00:00
Igor Sheludko
46d1986812 [cleanup] Fix kPointerSize in tests
Bug: v8:8477, v8:8834
Change-Id: I9213cca077a2758b87a6cb95bcb01d0186c32098
Reviewed-on: https://chromium-review.googlesource.com/c/1472633
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59602}
2019-02-14 15:29:52 +00:00
Michael Starzinger
1354ff9329 [turbofan] Disallow copying of {CodeAssemblerLabel}.
R=tebbi@chromium.org
BUG=chromium:931536

Change-Id: I3a6dbabec7a84f55d6aa85934dca37af55390552
Reviewed-on: https://chromium-review.googlesource.com/c/1473034
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59601}
2019-02-14 15:08:12 +00:00
Toon Verwaest
e4fbac9813 [parser] Don't block PRIVATE_NAME in ParseObjectPropertyDefinition
This is already blocked when PRIVATE_NAME is parsed anyway, and we simply need
to make sure that we don't continue. So marking the prop_info->kind as kNotSet
will do what you want via the unexpected path rather than through the main hot
path.

Bug: v8:8808
Change-Id: I93beb80a89cf764cd79d6c3ec3a5fc763a98c4d6
Reviewed-on: https://chromium-review.googlesource.com/c/1472635
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59600}
2019-02-14 14:51:22 +00:00
Alexander Timokhin
2da19bd4cb Fix HeapNumber/MutableHeapNumber value alignment
HeapNumbers and MutableHeapNumber requires alignment for their double
value field but for now this field can be misaligned on 32-bit platforms.

According to code in Heap::GetFillToAlign() function, kDoubleUnaligned
doesn't actually mean "unaligned" but "aligned to half of double".

This CL fixes this misalignment.

Change-Id: I9b9c58d580bb287e7dad44bc96cd6b4593707b5e
Reviewed-on: https://chromium-review.googlesource.com/c/1470113
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59599}
2019-02-14 13:51:47 +00:00
Benedikt Meurer
a2d9924c42 [turbofan] Introduce a CallFunctionTemplate builtin.
When calling into API callbacks from TurboFan optimized, we can
currently only take a fast-path when TurboFan is able to find some
information about the receiver in the graph, or when the API callback
specifies that it neither requires an access check (aka "accepts any
receiver") nor an interface check (aka "compatible receiver check").

This change introduces a new CallFunctionTemplate builtin that sits
in front of the CallApiCallback builtin and does both the access as well
as the interface check as necessary (and raises appropriate exceptions).
This way TurboFan can still call into the API callback via the fast-path
even without ahead knowledge about the receiver, which is significantly
faster than the generic call machinery for API callbacks.

On the test case from the Angular team[1], the interesting metrics
improve from

  DOM_mono: 0.273 ms
  DOM_mega: 0.571 ms
  DOM_call: 0.649 ms

to

  DOM_mono: 0.264 ms
  DOM_mega: 0.572 ms
  DOM_call: 0.368 ms

so the DOM_call is only about **1.4 times slower** than the DOM_mono and
about **1.5 times faster** than the DOM_mega case (compared to **2.4
times slower**). Execution time in the DOM_call was reduced by around
**~45%**.

Currently this new code path is limited to TurboFan optimized code, but
the idea is to eventually migrate the API calls from baseline to also
use the new CSA functionality, but there are lot's of subleties to take
into account, so starting with small changes to get coverage for the
basic building blocks.

[1]: https://mhevery.github.io/perf-tests/DOM-megamorphic.html

Bug: v8:8820
Change-Id: Ie1029cf182ce05a6e519fd9a9d4fa825db8adb4c
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1470129
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59598}
2019-02-14 12:42:57 +00:00
Michael Starzinger
a08a150cc8 Reland "[wasm] Fix two jump table offset parameters."
This is a reland of 74951850a0

Original change's description:
> [wasm] Fix two jump table offset parameters.
> 
> R=jgruber@chromium.org
> 
> Change-Id: I5b40819b1a746f16b7b18aac1bba65d83a7e3483
> Reviewed-on: https://chromium-review.googlesource.com/c/1470127
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59560}

Change-Id: I70b814f81bfd0c13e09a2641871da2d4ec5a308d
Reviewed-on: https://chromium-review.googlesource.com/c/1470111
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59597}
2019-02-14 12:29:55 +00:00
Michael Achenbach
d874e78ebe [test] Raise swarming priority on release branche builders
The builders were originally allowed higher cycle time, as fast responses
weren't necessary. They should, however, never fail due to expiring tasks.

This has happened more often lately, hence they should run with normal
CI priority. The impact is very small as they run very infrequently.

NOTRY=true

Bug: chromium:930255
Change-Id: Id9d4eb70322862cf98b9ae4e313e5c0b002b5bd1
Reviewed-on: https://chromium-review.googlesource.com/c/1466303
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59596}
2019-02-14 12:23:55 +00:00
Dan Elphick
5cc245ae75 [compile] Add support for lazy generation of source position tables
If enable_omit_source_positions is true (defaults to false), source
position tables are not generated when compiling bytecode. They will
then be regenerated when exceptions are thrown.

This adds a new function Compiler::CollectSourcePositions which given a
SharedFunctionInfo with bytecode but no source position table re-parses
and regenerates the bytecode but this time with source positions
collection enabled. Note this will reparse all inner functions that
have previously been compiled since the preparse data is no longer
available.

With the flag enabled there still 18 test failures mostly related to
debugging.

v8: 8510
Change-Id: I46dff9818d8a89c901ba8ae8df94dcaca83aa658
Reviewed-on: https://chromium-review.googlesource.com/c/1385165
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59595}
2019-02-14 11:26:35 +00:00
Yang Guo
6cb174b4b3 [serializer] Remove code object handling from code serializer
R=leszeks@chromium.org

Change-Id: Ib66b36884be7dd1283eb0375cfaf94a5b503f162
Reviewed-on: https://chromium-review.googlesource.com/c/1470110
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59594}
2019-02-14 11:17:14 +00:00
Georg Neis
6ed3f799ce [turbofan] Use GetSlotOperand instead of converting GetIndexOperand
Change-Id: I616841c626fc95a6015014e308cbd653e95ede19
Reviewed-on: https://chromium-review.googlesource.com/c/1472671
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59593}
2019-02-14 11:04:04 +00:00
Georg Neis
5cc1ddafbe [turbofan] Refactor ComputeElementAccessInfos
... such that the feedback maps can evenentually be processed in the
serialization phase.

Bug: v8:7790
Change-Id: Ic033e88646a1b161710b1ca2028ef10f49d23cfd
Reviewed-on: https://chromium-review.googlesource.com/c/1472293
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59592}
2019-02-14 11:01:44 +00:00
Santiago Aboy Solanes
dae0f73f29 [ptr-compr][arm64] TurboFan support for compressing stores
Similar to x64's CL (https://chromium-review.googlesource.com/c/v8/v8/+/1459638)

Bug: v8:7703
Change-Id: I4b4e06ccdb9f428559dfb6b74e8ac149f955745c
Reviewed-on: https://chromium-review.googlesource.com/c/1467181
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59591}
2019-02-14 10:42:44 +00:00
Mythri
596c292af6 [ic] Update KeyedStoreIC to handle no feedback vector case
The megamorphic case in the KeyedStoreIC doesn't use/update any feedback.
We could use this path to fast path some of the keyed stores instead of
misssing to the runtime when the feedback vector is not available. This
cl, moves the check for feedback vector from the bytecode handler to the
KeyedStoreIC and calls the KeyedStoreIC_Megamorphic builtin when there is
no valid feedback vector. This will help improve the performance of no
feedback/jitless case.

Bug: v8:8293
Change-Id: I71c128b355d47ac20e50fc836f4bc2cf0aab1154
Reviewed-on: https://chromium-review.googlesource.com/c/1460946
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59590}
2019-02-14 10:38:24 +00:00
Mathias Bynens
3b4cadedee Remove always-true --harmony-symbol-description runtime flag
It shipped in Chrome 70.

Bug: v8:7807, v8:8562
Change-Id: I5c5a9fc23656018ee6e9115af7a0c779230e681b
Reviewed-on: https://chromium-review.googlesource.com/c/1450787
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59589}
2019-02-14 10:36:05 +00:00
Dan Elphick
828b518a88 [parsing] Fix AllowsLazyCompilation
Class member initializer functions do not support lazy compilation, so
change FunctionLiteral::AllowsLazyCompilation to return false for them.

Change-Id: I38434f3a7e8c88af3f407cf19308fc3862ec4403
Reviewed-on: https://chromium-review.googlesource.com/c/1470103
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59588}
2019-02-14 09:59:27 +00:00
Frank Tang
7ffdf82173 [Intl] Fix Null-dereference in CreateICUDateFormatFromCache
Bug: chromium:930304
Change-Id: I7793f83b3f3e9aeaa3ecf114c6064773257e90e8
Reviewed-on: https://chromium-review.googlesource.com/c/1461167
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59587}
2019-02-14 09:53:56 +00:00
Tobias Tebbi
754987938b Revert "[build] disable C++ optimization for mksnapshot code."
This reverts commit cee2f772c7.

Reason for revert: Breaks sanitizer builds: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20UBSan/4682

Original change's description:
> [build] disable C++ optimization for mksnapshot code.
> 
> By disabling C++ optimizations for code that's only run in mksnapshot,
> that is, CSA and Torque-generated code, we can save compile time.
> I observed up to 2x improvements of compile time for some files,
> while the mksnapshot time did not increase significantly.
> 
> Bug: v8:7629
> Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
> Reviewed-on: https://chromium-review.googlesource.com/c/1460941
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59585}

TBR=yangguo@chromium.org,sigurds@chromium.org,tebbi@chromium.org

Change-Id: I50da40da167f49a14e3a8994377c4f9dafdfe2ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7629
Reviewed-on: https://chromium-review.googlesource.com/c/1472630
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59586}
2019-02-14 09:50:48 +00:00
Tobias Tebbi
cee2f772c7 [build] disable C++ optimization for mksnapshot code.
By disabling C++ optimizations for code that's only run in mksnapshot,
that is, CSA and Torque-generated code, we can save compile time.
I observed up to 2x improvements of compile time for some files,
while the mksnapshot time did not increase significantly.

Bug: v8:7629
Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
Reviewed-on: https://chromium-review.googlesource.com/c/1460941
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59585}
2019-02-14 09:29:56 +00:00
tzik
ed9b10c30e Remove unused has_prototype_slot parameter on FunctionMapIndex
has_prototype_slot on Context::FunctionMapIndex() is unused in its
implementation, and all callers passes just true.
Whether the function has prototype or not is determined by FunctionKind
instead.

Change-Id: I598515b25267dd3470cccbf3236b5e64c6959d00
Reviewed-on: https://chromium-review.googlesource.com/c/1469542
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59584}
2019-02-14 07:01:26 +00:00
Johannes Henkel
d3cf03c6e9 [DevTools] Roll inspector_protocol (v8) ...
... to ec358ccfd63a2a657c147329c7793d217e278a58.

This adds support for CBOR <-> Value.

v8 changes:
- Add StringUTF8Adapter (from Pavel's change)
- Add Binary::fromSpan (needed for the cbor->BinaryValue conversion).

Change-Id: I09746dc361df0b150b23697a20b287613558c003
Reviewed-on: https://chromium-review.googlesource.com/c/1470955
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59583}
2019-02-14 04:42:24 +00:00
Francis McCabe
0988e0d647 [wasm] ReturnCall Implementation (decoder).
Focuses on decoder implementation and unittests of decoding return call instructions

Bug: v8:7431
Change-Id: Ib1351bb26f8bac0a766d633486492fcd8ead627b
Reviewed-on: https://chromium-review.googlesource.com/c/1455476
Commit-Queue: Francis McCabe <fgm@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59582}
2019-02-14 00:02:03 +00:00