Commit Graph

61300 Commits

Author SHA1 Message Date
Victor Gomes
2a1a7bf2c5 [runtime] Reverse JS arguments: fix tests and builtin arguments
Bug: v8:10201
Change-Id: I72cbe15912395b9b06ffdccce935abae6e7a050e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2093508
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66808}
2020-03-20 13:07:11 +00:00
Leszek Swirski
905d38f579 [offthread] Ensure off-thread allocations are pretenured
Squash a couple of remaining places where compilation finalization was
allocating new-space objects.

Bug: chromium:1011762
Change-Id: Ie0462eed422016f860146724a06dd2f1963bd88e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110019
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66807}
2020-03-20 11:32:51 +00:00
Yolanda Chen
3fb7590610 [regalloc] Find optimal spilling position when spill range to end
When spill a range without register uses inside a loop, it is beneficial to spill the range ealier at the loop header to reduce memory moves from the back edges.

The changes to FindOptimalSpillingPos are motivated as follows:
 - Change “next_use->pos() < pos” to “next_use->pos() <= pos”.
  The former version causes a crash of mksnapshot in debug build,
  because it is possible that a UsePosition at a split point gets split
  to the previous range according to “DetachAt”. For example, we
  have a live range with:
    UseIntervals: [1, 20[
    UsePosition: 10
  When split the live range at position 10, we will get:
    Range 0:0: UseInterval: [1, 10[
               UsePosition: 10
    Range 0:1: UseInterval: [10, 20[

 - Change “NextUsePositionRegisterIsBenefitial” to
   “NextRegisterPosition”, because there’s always a
   “Define” use position at the loop header for those phis
   that do not require a register. Using the original check
   will hence not apply the optimization.


Change-Id: I3b0bb3687ba572f1d3fc1892cefae7e866d99baa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2094964
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
Cr-Commit-Position: refs/heads/master@{#66806}
2020-03-20 10:40:26 +00:00
Leszek Swirski
f6b185ca2a [offthread] Ensure off-thread page marking bits are right
Ensure that the off-thread pages' marking bits (including the page
headers) are correct, and synchronised correctly on merge.

Bug: chromium:1011762
Change-Id: I46c66fb35d49d39eb0da3513c869baf49c366706
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110020
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66805}
2020-03-20 10:39:21 +00:00
Zhao Jiazhong
d745a1e3ac [mips][wasm] Fix FpRegister size in WasmDebugBreakFrameConstants.
The FpRegister size was miswritten as kSimd128Size like x64, while it
should be kDoubleSize on mips.

Change-Id: Iac4c5687e398a87ec0508fb99042a487c41ddf8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110891
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66804}
2020-03-20 10:36:33 +00:00
Georg Neis
6fffffceca [mjsunit] Reenable test es6/array-iterator-turbo
I'm unable to produce an issue with this test locally, so let's
try to enable it again.

Big: v8:6587
Change-Id: Ida834ac4ccf8c25d8f5c1e09fc57479db46a1873
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108722
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66803}
2020-03-20 10:13:21 +00:00
Maya Lekova
ce1ee49223 [regexp] Add missing const qualifier
This is patching 560f2d8bb3 for a
failing android-binary-size bot, see
https://chromium-review.googlesource.com/c/chromium/src/+/2110413

TBR=rmcilroy@chromium.org

Bug: chromium:747064
Change-Id: I37c5484afa427420d7a4614300556f7a5e99b21d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2111211
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66802}
2020-03-20 08:50:00 +00:00
Georg Neis
c25cc4e273 [turbofan] Remove bogus DCHECK and add a comment
Bug: chromium:1062916
Change-Id: Ic29ca849fb17c1409cc11018fdbc9d3363ebd55c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110027
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66801}
2020-03-20 08:11:00 +00:00
v8-ci-autoroll-builder
7905090da2 Update V8 DEPS.
Rolling v8/build: 9b1394c..9e8017c

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/8413a03..df670f0

Rolling v8/tools/clang: 6e39ba4..689fb3d

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

Change-Id: If6421082ec9f3e737d9892778cffec143136cbcc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2111138
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#66800}
2020-03-20 04:02:10 +00:00
Ng Zhi An
1485de1777 [wasm-simd][arm64] Use unique register for shifts
The src register needs to be different from the temporary Simd128
register since in the codegen we modify tmp before using tmp and src.

Bug: chromium:1063006
Change-Id: I8b4b2d23d8f090ea37041e82cac97470bcf0d833
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2111110
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66799}
2020-03-19 22:57:50 +00:00
Iain Ireland
560f2d8bb3 Reland "[regexp] Rewrite error handling"
This is a reland of e80ca24c80

Original change's description:
> [regexp] Rewrite error handling
>
> This patch modifies irregexp's error handling. Instead of representing
> errors as C strings, they are represented as an enumeration value
> (RegExpError), and only converted to strings when throwing the error
> object in regexp.cc. This makes it significantly easier to integrate
> into SpiderMonkey. A few notes:
>
> 1. Depending on whether the stack overflows during parsing or
>    analysis, the stack overflow message can vary ("Stack overflow" or
>    "Maximum call stack size exceeded"). I kept that behaviour in this
>    patch, under the assumption that stack overflow messages are
>    (sadly) the sorts of things that real world code ends up depending
>    on.
>
> 2. Depending on the point in code where the error was identified,
>    invalid unicode escapes could be reported as "Invalid Unicode
>    escape", "Invalid unicode escape", or "Invalid Unicode escape
>    sequence". I fervently hope that nobody depends on the specific
>    wording of a syntax error, so I standardized on the first one. (It
>    was both the most common, and the most consistent with other
>    "Invalid X escape" messages.)
>
> 3. In addition to changing the representation, this patch also adds an
>    error_pos field to RegExpParser and RegExpCompileData, which stores
>    the position at which an error occurred. This is used by
>    SpiderMonkey to provide more helpful messages about where a syntax
>    error occurred in large regular expressions.
>
> 4. This model is closer to V8's existing MessageTemplate
>    infrastructure. I considered trying to integrate it more closely
>    with MessageTemplate, but since one of our stated goals for this
>    project was to make it easier to use irregexp outside of V8, I
>    decided to hold off.
>
> R=jgruber@chromium.org
>
> Bug: v8:10303
> Change-Id: I62605fd2def2fc539f38a7e0eefa04d36e14bbde
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2091863
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66784}

R=jgruber@chromium.org

Bug: v8:10303
Change-Id: Iad1f11a0e0b9e525d7499aacb56c27eff9e7c7b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2109952
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66798}
2020-03-19 16:59:43 +00:00
Andreas Haas
1e1d4d8291 [wasm] Introduce a TableCopy builtin
This CL introduces a CSA builtin for the TableCopy instruction. This
builtin allows to generate smaller code for both TurboFan and Liftoff,
and easier code generation from Liftoff.

The smaller code size comes from:
* Parameters are passed through registers, not the stack.
* Lower number of parameters: the call target, number of parameters, and
context are not passed as parameters.
* No int to smi conversion in generated code.

R=clemensb@chromium.org

Bug: v8:10281
Change-Id: I4734b94c8a2aff08a5938504e3e36d0d2424f8ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110010
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66797}
2020-03-19 16:47:33 +00:00
Peter Marshall
d1253ae95b [unwinder] Advance deprecation of the old unwinder API
Chrome uses the new version now.

Bug: v8:8116
Change-Id: I59af8d2c6a897a852acd6de3a7938a4b8d3943e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110015
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66796}
2020-03-19 16:18:53 +00:00
Ng Zhi An
4ac48b600e [wasm-simd][liftoff][arm][arm64] Implement sub for Liftoff
Bug: v8:9909
Change-Id: Ica1cb36e7e071e5755009d57a0f03080b74bbf8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108743
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66795}
2020-03-19 16:06:43 +00:00
David Manouchehri
765053dc1a [Intl] Correct RelativeTimeFormat behaviour on ICU error.
Bug: chromium:1062763
Change-Id: I70d44f2db06b5ec1d84ab6678582dfc559d47e7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108729
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: David Manouchehri <david@davidmanouchehri.com>
Cr-Commit-Position: refs/heads/master@{#66794}
2020-03-19 15:58:53 +00:00
Ng Zhi An
3406cba8fe [wasm-simd][arm64] Bitmask instructions
Implement i8x16.bitmask, i16x8.bitmask, i32x4.bitmask on interpreter and
arm64.

These operations are behind wasm_simd_post_mvp flag, as we are only
prototyping to evaluate performance. The codegen is based on guidance at
https://github.com/WebAssembly/simd/pull/201.

Bug: v8:10308
Change-Id: I835aa8a23e677a00ee7897c1c31a028850e238a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2099451
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66793}
2020-03-19 15:52:23 +00:00
Andreas Haas
ca5ee9d636 [wasm] Introduce a WasmTableInit CSA builtin
This CL introduces a CSA builtin for the TableInit instruction. This
builtin allows to generate smaller code for both TurboFan and Liftoff,
and easier code generation from Liftoff.

The smaller code size comes from:
* Parameters are passed through registers, not the stack.
* Lower number of parameters: the call target, number of parameters, and
context are not passed as parameters.
* No int to smi conversion in generated code.

The CL also introduces a small CSA function which takes an uint32 value
and a max value as parameters and returns a Smi of the minimum of these
two.

R=clemensb@chromium.org, ishell@chromium.org

Bug: v8:10281
Change-Id: I40f248c20ec76e6ae9483a5e2907a68f42f2cb04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106201
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66792}
2020-03-19 14:52:28 +00:00
Clemens Backes
599a6e0ae8 [liftoff] Add some more code comments
Add some more code comments for code snippets that are not obvious,
especially if debug code is enabled.
The comments help when looking at Liftoff code for debugging code
generation issues.

R=thibaudm@chromium.org

Change-Id: I566bf2b05a454fb8addc030359969d36cb2cb707
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108557
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66791}
2020-03-19 14:45:25 +00:00
Clemens Backes
a1439d4182 [liftoff][debug] Minor cleanup
1) Replace a condition by a DCHECK.
2) Remove dead argument.

R=thibaudm@chromium.org

Bug: v8:10321
Change-Id: I546d18e7e5520630ab32b4f73f9fe12b0441cb95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108556
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66790}
2020-03-19 14:36:23 +00:00
Clemens Backes
da6476671f [liftoff][debug] Implement StepIn
Update the "hook on function call" flag also in the wasm case, and
slightly change the {IsStepping} logic to stop in any frame if the last
step action was anything other than StepNext.
In future CLs, this has to be extended further for StepOut and for
StepOver at a return location.
When that is done, we can also reenable more stepping in the test.

R=thibaudm@chromium.org

Bug: v8:10321
Change-Id: Ib3aa8c2c2e137690140e5879a33e2bcc340821e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108035
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66789}
2020-03-19 11:27:53 +00:00
Daniel Bevenius
32b22fe9de [torque] Use char newline character instead of string
Currently, when GeneratePrintDefinitionsForClass generates its Print
functions it uses a string literal as the newline character for all the
last lines. For example:

void TorqueGeneratedStruct<Struct, HeapObject>::StructPrint(
    std::ostream& os) {
  this->PrintHeader(os, "TorqueGeneratedStruct");
  os << "\n";
}

The last line could use a single character instead of a string,
for example:

void TorqueGeneratedStruct<Struct, HeapObject>::StructPrint(
    std::ostream& os) {
  this->PrintHeader(os, "TorqueGeneratedStruct");
  os << '\n';
}

The commit suggests changing this into a char.

Change-Id: Id7a2f5fb17108fcbb543109d18b6b474ac1c5d2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108546
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66788}
2020-03-19 10:27:03 +00:00
Philip Pfaffe
9696695000 [wasm-debug-evaluate] Implement the foundation for wasm debug evaluate
This implements the first part of WebAssembly debug evaluate. The patch
includes the foundation required to execute evaluator modules. It only
implements the first of the APIs of the evaluator module spec.

Bug: chromium:1020120
Change-Id: I06ec98a63d0a0ec8d81c2eac4319c4b85d3e16c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2089936
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66787}
2020-03-19 10:18:23 +00:00
Leszek Swirski
2193f691da Revert "[regexp] Rewrite error handling"
This reverts commit e80ca24c80.

Reason for revert: Causes failures in the fast/regex/non-pattern-characters.html Blink web test (https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Linux/3679)

Original change's description:
> [regexp] Rewrite error handling
> 
> This patch modifies irregexp's error handling. Instead of representing
> errors as C strings, they are represented as an enumeration value
> (RegExpError), and only converted to strings when throwing the error
> object in regexp.cc. This makes it significantly easier to integrate
> into SpiderMonkey. A few notes:
> 
> 1. Depending on whether the stack overflows during parsing or
>    analysis, the stack overflow message can vary ("Stack overflow" or
>    "Maximum call stack size exceeded"). I kept that behaviour in this
>    patch, under the assumption that stack overflow messages are
>    (sadly) the sorts of things that real world code ends up depending
>    on.
> 
> 2. Depending on the point in code where the error was identified,
>    invalid unicode escapes could be reported as "Invalid Unicode
>    escape", "Invalid unicode escape", or "Invalid Unicode escape
>    sequence". I fervently hope that nobody depends on the specific
>    wording of a syntax error, so I standardized on the first one. (It
>    was both the most common, and the most consistent with other
>    "Invalid X escape" messages.)
> 
> 3. In addition to changing the representation, this patch also adds an
>    error_pos field to RegExpParser and RegExpCompileData, which stores
>    the position at which an error occurred. This is used by
>    SpiderMonkey to provide more helpful messages about where a syntax
>    error occurred in large regular expressions.
> 
> 4. This model is closer to V8's existing MessageTemplate
>    infrastructure. I considered trying to integrate it more closely
>    with MessageTemplate, but since one of our stated goals for this
>    project was to make it easier to use irregexp outside of V8, I
>    decided to hold off.
> 
> R=​jgruber@chromium.org
> 
> Bug: v8:10303
> Change-Id: I62605fd2def2fc539f38a7e0eefa04d36e14bbde
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2091863
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66784}

TBR=jgruber@chromium.org,iireland@mozilla.com

Change-Id: I9247635f3c5b17c943b9c4abaf82ebe7b2de165e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10303
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108550
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66786}
2020-03-19 09:58:12 +00:00
Emanuel Ziegler
38c3bd4866 [wasm][mips] Save FP & PC when calling C functions
Ported changes from the following CLs to mips/mips64:
  - https://chromium-review.googlesource.com/c/v8/v8/+/2066964
  - https://chromium-review.googlesource.com/c/v8/v8/+/2071866
  - https://chromium-review.googlesource.com/c/v8/v8/+/2080242

This change is needed for profiling of Wasm code that calls C-function
to ignore the C-stack above the Wasm stack that otherwise couldn't be
parsed otherwise.

Bug: chromium:1045860
Change-Id: Ifdce5be6c5373714a67b3ce8d8c4f0a18f63b6fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2082566
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66785}
2020-03-19 09:38:06 +00:00
Iain Ireland
e80ca24c80 [regexp] Rewrite error handling
This patch modifies irregexp's error handling. Instead of representing
errors as C strings, they are represented as an enumeration value
(RegExpError), and only converted to strings when throwing the error
object in regexp.cc. This makes it significantly easier to integrate
into SpiderMonkey. A few notes:

1. Depending on whether the stack overflows during parsing or
   analysis, the stack overflow message can vary ("Stack overflow" or
   "Maximum call stack size exceeded"). I kept that behaviour in this
   patch, under the assumption that stack overflow messages are
   (sadly) the sorts of things that real world code ends up depending
   on.

2. Depending on the point in code where the error was identified,
   invalid unicode escapes could be reported as "Invalid Unicode
   escape", "Invalid unicode escape", or "Invalid Unicode escape
   sequence". I fervently hope that nobody depends on the specific
   wording of a syntax error, so I standardized on the first one. (It
   was both the most common, and the most consistent with other
   "Invalid X escape" messages.)

3. In addition to changing the representation, this patch also adds an
   error_pos field to RegExpParser and RegExpCompileData, which stores
   the position at which an error occurred. This is used by
   SpiderMonkey to provide more helpful messages about where a syntax
   error occurred in large regular expressions.

4. This model is closer to V8's existing MessageTemplate
   infrastructure. I considered trying to integrate it more closely
   with MessageTemplate, but since one of our stated goals for this
   project was to make it easier to use irregexp outside of V8, I
   decided to hold off.

R=jgruber@chromium.org

Bug: v8:10303
Change-Id: I62605fd2def2fc539f38a7e0eefa04d36e14bbde
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2091863
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66784}
2020-03-19 08:51:32 +00:00
Leszek Swirski
fabea6afb1 Revert "[parser] Introduce UnoptimizedCompileFlags"
This reverts commit d91679bf3a.

Reason for revert: Seems to cause UBSan errors

Original change's description:
> [parser] Introduce UnoptimizedCompileFlags
> 
> UnoptimizedCompileFlags defines the input flags shared between parse and
> compile (currently parse-only). It is set initially with some values, and
> is immutable after being passed to ParseInfo (ParseInfo still has getters
> for the fields, but no setters).
> 
> Since a few of the existing flags were output flags, ParseInfo now has a
> new output_flags field, which will eventually migrate to a ParseOutputs
> structure.
> 
> Bug: v8:10314
> Change-Id: If3890a5fad883bca80a97bf9dfe44d91797dc286
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096580
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66782}

TBR=ulan@chromium.org,rmcilroy@chromium.org,leszeks@chromium.org,szuend@chromium.org

Change-Id: Ica139e8862e00cd0560638a0236bbaccd7b2188c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10314
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108548
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66783}
2020-03-19 08:46:52 +00:00
Leszek Swirski
d91679bf3a [parser] Introduce UnoptimizedCompileFlags
UnoptimizedCompileFlags defines the input flags shared between parse and
compile (currently parse-only). It is set initially with some values, and
is immutable after being passed to ParseInfo (ParseInfo still has getters
for the fields, but no setters).

Since a few of the existing flags were output flags, ParseInfo now has a
new output_flags field, which will eventually migrate to a ParseOutputs
structure.

Bug: v8:10314
Change-Id: If3890a5fad883bca80a97bf9dfe44d91797dc286
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096580
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66782}
2020-03-19 08:23:12 +00:00
v8-ci-autoroll-builder
2b1d9b0f3c Update V8 DEPS.
Rolling v8/build: 44de6a6..9b1394c

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/42d02fb..8413a03

Rolling v8/third_party/depot_tools: a30b7bd..464e9ff

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

Change-Id: Ibfb16f9a6ca42a16fa40f6534d77bbe6e4ef5c39
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2109202
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#66781}
2020-03-19 03:55:12 +00:00
Milad Farazmand
a8f60c8008 s390: [wasm-simd] disable some of 64x2 cctests on s390x
"I64x2Eq", "S1x2AnyTrue" and "S1x2AllTrue" do not yet have lowering
implemented hence some of the test case may fail on s390x
hardware without AVX support.

Change-Id: Ice01bcaed78950fbad36e2ba37c8f7ae5d10b59b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107763
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66780}
2020-03-18 22:27:52 +00:00
Ng Zhi An
0d886c5688 [wasm-simd][x64] Optimize codegen when shift is constant
This optimizes i8x16 shifts when the shift value is constant. It brings
generated instruction counts down from 10 to 6 (unsigned), and 9 to 5
(signed).

For Signed, we use a word (16-bit) shift, then mask away the high (shru)
or low (shl) bits to achieve a byte shift. Most of the instructions are
dedicated to building the mask.

Bug: v8:10115
Change-Id: I1d5c0e0fb779eeb7e0185d3cb7fd595837fd8daf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106293
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66779}
2020-03-18 21:34:07 +00:00
Ng Zhi An
aff14d7ee8 [wasm-simd][fuzzer] Add more i8x16 and i16x8 ops
Bug: v8:10180
Change-Id: I700d10c82f6691bfc9a021fec120779c9d0a08e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107647
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66778}
2020-03-18 20:49:41 +00:00
Ulan Degenbaev
70bc9b5a41 [heap] Remove --experimental_new_space_growth_heuristic
The flag is old and is disabled by default.

Change-Id: Ica1e4f3d7a9ec0e1130a8b097848251f9dc74ce0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108727
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66777}
2020-03-18 19:48:55 +00:00
Camillo Bruni
9b715dfefa [d8] Support node-style module loading
- normalize relative paths with parent segments
- load .js and .mjs files automatically when using
  --fuzzy-module-file-extensions

Change-Id: Iac56c6010f1b3450448b98247db88bfa96ae32ba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096629
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66776}
2020-03-18 16:57:37 +00:00
Clemens Backes
0d05e8d2db [liftoff][debug] Add nops to avoid source position collisions
Without the nops, the PC after the call might be the same as the PC of
the next instruction, and we might emit two different source positions
for the same PC.
This will not be the final solution, see attached bug.

R=thibaudm@chromium.org

Bug: v8:10337
Change-Id: I8c893d8d7ad00684ec6e1bc7f6c00f649695029f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108029
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66775}
2020-03-18 16:32:17 +00:00
Clemens Backes
21dde46b82 [liftoff][debug] Check for "hook on function call"
This extends the Liftoff function prologue in the debug case. It now
checks the "hook on function call" flag, and if that flag is set, it
triggers a breakpoint.
The address of that flag is stored in the WasmInstanceObject for fast
access.

Drive-by: Add an output operator for ValueType, which helps with
debugging.

R=thibaudm@chromium.org

Bug: v8:10321
Change-Id: I572de802815259ee0ef0df9b22ce30b510b4e30d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106211
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66774}
2020-03-18 16:01:27 +00:00
Liviu Rau
db099f186c Update builders config for previous branch coverage
Bug: v8:10336
Change-Id: I46af204cd25b0e0d3a300e1449939f502b757d3c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107842
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66773}
2020-03-18 14:15:44 +00:00
Zhao Jiazhong
bec36f640c [mips][wasm] Load register values from DebugBreak frame
Port ae03752fd9
https://crrev.com/c/2102574

Original Commit Message:

  This implements inspection of live registers on breakpoints in Liftoff.
  To that end, the frame pointer of the WasmDebugBreak frame is remembered
  when iterating the stack. Based on a platform-specific implementation of
  {WasmDebugBreakFrameConstants}, the offset of the respective register
  within that frame is computed, and the value is read from the frame.

  As a drive-by, the wasm debug side table is storing register codes as
  liftoff codes, which can also store register pairs (needed for i64 on
  32-bit platforms, and for SIMD, which is not supported yet).

Change-Id: I88bcc5256e1a3b4447c727673178c41fbdd04df4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2105506
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66772}
2020-03-18 13:46:34 +00:00
Leszek Swirski
37aaa4105c [parser] Remove Handles from ParseInfo
Remove the wrapped arguments and outer scope info handles from
ParseInfo, and instead infer them from the SharedFunctionInfo or Script,
or in the case of eval pass it through to the parser as an argument.

Bug: v8:10314
Change-Id: Ia1d1dbab5b62252e10fa2055f7e91f914324efd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106200
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66771}
2020-03-18 13:38:24 +00:00
Zhao Jiazhong
ebd85d2cee [mips][wasm-simd][liftoff] Implement sub
Port 3e1b6b4034
https://crrev.com/c/2101129

Change-Id: Icc7198221f44f52c88b205947665898b6813cd8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107247
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66770}
2020-03-18 13:34:34 +00:00
Milad Farazmand
cd36155e89 PPC/s390: [wasm-simd] [liftoff] Implement sub on x64 and ia32
Port 3e1b6b4034

R=jing.bao@intel.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I3f4837a896217dd3331b60e1477806d05f106c24
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2107727
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66769}
2020-03-18 13:30:54 +00:00
Georg Neis
7cbdff438d [turbofan] Extend and make more use of Type::Unique
"t.Is(Type::Unique())" is more conservative and future-proof than
"!t.Maybe(Type::NumericOrString)".

Change-Id: I7d08244802feeb062fd2f8a9d8f3af85eb43bba3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106207
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66768}
2020-03-18 11:33:52 +00:00
Liviu Rau
329d371979 Coverage for previous branch
Bug: v8:10336
Change-Id: I96495489cf745aaa04a30675f6254c72b69d446f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108025
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66767}
2020-03-18 10:57:19 +00:00
Tobias Tebbi
4400755a83 [torque] make map field const
As an escape hatch, add UnsafeConstCast() to still mutate the map
field where necessary.

Drive-by change: Refactor NewPromiseReactionJobTask to avoid unsafe
allocation and map mutations.

Bug: v8:7793
Change-Id: I90e06340c1cf048059b544f1c0a6f730f75d200c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096675
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66766}
2020-03-18 10:51:39 +00:00
Zhao Jiazhong
a96069964c [mips][wasm] Fix registers spilled in DebugBreak frame
Port e47f9a9d50
https://crrev.com/c/2102570

Original Commit Message:

  The set of registers to spill was wrong. Instead of spilling wasm
  parameter registers (like the WasmCompileLazy builtin), we should spill
  all registers that are being used as Liftoff cache registers.
  This CL defines platform-specific WasmDebugBreakFrameConstants which
  hold the set of registers to spill. This set is used in the builtin, and
  will later be used for inspecting the spilled registers.

  In order to iterate bit sets more easily in both direction (MSB to LSB
  or LSB to MSB), we add a base::bits::IterateBits{,Backwards} method
  which provides the respective iterators.

Change-Id: I1137a0b8bcb20d994bfc8662f0a938b627582fbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2105495
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66765}
2020-03-18 10:36:48 +00:00
Georg Neis
9e098f06a4 [turbofan] Fix misplaced DCHECK
Bug: chromium:1062532
Change-Id: Iaac3103987a561ce519321276c623b5eb37ec830
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2108022
Commit-Queue: Georg Neis <neis@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66764}
2020-03-18 10:22:28 +00:00
Georg Neis
1a18341789 [turbofan] Avoid widening type when reducing JSStrictEqual
We don't ever want a node's type to become less precise.

Also move a part of JSTypedLowering::ReduceJSStrictEqual that
can be expressed solely in terms of types into the typer, where
it generalizes an existing case.

Change-Id: I37c58fed48f606f6fe34e98e5f066434e50cb6c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106204
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66763}
2020-03-18 10:08:58 +00:00
Tobias Tebbi
94611e8abb [torque] ensure array lengths are const
To ensure good error messages, we do create bindings even for non-const
fields but then add a new error message mechanism when accessing such
a binding.

Bug: v8:7793
Change-Id: I2f20483514660c5ce92202d301c631f6ac055446
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096617
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66762}
2020-03-18 09:44:59 +00:00
Georg Neis
abf92c0614 [turbofan] Use shortcut kEliminatable in some operator definitions
Change-Id: I9388a6b4f684a1567e1cbae9ee4784e43a99633e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106208
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66761}
2020-03-18 09:27:18 +00:00
Tobias Tebbi
8cb5dea960 [torque] generate int accessors for Smi fields
In the runtime, we always had a convention to use int-typed accessors
for Smi fields. For Torque-generated classes, we kept them Smi-typed
but then added int wrappers around that.
This CL makes Torque generate int-typed accessors directly, removing the
need for these wrappers.

TBR=hpayer@chromium.org

Bug: v8:7793
Change-Id: I348e1d96295c9676fafda32b7d49088848527f89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2106210
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66760}
2020-03-18 09:24:08 +00:00
Tobias Tebbi
d7e02ea463 [torque] add const references and disallow const class field writes
- Allow type expression for abstract type supertypes.
  For consistency, and ease of implementation, also allow this for enums.
- Allow subtyping of structs. This requires changing all places where we
  checked for struct types and instead check if we have a subtype of a
  struct type.
- This allows defining two subtypes of the Reference<T> struct for
  mutable and constant references. Mutable references are a subtype of
  constant references.
- &T desugars to MutableReference<T>
  const &T desugars to ConstReference<T>
- A const field of a class produces a constant reference.
  A const field of a mutable reference to a struct is const.
  A mutable field of a const reference to a struct is const.
- It is possible to assign a new struct value to a mutable reference to
  a struct, even if the struct contains const fields. This is analogous
  to allowing assignments of let-bound structs with constant fields.

Not in this CL:
- A notion of const slices.
- Applying const to appropriate class fields.

Bug: v8:7793
Change-Id: I6e7b09d44f54db25f8bf812be5f3b554b80414e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2096615
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66759}
2020-03-18 08:47:49 +00:00