Commit Graph

19293 Commits

Author SHA1 Message Date
Ulan Degenbaev
aaa700bda4 Revert "[heap] Remove independent handles"
This reverts 667555c6b8.

This is a short-term fix for NodeJS regression caused by Scavenger
not collecting weak handles that are marked as independent.

Bug: chromium:847863, chromium:780749
Change-Id: Ia1c02e042d0e593c6f5badb82c4ef20b923d3806
Reviewed-on: https://chromium-review.googlesource.com/1082442
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@{#53502}
2018-06-04 19:13:20 +00:00
Deepti Gandluri
66f3e8f64d [wasm] Enable sign extension opcodes by default
Change-Id: Id6f87f55541eba44a22be2721f9182095ca69359
Reviewed-on: https://chromium-review.googlesource.com/1085508
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53501}
2018-06-04 18:36:44 +00:00
Tom Anderson
c2455500f4 Remove manual references to exe_and_shlib_deps
After [1], a manual dependency on exe_and_shlib_deps is no longer necessary
since it's automatically added.  This CL removes all remaining manual references
to exe_and_shlib_deps.

[1] d7ed1f0a9c

BUG=chromium:845700
R=machenbach

Change-Id: I17da573b7b6509a690caf8be6ae6afc180105f07
Reviewed-on: https://chromium-review.googlesource.com/1082913
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53500}
2018-06-04 18:35:43 +00:00
Deepti Gandluri
137ff44038 Revert "[csa] Ensure the requested allocation size fits in a Smi"
This reverts commit 515cc07d28.

Reason for revert: Tree closed on mkgrokdump failures
https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.v8%2FV8_Mac64%2F22277%2F%2B%2Frecipes%2Fsteps%2FCheck%2F0%2Flogs%2Fmkgrokdump%2F0
https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.v8%2FV8_Linux64%2F24882%2F%2B%2Frecipes%2Fsteps%2FCheck_-_noavx%2F0%2Flogs%2Fmkgrokdump%2F0
https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.v8%2FV8_Win64%2F24413%2F%2B%2Frecipes%2Fsteps%2FCheck%2F0%2Flogs%2Fmkgrokdump%2F0

Original change's description:
> [csa] Ensure the requested allocation size fits in a Smi
> 
> In CSA::AllocateRaw, ensure that the given allocation size fits into a
> Smi.
> 
> Bug: chromium:848672
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I4e74791296163188b1ca77cae8226a9833fba8ef
> Reviewed-on: https://chromium-review.googlesource.com/1084930
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53495}

TBR=yangguo@chromium.org,jgruber@chromium.org,ishell@chromium.org

Change-Id: I4d1019c03b393c1a59e5eca558d9cd26ce63e17a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:848672
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1085647
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53496}
2018-06-04 18:30:50 +00:00
jgruber
515cc07d28 [csa] Ensure the requested allocation size fits in a Smi
In CSA::AllocateRaw, ensure that the given allocation size fits into a
Smi.

Bug: chromium:848672
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I4e74791296163188b1ca77cae8226a9833fba8ef
Reviewed-on: https://chromium-review.googlesource.com/1084930
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53495}
2018-06-04 16:26:57 +00:00
Jakob Gruber
3348ed0b5e Revert "[array] Implement Array.p.sort in Torque"
This reverts commit df1676e616.

Reason for revert: https://crbug.com/v8/7382#c26

Original change's description:
> [array] Implement Array.p.sort in Torque
> 
> This CL implements a generic baseline version and 3 fastpaths, for
> various elements kinds, of Array.p.sort in Torque. Details can be found
> in the Design Doc: https://goo.gl/Ge321G.
> 
> Performance impact on micro benchmarks depends on the element kind
> and whether the user provides a comparison function.
> For HoleySmi/HoleyElement we have a speedup between 1.5-1.8 across
> the board. For Dictionary we are slower in all micro benchmarks (0.7).
> For PackedSmi it depends on the call site and whether or not a
> comparison function is used.
> 
> Detailed numbers: https://goo.gl/mTyPSb
> 
> Bug: v8:7382
> Change-Id: I50acabd2032af0bc01d36b0de0f555d66be56a7e
> Reviewed-on: https://chromium-review.googlesource.com/1061523
> Commit-Queue: Simon Zünd <szuend@google.com>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53481}

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

Change-Id: I4c1b32a434d49caba67c80bccb068390607f90a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7382
Reviewed-on: https://chromium-review.googlesource.com/1085407
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53494}
2018-06-04 15:26:18 +00:00
Michael Starzinger
b1583b6cd3 [wasm] Load {CEntryStub} from the instance object.
This avoids embedding the {CEntryStub} into generated {WasmCode} and
instead loads it from the instance object. It is another step towards
making the generated code independent of the Isolate.

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

Change-Id: Ic6ab7602a77fc11e6ec4a03e1bdba647d54df5e3
Reviewed-on: https://chromium-review.googlesource.com/1084841
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53491}
2018-06-04 14:42:47 +00:00
Clemens Hammacher
18d816e96e [wasm] Clean up fields and methods in NativeModule
1) The code table never grows, so store it in a heap-allocated byte
   array instead of an std::vector.
2) Rename {functions_count} to {num_functions} for consistency with
   {num_imported_functions} and occurences in other data structures.

R=mstarzinger@chromium.org

Bug: v8:7754
Change-Id: Id9d66545ed7aa675d663dad5936a9ef6d44ace7d
Reviewed-on: https://chromium-review.googlesource.com/1066014
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53488}
2018-06-04 12:39:27 +00:00
Michael Starzinger
c96ac82c50 [wasm] Make stack check independent of the Isolate.
This makes stack checks in WasmCode independent of the underlying
Isolate by loading the limit address from the WasmInstanceObject instead
of embedding it into the instruction stream. It hence removes the last
use of the Isolate field from WasmGraphBuilder.

Additionally this introduces the notion of a "runtime stub" which
represents stub code global to the NativeModule that can be directly
called from each WasmCode in the same module. These stubs can act as
trampolines via which Isolate-independent WasmCode can enter other V8
builtins or runtime functions that remain Isolate-dependent. They will
eventually replace the current "trampoline" in a NativeModule.

R=titzer@chromium.org
BUG=v8:7424

Change-Id: Ie1f5582ee656b1ab7716ea06316d6e21a0268e74
Reviewed-on: https://chromium-review.googlesource.com/1078732
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53487}
2018-06-04 11:24:17 +00:00
Sreten Kovacevic
51ac26cf79 [instruction-scheduler][mips] Implement instruction-scheduler on mips
Also, remove cctest/test-instruction-scheduler/DeoptInMiddleOfBasicBlock
from skip-list.

Change-Id: I392cab0c96b7adc5e9c94eacb60c97e09f0ec16a
Reviewed-on: https://chromium-review.googlesource.com/1084591
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#53485}
2018-06-04 10:12:37 +00:00
Marja Hölttä
02ba28b669 [reland] [in-place weak refs] Replace WeakCells in DescriptorArray.
BUG=v8:7308
TBR=ishell@chromium.org, tebbi@chromium.org

Change-Id: I0f7de13967d3e109b40d7158ee29775754c3d108
Reviewed-on: https://chromium-review.googlesource.com/1082475
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53483}
2018-06-04 08:59:17 +00:00
Marja Hölttä
80aaa87981 [in-place weak refs] Make the WeakArrayList API more generic.
(Pre-work for adding special-purpose data structures as subclasses.)

BUG=v8:7308

Change-Id: I82a5a96e18c3321e9d5b783642516ff869b45f27
Reviewed-on: https://chromium-review.googlesource.com/1084474
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53482}
2018-06-04 08:45:57 +00:00
Simon Zünd
df1676e616 [array] Implement Array.p.sort in Torque
This CL implements a generic baseline version and 3 fastpaths, for
various elements kinds, of Array.p.sort in Torque. Details can be found
in the Design Doc: https://goo.gl/Ge321G.

Performance impact on micro benchmarks depends on the element kind
and whether the user provides a comparison function.
For HoleySmi/HoleyElement we have a speedup between 1.5-1.8 across
the board. For Dictionary we are slower in all micro benchmarks (0.7).
For PackedSmi it depends on the call site and whether or not a
comparison function is used.

Detailed numbers: https://goo.gl/mTyPSb

Bug: v8:7382
Change-Id: I50acabd2032af0bc01d36b0de0f555d66be56a7e
Reviewed-on: https://chromium-review.googlesource.com/1061523
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53481}
2018-06-04 08:40:27 +00:00
Alexey Kozyatinskiy
e404670696 [debug] removed most debugger js
Removed most of mirrors.js and debug.js.
Further steps:
- migrate liveedit.js to native,
- remove debugger context.

R=yangguo@chromium.org
TBR=leszeks@chromium.org

Bug: v8:5530
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I291ef20ef3c63a424d32e3e0c9d0962a6ca382d1
Reviewed-on: https://chromium-review.googlesource.com/1081176
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53480}
2018-06-03 06:02:59 +00:00
Alexey Kozyatinskiy
5cb11a17cd Reland "[inspector] added Runtime.installBinding method"
This is a reland of 49c4ac7753

Original change's description:
> [inspector] added Runtime.installBinding method
>
> A lot of different clients use console.debug as a message channel from
> page to protocol client. console.debug is a little slow and not
> designed for this use case.
>
> This CL introduces new method: Runtime.installBinding. This method
> installs binding function by given name on global object on each
> inspected context including any context created later.
> Binding function takes exactly one string argument. Each time when
> binding function is called, Runtime.bindingCalled notification is
> triggered and includes passed payload.
>
> Binding function survives page reload and reinstalled right after
> console object is setup. So installed binding can be used inside
> script added by Page.addScriptToEvaluateOnNewDocument so client may do
> something like:
> Runtime.installBinding({name: 'send'});
> Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'});
> .. navigate page ..
>
> In microbenchmark this function is ~4.6 times faster then
> console.debug.
>
> R=lushnikov@chromium.org,pfeldman@chromium.org
>
> Bug: none
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3
> Reviewed-on: https://chromium-review.googlesource.com/1077662
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53462}

TBR=dgozman@chromium.org

Bug: none
Change-Id: I58d053581a86f15338dea621498058b7b75c7c85
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1081833
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53479}
2018-06-01 22:52:55 +00:00
Deepti Gandluri
785bd43b7e [wasm] Enable sign extension operations in the interpreter
Change-Id: I204a021ffc8b120ffe232e3f5db924e54c6d980e
Reviewed-on: https://chromium-review.googlesource.com/1083337
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53478}
2018-06-01 22:12:45 +00:00
Aseem Garg
dc6819ec56 [wasm] Add simd replaceLane ops to wasm interpreter
Also enables tests for globals and mixed type use

R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: I828f1628a1c27d9f07ba3a830600f81c5a404b2d
Reviewed-on: https://chromium-review.googlesource.com/1080340
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53477}
2018-06-01 21:50:35 +00:00
Nebojsa Ciric
91df12aa36 Prevent throwing exceptions more than once during Locale construction.
Change code to propagate errors/exceptions to the top, and throw only once.

Bug: v8:7684
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I9a2d15cc4931f5bf029d2a8d78ad86e61f8db452
Reviewed-on: https://chromium-review.googlesource.com/1066808
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53476}
2018-06-01 18:18:54 +00:00
Marja Hölttä
d115b74502 Revert "[in-place weak refs] Replace WeakCells in DescriptorArray."
This reverts commit 0f23ceddfb.

Reason for revert: buildbot failures

Original change's description:
> [in-place weak refs] Replace WeakCells in DescriptorArray.
> 
> BUG=v8:7308
> 
> Change-Id: Ib0ad52916d6f5b65e7612981b467b491d832f505
> Reviewed-on: https://chromium-review.googlesource.com/1075053
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53473}

TBR=ulan@chromium.org,marja@chromium.org,tebbi@chromium.org,ishell@chromium.org

Change-Id: I713ab10650f933a8218a61521868d6cd16cb821e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7308
Reviewed-on: https://chromium-review.googlesource.com/1082218
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53474}
2018-06-01 12:16:01 +00:00
Marja Hölttä
0f23ceddfb [in-place weak refs] Replace WeakCells in DescriptorArray.
BUG=v8:7308

Change-Id: Ib0ad52916d6f5b65e7612981b467b491d832f505
Reviewed-on: https://chromium-review.googlesource.com/1075053
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53473}
2018-06-01 11:02:59 +00:00
Sergiy Byelozyorov
7bd8b1c0fc Revert "[inspector] added Runtime.installBinding method"
This reverts commit 49c4ac7753.

Reason for revert: breaks linux_chromium_rel_ng when rolling into Chromium: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/107377

Original change's description:
> [inspector] added Runtime.installBinding method
> 
> A lot of different clients use console.debug as a message channel from
> page to protocol client. console.debug is a little slow and not
> designed for this use case.
> 
> This CL introduces new method: Runtime.installBinding. This method
> installs binding function by given name on global object on each
> inspected context including any context created later.
> Binding function takes exactly one string argument. Each time when
> binding function is called, Runtime.bindingCalled notification is
> triggered and includes passed payload.
> 
> Binding function survives page reload and reinstalled right after
> console object is setup. So installed binding can be used inside
> script added by Page.addScriptToEvaluateOnNewDocument so client may do
> something like:
> Runtime.installBinding({name: 'send'});
> Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'});
> .. navigate page ..
> 
> In microbenchmark this function is ~4.6 times faster then
> console.debug.
> 
> R=​lushnikov@chromium.org,pfeldman@chromium.org
> 
> Bug: none
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3
> Reviewed-on: https://chromium-review.googlesource.com/1077662
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53462}

TBR=dgozman@chromium.org,lushnikov@chromium.org,pfeldman@chromium.org,kozyatinskiy@chromium.org

Change-Id: I1ebafd42db01d8a6435d58386f2c667b92db12f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1082311
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53470}
2018-06-01 09:15:21 +00:00
Dan Elphick
03c85c23cf [regexp] Eliminate all GetIsolates
Remove all uses of GetIsolate/GetHeap by passing Isolate in from all
call sites.

Bug: v8:7786
Change-Id: I64ff8d5796db9d602e86bff4d0b9297cbe700d0d
Reviewed-on: https://chromium-review.googlesource.com/1080819
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53467}
2018-06-01 07:55:19 +00:00
Hidy Han
f69527ee49 Expose Runtime.setAsyncCallStackDepth API for async stack collection.
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4a29336a585bb690f915c876b3b07eb2601d027b
Reviewed-on: https://chromium-review.googlesource.com/1080225
Commit-Queue: Hidy Han <hidyhan@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53466}
2018-06-01 03:09:27 +00:00
Alexey Kozyatinskiy
49c4ac7753 [inspector] added Runtime.installBinding method
A lot of different clients use console.debug as a message channel from
page to protocol client. console.debug is a little slow and not
designed for this use case.

This CL introduces new method: Runtime.installBinding. This method
installs binding function by given name on global object on each
inspected context including any context created later.
Binding function takes exactly one string argument. Each time when
binding function is called, Runtime.bindingCalled notification is
triggered and includes passed payload.

Binding function survives page reload and reinstalled right after
console object is setup. So installed binding can be used inside
script added by Page.addScriptToEvaluateOnNewDocument so client may do
something like:
Runtime.installBinding({name: 'send'});
Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'});
.. navigate page ..

In microbenchmark this function is ~4.6 times faster then
console.debug.

R=lushnikov@chromium.org,pfeldman@chromium.org

Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3
Reviewed-on: https://chromium-review.googlesource.com/1077662
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53462}
2018-05-31 21:27:07 +00:00
Sergiy Byelozyorov
bbfe7f32c5 Revert "[inspector] RemoteObject.description should be empty for primitive type"
This reverts commit 003159e777.

Reason for revert: breaks roll into Chromium: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_headless_rel/3140

Original change's description:
> [inspector] RemoteObject.description should be empty for primitive type
> 
> We currently report description field for numbers. On client side user
> can calculate description as remoteObject.unserializableValue ||
> (remoteObject.value + ''). Let's report description only for objects to
> simplify value -> remoteObject logic a bit.
> 
> R=​dgozman@chromium.org
> TBR=jgruber@chromium.org
> 
> Bug: chromium:595206
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I91356a44aa3024e20c8f966869abf4a41b88e4bc
> Reviewed-on: https://chromium-review.googlesource.com/737485
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53453}

TBR=dgozman@chromium.org,pfeldman@chromium.org,kozyatinskiy@chromium.org

Change-Id: Ifc184e1ac158d9ea7034922a7250444448fac49f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:595206
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1081207
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53461}
2018-05-31 18:52:08 +00:00
Bill Budge
1ae84e18d7 [wasm] Handle special case 32x4 and 16x8 shuffles on ia32
- Adds v/pshufhw, v/palignr instructions to assembler and
  macro-assembler.
- Uses better instruction sequences for 32x4 shuffles using half-
  shuffles and blends.
- Uses better instruction sequences for 16x8 shuffles.
- Uses better instruction sequences for concatenating 8x16 shuffles.

Change-Id: I3e6dca2937a2b167c754c47331c3a2f8ab9786db
Reviewed-on: https://chromium-review.googlesource.com/1066986
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53460}
2018-05-31 17:29:27 +00:00
Alexey Kozyatinskiy
d920bf37d6 [inspector] removed last usage of debugger context on inspector side
This is another step to remove a huge amount of legacy code from v8.

R=dgozman@chromium.org

Bug: v8:5530
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I634bda41c53a49dc4912291eb52f02847f56f4f3
Reviewed-on: https://chromium-review.googlesource.com/1080398
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53459}
2018-05-31 16:50:07 +00:00
Alexey Kozyatinskiy
003159e777 [inspector] RemoteObject.description should be empty for primitive type
We currently report description field for numbers. On client side user
can calculate description as remoteObject.unserializableValue ||
(remoteObject.value + ''). Let's report description only for objects to
simplify value -> remoteObject logic a bit.

R=dgozman@chromium.org
TBR=jgruber@chromium.org

Bug: chromium:595206
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I91356a44aa3024e20c8f966869abf4a41b88e4bc
Reviewed-on: https://chromium-review.googlesource.com/737485
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53453}
2018-05-31 06:43:15 +00:00
Alexey Kozyatinskiy
47b650e22f [inspector] nice stepOut from async function
If async function A awaited async function B, stepOut from function B
should go to function A.

Bug: v8:7753
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iedc1d8b85a52aa60519e56b319325436fc2168c9
Reviewed-on: https://chromium-review.googlesource.com/1054618
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53451}
2018-05-31 00:34:25 +00:00
Alexey Kozyatinskiy
85bb3ed275 [inspector] reenable some inspector tests
TBR=dgozman@chromium.org

Bug: v8:6170,v8:6171
Change-Id: I1f3eb7fbe1c2a9347428ce9742f22826035be52d
Reviewed-on: https://chromium-review.googlesource.com/1080046
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53450}
2018-05-30 22:51:43 +00:00
Ben Smith
b466a99f91 [wasm] Rename type to value in Global constructor
This was renamed recently in the spec.

Change-Id: I825e47e8b4113ddb2c3356ee8e7663705ba65e1c
Reviewed-on: https://chromium-review.googlesource.com/1079851
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53448}
2018-05-30 21:08:03 +00:00
Leszek Swirski
53d4dfc377 [sfi] Compress function arg counts to 16 bit
Compress the parameter count (and function length) stored in
SharedFunctionInfo to a uint16_t. This limits us to 2^16 - 1 parameters
per function, minus one for the "don't adapt arguments" sentinel value,
which is one fewer than Code::kMaxArguments was already. Anyway, 65534
arguments should be enough for anyone!

This drops SFI size by 4 bytes.

Bug: chromium:818642
Change-Id: I126bfb24453dcdc5087a104d3a12cf195a56fa9f
Reviewed-on: https://chromium-review.googlesource.com/1076627
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53447}
2018-05-30 16:35:50 +00:00
Alexey Kozyatinskiy
c002394687 [inspector] speedup async instrumentation
We use name of the function at the moment of first appearance of given
function in stack trace. Any further name changes would be ignored.
It gives us around 20% speedup.

Perf analysis: https://bit.ly/2wp99vt

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

Bug: v8:7078
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9f21f0bd9cd923e5abaeffb9209df0be2f49afff
Reviewed-on: https://chromium-review.googlesource.com/1050984
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53446}
2018-05-30 16:17:51 +00:00
Alexey Kozyatinskiy
b6c9086ca1 [inspector] reworked async stack instrumentation for async functions
New intstrumentation consists of:
- kAsyncFunctionSuspended when async function is suspended on await
  (called on each await),
- kAsyncFunctionFinished when async function is finished.

Old instrumentation was based on reusing async function promise.
Using this promise produces couple side effects:
- for any promise instrumentation we first need to check if it is
  special case for async function promise or not - it requires
  expensive reading from promise object.
- we capture stack for async functions even if it does not contain
  awaits.
- we do not properly cancel async task created for async function.

New intsrumntation resolved all these problems as well as provide
clear mapping between async task and generator which we can use later
to fetch scope information for async functions on pause.

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

Bug: v8:7078
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ifdcec947d91e6e3d4d5f9029bc080a19b8e23d41
Reviewed-on: https://chromium-review.googlesource.com/1043096
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53445}
2018-05-30 16:01:59 +00:00
Alexey Kozyatinskiy
6d87d95785 [inspector] use interrupt for pause only as last resort
With this CL we use interrupt for pause in two cases:
- when we process Debugger.pause on interruption,
- when we would like to break as soon as possible after OOM.
In all other cases, e.g. for async step into we use break
on function call by calling StepIn debugger action.

In mentioned cases we should not actually use interrupt as well:
- Debugger.pause in this case scheduled using interrupt and we
  may just break right now without requesting another interrupt,
  unfortunately blink side is not ready,
- we should use more reliable way to break right after near OOM
  callback, otherwise we can get this callback, increase limit,
  request break on next interrupt, before interrupt get another
  huge memory allocation and crash.

There are couple advantages:
- we get much better break locations for async stepping
  (see inspector tests expectations),
- we can remove DEBUG_BREAK interruption
  (it should speedup blackboxing with async tasks, see
  removed todo in debug.cc for details)
- it is required preparation step for async step out,
  (see https://chromium-review.googlesource.com/c/v8/v8/+/1054618)

Bug: v8:7753
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iabd7627dbffa9a0eab1736064caf589d02591926
Reviewed-on: https://chromium-review.googlesource.com/1054155
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53439}
2018-05-30 13:54:37 +00:00
Camillo Bruni
f3131cef16 [js-perf-test] Fix benchmark suite
Add missing parameters to createSuiteWithWarmup

Change-Id: I8865f162443b43b8b7bee4680e17c34d397f8d53
Reviewed-on: https://chromium-review.googlesource.com/1078747
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53438}
2018-05-30 11:47:25 +00:00
Ben L. Titzer
200dcb0557 Add size estimate to Managed<T>
Extends the functionality of Managed<T> to track an estimated size
for the external memory associated with an instance of Managed<T>
in order to allow for proper accounting in the garbage collector.

R=mstarzinger@chromium.org
CC=ulan@chromium.org

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I8c49c6245eaf267c9264ebb93b43d5dfbf4671fd
Reviewed-on: https://chromium-review.googlesource.com/1076332
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53433}
2018-05-30 10:26:21 +00:00
jgruber
70b5fd3b6e [api] Add option to consume code cache on module compilation
This extends the ScriptCompiler::CompileModule function with a
CompileOptions argument. Accepted values are kNoCompileOptions (in
which case, behavior remains unmodified) and kConsumeCodeCache. If the
latter is passed, we try to fetch the given module from the code
cache.

Since it is possible to compile the same source code as both a script
and a module (and different code is generated for the two cases), a
new is_module bit is added to the SerializedCodeData header to
disambiguate between the two cases.

Bug: v8:7685
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I34b3642505577ed9ed0caedbee5876308c5a53ea
Reviewed-on: https://chromium-review.googlesource.com/1073327
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53432}
2018-05-30 07:32:48 +00:00
Simon Zünd
0dbac434af [js-perf-test] Make regress-2185-2 test into a benchmark.
The regression test 2185-2 measured the Array.p.sort time for various
pre-sorted data configurations. This CL adds the various data
configurations to the ArraySortPreSorted benchmark and removes the
regression test altogether.

R=cbruni@chromium.org, jgruber@chromium.org

Change-Id: I6e2eb235e4a7578f4a107229bfc6a9e89a3aa5e3
Reviewed-on: https://chromium-review.googlesource.com/1076188
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53420}
2018-05-29 15:56:58 +00:00
Mathias Bynens
dd78d60359 Ship Array.prototype.{flat,flatMap} 🎉
Intent to ship:
https://groups.google.com/d/msg/v8-users/15GL4-UHEcE/OEKOou3bBgAJ

Bug: v8:7220
Change-Id: Ib1efde29e27b956db3d8ebf12ff7a3f163db7c22
Reviewed-on: https://chromium-review.googlesource.com/1076335
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53419}
2018-05-29 15:44:18 +00:00
Camillo Bruni
f728d6984d [js-perf-test] Consistently use createSuite in all benchmarks
Change-Id: I7bf0144bacd0572a42b98d0a0f19df3daf63128b
Bug: chromium:840785
Reviewed-on: https://chromium-review.googlesource.com/1051240
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53418}
2018-05-29 15:06:48 +00:00
Simon Zünd
9ef4df2f30 [torque] Add unsafe cast to Torque.
This CL is a proposal to add "checked" casts (CAST in CSA) to the Torque language.
The CL adds the "unsafe_cast<>" operator that emits a "CAST".

Example:

let n: Number = ...;
...
if (TaggedIsSmi(n)) {
  let m: Smi = unsafe_cast<Smi>(n);
  ...
}

The cast wont incur a runtime overhead now.

R=tebbi@chromium.org

Change-Id: I9fca90d1d11e61617ba0270e5022fd66200e2195
Reviewed-on: https://chromium-review.googlesource.com/1070151
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53416}
2018-05-29 14:59:58 +00:00
Anna Henningsen
0fd549f885 [api] Allow escaping MaybeLocal handles on EscapableHandleScope
This adds a convenience overload for `EscapableHandleScope::Escape()`
which moves `MaybeLocal<T>`s into the outer scope, like a regular
`Local<T>`.

This basically moves the syntactic clutter of having to write
`maybe_local.FromMaybe(Local<Foo>())` instead of just `maybe_local`
to a central location.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I1d87d75c6564b10e8ec34957bdd3eac46ffea917
Reviewed-on: https://chromium-review.googlesource.com/1056529
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53415}
2018-05-29 14:51:18 +00:00
Sebastien Marchand
df2419039c Fix a Jumbo breakage
see crbug.com/841460 , we recently hit some build issues when using
Goma + jumbo builds because of a conflict on the definition of CONST,
v8 defines it in globals.h and including windows.h also defines it. It
should be possible to fix this by adding a bunch of #undef CONST but it
seems a little bit hacky and might not always work (this could only fix
the problem temporary if the jumbo merge limit changes and cause some
include files to get included in a different order).

Renaming the v8 definition of CONST to kConst, this follows the
style guide guidelines: "there is no reason to change old code to use
constant-style names, unless the old names are actually causing a
compile-time problem"
(https://google.github.io/styleguide/cppguide.html#Enumerator_Names)

I also had to turn the PropertyConstness enum into an enum class to
avoid some conflicts (both PropertyConstness and VariableMode define
kConst).


Bug: chromium:841460
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2b70b9095374e88a5ae364cc557b39f20a3ab60f
Reviewed-on: https://chromium-review.googlesource.com/1064197
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53413}
2018-05-29 14:36:48 +00:00
Marja Hölttä
57cc9eaeb1 [in-place weak refs] Remove WeakFixedArray::Shrink.
WeakFixedArray::Shrink is fragile when not used properly (might invalidate GC
bookeeping (location of weak slots)).

BUG=v8:7308

Change-Id: Id84329e2a78907f5f0bfafae32fc2a71b77edbe7
Reviewed-on: https://chromium-review.googlesource.com/1076236
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53410}
2018-05-29 13:44:57 +00:00
Michael Starzinger
f4b23239df [wasm] Add missing WebAssembly.instantiate regression test.
R=titzer@chromium.org
TEST=mjsunit/regress/wasm/regress-799952
BUG=chromium:799952

Change-Id: Idb4a1938cc04f2f5b1ea33ba390c5917fea2c0c1
Reviewed-on: https://chromium-review.googlesource.com/1075967
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53402}
2018-05-29 10:37:32 +00:00
jgruber
3e57261399 [builtins] Move remaining Array constructor stubs to builtins
Calls from embedded builtins to stubs are expensive due to the
indirection through the builtins constants table. This moves
all remaining Array constructor stubs to builtins.

Bug: v8:6666
Change-Id: I5989a7480697a506a1bae1929ddd2e3f1d655048
Reviewed-on: https://chromium-review.googlesource.com/1074759
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53399}
2018-05-29 09:48:21 +00:00
Michael Lippautz
307ebc35fa Revert "[infra] Add gc_stats variant to Linux64 debug bot"
This reverts commit e839484ebe.

Reason for revert: https://ci.chromium.org/buildbot/client.v8/V8%20Linux64%20-%20debug/22300

Original change's description:
> [infra] Add gc_stats variant to Linux64 debug bot
> 
> No-try: true
> Bug: v8:7760
> Change-Id: I2a4e91b58de4387a4bfa5b79681db25880af8954
> Reviewed-on: https://chromium-review.googlesource.com/1068643
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53394}

TBR=machenbach@chromium.org,mlippautz@chromium.org

Change-Id: I7342341fb63742de4e51c0df65e8323f2a6dbd7a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7760
Reviewed-on: https://chromium-review.googlesource.com/1075927
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53395}
2018-05-29 06:13:07 +00:00
Michael Lippautz
e839484ebe [infra] Add gc_stats variant to Linux64 debug bot
No-try: true
Bug: v8:7760
Change-Id: I2a4e91b58de4387a4bfa5b79681db25880af8954
Reviewed-on: https://chromium-review.googlesource.com/1068643
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53394}
2018-05-29 05:46:26 +00:00
Igor Sheludko
7a45af140e [ptr-compr] Unify SmiTag/SmiUntag operations in hand-written assembly code.
The result of SmiUntag is a sign-extended word-size value.

Bug: v8:7703
Change-Id: I85dc87b541cab78286e47e2147c16c6a0939f509
Reviewed-on: https://chromium-review.googlesource.com/1073232
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53389}
2018-05-28 14:27:27 +00:00