Commit Graph

47289 Commits

Author SHA1 Message Date
Jungshik Shin
c6d2daace3 Skip two tests temporarily to prepare for ICU roll
Rolling ICU to include the following CLs will make the two tests
below pass unexpectedly.
   https://chromium-review.googlesource.com/c/chromium/deps/icu/+/1026797

   intl402/language-tags-canonicalized.js
   intl402/Intl/preferred-variants.js

Mark them as skipped for now. Will remove from the status file when
the following v8 CL is submitted after ICU is rolled.

 https://chromium-review.googlesource.com/c/v8/v8/+/1023379

Bug: v8:7669, v8:5693
Test: The above tests
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Iae2ab0076b3dfcf45b8940c0d294cb3371463654
Reviewed-on: https://chromium-review.googlesource.com/1028655
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52797}
2018-04-25 20:40:39 +00:00
Jungshik Shin
f2974002ec TimeClip before formatting in Intl.DateTimeFormat
https://github.com/tc39/ecma402/pull/194 requires that
TimeClip be called before formatting in Intl.DateTimeFormat.

Bug: v8:7471
Test: test262/intl402/DateTimeFormat/prototype/format/time-clip*
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Iad80376ae7598aab3e4df84a6cbbcd8691e16e09
Reviewed-on: https://chromium-review.googlesource.com/1027442
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52796}
2018-04-25 20:17:29 +00:00
Aleksey Kozyatinskiy
9a7c4bfe1e Revert "[elements] Improve Array.prototype.splice speed"
This reverts commit dcdabdc86a.

Reason for revert: broke tsan.

Original change's description:
> [elements] Improve Array.prototype.splice speed
> 
> By using memmove for SMI elements we get a roughly 3x speedup over the slower
> iterative copying with write barriers.
> 
> Bug: chromium:835558
> Change-Id: I73da07a1648a3495ff78212ffa1ed949d205a7d2
> Reviewed-on: https://chromium-review.googlesource.com/1028236
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52792}

TBR=cbruni@chromium.org,ishell@chromium.org

Change-Id: I77c46fe3d47d651de3c39df9fbf5f30c340188e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:835558
Reviewed-on: https://chromium-review.googlesource.com/1028337
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52795}
2018-04-25 19:46:50 +00:00
Ben Smith
9166affb29 [wasm] Implement importing mutable globals
The WasmInstanceObject stores two new arrays:

- imported_mutable_globals_buffers_: a FixedArray of all the imported
  globals' array buffers.
- imported_mutable_globals: a calloc'd array of Addresses pointing to
  the mutable global in its array buffer.

When accessing the global, the generated code looks up the address in
imported_mutable_globals to find where to load/store.

Bug: v8:7625
Change-Id: I60844c21a788fce28f346455f10f2283d1c152e9
Reviewed-on: https://chromium-review.googlesource.com/1020602
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52794}
2018-04-25 18:57:48 +00:00
Alexey Kozyatinskiy
e81b0db787 [runtime] added v8::Isolate::SafeForTerminationScope and isolate flag
When only_terminate_in_safe_scope flag is passed as CreateParams for
v8::Isolate, V8 does not trigger intrruption for termination if there
is no explicit SafeForTerminationeScope.
Scope enables termination only in direct v8 calls, any recursive calls
require explicit SafeForTerminationScope.

R=yangguo@chromium.org

Bug: chromium:820640
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iac17e30a4b47aa84e70e9218ca0adca9d07f726e
Reviewed-on: https://chromium-review.googlesource.com/1025390
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52793}
2018-04-25 18:11:58 +00:00
Camillo Bruni
dcdabdc86a [elements] Improve Array.prototype.splice speed
By using memmove for SMI elements we get a roughly 3x speedup over the slower
iterative copying with write barriers.

Bug: chromium:835558
Change-Id: I73da07a1648a3495ff78212ffa1ed949d205a7d2
Reviewed-on: https://chromium-review.googlesource.com/1028236
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52792}
2018-04-25 17:41:31 +00:00
Camillo Bruni
a3142476ba [runtime] Do not refer directly to the closure stored in the context
This is is a preparatory CL to detach the JSFunction from the Context.
We mainly rewrite the DebugScopeInterator to no longer rely on the a
JSFunction to be around. Additionally the empty_function needs to have
a proper ScopeInfo now.

Drive-by-fix: Improve ScopeInfo debug printing

Bug: v8:7066
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2f2fa0e78914a12e076384e0e1234c2322ad1ee8
Reviewed-on: https://chromium-review.googlesource.com/918721
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52791}
2018-04-25 17:24:02 +00:00
Camillo Bruni
e570e67383 [heap][elements] Improve Array.prototype.splice speed
- 30% speedup by adding HeapObject shortcut for Heap::InNewSpace

Bug: chromium:835558
Change-Id: I48b5ec43a5ecdd7d82827c955ab418fdeff449d8
Reviewed-on: https://chromium-review.googlesource.com/1027471
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52790}
2018-04-25 17:00:46 +00:00
Ben Smith
6a50560650 [wasm] Implement WebAssembly.Global import/export
The mutable-globals proposal spec allows importing as Numbers or
WebAssembly.Global values, but always exports as WebAssembly.Global.

Since the value is always boxed, we can also import/export i64 values.

This CL also includes support for export of mutable globals. Since the
underlying ArrayBuffer that stores the global's value is shared between
the module and the WebAssembly.Global object, all that needs to be done
is remove the validation check.

Bug: v8:7625
Change-Id: I24d763e3bc193d229a7cc33b2f2690a473c6f2bc
Reviewed-on: https://chromium-review.googlesource.com/1018406
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52789}
2018-04-25 16:54:06 +00:00
Andrew Grieve
68f2e52059 build_gn.py: Forward BUNDLED_WIN_TOOLCHAIN_ROOT
And tweak --depot-tools to go first on PATH

Change-Id: Iee53d84fd028ac0c2de6f872184cbce51e84c54f
Reviewed-on: https://chromium-review.googlesource.com/1028210
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52788}
2018-04-25 16:13:13 +00:00
Kim-Anh Tran
5ef33ea5a2 [wasm] Update counters after tier-up
Statistics need to be updated after top-tier code is added to
the native module.

Change-Id: Ie3a76caf233a2c3929b40fd0371c3069724b5289
Reviewed-on: https://chromium-review.googlesource.com/1027854
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Cr-Commit-Position: refs/heads/master@{#52787}
2018-04-25 15:30:02 +00:00
Camillo Bruni
76cab5ff78 Fix Object.entries/.values with non-enumerable properties
Iterate over all descriptors instead of bailing out early and missing
enumerable properties later.

Bug: chromium:836145
Change-Id: I104f7ea89480383b6b4b9204942a166bdf8e0597
Reviewed-on: https://chromium-review.googlesource.com/1027832
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52786}
2018-04-25 13:44:32 +00:00
Clemens Hammacher
52f07582e0 [Liftoff] Implement i64 division and remainder
This adds support for i64.div_s, i64.div_u, i64.rem_s, and i64.rem_u.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: I37e564684b278c8d2f664a859851c67f4bd83190
Reviewed-on: https://chromium-review.googlesource.com/1027612
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52785}
2018-04-25 12:59:11 +00:00
Clemens Hammacher
7f78e75a72 [Liftoff] Implement the select opcode
R=ahaas@chromium.org

Bug: v8:6600
Change-Id: Iaa46324dfcf3b20f42d6a7448fca9ef2bbf241e9
Reviewed-on: https://chromium-review.googlesource.com/1027851
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52784}
2018-04-25 12:41:06 +00:00
Predrag Rudic
8a712b007c MIPS [Liftoff] Add missing case for Load
Change-Id: Ide0b3cab6c1cdb6cbb1b189852b309e08c1c504f
Reviewed-on: https://chromium-review.googlesource.com/1028010
Reviewed-by: Sreten Kovacevic <sreten.kovacevic@mips.com>
Commit-Queue: Sreten Kovacevic <sreten.kovacevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#52783}
2018-04-25 12:31:31 +00:00
Sigurd Schneider
6435107583 [turbofan] Move Date.now/Date.p.getTime to JSCallReducer
This CL also introduces an effect dependent simplified operator
DateNow and associated lowerings.

Bug: v8:7340, v8:7250
Change-Id: Icd4a8c3c45a8dbe7ef490fc3ee68c0c68bbed011
Reviewed-on: https://chromium-review.googlesource.com/1024836
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52782}
2018-04-25 12:06:01 +00:00
Andreas Haas
068e40d588 [wasm] Update spec tests
R=titzer@chromium.org

Change-Id: I8cd8035cbe0b2703e8aa8ed2b2492023edf2b91e
Reviewed-on: https://chromium-review.googlesource.com/1026674
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52781}
2018-04-25 12:02:21 +00:00
Andreas Haas
2f0a78ab75 [test] Disable pause-on-oom in no_snap
TBR=machenbach@chromium.org

Bug: v8:7631
No-Tree-Checks: true
No-Try: true
Change-Id: Iace8fae7fcbdd1766394ee30d0c1e54f3a29e2b9
Reviewed-on: https://chromium-review.googlesource.com/1027852
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52780}
2018-04-25 11:50:21 +00:00
Kim-Anh Tran
074429a429 [wasm] Create runtime objects directly after compilation finishes
We want to ensure that all runtime objects are created as soon as
compilation finishes. Instead of scheduling another foreground thread
to create these runtime objects, we now call it directly from the already
executing foreground thread.

Change-Id: I9e8f47dba237de16e0bac119f1649496c8525b37
Reviewed-on: https://chromium-review.googlesource.com/1027712
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Cr-Commit-Position: refs/heads/master@{#52779}
2018-04-25 11:48:51 +00:00
Michael Achenbach
5092a8a6e9 Whitespace change to trigger bots
Infra sanity testing after https://crrev.com/c/1019080

TBR=santa

Change-Id: I7cadb6991ed2d9903f8cdd4d21e97f5a058eadf0
Reviewed-on: https://chromium-review.googlesource.com/1027830
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52778}
2018-04-25 11:45:31 +00:00
Andreas Haas
2a3c2c73d5 Reland: [refactoring] Remove the isolate from signatures of ExternalReferences
I missed one required change which was hidden behind an #if. The fix is in
the diff between Patch 1 and Patch 3.

Original message:
In this CL I remove the isolate from signatures of ExternalReference
accessor functions where the isolate is not used. The uses of the
isolate were already removed in previous CLs.

Changes:
* I split the ExternalReference list in external-reference.h into
those which need the isolate for initialization and those which do not.

* I removed the public constructors and replaced them by
  ExternalReference::Create(). The reason is to separate external
  creation more clearly from internal creation, because externally
  created ExternalReferences sometimes need redirection, whereas
  internally created ExternalReferences are just stored as they are.
  In addition, by removing the isolate from the signature of the
  public constructors, they suddenly exactly matched the interal
  constructor.

* Replace all uses of the public constructors with
  ExternalReference::Create().

* Remove the isolate from all call sites where necessary.


This is a step towards making WebAssembly compilation independent of
the isolate.

R=mstarzinger@chromium.org

Bug: v8:7570
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I750c162f5d58ed32e866722b0db920f8b9bd8057
Reviewed-on: https://chromium-review.googlesource.com/1026673
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52777}
2018-04-25 09:47:30 +00:00
Simon Zünd
3ea1ad234c [typedarray] Implement TypedArray.p.sort using Torque.
This CL implements TypedArray.p.sort in Torque. The Torque
version works basically the same as the existing JS builtin:

When no comparison function is provided, the C++ fast path builtin
is used. Otherwise a quicksort written in Torque is used, with
a InsertionSort fallback for smaller arrays.

The JS quicksort implementation also containes a more elaborate
third pivot calculation for larger arrays. This is currently not done.

Reported benchmark results are only for those, where a custom
comparison function is provided. The numbers for the C++ path stayed
the same.

Benchmark   Current (JS)       Torque    Speedup

IntTypes            83.9        263.7        3.1
BigIntTypes         32.1         54.6        1.7
FloatTypes          99.3        138.7        1.4

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

Bug: v8:7382
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I7abe7ceff525bab24f302d2f06b5961cca770d24
Reviewed-on: https://chromium-review.googlesource.com/1021691
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52776}
2018-04-25 09:03:40 +00:00
Predrag Rudic
2393710a27 [bigint] Add big endian support for BigInts serialization
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3fc1b53c43e53e12e041178912f372f33068d67c
Reviewed-on: https://chromium-review.googlesource.com/1023418
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52775}
2018-04-25 08:29:20 +00:00
Georg Neis
a12413531d [modules] Anticipate stack overflow when traversing module graph.
Bug: chromium:836124
Change-Id: I82d29408476c9c5b2c62a6368f32575e33932ef3
Reviewed-on: https://chromium-review.googlesource.com/1025890
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52774}
2018-04-25 08:20:10 +00:00
Simon Zünd
44a000fd4b [torque] Add negative decimal literals.
This CL changes the DECIMAL_LITERAL lexer rule to allow
negative decimal literals as well.

This could also be achieved by using the unary minus operation,
which would occur an runtime overhead and feel counter-intuitive
for literals (imho).

R=tebbi@chromium.org

Change-Id: Ib01aa1930254bcd85a161de385b0fd4f176feb46
Reviewed-on: https://chromium-review.googlesource.com/1027473
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#52773}
2018-04-25 07:54:40 +00:00
Jaroslav Sevcik
549a3143d5 [turbofan] Prepare the Type class for UB treatment.
This is just code reshuffling to enable changing Type* to Type.

Bug: v8:3770
Change-Id: I8ed4ff41b480cab377d115c57c49d6f6c0c46d6d
Reviewed-on: https://chromium-review.googlesource.com/1025897
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52772}
2018-04-25 06:48:19 +00:00
jing.bao
2aa995bf9b [wasm]implement simd lowering for packing integer conversions
I16x8SConvertI32x4, I16x8UConvertI32x4,
I8x16SConvertI16x8, I8x16UConvertI16x8

Change-Id: Iab462c3fb6c60de7b54a925e438862362605fe8d
Reviewed-on: https://chromium-review.googlesource.com/1016178
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52771}
2018-04-25 02:16:48 +00:00
Erik Luo
9b3dafb99a [debug] expose SideEffectType when setting template accessors
This expands the SideEffectType flag to cover whitelisting embedder
callbacks that are setup with Template accessors.

- v8::ObjectTemplate::SetNativeDataProperty
- v8::ObjectTemplate::SetLazyDataProperty
- v8::ObjectTemplate::SetAccessor

Bug: v8:7515
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ieda6c793141ab249c4f41d00e6572fe2a29ac629
Reviewed-on: https://chromium-review.googlesource.com/1015896
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52770}
2018-04-24 22:52:48 +00:00
Andreas Haas
7bfed2ad42 Revert "[refactoring] Remove the isolate from signatures of ExternalReferences"
This reverts commit 44ea425ab1.

Reason for revert: https://ci.chromium.org/buildbot/client.v8.ports/V8%20Arm%20-%20debug%20builder/13575

Original change's description:
> [refactoring] Remove the isolate from signatures of ExternalReferences
> 
> In this CL I remove the isolate from signatures of ExternalReference
> accessor functions where the isolate is not used. The uses of the
> isolate were already removed in previous CLs.
> 
> Changes:
> * I split the ExternalReference list in external-reference.h into
> those which need the isolate for initialization and those which do not.
> 
> * I removed the public constructors and replaced them by
>   ExternalReference::Create(). The reason is to separate external
>   creation more clearly from internal creation, because externally
>   created ExternalReferences sometimes need redirection, whereas
>   internally created ExternalReferences are just stored as they are.
>   In addition, by removing the isolate from the signature of the
>   public constructors, they suddenly exactly matched the interal
>   constructor.
> 
> * Replace all uses of the public constructors with
>   ExternalReference::Create().
> 
> * Remove the isolate from all call sites where necessary.
> 
> 
> This is a step towards making WebAssembly compilation independent of
> the isolate.
> 
> Bug: v8:7570
> R=​mstarzinger@chromium.org
> 
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: I14f511fc6acc50ab2d6a6641299f5ddbeabef0da
> Reviewed-on: https://chromium-review.googlesource.com/1018982
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52768}

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

Change-Id: I7c0d8d420f815cede23d550dee8942ac4d7791cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7570
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1026570
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52769}
2018-04-24 20:02:00 +00:00
Andreas Haas
44ea425ab1 [refactoring] Remove the isolate from signatures of ExternalReferences
In this CL I remove the isolate from signatures of ExternalReference
accessor functions where the isolate is not used. The uses of the
isolate were already removed in previous CLs.

Changes:
* I split the ExternalReference list in external-reference.h into
those which need the isolate for initialization and those which do not.

* I removed the public constructors and replaced them by
  ExternalReference::Create(). The reason is to separate external
  creation more clearly from internal creation, because externally
  created ExternalReferences sometimes need redirection, whereas
  internally created ExternalReferences are just stored as they are.
  In addition, by removing the isolate from the signature of the
  public constructors, they suddenly exactly matched the interal
  constructor.

* Replace all uses of the public constructors with
  ExternalReference::Create().

* Remove the isolate from all call sites where necessary.


This is a step towards making WebAssembly compilation independent of
the isolate.

Bug: v8:7570
R=mstarzinger@chromium.org

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I14f511fc6acc50ab2d6a6641299f5ddbeabef0da
Reviewed-on: https://chromium-review.googlesource.com/1018982
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52768}
2018-04-24 18:39:27 +00:00
Eric Holk
45dd38c167 [wasm] Add metrics for Wasm memory allocation
This adds two new UMA histograms to give us more insight into Wasm
memory allocation.

The first records the result of every attempt to to allocate a Wasm
backing store. This will let us know things like how often we
explicitly trigger a GC, or how often we hit our address space limit.

The second records how many megabytes of address space Wasm reserves.
A sample is added every time the number either increases or decreases.
This metric will give us a sense of how many outstanding Wasm memories
there are in typical usage.

Change-Id: I38c1bc1ad915c26b6cda3c373ededdd395193a4c
Reviewed-on: https://chromium-review.googlesource.com/1024646
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52767}
2018-04-24 18:08:37 +00:00
Sathya Gunasekaran
238dff2664 [hashtable] Move FindOrderedHashTableEntry to CSA
... from BaseCollectionsAssembler

Bug: v8:7569
Change-Id: I938257b18372bbe8a43af3f25c85d192950be8fa
Reviewed-on: https://chromium-review.googlesource.com/1026053
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52766}
2018-04-24 16:30:18 +00:00
Sathya Gunasekaran
cec163026a [hashtable] Move ordered hash table allocation to CSA
.. from BaseCollectionsAssembler

Bug: v8:7569
Change-Id: I87fd35dbd82ad5752c857f35b63403ca348bf305
Reviewed-on: https://chromium-review.googlesource.com/1024700
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52765}
2018-04-24 16:20:27 +00:00
Clemens Hammacher
75922ead2b [Liftoff] Implement i32.rem_u and i32.rem_s
This adds support for i32.rem_u and i32.rem_s, implemented on ia32 and
x64.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: Id08a51f7a0dcb7a1ed43c5a97be7a7dafff85397
Reviewed-on: https://chromium-review.googlesource.com/1023932
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52764}
2018-04-24 16:15:37 +00:00
Dan Elphick
75288a03be [torque] Use StringConstant when generating strings
Use StringConstant instead of NewStringFromAsciiChecked so strings are
deduplicated.

Change-Id: I0c5395be6d06caacd7d257b61bd2372da2fce427
Reviewed-on: https://chromium-review.googlesource.com/1025815
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52763}
2018-04-24 15:45:39 +00:00
Clemens Hammacher
6e83096491 [cleanup] Use CodeReference in Disassembler
This avoids some code duplication.

R=mstarzinger@chromium.org

Bug: v8:7570
Change-Id: Ib8f9095945e688e24351529f8e782614453f2161
Reviewed-on: https://chromium-review.googlesource.com/1023416
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52762}
2018-04-24 14:35:38 +00:00
Andrew Grieve
09027e6ca5 Node integration: Split build_gn.py into two steps (generate vs build)
Makes builds go faster by not having to re-run "gn gen" unnecessarily

Also adds a bunch of flags that configure uses.
  --max-load
  --max-jobs
  --extra-gn-args
  --depot-tools
  --bundled-win-toolchain

NOTRY=true
NOTREECHECKS=true

Change-Id: I6555623468d2b11d188ca29563586f5ea9b4dda9
Reviewed-on: https://chromium-review.googlesource.com/1016582
Commit-Queue: agrieve <agrieve@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52761}
2018-04-24 14:21:58 +00:00
Andrew Grieve
dd69a17a9b Node integration: Update fetch_deps.py to return depot_tools path
NOTRY=true
NOTREECHECKS=true

Change-Id: I6a9f671a9c3db4fb2eb346ccdf80a10d3e7a5040
Reviewed-on: https://chromium-review.googlesource.com/1025952
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52760}
2018-04-24 14:13:38 +00:00
Kim-Anh Tran
e47072c97a [wasm] Basic wasm tier-up
Wasm tier-up first compiles the whole module using Liftoff, and then
using Turbofan. The idea is to achieve fast start-up times by first
running Liftoff-compiled code. In the meantime we finish compilation
with Turbofan, and replace the Liftoff-compiled code as soon
as Turbofan finished compilation, thus achieving high performance.
Tier-up is enabled through the flag FLAG_wasm_tier_up.

Bug: v8:6600
Change-Id: I70552969c53d909a591666a1e7ce1ee1419b2f34
Reviewed-on: https://chromium-review.googlesource.com/1010422
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52759}
2018-04-24 13:56:23 +00:00
Andreas Haas
3a56441a8c [wasm][cleanup] Move ValueType into its own header file
This CL splits the definition of ValueType and its helper functions
into its own header file.

R=clemensh@chromium.org

Bug: v8:7570
Change-Id: I3aa776edb45839d7d38836e131df45732c685310
Reviewed-on: https://chromium-review.googlesource.com/1021810
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52758}
2018-04-24 13:55:18 +00:00
Sigurd Schneider
5043ab6fba [turbofan] Move Array.isArray to JSCallReducer/JSTypedLowering
This CL introduces a JSOperator for Array.isArray and moves the
corresponding lowering to JSCallReducer and JSTypedLowering.

Bug: v8:7340, v8:7250
Change-Id: Iaa7ced2ad34bec8cccc9da1041007261168cf4b3
Reviewed-on: https://chromium-review.googlesource.com/1025092
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52757}
2018-04-24 13:54:13 +00:00
Sigurd Schneider
e698cd3633 [deoptimizer] Improve readability of debug output
Bug: v8:7679
Change-Id: If8b6d9ad4f93eb2b98878c916625b7a344e5900c
Reviewed-on: https://chromium-review.googlesource.com/1021532
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52756}
2018-04-24 13:49:08 +00:00
Andreas Haas
49712d8acf [wasm] Call AsyncInstantiate directly when instantiating a module object
WebAssembly.instantiate is polymorphic, it can either take a module
object as parameter, or a buffer source which should be compiled first.
To share code between the two implementations, the module object was
first passed to a promise (i.e. which is the result of compilation).
However, passing the module object to a promise has a side effect if
the module object has a then function. To avoid this side effect I
remove this code sharing and call AsyncInstantiate directly in case
the parameter is a module object.

R=mstarzinger@chromium.org

Bug: chromium:836141
Change-Id: I67b76d0d7761c5aeb2cf1deda45b6842e494eed4
Reviewed-on: https://chromium-review.googlesource.com/1025774
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52755}
2018-04-24 13:01:18 +00:00
Clemens Hammacher
ba864684e7 [wasm] Fix remaining external refs to take Address
Passing a pointer of the needed type, and then reading using
ReadUnalignedValue is pointless, since the compiler can assume
alignment of the pointer value.
This CL fixes the remaining external refs of wasm to take an Address to
a single buffer.

R=ahaas@chromium.org

Bug: v8:7570, v8:3770
Change-Id: If8a7324a4703e1e900cb3c5644baef207e6a371d
Reviewed-on: https://chromium-review.googlesource.com/1023406
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52754}
2018-04-24 12:35:28 +00:00
Kenton Varda
b49206ded9 ThreadDataTable: Change global linked list to per-Isolate hash map.
For use cases with a large number of threads or a large number of isolates (or
both), ThreadDataTable can be a major performance bottleneck due to O(n)
lookup time of the linked list. Switching to a hash map reduces this to O(1).

Example 1: Sandstorm.io, a Node.js app that utilizes "fibers", was observed
spending the majority of CPU time iterating over the ThreadDataTable.
See: https://sandstorm.io/news/2016-09-30-fiber-bomb-debugging-story

Example 2: Cloudflare's Workers engine, a high-multi-tenancy web server
framework built on V8 (but not Node), creates large numbers of threads and
isolates per-process. It saw a 34x improvement in throughput when we applied
this patch.

Cloudflare has been using a patch in production since the Workers launch which
replaces the linked list with a hash map -- but still global.

This commit builds on that but goes further and creates a separate hash map
and mutex for each isolate, with the table being a member of the Isolate
class. This avoids any globals and should reduce lock contention.

Bug: v8:5338
Change-Id: If0d11509afb2e043b888c376e36d3463db931b47
Reviewed-on: https://chromium-review.googlesource.com/1014407
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52753}
2018-04-24 10:01:26 +00:00
Marja Hölttä
705d34e691 [torque] iwyu
BUG=v8:7490

Change-Id: I03421657d4abc3cd6e27ffafa6b922ea0e83b2b4
Reviewed-on: https://chromium-review.googlesource.com/1016381
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52752}
2018-04-24 08:58:20 +00:00
Daniel Clifford
480cc98950 Fix Torque memory leaks identified by ASAN
Bug: v8:7666
Change-Id: Ida9b6f964261bad75a4eb5d567ad37ec82569bcc
Reviewed-on: https://chromium-review.googlesource.com/1023061
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52751}
2018-04-24 08:40:50 +00:00
Marja Hölttä
ba40d7c2b6 [reland] [csa] Add TNode<MaybeObject>.
LoadMaybeWeakField returns a TNode<MaybeObject>, and the only way to extract
values from it is through explicit functions.

Previous version: https://chromium-review.googlesource.com/1014106

BUG=v8:7308

Change-Id: I73bf3a007733ed84937e45336ac142011adc5151
Reviewed-on: https://chromium-review.googlesource.com/1023935
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52750}
2018-04-24 08:22:26 +00:00
Ingvar Stepanyan
1c23f888a1 Cleanup NewFunctionFromSharedFunctionInfo
NewFunctionFromSharedFunctionInfo is not called with `undefined`
anymore, and so can be changed to just accept `Handle<Context>`.

Additionally, reporting script compilation to the debugger can now
be moved into `Compiler::PostInstantiation`.

R=yangguo@chromium.org

Change-Id: I0a9b3fa51f87f41b4fc97a29f79c110c6246f273
Reviewed-on: https://chromium-review.googlesource.com/1024832
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52749}
2018-04-24 08:20:40 +00:00
Benedikt Meurer
7f8e83b56d [builtins] Properly reject immediately throwing thenables.
Bug: chromium:830565
Change-Id: I1adab76e790a81f51f7b03165962992f5afecc99
Reviewed-on: https://chromium-review.googlesource.com/1023400
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52748}
2018-04-24 07:55:00 +00:00