Commit Graph

7314 Commits

Author SHA1 Message Date
Andreas Haas
fdb0b7abb3 [wasm] Update the wasm spec tests.
This CL updates the hook for the WebAssembly spec repository, and it
updates the WebAssembly spec tests. The WebAssembly spec tests have to
be updated manually with the tools/wasm/update-wasm-spec-tests.sh
script. Mircea, I saw that you updated the WebAssembly spec repository
last time. Can you please take a look?

UPDATE: I improved the update script slightly, and there is one
additional JS API test we fail now and have to fix eventually.

R=mtrofin@chromium.org

Change-Id: I3c0df9cee64d444147db47daa0c1936edf116173
Reviewed-on: https://chromium-review.googlesource.com/509257
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45692}
2017-06-02 15:25:00 +00:00
Ilija.Pavlovic
9c8f0f09ea Fix tests regress-336820 and regress-678917.
Execution tests regress-336820 and regress-678917 finished with error
messages "allocation failure GC in old space requested" and "fatal
javascript OOM in CALL_AND_RETRY_LAST". For successful execution,
parameter max_old_space_size must be increased and this is done inside
tests.

TEST=mjsunit/regress/regress-336820,
     mjsunit/regress/regress-678917
BUG=

Review-Url: https://codereview.chromium.org/2907363003
Cr-Original-Commit-Position: refs/heads/master@{#45672}
Committed: 1550c86909
Review-Url: https://codereview.chromium.org/2907363003
Cr-Commit-Position: refs/heads/master@{#45681}
2017-06-02 13:08:53 +00:00
bmeurer
3028f8075e [turbofan] Optimize Function.prototype.bind for the common case.
When the input to Function.prototype.bind is a known function, we can
inline the allocation of the JSBoundFunction into TurboFan, which
provides a 2x speed-up for several hot functions in Node streams (as
discovered by Matteo Collina). One of example of this can be found in
https://github.com/nodejs/node/pull/13322, which can be optimized and
made more readable using bind instead of closures.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2916063002
Cr-Commit-Position: refs/heads/master@{#45679}
2017-06-02 12:30:04 +00:00
jarin
f0645612c4 This is a first step towards reducing the number of stores/loads when suspending/resuming a generator.
Unfortunately, even for an empty generator, we still use 8 register for various things (try-finally, copies of generator object, parser-introduced temporaries). I will try to get rid of these in separate CLs.

Changes:

- SuspendGenerator bytecode now takes register list to save.
- ResumeGenerator was split into two bytecodes:
  * Resume generator reads the state out and marks the generator as
      'executing'.
  * RestoreGeneratorRegisters reloads the registers from
      the generator.
    + this required adding support for output register list.

- Introduced generator_object_ register in the bytecode generator.
  * in subsequent CLs, I will make better use of it, the goal is
      to get rid if the .generator_object local variable.

- Taught register optimizer to flush unassigned registers.

BUG=v8:6379

Review-Url: https://codereview.chromium.org/2894293003
Cr-Commit-Position: refs/heads/master@{#45675}
2017-06-02 11:55:48 +00:00
machenbach
3b7ff7a5e5 Revert of [heap] Decrease old space physical memory factor. (patchset #3 id:40001 of https://codereview.chromium.org/2907363003/ )
Reason for revert:
Fails on other bots now:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug/builds/16197
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/13170
https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20gc%20stress/builds/6749

Original issue's description:
> Fix tests regress-336820 and regress-678917.
>
> Execution tests regress-336820 and regress-678917 finished with error
> messages "allocation failure GC in old space requested" and "fatal
> javascript OOM in CALL_AND_RETRY_LAST". For successful execution,
> parameter max_old_space_size must be increased and this is done inside
> tests.
>
> TEST=mjsunit/regress/regress-336820,
>      mjsunit/regress/regress-678917
> BUG=
>
> Review-Url: https://codereview.chromium.org/2907363003
> Cr-Commit-Position: refs/heads/master@{#45672}
> Committed: 1550c86909

TBR=hpayer@chromium.org,jochen@chromium.org,mlippautz@chromium.org,mstarzinger@chromium.org,ulan@chromium.org,ivica.bogosavljevic@imgtec.com,bmeurer@chromium.org,jarin@chromium.org,ishell@chromium.org,Ilija.Pavlovic@imgtec.com,Ilija.Pavlovic@imgtec.com,Ilija.Pavlovic@imgtec.com,Ilija.Pavlovic@imgtec.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2917063002
Cr-Commit-Position: refs/heads/master@{#45673}
2017-06-02 11:54:01 +00:00
Ilija.Pavlovic
1550c86909 Fix tests regress-336820 and regress-678917.
Execution tests regress-336820 and regress-678917 finished with error
messages "allocation failure GC in old space requested" and "fatal
javascript OOM in CALL_AND_RETRY_LAST". For successful execution,
parameter max_old_space_size must be increased and this is done inside
tests.

TEST=mjsunit/regress/regress-336820,
     mjsunit/regress/regress-678917
BUG=

Review-Url: https://codereview.chromium.org/2907363003
Cr-Commit-Position: refs/heads/master@{#45672}
2017-06-02 09:41:55 +00:00
gdeepti
5c0baf7127 [wasm] Fix WasmMemoryObject constructor for when a module has no initial memory
BUG=chromium:724972

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

Review-Url: https://codereview.chromium.org/2917603002
Cr-Commit-Position: refs/heads/master@{#45665}
2017-06-01 17:08:02 +00:00
Sathya Gunasekaran
51d38345f9 [bootstrapper] Ensure Map/Set constructor has fast properties.
Currently x instanceof Map/Set checks cannot take the fast path, since
the Map/Set constructor has dictionary properties. To avoid that, just
forcibly migrate the Map/Set constructor to fast properties again once
it's fully setup in the bootstrapper.

Bug: v8:5717, v8:5902
Change-Id: I23dfd00456c9206a0ca5af71dfbc9236982936fc
Reviewed-on: https://chromium-review.googlesource.com/520578
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45663}
2017-06-01 14:22:09 +00:00
georgia.kouveli
6a99238b90 [arm] Clean up disabling of sharing code target entries.
This fixes an issue with ful-codegen where code target entries for the OSR
check were being incorrectly shared. We now explicitly disable sharing of code
target constant pool entries for full-codegen and for calls to builtins from
WASM code, using a scope.

BUG=chromium:725743

Review-Url: https://codereview.chromium.org/2922433002
Cr-Commit-Position: refs/heads/master@{#45661}
2017-06-01 13:18:21 +00:00
Michael Starzinger
15691758b3 [asm.js] Fix associativity of multiplicative expressions.
R=clemensh@chromium.org
TEST=mjsunit/asm/regress-719866
BUG=chromium:719866

Change-Id: I6cc9f222769aa036275654286c9c6271ef2d1334
Reviewed-on: https://chromium-review.googlesource.com/520945
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45660}
2017-06-01 13:03:03 +00:00
Michael Lippautz
c375a548d2 [heap] Add retained size counter to array buffer tracking
Bug: 
Change-Id: If4a5408f8ff63a8a2b189f60fda37896a9403d3d
Reviewed-on: https://chromium-review.googlesource.com/519386
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45646}
2017-05-31 18:36:24 +00:00
Ben Smith
89a6f9c138 Fix Check failure on OOB access in Atomics.wait
Bug: chromium:724973
Change-Id: I227b30b50f92fac7d6cf3ec3369e324282352ccb
Reviewed-on: https://chromium-review.googlesource.com/514348
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45643}
2017-05-31 15:08:52 +00:00
Clemens Hammacher
45618a9ab5 [wasm] Make prototype flags experimental
Most prototype implementations are not fully supported in the
interpreter. This is the case at least for exception handling, simd, and
atomics. Any function can be redirected to the interpreter though,
either by passing --wasm-interpret-all, or by dynamically redirecting to
the interpreter for debugging.
Making the flags experimental keeps the fuzzer from playing around with
these flags.

Drive-by: Refactor tests which explicitly set the prototype flag to use
a new scope for that.

R=ahaas@chromium.org
BUG=chromium:727584

Change-Id: I67da79f579f1ac93c67189afef40c6524bdd4430
Reviewed-on: https://chromium-review.googlesource.com/519402
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45639}
2017-05-31 14:18:08 +00:00
Tobias Tebbi
f70ceeae1d [turbofan] teach escape analysis about oddly occurring simplified number ops
Bug: chromium:726638
Change-Id: Ib30b147ec60f9f13c5164765f8c63be7a1339e9f
Reviewed-on: https://chromium-review.googlesource.com/517497
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45634}
2017-05-31 13:59:38 +00:00
Peter Marshall
ad3724eb10 [turbofan] Mark SeqStringCharCodeAt return type as Word32, not Tagged.
Causes crashes on canary if there is a GC and the value makes it onto
the stack.

Bug: chromium:727662
Change-Id: I44fa8cf8a83b43d64418896c0a1f5518401b454f
Reviewed-on: https://chromium-review.googlesource.com/519302
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45623}
2017-05-31 10:51:28 +00:00
Igor Sheludko
6fb4201836 [tests] Fix typo in Flags value.
TBR=jarin@chromium.org
NOTRY=true

Bug: v8:6447
Change-Id: Ied42c4ba8fc19f2441f6c2ffd31d3f56055ac487
Reviewed-on: https://chromium-review.googlesource.com/518823
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45616}
2017-05-31 08:24:57 +00:00
Marja Hölttä
06f05ec231 [parser] Skipping inner funcs: make more functions skippable.
- Enable aggressive lazy inner funcs (make non-declaration funcs lazy, ie let f =
  function() { ... } when --experimental-preparser-scope-analysis is on.
- Turn on variable tracking for lazy top level functions: this makes their inner
  functions skippable.
- Test fix for an testing bug uncovered by this work: when restoring the data
  for the relevant scope, don't assume it's the outermost scope for which we
  have data.
- Fix: if we abort lazy parsing a function, we shouldn't produce any data for
  it.

BUG=v8:5516

Change-Id: I0606fbabb5886dc57dbb53ab5f3fb894ff5d032e
Reviewed-on: https://chromium-review.googlesource.com/518165
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45615}
2017-05-31 07:49:55 +00:00
jgruber
9ca164d051 [csa] Add assertions to CSA
This adds a bunch of assertions to CSA, mostly about documenting and checking
parameter types.

Drive-by-change: Removed unused function.

BUG=v8:6325

Review-Url: https://codereview.chromium.org/2847923003
Cr-Original-Original-Commit-Position: refs/heads/master@{#45398}
Committed: b14a981496
Review-Url: https://codereview.chromium.org/2847923003
Cr-Original-Commit-Position: refs/heads/master@{#45443}
Committed: 62b0de1ef5
Review-Url: https://codereview.chromium.org/2847923003
Cr-Commit-Position: refs/heads/master@{#45607}
2017-05-30 14:23:17 +00:00
Camillo Bruni
32e4bcd974 [heap-verify] Fix arguments verification with mapped elements
Bug: chromium:726836
Change-Id: I2eaec8550e7ba038646a1f7834d4514a8d4009ea
Reviewed-on: https://chromium-review.googlesource.com/517954
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45604}
2017-05-30 14:05:34 +00:00
Marja Hölttä
36de9199f4 [parser] Disable aborting preparsing for arrow functions.
It's extremely difficult to get right: there have been several bugs
related to this feature, especially when combined with
non-simple parameter lists in arrow functions.

BUG=chromium:727218

Change-Id: I97dfbc57a7650199964c5fe99de69143c8e537c2
Reviewed-on: https://chromium-review.googlesource.com/518145
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45603}
2017-05-30 14:00:54 +00:00
Igor Sheludko
8820a79e17 [ic] Properly handle the case when all receiver maps are deprecated.
This may happen in KeyedStoreIC when the last store via setter deprecates the receiver map.

Bug: chromium:723366
Change-Id: Iff19e50c3761584401340d276ab4eead111883c3
Reviewed-on: https://chromium-review.googlesource.com/517952
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45592}
2017-05-30 09:38:48 +00:00
Clemens Hammacher
b5203e8f4e [wasm] Remove more obsolete DCHECKs
This time for the current memory size. This call also used to use the
context object stored in the instance, hence it required the instance
to be set. This is no longer the case, so the DCHECKs can just be
removed.

R=ahaas@chromium.org
BUG=chromium:727222

Change-Id: I72a7e3e80c3beb15ecad00c5be068e803456797e
Reviewed-on: https://chromium-review.googlesource.com/517947
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45587}
2017-05-30 08:58:09 +00:00
Michael Starzinger
f7f03da0d3 [turbofan] Fix value output count range on Operator.
This widens the range of value output counts to 32 bit on the {Operator}
class. Note that the limit imposed by the parser is 65535 parameters for
each function, but the {Start} node has additional value outputs.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-724153
BUG=chromium:724153

Change-Id: I21b5d947cc2305b255ddbbff6ec1dfa5c02784c7
Reviewed-on: https://chromium-review.googlesource.com/517489
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45573}
2017-05-29 15:49:06 +00:00
Peter Marshall
2f3f974f74 [builtins] Fix TypedArray slice for species constructor.
Bug: chromium:725865
Change-Id: I94006d45aefb969fb0cf98ec475c30c14b3837fa
Reviewed-on: https://chromium-review.googlesource.com/517488
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45567}
2017-05-29 14:25:44 +00:00
Camillo Bruni
e822488d76 [runtime] Directly support double values in CloneShallowObjectLiteral
Bug: v8:6211
Change-Id: If6d2ef7889ae6a0c3aa430d3f69c53f19cc1f1c6
Reviewed-on: https://chromium-review.googlesource.com/509571
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45563}
2017-05-29 13:27:17 +00:00
Clemens Hammacher
14fae58987 [asm] Fix reusing code with annotated export info
For lazy compilation, we encode information about table exports in the
deoptimization data. This information is rebuilt on each instantiation,
so we need to reset it when reusing code objects from another instance.

R=ahaas@chromium.org
BUG=chromium:727219

Change-Id: I90557ef06e692d0a8323223cac26679efcfa408b
Reviewed-on: https://chromium-review.googlesource.com/517945
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45559}
2017-05-29 12:33:57 +00:00
Michael Achenbach
0a1cad371e [test] Deprecate timeout test expectations
Tests should instead be skipped or fixed.

Existing timeout expectations are either optimistically deleted or replaced by the SLOW keyword.

Change-Id: Ic43f52bf18d0702674c95f9263a109041a1c9cd8
Reviewed-on: https://chromium-review.googlesource.com/518122
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45552}
2017-05-29 10:38:55 +00:00
Igor Sheludko
397afc6960 [runtime] Set proper initial map for AsyncFunction constructor.
... to make AsyncFunction subclassing work.

Bug: chromium:725537
Change-Id: I7edf4891e14e01567046e7536b3aa93877111448
Reviewed-on: https://chromium-review.googlesource.com/517087
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45544}
2017-05-26 21:06:48 +00:00
Sathya Gunasekaran
6b31174aec [Promise] Add smi check for species constructor
Bug: chromium:726636
Change-Id: Ied6af8c969ed05b7a334238b30930658af060e7d
Reviewed-on: https://chromium-review.googlesource.com/516734
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45537}
2017-05-26 11:18:37 +00:00
Caitlin Potter
cd778f13ac [test] add mjsunit regression tests for v8:6322
A few tests that would be good to have to verify that the known manifestations
of this bug are resolved.

Previously, the async generator and async function tests would crash. The other
ones never did, but still resulted in the register overwite bug.

BUG=v8:6322
R=adamk@chromium.org

Change-Id: Ic2238227629077de5671d67d18b3bfe018dd23f4
Reviewed-on: https://chromium-review.googlesource.com/514230
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#45524}
2017-05-24 19:06:26 +00:00
machenbach
a07218a56d Revert of [turbofan] Speculatively optimize string character access. (patchset #1 id:1 of https://codereview.chromium.org/2905623003/ )
Reason for revert:
Changes layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/15867

See:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original issue's description:
> [turbofan] Speculatively optimize string character access.
>
> Add a protector cell for string bounds checks that is being used to
> protect speculative bounds for String.prototype.charCodeAt and
> String.prototype.charAt in TurboFan (and Crankshaft). This way we don't
> have the diamond in optimized code, which stands in the way of other
> optimizations for charCodeAt that are currently being worked on by
> petermarshall@.
>
> BUG=v8:6391
> TBR=mlippautz@chromium.org
> R=petermarshall@chromium.org
>
> Review-Url: https://codereview.chromium.org/2905623003
> Cr-Commit-Position: refs/heads/master@{#45514}
> Committed: 9d8bd05516

TBR=petermarshall@chromium.org,mlippautz@chromium.org,bmeurer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:6391

Review-Url: https://codereview.chromium.org/2900333002
Cr-Commit-Position: refs/heads/master@{#45521}
2017-05-24 17:04:44 +00:00
Mircea Trofin
55193800cf Revert "Revert "[wasm] Remove override-ability from async compile and instantiate.""
This reverts commit ee3729d26e.

Reason for revert: The initial commit required https://chromium-review.googlesource.com/c/510021/ also land on the Blink side. I mistakenly thought it did.

Original change's description:
> Revert "[wasm] Remove override-ability from async compile and instantiate."
> 
> This reverts commit 2869dd55f3.
> 
> Reason for revert: Breaks:
> https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/15850
> 
> See also:
> https://github.com/v8/v8/wiki/Blink-layout-tests
> 
> Original change's description:
> > [wasm] Remove override-ability from async compile and instantiate.
> > 
> > We're now using explicit APIs.
> > 
> > Bug: 
> > Change-Id: I4a4248e44543f6e7dfcbdc66456e610fb98ff5ee
> > Reviewed-on: https://chromium-review.googlesource.com/513406
> > Commit-Queue: Brad Nelson <bradnelson@chromium.org>
> > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#45500}
> 
> TBR=bradnelson@chromium.org,mtrofin@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Bug: 
> Change-Id: Ie7c2db40279bd07c535c20afaa1cea51b680fe65
> Reviewed-on: https://chromium-review.googlesource.com/513862
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#45502}

TBR=bradnelson@chromium.org,machenbach@chromium.org,mtrofin@chromium.org,v8-reviews@googlegroups.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Bug: 
Change-Id: Ib826b590b5d362d005460fcebdc6800c8d6c5f63
Reviewed-on: https://chromium-review.googlesource.com/513496
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45519}
2017-05-24 15:55:04 +00:00
Camillo Bruni
106226e9c6 [literals] Set the proper Map on the elements store for object literals
Bug: chromium:725201
Change-Id: Ic75f4080b8ef28e64b471887871c526c0bac316b
Reviewed-on: https://chromium-review.googlesource.com/514004
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45518}
2017-05-24 14:44:13 +00:00
bmeurer
9d8bd05516 [turbofan] Speculatively optimize string character access.
Add a protector cell for string bounds checks that is being used to
protect speculative bounds for String.prototype.charCodeAt and
String.prototype.charAt in TurboFan (and Crankshaft). This way we don't
have the diamond in optimized code, which stands in the way of other
optimizations for charCodeAt that are currently being worked on by
petermarshall@.

BUG=v8:6391
TBR=mlippautz@chromium.org
R=petermarshall@chromium.org

Review-Url: https://codereview.chromium.org/2905623003
Cr-Commit-Position: refs/heads/master@{#45514}
2017-05-24 13:53:40 +00:00
Peter Marshall
14fa66b7a3 [turbofan] Add SeqStringCharCodeAt operation.
Add a sequential string type to the compiler, and transform
charCodeAt on SeqString into SeqStringCharCodeAt.

SeqStringCharCodeAt can handle one and two byte strings.

Bug: v8:6391
Change-Id: I2785257522c28f3b268c9833f5313e9630cb982a
Reviewed-on: https://chromium-review.googlesource.com/509573
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45508}
2017-05-24 11:59:52 +00:00
Michael Achenbach
bf2f18ffd1 Revert "[test] Don't hide crashes in predictable mode"
This reverts commit 589a4d1df4.

Reason for revert: Breaks webkit:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20predictable/builds/11714

Original change's description:
> [test] Don't hide crashes in predictable mode
> 
> Bug: v8:6426
> Change-Id: I278dda0d628732bb9c539c2648d2b27bcbc89bf0
> Reviewed-on: https://chromium-review.googlesource.com/512643
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#45504}

TBR=jkummerow@chromium.org,machenbach@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: v8:6426

Change-Id: I85c573fa332f436bb57f2747ad98c26e1c1f23bd
Reviewed-on: https://chromium-review.googlesource.com/513866
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45506}
2017-05-24 11:50:59 +00:00
Michael Achenbach
589a4d1df4 [test] Don't hide crashes in predictable mode
Bug: v8:6426
Change-Id: I278dda0d628732bb9c539c2648d2b27bcbc89bf0
Reviewed-on: https://chromium-review.googlesource.com/512643
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45504}
2017-05-24 10:24:09 +00:00
Michael Achenbach
ee3729d26e Revert "[wasm] Remove override-ability from async compile and instantiate."
This reverts commit 2869dd55f3.

Reason for revert: Breaks:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/15850

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

Original change's description:
> [wasm] Remove override-ability from async compile and instantiate.
> 
> We're now using explicit APIs.
> 
> Bug: 
> Change-Id: I4a4248e44543f6e7dfcbdc66456e610fb98ff5ee
> Reviewed-on: https://chromium-review.googlesource.com/513406
> Commit-Queue: Brad Nelson <bradnelson@chromium.org>
> Reviewed-by: Brad Nelson <bradnelson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#45500}

TBR=bradnelson@chromium.org,mtrofin@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Bug: 
Change-Id: Ie7c2db40279bd07c535c20afaa1cea51b680fe65
Reviewed-on: https://chromium-review.googlesource.com/513862
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45502}
2017-05-24 06:49:38 +00:00
Mircea Trofin
2869dd55f3 [wasm] Remove override-ability from async compile and instantiate.
We're now using explicit APIs.

Bug: 
Change-Id: I4a4248e44543f6e7dfcbdc66456e610fb98ff5ee
Reviewed-on: https://chromium-review.googlesource.com/513406
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45500}
2017-05-23 23:48:46 +00:00
Camillo Bruni
1783cd32f1 [mjsunit] Split slow large object literal tests
Change-Id: Ib6ee9d9ce827c2f9f42f09292b0caca922cfde1e
Reviewed-on: https://chromium-review.googlesource.com/512663
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45487}
2017-05-23 12:59:03 +00:00
bmeurer
9dbafbd5d3 [turbofan] Add support for inlining accessors into try-blocks.
Previously the inlining of accessors into try-blocks (i.e. try/catch,
try/finally, for-of, etc.) was disabled in JSNativeContextSpecialization,
which prevented a couple of interesting optimizations, i.e. we end up
with a LOAD_IC in optimized code for this simple example:

  class A { get x() { return 1; } }
  function foo(a) {
    try {
      return a.x;
    } catch (e) {
      return 0;
    }
  }
  foo(new A)

This is now fixed and the accessors are properly rewired into the
handler chain.

BUG=v8:6278,v8:6344,v8:6424
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2902533003
Cr-Commit-Position: refs/heads/master@{#45485}
2017-05-23 12:02:28 +00:00
Michael Starzinger
ea48d83d37 [asm.js] Ensure lookups of imports are non-observable.
This makes sure that property lookups on the provided imports object are
non-observable to JavaScript. It allows instantiation failures to fall
back to JavaScript proper without accidentally calling accessors twice.
Also accessors might invalidate previous checks done during linking or
throw exceptions.

R=clemensh@chromium.org
TEST=mjsunit/regress/regress-crbug-719384
BUG=chromium:719384

Change-Id: I3db2672d2a496110f705d02b82878e70cd5d701f
Reviewed-on: https://chromium-review.googlesource.com/509552
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45481}
2017-05-23 10:42:43 +00:00
Clemens Hammacher
70a43f4d3d [wasm] Validate function bodies for lazy compilation
Validation normally happens while generating the turbofan graph of a
wasm function. For lazy compilation (behind the flag
--wasm-lazy-compilation), we skip this graph generation step during
module generation. Thus we need to validate explicitely.

R=ahaas@chromium.org
BUG=chromium:724851

Change-Id: Ic70887c0d823460a272d0bb636dc98b2b7a7e55e
Reviewed-on: https://chromium-review.googlesource.com/509574
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45478}
2017-05-23 09:47:56 +00:00
Andreas Haas
8e0daf78da [wasm] Also kBadChar is a valid utf8 character
The validation of utf8 strings in WebAssembly modules used the character
kBadChar = 0xFFFD to indicate a validation error. However, this
character can appear in a valid utf8 string. This CL fixes this problem
by duplicating some of the code in {Utf8::CalculateValue} and inlining
it directly into Utf8::Validate. Note that Utf8::Validate is used only
for WebAssembly.

Tests for this change are in the WebAssembly spec tests, which I will
update in a separate CL.

R=vogelheim@chromium.org

Change-Id: I8697b9299f3e98a8eafdf193bff8bdff90efd7dc
Reviewed-on: https://chromium-review.googlesource.com/509534
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45476}
2017-05-23 09:28:06 +00:00
Clemens Hammacher
a4eb80f7a6 [wasm] Fix runtime call syntax
This is to avoid ClusterFuzz picking up and using those calls.
With the proper syntax (no whitespace), they are recognized as runtime
calls and will be checked against a whitelist.

R=mstarzinger@chromium.org
BUG=chromium:724459

Change-Id: I5533f066feeb66f622230b12f79f9d227e2b2465
Reviewed-on: https://chromium-review.googlesource.com/509575
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45475}
2017-05-23 09:26:56 +00:00
Clemens Hammacher
a5449b0fd6 [wasm] Stricter max memory check
If the maximum number of memory pages is raised using
--wasm-max-mem-pages, we might allocate more than kMaxInt bytes for
wasm memory. The byte length is stored as int in JSArrayBuffer, hence
this can lead to failures.
Thus, we now additially check against kMaxInt, and fail instantiation
if this check fails.

Drive-by: Add/fix more bounds checks.

R=ahaas@chromium.org
BUG=chromium:724846

Change-Id: Id8e1a1e13e15f4aa355ab9414b4b950510e5e88a
Reviewed-on: https://chromium-review.googlesource.com/509255
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45465}
2017-05-22 14:28:11 +00:00
Michael Starzinger
d813f46e0b [asm.js] Properly handle unused function imports.
This makes sure that function imports without a single call site within
the asm.js module are still preserved in the WebAssembly module, hence
preserving intended JavaScript semantics during module instantiation.

R=clemensh@chromium.org
TEST=mjsunit/regress/regress-crbug-722348
BUG=chromium:722348

Change-Id: I624d0e52b32b864c1e3002187a99a0a63834a4b0
Reviewed-on: https://chromium-review.googlesource.com/509450
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45452}
2017-05-22 11:41:07 +00:00
Camillo Bruni
467b70c978 [runtime] Support fast cloning of object literal elements
BUG: v8:6211
Change-Id: Ief28872f6ce97ff326f9a86367f872e321b2612a
Bug: 
Reviewed-on: https://chromium-review.googlesource.com/508650
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45448}
2017-05-22 10:25:29 +00:00
jgruber
9376944976 Revert of [csa] Add assertions to CSA (patchset #14 id:260001 of https://codereview.chromium.org/2847923003/ )
Reason for revert:
Linux-nosnap failures:

https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/13282

Original issue's description:
> [csa] Add assertions to CSA
>
> This adds a bunch of assertions to CSA, mostly about documenting and checking
> parameter types.
>
> Drive-by-change: Removed unused function.
>
> BUG=v8:6325
>
> Review-Url: https://codereview.chromium.org/2847923003
> Cr-Original-Commit-Position: refs/heads/master@{#45398}
> Committed: b14a981496
> Review-Url: https://codereview.chromium.org/2847923003
> Cr-Commit-Position: refs/heads/master@{#45443}
> Committed: 62b0de1ef5

TBR=cbruni@chromium.org,ishell@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:6325

Review-Url: https://codereview.chromium.org/2893253002
Cr-Commit-Position: refs/heads/master@{#45445}
2017-05-22 09:07:20 +00:00
jgruber
62b0de1ef5 [csa] Add assertions to CSA
This adds a bunch of assertions to CSA, mostly about documenting and checking
parameter types.

Drive-by-change: Removed unused function.

BUG=v8:6325

Review-Url: https://codereview.chromium.org/2847923003
Cr-Original-Commit-Position: refs/heads/master@{#45398}
Committed: b14a981496
Review-Url: https://codereview.chromium.org/2847923003
Cr-Commit-Position: refs/heads/master@{#45443}
2017-05-22 08:06:59 +00:00