Commit Graph

47254 Commits

Author SHA1 Message Date
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
Erik Luo
363996f7ab [inspector] whitelist side-effect-free console API callbacks
This CL whitelists Console Command Line API callbacks on the V8 side.

Bug: chromium:810176
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7afdd6bd4263cb4cb18bdf02b37ab3e822ae5c96
Reviewed-on: https://chromium-review.googlesource.com/1016094
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52747}
2018-04-23 22:06:07 +00:00
Vincent Belliard
bca2b694f9 [Liftoff] Add LiftoffStackSlots
On AArch64, we can't push arguments one by one because sp must always be 16 byte aligned.
This patch adds a LiftoffStackSlots class which holds everything which has to be pushed.
This way, on AArch64, we will be able to reserve the needed space and eventually add some padding. Then, all pushes will be converted to stores into this reserved space.

Bug: v8:6600

Change-Id: I17480fb841f16e07356b35326c59e3c7f03ed012
Reviewed-on: https://chromium-review.googlesource.com/1023977
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52746}
2018-04-23 20:59:17 +00:00
Alexey Kozyatinskiy
f2b5a6da4e [inspector] added Debugger.setBreakpointOnFunctionCall
This function can be used to set breakpoint on any function call,
including native functions without source code, for them new method is
only one way to set breakpoint.

R=dgozman@chromium.org

Bug: chromium:828076
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iae8f4805b6e860a7ca008041fdfbe75e43a1959c
Reviewed-on: https://chromium-review.googlesource.com/1023128
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52745}
2018-04-23 20:36:47 +00:00
Eric Holk
94139bc6ac [wasm] Register trap handler data for lazily compiled functions
Bug: chromium:834693, chromium:834955
Change-Id: I243521f45c2b7e2457a37d34ab3629670d8fa39b
Reviewed-on: https://chromium-review.googlesource.com/1020361
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52744}
2018-04-23 18:30:24 +00:00
Alexey Kozyatinskiy
d3f6c6479f [runtime] implemented SafeForInterruptsScope
This CL introduced SafeForInterruptsScope. This scope overrides
outer PostponeInterruptsScopes:
- reschedule postponed interrupts if needed,
- allow requesting new interrupts.
As soon as scope removed interrupts are posponed if needed.

This scope will be:
- used to allow inspector to interrupt and terminate
  DebugeEvaluate::Local,
- exposed with new flag on Isolate to implement SafeForTerminationScope
  in blink.

R=yangguo@chromium.org

Bug: chromium:820640
Change-Id: I15befc10c2cee393d1e3be48cecb31ee14dae638
Reviewed-on: https://chromium-review.googlesource.com/1022969
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52743}
2018-04-23 17:53:55 +00:00
Sigurd Schneider
30be479711 Reland "[builtins] Separate species protectors for Array, TypedArray, Promise"
This is a reland of 5728b3fbc5

Original change's description:
> [builtins] Separate species protectors for Array, TypedArray, Promise
> 
> Previously, there was one species protector for Array, TypedArray and
> Promise. This CL splits the protector in three separate ones. This means
> that invalidating one of them does not have negative performance
> implications for the other ones.
> 
> Bug: chromium:835347, v8:7340
> Change-Id: Id84aa0071f17096192965264eb60ddadd1e8e73f
> Reviewed-on: https://chromium-review.googlesource.com/1023408
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52733}

Bug: chromium:835347, v8:7340
Change-Id: I0c0188a0723e206ddb362834bcf872b23cd7666d
Reviewed-on: https://chromium-review.googlesource.com/1023811
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52742}
2018-04-23 17:52:50 +00:00
Alexey Kozyatinskiy
f1e3051ef6 [inspector] consider object with embedder fields as non-temporary
Embedder may implement any non trivial logic using embedder fields,
e.g. creates wrappers lazily and store native pointer to native object
inside embedder fields.

R=yangguo@chromium.org

Bug: v8:7588
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Id14eb6e686f8945cb350cfe77e8a4b3c52c5ec5b
Reviewed-on: https://chromium-review.googlesource.com/1013404
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52741}
2018-04-23 17:40:40 +00:00
Aleksey Kozyatinskiy
dcf0456ca6 Revert "Roll third_party/inspector_protocol to 59ca26e"
This reverts commit bd7f5cf0ab.

Reason for revert: does not work well.

Original change's description:
> Roll third_party/inspector_protocol to 59ca26e
> 
> This roll includes:
>   - [inspector_protocol] first class citizien .pdl support
>   - [inspector_protocol] node uses script names inside own repository
> 
> + removed .json file
> 
> R=​pfeldman@chromium.org,yangguo@chromium.org
> 
> Bug: none
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: Idd87e80a3ce42198858ade4bcf6e6fec4b2f0731
> Reviewed-on: https://chromium-review.googlesource.com/804635
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52734}

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

Change-Id: I64cfa2740c03a2c15db1eb483212adec8f5f6a76
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/1024350
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52740}
2018-04-23 17:38:31 +00:00
Sigurd Schneider
519efef583 [deoptimizer] Manage input index in TranslatedFrame::iterator
This manages input_index directly in TranslatedFrame::iterator.
I think the overhead is low enough, expecially since all uses
of the iterator, except one, compute input_index anyway.

Bug: v8:7679
Change-Id: I7e5fc08ff23a49415265afd617248c55f4d95e19
Reviewed-on: https://chromium-review.googlesource.com/1021711
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52739}
2018-04-23 17:03:36 +00:00
Pierre Langlois
25acc255f7 [arm] Fix SplitAddImmediate test on Armv6.
The movw/movt instructions are only available since Armv7. One of the
disassembly tests was expecting these instructions when, on Armv6, we generate a
load literal.

Change-Id: I2b11894b5de748fc185f341b0cd49fa518d005e5
Reviewed-on: https://chromium-review.googlesource.com/978143
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52738}
2018-04-23 17:00:36 +00:00
Clemens Hammacher
340d2c0f61 [Liftoff] Implement i32.div_u and i32.div_s
This adds support for i32.div_u and i32.div_s, implemented on ia32 and
x64.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: I920fb0613ecba0021dab0936690415be88d666e9
Reviewed-on: https://chromium-review.googlesource.com/1021890
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52737}
2018-04-23 15:52:26 +00:00
Sigurd Schneider
75e282342c Revert "[builtins] Separate species protectors for Array, TypedArray, Promise"
This reverts commit 5728b3fbc5.

Reason for revert: Breaks noi18n build

Original change's description:
> [builtins] Separate species protectors for Array, TypedArray, Promise
> 
> Previously, there was one species protector for Array, TypedArray and
> Promise. This CL splits the protector in three separate ones. This means
> that invalidating one of them does not have negative performance
> implications for the other ones.
> 
> Bug: chromium:835347, v8:7340
> Change-Id: Id84aa0071f17096192965264eb60ddadd1e8e73f
> Reviewed-on: https://chromium-review.googlesource.com/1023408
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52733}

TBR=sigurds@chromium.org,bmeurer@chromium.org

Change-Id: Ied8b436e7991c759eb3b98702c142aa127a7e63c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:835347, v8:7340
Reviewed-on: https://chromium-review.googlesource.com/1024151
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52736}
2018-04-23 15:48:07 +00:00
Marja Hölttä
be88e1c6a7 Revert "[csa] Add TNode<MaybeObject>."
This reverts commit c823ca959e.

Reason for revert: test failures

Original change's description:
> [csa] Add TNode<MaybeObject>.
> 
> LoadMaybeWeakField returns a TNode<MaybeObject>, and the only way to extract
> values from it is through explicit functions.
> 
> BUG=v8:7308
> 
> Change-Id: I98da6b715527bb9976b4c78ed9caaa39fbcb3ed5
> Reviewed-on: https://chromium-review.googlesource.com/1014106
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52732}

TBR=marja@chromium.org,petermarshall@chromium.org,tebbi@chromium.org

Change-Id: Ie7ff36d39db1fedf668c21ed56532e364e93eca1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7308
Reviewed-on: https://chromium-review.googlesource.com/1024150
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52735}
2018-04-23 15:46:07 +00:00
Alexey Kozyatinskiy
bd7f5cf0ab Roll third_party/inspector_protocol to 59ca26e
This roll includes:
  - [inspector_protocol] first class citizien .pdl support
  - [inspector_protocol] node uses script names inside own repository

+ removed .json file

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

Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Idd87e80a3ce42198858ade4bcf6e6fec4b2f0731
Reviewed-on: https://chromium-review.googlesource.com/804635
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52734}
2018-04-23 15:29:16 +00:00
Sigurd Schneider
5728b3fbc5 [builtins] Separate species protectors for Array, TypedArray, Promise
Previously, there was one species protector for Array, TypedArray and
Promise. This CL splits the protector in three separate ones. This means
that invalidating one of them does not have negative performance
implications for the other ones.

Bug: chromium:835347, v8:7340
Change-Id: Id84aa0071f17096192965264eb60ddadd1e8e73f
Reviewed-on: https://chromium-review.googlesource.com/1023408
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52733}
2018-04-23 14:54:46 +00:00
Marja Hölttä
c823ca959e [csa] Add TNode<MaybeObject>.
LoadMaybeWeakField returns a TNode<MaybeObject>, and the only way to extract
values from it is through explicit functions.

BUG=v8:7308

Change-Id: I98da6b715527bb9976b4c78ed9caaa39fbcb3ed5
Reviewed-on: https://chromium-review.googlesource.com/1014106
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52732}
2018-04-23 14:52:26 +00:00
Andreas Haas
5c9b30ae38 [api] Split isolate allocation and initialization
At the moment, the isolate is allocated and initialized in a single
step. This has the downside that the platform cannot register the
isolate before the isolate gets initialized, and therefore the platform
is not available for the isolate during initialization. With this CL we
register the uninitialized isolate on the platform and initialize the
isolate after that.

This change is needed to allow the creation of task runners already
during the initialization of the isolate.

The related chromium CL: https://crrev.com/c/1015020

R=yangguo@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I52e89388a757f2693d1a800e7aa7701aa0080795
Reviewed-on: https://chromium-review.googlesource.com/1014044
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52731}
2018-04-23 14:48:46 +00:00
Sigurd Schneider
62b22fbd12 [deoptimizer] Use FrameWriter in DoComputeConstructStub
This CL applies the previously introduced stack abstraction for
constructing output frames to constructor stub frames.

Bug: v8:7679

Change-Id: I707b3d11c033b29873317f5798e1ee89c13e9907
Reviewed-on: https://chromium-review.googlesource.com/1021410
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52730}
2018-04-23 13:45:38 +00:00
Georg Neis
773a746ef7 Remove a C++ loop header's reliance on implementation-defined behavior.
Change-Id: I9684997c59664792fa69e5147fbf82e7931dbba1
Reviewed-on: https://chromium-review.googlesource.com/1023405
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52729}
2018-04-23 13:23:06 +00:00
Ulan Degenbaev
dd0ce92422 Revert "[heap] Removing marking step size ramp-up interval heuristic."
This reverts commit 2998a1761a.

Reason for revert: perf regressions crbug.com/835472

Original change's description:
> [heap] Removing marking step size ramp-up interval heuristic.
> 
> The heuristic is no longer needed now that we have concurrent marking.
> 
> Bug: chromium:834371
> Change-Id: I8ca3eaacdab618f690d8007aff66713260ace19f
> Reviewed-on: https://chromium-review.googlesource.com/1017123
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52693}

TBR=ulan@chromium.org,hpayer@chromium.org,mlippautz@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:834371
Change-Id: I574abd75e77ae9ff443419f01750a3f01072adaf
Reviewed-on: https://chromium-review.googlesource.com/1023890
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52728}
2018-04-23 11:50:46 +00:00
Sigurd Schneider
8c8976480a [deoptimizer] Use FrameWriter in DoComputeArgumentsAdaptorFrame
This CL applies the previously introduced stack abstraction for
constructing output frames to argument adaptor frames.

Bug: v8:7679

Change-Id: I07cb4447a8af510b24a8489d8abd047845a23e62
Reviewed-on: https://chromium-review.googlesource.com/1019148
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52727}
2018-04-23 11:27:36 +00:00
Sigurd Schneider
9557a91ff7 [turbofan] Move isNaN/isFinite to JSCallReducer
This CL also adds the simplified operator NumberIsNaN.

Bug: v8:7340, v8:7250
Change-Id: Ifa44cf59b30ee700f7df61f8d58782a43fd0f3c5
Reviewed-on: https://chromium-review.googlesource.com/1023391
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52726}
2018-04-23 11:08:36 +00:00
jgruber
7b4286b84f Add regression test for crbug.com/v8/7682
Bug: v8:7382,v8:7682
Change-Id: I57aa1658e8136334e18390c422eded3713066728
Reviewed-on: https://chromium-review.googlesource.com/1023394
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52725}
2018-04-23 10:58:15 +00:00
Peter Marshall
35985ce6ab [cpu-profiler] Use std::unordered_map for hashmaps.
There doesn't seem to be any reason to use our custom hashmap here,
which has a more complicated interface.

Change-Id: Ib08c2e400a3cb402a5984b925034aac29750c2ec
Reviewed-on: https://chromium-review.googlesource.com/1019445
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52724}
2018-04-23 10:54:26 +00:00
jgruber
384a51da42 [prof] Attribute ticks in embedded builtins correctly
When attributing ticks to a function, we first check if the current pc
matches a section within the dynamic library. If we find a match here,
then we don't continue looking within dynamically generated range
information, e.g. for JS functions and builtins.

This logic breaks when embedded builtins come into play. They live
within the libv8.so shared library, and are found when looking up
statics. But what we really want is to look up the dynamically
generated code-range, which contains more precise information.

In this CL, this case is detected by matching the found symbol name.
If it's the embedded blob, then we continue to dynamic lookup.

Bug: v8:6666
Change-Id: I7cea2cd4898f5a08381a071bdbc2f862b9c80880
Reviewed-on: https://chromium-review.googlesource.com/1023422
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52723}
2018-04-23 10:18:26 +00:00
Clemens Hammacher
7d32cf4ee7 [cleanup] Clean up CodeReference class
This CL fixes the new {CodeReference} class to comply to the style
guide. It makes it a proper class, renames private fields to end in an
underscore and simplifies the union declaration.

R=ahaas@chromium.org
CC=herhut@chromium.org

Bug: v8:7570
Change-Id: I329bbc6fca1ba3c0cb34fb4e1179eb4fa9044e76
Reviewed-on: https://chromium-review.googlesource.com/1023414
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52722}
2018-04-23 10:10:45 +00:00
Clemens Hammacher
ba020627e8 [wasm] Enable highlighting of current instruction in "jco"
For on-heap code, there is the nice feature of highlighting the current
pc on the "jco" gdb macro (calling {Code->Print}, {Code->Disassemble}
or {WasmCode::Disassemble}). For wasm code, this feature was missing so
far. This CL adds it.

R=ahaas@chromium.org

Change-Id: I0ee86d3c5cf9f42581f03c2ba4ec16b4c992e016
Reviewed-on: https://chromium-review.googlesource.com/1021517
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52721}
2018-04-23 09:47:57 +00:00
Clemens Hammacher
f7f7cd2e8a [Liftoff] Allow more register reuse
For binary operations and unary operations, we were pinning too many
registers, thereby disallowing to reuse a src register for the result.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: Id4eea1e35d29c170e191249ef42d11ed1d284490
Reviewed-on: https://chromium-review.googlesource.com/1021818
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52720}
2018-04-23 09:35:25 +00:00
Ivo Markovic
8da9631b76 Force proper code aligment in wasm serializer.
Change-Id: Ia32553de2b2365e7396392c8b6fbdba628d3f038
Reviewed-on: https://chromium-review.googlesource.com/1013929
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52719}
2018-04-23 09:16:06 +00:00
Georg Neis
021e9b089e Remove incorrect receiver checks from some array methods.
Several functions on Array.prototype incorrectly threw a TypeError just
because their receiver was sealed or frozen.

Bug: v8:7677
Change-Id: I4ec38bfbf468f9bd676f1c0b341c8a50cf814f15
Reviewed-on: https://chromium-review.googlesource.com/1021870
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52718}
2018-04-23 08:57:35 +00:00
Sigurd Schneider
1b03393202 [deoptimizer] Use FrameWriter in DoComputeInterpretedFrame
This CL applies the previously introduced stack abstraction for
constructing output frames to interpreted frames.

Bug: v8:7679

Change-Id: I8f62b40f76f3ea43145de37429c84fcaeb12a935
Reviewed-on: https://chromium-review.googlesource.com/1019146
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52717}
2018-04-23 08:43:15 +00:00
Timothy Gu
6989b3f6d7 [intl] Fix default Intl language tag handling
With certain ICU data bundles (such as the Node.js "small-icu"),
%GetDefaultICULocale() may return a more specific language tag (e.g.
"en-US") than what's available (e.g. "en"). In those cases, consider the
more specific language tag supported.

This CL also resolves the following Node.js issue:
   https://github.com/nodejs/node/issues/15223

Bug: v8:7024
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ifda0776b3418734d5caa8af4e50c17cda95add73
Reviewed-on: https://chromium-review.googlesource.com/668350
Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52716}
2018-04-21 13:16:20 +00:00
Michael Achenbach
7a0d0e8564 [test] Skip flaky test on native arm hardware
NOTRY=true
TBR=ulan@chromium.org

Bug: v8:7678
Change-Id: Id0b582539b0c9495ae7cd51a2324d096ade66821
Reviewed-on: https://chromium-review.googlesource.com/1021576
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52715}
2018-04-20 15:46:15 +00:00
Sigurd Schneider
a1f33fa28a [deoptimizer] Refactor frame output writing in deoptimizer
This CL introduces an stack abstraction for writing frame descriptions.
Previously, we managed the output offset by hand, which is verbose and
error prone. This CL introduced FrameWriter, which offers a stack
abstraction with push operations for constructing the output frame
descriptions.

The abstraction is only applied to DoComputeBuiltinContinuation;
following CLs will apply it to the other DoCompute* functions.

Bug: v8:7679

Change-Id: Ia6e34de1ed63ba9245e2a08945b1e0548562ed43
Reviewed-on: https://chromium-review.googlesource.com/1019143
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52714}
2018-04-20 15:13:15 +00:00
Ulan Degenbaev
6b129066a9 [test] Make SamplingHeapProfilerRateAgnosticEstimates more robust.
The function allocating objects in the test can be inlined in the middle
of the run. All allocations after inlining are currently not accounted.
This patch sums up allocations of the function and its outer function.

The difference between counts is now about 4%-6% (down from 15%).

Bug: chromium:834832
Change-Id: Iad071bd5bf53bb3527c9cb24d0a9ea38618c833c
Reviewed-on: https://chromium-review.googlesource.com/1021734
Reviewed-by: Ali Ijaz Sheikh <ofrobots@google.com>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52713}
2018-04-20 13:56:14 +00:00