Commit Graph

9087 Commits

Author SHA1 Message Date
Caitlin Potter
93fc3841c3 [parsing] inline ArrayLiteral creation for spread calls
Instead of using runtime calls to generate the Array Literal passed to
%reflect_call / %reflect_construct, we create an ArrayLiteral from the
list of arguments, and perform spreads using the interpreter mechanism for
spreading in ArrayLiterals (thus, the spreading becomes inline). This
array literal is still passed to %reflect_call / %reflect_construct as
before.

This cuts the runtime for bench-spread-call.js -> testSpread roughly in
half, and will likely improve further once
https://chromium-review.googlesource.com/c/v8/v8/+/915364 has landed.

BUG=v8:7446
R=neis@chromium.org, adamk@chromium.org

Change-Id: I74a6acd3a60aad422e4ac575275c7b567659d8ad
Reviewed-on: https://chromium-review.googlesource.com/939587
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51678}
2018-03-02 08:44:26 +00:00
Deepti Gandluri
ad3d0ba83c [wasm] Add I64 Atomic binary operations for x64
Bug: v8:6532
Change-Id: I6fde1fd2cc5776628af4e8a92e9b9ec030b398f7
Reviewed-on: https://chromium-review.googlesource.com/923718
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51675}
2018-03-02 00:30:54 +00:00
Deepti Gandluri
782f6401ee Revert "[parser] Implements proposal-numeric-separator."
This reverts commit 517df52488.

Reason for revert: Fails MSAN tests - https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/20030

Original change's description:
> [parser] Implements proposal-numeric-separator.
> 
> https://github.com/tc39/proposal-numeric-separator
> 
> This proposal-numeric-separator extends NumericLiteral and
> allows developers to insert underscore(_) inside numeric literal.
> 
> Bug: v8:7317
> Change-Id: I2a1a45cd6fe09cc5df63433bc915988fde687a33
> Reviewed-on: https://chromium-review.googlesource.com/923441
> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51671}

TBR=adamk@chromium.org,jkummerow@chromium.org,hablich@chromium.org,gsathya@chromium.org,mathias@chromium.org,goto@google.com,brn@b6n.ch

Change-Id: I6dcf46820caf20f28fbc11d94a5e8ced3cbbc78d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7317
Reviewed-on: https://chromium-review.googlesource.com/944767
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51672}
2018-03-01 23:04:36 +00:00
Taketoshi Aono
517df52488 [parser] Implements proposal-numeric-separator.
https://github.com/tc39/proposal-numeric-separator

This proposal-numeric-separator extends NumericLiteral and
allows developers to insert underscore(_) inside numeric literal.

Bug: v8:7317
Change-Id: I2a1a45cd6fe09cc5df63433bc915988fde687a33
Reviewed-on: https://chromium-review.googlesource.com/923441
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51671}
2018-03-01 22:28:14 +00:00
Jakob Kummerow
ed2e7dc618 [bigint] Expose BigInt on the API
Bug: v8:6791, v8:7486
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I733d0fb886c42928816fe570712ed23f41c8e751
Reviewed-on: https://chromium-review.googlesource.com/938945
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51664}
2018-03-01 18:58:38 +00:00
Gabriel Charette
70222a9d03 [v8 platform] Rename BackgroundThread methods to WorkerThreads method.
Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/941442.

"background" refers to a priority and is inappropriate to refer to
worker threads as many tasks posted to worker threads by v8 are in
fact high priority.

Also took advantage of this rename to make NumberOfWorkerThreads()
return an int instead of size_t. While it is never negative, int is
simpler and Google C++ style guide states to avoid unsigned integers in
such cases (ref. "On Unsigned Integers" @
https://google.github.io/styleguide/cppguide.html#Integer_Types).

The Chromium embedder for that call provided an int which was converted
to size_t for this override and most often casted back down to int on the
v8 side, adding churn, and readability overhead.

R=ahaas@chromium.org

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib5280df73d2846b111d985be65a10b049995ea6a
Reviewed-on: https://chromium-review.googlesource.com/941944
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51662}
2018-03-01 15:30:35 +00:00
Igor Sheludko
16a3a4e946 [ic] Properly handle kApiGetter case with null prototype.
Bug: chromium:808845
Change-Id: I406ca472e74b8fce5f79bc389bd40aec7dcebb84
Reviewed-on: https://chromium-review.googlesource.com/943261
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51661}
2018-03-01 15:18:44 +00:00
Ivica Bogosavljevic
e89daf3b3a MIPS: Rename macros for sid sysroot update
Some macros in test-assembler-mips have the same name
as newly introduced macros in sid sysroot. We rename
them in order to prevent compilation problems

Change-Id: I84d9562f39c1aca8ac20e979466862228f438425
Reviewed-on: https://chromium-review.googlesource.com/942322
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#51649}
2018-03-01 12:58:27 +00:00
Gabriel Charette
86b4b5345a [v8 platform] Get rid of unused ExpectedRuntime parameter.
With a temporary intermediate step to allow adapting embedders before
getting rid of the ExpectedRuntime method altogether.

The method is being renamed to CallOnWorkerThread() as an effort to
go away from "background" nomenclature for worker threads ("background"
usually refers to a priority but worker threads are commonly used for
high priority tasks in v8).
Other CLs will follow to rename other "background" APIs.

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2fd4eac7458708d4eacb0f4871c982a567a3865e
Reviewed-on: https://chromium-review.googlesource.com/941442
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51645}
2018-03-01 10:35:42 +00:00
jing.bao
36ddd0755f Add phaddd/vphaddd, phaddw/vphaddw and vhaddps to ia32
Also Add vhaddps to x64
Fix haddps for SSE3 scope and disassembler on ia32/x64

Change-Id: If511e6428fa1ce034b4281943dfee1405c9d4ffc
Reviewed-on: https://chromium-review.googlesource.com/939265
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#51642}
2018-03-01 01:30:59 +00:00
Hannes Payer
af1bffd314 [heap] Move FreeListCategory memory out of the page header.
Bug: chromium:774108
Change-Id: I5345fed261862b0e20356ec4579b16cdf0ea58a6
Reviewed-on: https://chromium-review.googlesource.com/899148
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51606}
2018-02-27 15:39:04 +00:00
Michael Starzinger
fafd1cdd35 Move exception handler table into instruction stream.
This changes the encoding of the {HandlerTable} from an array of Smi
values to a byte array. It allows embedding of said array into the
instruction stream of {Code} objects (similar to how safepoint tables
work). For interpreted bytecode the table is attached as a {ByteArray}
to the bytecode.

The advantage of this approach is a more compact encoding and also the
ability to move such tables easily off the GC'ed heap if needed (as is
done for WebAssembly code for example).

R=jarin@chromium.org

Change-Id: I3320415dff69b3d1053825bda0d667a28232bf6d
Reviewed-on: https://chromium-review.googlesource.com/934642
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51589}
2018-02-27 10:20:35 +00:00
Adam Klein
0084d42dc9 [cctest] Avoid redundant call in cctest/test-api/CallAsFunction
R=jkummerow@chromium.org

Bug: v8:7497
Change-Id: I4b75fde49a352a6e8d99211efdbb09d77aa88069
Reviewed-on: https://chromium-review.googlesource.com/938183
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51583}
2018-02-26 21:21:41 +00:00
Adam Klein
8fa85efd27 [esnext] Remove always-disabled support for function.sent
This proposal has not moved beyoned stage 2 in two years, and has never
moved past the HARMONY_INPROGRESS state in flag-definitions.h.

It was originally added to aide in desugaring yield*, but is no longer
used for that purpose.

Bug: v8:4700, v8:7310
Change-Id: Ieca40d8e4bf565516bbe71e47b996daa70d2e835
Reviewed-on: https://chromium-review.googlesource.com/935297
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51582}
2018-02-26 20:01:41 +00:00
Yang Guo
b04c87d84c [regexp] fix v8_interpreted_regexp build.
R=jgruber@chromium.org

Change-Id: I8328fdaf5d53850b87dd16867255d4325ab9cd9c
Reviewed-on: https://chromium-review.googlesource.com/936644
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51570}
2018-02-26 13:53:33 +00:00
Marja Hölttä
dd3c4fca2f [objects.h splitting] Move Promise-related classes.
BUG=v8:5402,v8:7310

Change-Id: Ic3ee7d2dec0403e7831f51735365c26caadc6a7b
Reviewed-on: https://chromium-review.googlesource.com/934136
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51565}
2018-02-26 13:19:00 +00:00
Ulan Degenbaev
e8925ad509 [heap-profiler] Show key as the value retainer for weak maps.
The key -> value edge is shown as "<index> / WeakMap", where <index> is
the index of the edge in the key.

Bug: chromium:778739, chromium:749502
Change-Id: I657051695f2a171372788dbb777543a55a35d554
Reviewed-on: https://chromium-review.googlesource.com/926524
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51559}
2018-02-26 11:35:45 +00:00
Yang Guo
175fc49c6e [debug] remove legacy implementation for break points.
R=herhut@chromium.org, jgruber@chromium.org

Bug: v8:7310, v8:5510
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Icefd10b6cc210e5bb2684d18b091179ead387326
Reviewed-on: https://chromium-review.googlesource.com/934445
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51552}
2018-02-26 10:01:39 +00:00
Marja Hölttä
80e0a759fd [iwyu] More iwyu fixes (date, execution etc.)
Removing includes which are not needed and also not indirectly pulled in.

BUG=v8:7490, v8:7310

Change-Id: I219ba92c3281c3c245cc6c5574c85c2d51a217a9
Reviewed-on: https://chromium-review.googlesource.com/934722
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51550}
2018-02-26 08:59:59 +00:00
jing.bao
1202e08eca [wasm]implement simd lowering for F32x4AddHoriz and I16x8AddHoriz.
Change lowering for Store to use input replacement type.

Change-Id: Ic1fbbb37a3cc938fca7015d838933284bae6068e
Reviewed-on: https://chromium-review.googlesource.com/903266
Commit-Queue: Jing Bao <jing.bao@intel.com>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51540}
2018-02-24 02:23:51 +00:00
Sathya Gunasekaran
9b13670983 [promise] Make re-fulfilling a promise a no op.
Previously the API allowed the embedder to re fulfill a non pending
promise. This was changed as part of
c041296189.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I53dc028fecdcc6ab05c05cfc7795e89519ed9633
Reviewed-on: https://chromium-review.googlesource.com/932968
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51536}
2018-02-24 00:38:10 +00:00
Michael Achenbach
2310ea72b9 [test] Skip flaky cpu-profiler test
See https://crbug.com/v8/5193#c26

TBR=yangguo@chromium.org
NOTRY=true

Bug: v8:5193
Change-Id: I10f4c57c54b5bf596641a0e4c492bd652941b28e
Reviewed-on: https://chromium-review.googlesource.com/934845
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51530}
2018-02-23 17:16:17 +00:00
Marja Hölttä
bdec7137ec [iwyu] Fixes related to isolate.h
BUG=v8:7490, v8:7310

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2eb6897d9dcc72cc6f399a8752b9f30d7d7010f8
Reviewed-on: https://chromium-review.googlesource.com/934504
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51523}
2018-02-23 16:03:37 +00:00
Sigurd Schneider
0165432e20 [cleanup] Rename Word to Int32/IntPtr depending on context
Bug: v8:7310
Change-Id: I3b9832c7090d5c4b2f425f85095b0d7bae29fbfd
Reviewed-on: https://chromium-review.googlesource.com/934321
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51519}
2018-02-23 14:34:07 +00:00
jgruber
481c21e0f4 [builtins] Add IsOffHeapSafe predicate and test
Off-heap-safety slightly differs from isolate-independence in that it
allows external references and checks instruction-size constraints.

This adds the new predicate as well as a cctest verifying it. New
DCHECKs are introduced to document assumptions and upcoming work.

Note that this breaks the --stress-off-heap-code flag. Fixes will
follow in upcoming CLs.

Bug: v8:6666
Change-Id: If4f3e0f4428bacc8d293cd864b9b07b81679c423
Reviewed-on: https://chromium-review.googlesource.com/934183
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51513}
2018-02-23 13:26:13 +00:00
Yang Guo
0b9b48b59d [debug] fix break for builtin constructors with regular construct stub.
Regular construct stubs eventually call InvokeFunction, which does
performs debug hook checking. For builtins such as Object, Array, etc.
this approach does not work since they have specialized construct stubs
that do not check for the debug hook.

R=bmeurer@chromium.org

Bug: v8:178
Change-Id: I3e1f5d2dae1c7a6220b7236bd6ea71d83a65171f
Reviewed-on: https://chromium-review.googlesource.com/931702
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51503}
2018-02-23 11:04:19 +00:00
Sathya Gunasekaran
8a78db6d4a [test262] Test262 Roll
Fixes broken background compile error reporting.

Fixes broken tests in DateTimeFormat and NumberFormat: PluralRules
constructor requires 'new'.

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I65216a3172595397f5de638c9d5d9d021d3257ce
Reviewed-on: https://chromium-review.googlesource.com/931935
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51488}
2018-02-22 22:31:50 +00:00
Clemens Hammacher
537885e829 [wasm][interpreter] Fix indirect calls to other instances
When calling a function through a function table, check whether the
instance of the called function differs from the current instance, and
in that case call the other function via a c-wasm-entry instead of
interpreting it.
The c-wasm-entry needs to pass the wasm context, so this CL changes
this to receive the wasm context as parameter instead of embedding the
context of the calling instance.

R=titzer@chromium.org

Bug: chromium:814562, v8:7400
Change-Id: Iea93f270542169f8aac4f8c81aacec559c716368
Reviewed-on: https://chromium-review.googlesource.com/930966
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51485}
2018-02-22 19:51:41 +00:00
Yang Guo
bebfd9d8bb [debug] add cctest for conditional breakpoint.
R=jgruber@chromium.org

Change-Id: I951d05f11d227fa3bc817010176bd966c23ad337
Reviewed-on: https://chromium-review.googlesource.com/931463
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51484}
2018-02-22 19:46:55 +00:00
Sathya Gunasekaran
47abe102c3 [class] Add bytecode expectations test for private class fields
Bug: v8:5368
Change-Id: I7ec4bb6c0f50d8a72a12f5d4521c5fdcba526014
Reviewed-on: https://chromium-review.googlesource.com/929876
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51479}
2018-02-22 17:34:55 +00:00
Benedikt Meurer
aff1f3788b [cleanup] Introduce a dedicated FeedbackCell.
This is preparatory cleanup work for eventually tracking the functions
(rather than concrete closures) in the CALL_IC, also for builtins like
the default PromiseCapability [[Resolve]] and [[Reject]] functions. It
adds a new FeedbackCell type, which is used by JSFunctions consistently
now to reference the feedback vector (or undefined if not the function
is not compiled yet or is a native/asm.js function).

This also changes the calling convention for FastNewClosure builtin and
the JSCreateClosure operator in TurboFan to carry the FeedbackCell here
instead of the parent FeedbackVector and the slot index. In addition we
eliminate the now unused %InterpreterNewClosure runtime function.

Bug: v8:2206, v8:7253, v8:7310
Change-Id: Ib4ce456e276e0273e57c163dcdd0b33abf863656
Reviewed-on: https://chromium-review.googlesource.com/928403
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51474}
2018-02-22 13:18:48 +00:00
Yang Guo
d80e1f47ed [regexp] add test for termination for long-running regexps.
R=jgruber@chromium.org

Change-Id: I9def56aa65e742f24ecfc25a01b20389e8867dc2
Reviewed-on: https://chromium-review.googlesource.com/931061
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51465}
2018-02-22 11:09:35 +00:00
Ulan Degenbaev
5da78ea40b [heap-profiler] Allow embedder to specify node name prefix.
This patch adds EmbedderGraph::Node::NamePrefix method that will be used
by Chrome for detached DOM nodes.

Bug: chromium:811925
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I89d3b88a3b90ed85addb1d34f08dd15e0559aa9a
Reviewed-on: https://chromium-review.googlesource.com/926362
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51464}
2018-02-22 10:48:03 +00:00
Sathya Gunasekaran
3cdb96b0ac [class] Ban private field deletion
Bug: v8:5368
Change-Id: I7c4f9101837a0bf4917bbb0c2f09587118168a02
Reviewed-on: https://chromium-review.googlesource.com/923362
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51449}
2018-02-21 19:14:23 +00:00
Ross McIlroy
aa9843d796 [Compiler] Don't save FeedbackVector in CompilationCache for Scripts.
The compilation logic never used the saved FeedbackVector for Script
compiles when looking up the CompilationCache, so remove it and
simplify the return value of LookupScript to be a
MaybeHandle<SharedFunctionInfo>

Change-Id: Ib1d833f997b299e2e79621bd8509bdfd911d4e10
Reviewed-on: https://chromium-review.googlesource.com/924002
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51443}
2018-02-21 17:07:13 +00:00
Ross McIlroy
0d872514ef [Compiler] Simplify and unify GetSharedFunctionFor[Streamed]Script.
Unifies GetSharedFunctionForStreamedScript with GetSharedFunctionForScript
so that both share a more similar API and some common code can be moved to
common helpers.

Introduces a Compiler::ScriptDetails struct to hold script meta-data
used to build new script objects.

BUG=v8:5203

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I3e6b4cd50da9bb92ef5a2bfd666a09b3619c34a4
Reviewed-on: https://chromium-review.googlesource.com/924189
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51438}
2018-02-21 15:40:13 +00:00
Nico Weber
19e0e69a97 Make v8 build with -Wimplicit-fallthrough in x86, arm, arm64, mips, mips64 configs.
x86, arm, arm64: no change in behavior
mips, mips64: disasm-mips(64).cc grows an UNREACHABLE that's
              maybe optimistic (but if it's not true, then that
              looks like a current unintentional fallthrough at
              that spot)
test-js-typed-lowering.cc: looks like a clear bug, but test-only code

Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/911731 which
did this for x64.

Doesn't turn on the warning yet.

Bug: chromium:812686
Change-Id: I7dd79c9885c90f41dd7e3a595256a954ab0ae643
Reviewed-on: https://chromium-review.googlesource.com/923528
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51437}
2018-02-21 15:37:03 +00:00
Sathya Gunasekaran
3da7cd3645 [class] Allow CallExpressions to access private fields
Bug: v8:5368
Change-Id: I92874d5ea190cd892f3cb5216e0f4bb5373d5350
Reviewed-on: https://chromium-review.googlesource.com/927345
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51436}
2018-02-21 15:27:13 +00:00
jgruber
ad74be52fa [builtins] Add builtins constants list to roots
This is a step towards off-heap (and eventually isolate-independent)
builtins.

Off-heap code cannot use the standard CallStub/CallRuntime mechanisms,
since they directly embed the callee code object pointer within the
caller.  There are two main issues with that: 1. the callee may be
moved by GC, and 2. the pc-relative addressing we currently use breaks
(i.e. ends up pointing to a random spot on the heap) when moving the
caller off-heap.

This CL addresses that by introducing a constants list stored on the
roots array.  Instead of embedding code targets, we now have the option
of loading them from constants list. The code sequence is:

REX.W movq rax,[r13+0x4a0]  // Load the constants cache.
REX.W movq rdx,[rax+0xf]    // From there, load the code target.
...
REX.W addq rdx,0x5f         // Add instruction_start.
call rdx

There's no visible performance impact on the web tooling benchmark.

This list will later be extended to also contain other constants such
as Strings.

Bug: v8:6666
Change-Id: Ifcf67d1f682804ba0b6d3d0383216e16575b6bf5
Reviewed-on: https://chromium-review.googlesource.com/923729
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51434}
2018-02-21 15:07:42 +00:00
Ulan Degenbaev
4724d0ff81 [heap-profiler] Fix a bug in MergeNames function.
Bug: chromium:811925
Change-Id: I0b2d9562fa77d6d198a689769705a2d5e977abf9
Reviewed-on: https://chromium-review.googlesource.com/928701
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51432}
2018-02-21 13:52:09 +00:00
Ben L. Titzer
0c1b4c257b [wasm] Move indirect function tables into the WasmContext
This CL changes the WASM implementation to access indirect function
tables through the WasmContext, whereas previously indirect function
tables and their sizes were constants that were inlined into compiled
into code, requiring code patching. This is a necessary step for sharing
code between instances and eventually, isolates.

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

Bug: v8:7424
Change-Id: Ida4138ed92729730dfbc0a81a84d8484b233d808
Reviewed-on: https://chromium-review.googlesource.com/895683
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51427}
2018-02-21 12:29:21 +00:00
Martyn Capewell
efb8508440 [arm] Support CSDB instruction
Add support for CSDB in the 32-bit assembler, disassembler and simulator.

Change-Id: I0e5432e4d219dd4699d5f9b7f911791acc87114c
Reviewed-on: https://chromium-review.googlesource.com/928522
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#51425}
2018-02-21 12:14:48 +00:00
Martyn Capewell
a33945a1a1 [arm64] Support CSDB instruction
Add support for CSDB, equivalent to HINT #20, in the system instruction space.

Additionally, relax the "unallocated" identification of hint instructions that
we don't support, such that they'll now disassemble as "unimplemented (System)"
rather than "unallocated".

Change-Id: Ia36d13fe17a98edb872f234e7cdda33d033618e8
Reviewed-on: https://chromium-review.googlesource.com/926806
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#51420}
2018-02-21 10:33:32 +00:00
Mythri
5a68df2ab5 Remove support for unused compile options.
We don't use parser caches anymore and request code caches
explicitly using ScriptCompiler::CreateCodeCache. Hence
removing the support for both parser cache and code cache options.
They are still retained in CompileOptions for backwards
compatibility. Apart from the api.cc, no other part should see
this option.

Bug: chromium:779254, chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ic8ad9afe3fa44bbb5adc71bdde59c0b4057a523d
Reviewed-on: https://chromium-review.googlesource.com/916261
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51416}
2018-02-21 09:51:31 +00:00
Justin Ridgewell
f6b6f71ba2 Consolidate UTF-8 Vector<char> to uc16 decoding into Iterator
Too many files know how to deal with decoding, counting, and splitting UTF-8
into uc16 chars. This consolidates several callers who deal with full
(Vector<char>, not streaming) bytes by using a UTF-8 Iterator to decode bytes
into individual uc16 chars.

R=marja@chromium.org

Bug: 
Change-Id: Ia36df3e8c1abd0398415ad23a474557c71c19a01
Reviewed-on: https://chromium-review.googlesource.com/831093
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Justin Ridgewell <jridgewell@google.com>
Cr-Commit-Position: refs/heads/master@{#51405}
2018-02-20 20:04:41 +00:00
Ulan Degenbaev
252e8a1c2d [heap-profiler] Merge embedder nodes and V8 wrapper nodes.
Each DOM node has the corresponding V8 wrapper object. This leads to
apparent duplication in the heap snapshot and may confuse the users.

This patch allows the embedder to specify V8 wrapper for each embedder
node. In the heap snapshot the wrapper node will be merged into the
embedder node. The resulting node will have the same properties as
the embedder node. If the wrapper node name has a tag, then the tag
is also added to the merged node.

Bug: chromium:811925

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2492f5b28163a78aee707b9ced1b09ac4b203e3f
Reviewed-on: https://chromium-review.googlesource.com/919482
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51394}
2018-02-20 15:04:48 +00:00
Stephan Herhut
7ecb6a38b9 Implement code creation events for wasm code on native heap
Adds support for generating logging/profiling event when wasm code gets compiled
on the native heap. As code objects on the native heap are not ordinary heap
objects, the existing abstractions for reporting cannot be used. Instead, add
specialized versions for WasmCode objects.

Change-Id: I808618d70142073b3c1b06edef6931f59bed8cf5
Reviewed-on: https://chromium-review.googlesource.com/913308
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51388}
2018-02-20 08:30:31 +00:00
Sigurd Schneider
e1ca671e45 [debug] Ensure breaking on inlined builtins works
This ensures that breaking on inlined builtins works, even when
compiling concurrently. This CL also introduces the member
Isolate::AbortConcurrentOptimization.

R=sigurds@chromium.org

Bug: v8:178
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ie6cbb48ebde18036888af2dd715862e7a14ddf9d
Reviewed-on: https://chromium-review.googlesource.com/912468
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51384}
2018-02-20 07:52:51 +00:00
Benedikt Meurer
d97bb31738 [async-await] Turn await closures into intrinsics.
There's no need to have the AsyncFunctionAwait/AsyncGeneratorAwait
operations as separate closures that are called via JavaScript calling
convention, but instead we can just have them as intrinsics (with the
goal to eventually turn them into IC stubs).

Drive-by-fix: Tail call to the ResumeGenerator builtin when resuming
an async function. The earlier restrictions no only apply with the new
machinery.

Bug: v8:7253
Change-Id: I0c4d04dae15b4211158fc07151adafda69d4faec
Reviewed-on: https://chromium-review.googlesource.com/924703
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51382}
2018-02-20 06:39:01 +00:00
Gabriel Charette
ac17ba0e56 Reland "Introduce ConcurrentMarking::StopRequest API."
This is a reland of f4b4109936.

Not expected to be the culprit of the 4 CL revert.

Original change's description:
> Introduce ConcurrentMarking::StopRequest API.
>
> This was extracted from https://chromium-review.googlesource.com/c/v8/v8/+/924073/10
> after it became clear that using COMPLETE_TASKS/PREEMPT_TASKS where
> it should make sense to doesn't work in practice for now.
>
> Experimental CLs which led to the above conclusion:
>  - https://chromium-review.googlesource.com/c/v8/v8/+/924865
>    (COMPLETE or CANCEL -- still broken)
>  - https://chromium-review.googlesource.com/c/v8/v8/+/924866
>    (CANCEL only, as before, works)
>  - https://chromium-review.googlesource.com/c/v8/v8/+/924028
>    (CANCEL and PREEMPT -- broken as well)
>
> Introducing this unittested API allows to reduce the size
> of the CLs causing hard-to-diagnose bots-only failures
> and fix them individually follow-ups @
>
>  1) https://chromium-review.googlesource.com/c/v8/v8/+/924029
>  2) https://chromium-review.googlesource.com/c/v8/v8/+/924031
>  3) https://chromium-review.googlesource.com/c/v8/v8/+/924030
>
> Bug: chromium:812178
> Change-Id: Icdac456e9f7874b0c4b321ccdb8898297dad7d73
> Reviewed-on: https://chromium-review.googlesource.com/924867
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51353}

Bug: chromium:812178
Change-Id: Iaa32f9cc6b2fa7004c7fae1f79aa4b00f5f8f34c
Reviewed-on: https://chromium-review.googlesource.com/924006
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51371}
2018-02-19 14:46:44 +00:00