Commit Graph

44566 Commits

Author SHA1 Message Date
Michael Starzinger
f4dde20044 [simulator] Refactor redirections to be process-wide.
This refactors the list of redirections of runtime call targets that
simulators maintain to be process-wide (as opposed to be per Isolate).
Such redirections are used for static C++ call targets which themselves
are process-wide, which makes this model a closer fit. Access is already
properly synchronized via a mutex.

Along the way this also introduces the {SimulatorBase} class as a common
base class for all simulator implementations.

R=clemensh@chromium.org

Change-Id: Iae8602c44b1b34cb916dde2b22c9403b0496b3d4
Reviewed-on: https://chromium-review.googlesource.com/823966
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50074}
2017-12-13 13:28:10 +00:00
Ross McIlroy
1d1f52534e [Interpreter] Make RegisterList constructor private to avoid missue.
RegisterLists should only be allocated via the register allocator. To ensure
this, make the RegisterList constructor private and only expose it to tests
and the BytecodeRegisterAllocator.

Change-Id: I09ebfc5c0f1baecfb1333fd672b96d462fd26fcf
Reviewed-on: https://chromium-review.googlesource.com/822196
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50073}
2017-12-13 13:15:35 +00:00
Clemens Hammacher
d5fbf0edcf [Liftoff] Fix stack space reservation
LiftoffAssembler::ReserveStackSpace expected number of bytes, not
number of stack slots. Also, make this clear in the naming of the
parameter, and remove a dead field.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ic4c7167cfa26a169b2936acdde865863141f441d
Reviewed-on: https://chromium-review.googlesource.com/823967
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50072}
2017-12-13 13:14:30 +00:00
Clemens Hammacher
5aaeb2fd1c [wasm] Simplify bounds check
We really just need one check instead of three. This also unifies the
error message to be the same on 32 and 64 bit systems.

Drive-by: Fix potential overflow in {validate_size}.

R=titzer@chromium.org

Bug: chromium:794353
Change-Id: I63c1f5ef53c1f245b9e82bcbf86a5d9ac0d2725e
Reviewed-on: https://chromium-review.googlesource.com/824082
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50071}
2017-12-13 10:44:24 +00:00
Georgia Kouveli
577b4c80e4 Update JSEntryStub for arm64 stack alignment.
This includes adding a padding slot to the stack handler, which is done for all
architectures for consistency.

Bug: v8:6644
Change-Id: I8a6379a82e2a9d1819069850b6734489bd6071a6
Reviewed-on: https://chromium-review.googlesource.com/822477
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#50070}
2017-12-13 10:38:40 +00:00
Sigurd Schneider
6630a1f111 [turbofan] Disallow speculation after deopt from array builtin
This disallows speculation after deoptimization from any of
Array.{forEach,map,filter,find} due to CheckMap fails. Such
CheckMap fails happen if the builtins' function argument
causes the map of the array to change. The js-call-lowering
refrains from optimizing builtins for which speculation was
disallowed.

Bug: v8:6898, v8:7127
Change-Id: Ied6696f8fb023ee404fb82e9d37bfb061f293854
Reviewed-on: https://chromium-review.googlesource.com/819354
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50069}
2017-12-13 10:33:16 +00:00
Clemens Hammacher
4b3043ef20 [Liftoff] Implement memory operations
Add support for loading and storing i32 values to and from memory.
Support for f32 and for non-traphandler configurations (i.e. emitting
bounds checks) will be added in a follow-up CL.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I43c44ce61f5acbac325261212374eb0f48c6ee89
Reviewed-on: https://chromium-review.googlesource.com/809164
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50068}
2017-12-13 10:29:39 +00:00
Tobias Tebbi
60247ea2ce [turbofan] maintain source positions in loop peeling and polymorphic inlining
I also used the opportunity to clean up the loop peeler a bit by making the
class stateful, to avoid passing long argument lists around.

Bug: v8:5864
Change-Id: I2e034c6eabd381b01e15cf3e6aa3ce7b14e7b3d8
Reviewed-on: https://chromium-review.googlesource.com/822933
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50067}
2017-12-13 09:51:46 +00:00
Sigurd Schneider
1edca59ffa [turbofan] Mark builtin stub frames as deoptimized again
For eager deopts within builtin stub frames we skiped marking the
underlying function as deoptimized. This avoided deopt loops where
we would just generate the same optimized code all over again.

Bug: v8:6898
Change-Id: Ie3d7ee4dfcbeb63e6087112d5740a423c4730599
Reviewed-on: https://chromium-review.googlesource.com/822491
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50066}
2017-12-13 09:17:17 +00:00
Michal Majewski
08a05c2bff [test] Move data access from suite to test.
- create testcase subclass for each test
- move get_command, get_source from suite to test
- promises-aplus tests are broken
- moving expected outcomes etc. is still in progress

Bug: v8:6917
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I006e64ecf51dda95c41dff88c68b24f17a638566
Reviewed-on: https://chromium-review.googlesource.com/798331
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50065}
2017-12-13 09:14:47 +00:00
Sigurd Schneider
cd99bada9a [turbofan] Add support to deoptimizer for setting no speculation bit
This CL adds support to the deoptimizer for setting the no speculation
bit on a provided feedback vector if desired.

Bug: v8:7127
Change-Id: I31fd1ea306cf5a4e919faeb896a83c1afdfccd63
Reviewed-on: https://chromium-review.googlesource.com/819370
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50064}
2017-12-13 08:52:34 +00:00
Michael Stanton
a52b4cdf2d Revert "[ICs] Eliminate trampoline ICs in TurboFan generic lowering"
This reverts commit 7d699b938c.

Reason for revert: Actually we like the trampolines. Slight reduction in code size, and prevents spanning the icache.

Original change's description:
> [ICs] Eliminate trampoline ICs in TurboFan generic lowering
> 
> Trampoline ICs differ from normal ICs only in that they
> load the feedback vector from the stack instead of accepting it
> as an argument. We created them for FullCodeGen, where you always
> have the feedback vector on the stack, and can reduce the amount
> of code required to invoke an ICs by hiding the stack load down
> in the trampoline IC.
> 
> Now the concept isn't really necessary, and we can achieve a
> nice cleanup of our idea-space by removing it. The first step is
> to remove their usage in TurboFan.
> 
> Bug: v8:7199
> Change-Id: I08aefa5de199b1f19adea261b7086a84338c0805
> Reviewed-on: https://chromium-review.googlesource.com/822193
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50038}

TBR=mvstanton@chromium.org,tebbi@chromium.org

Change-Id: I63dcd98b799739d1d6ea55508b1ea5cfad9e3292
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7199
Reviewed-on: https://chromium-review.googlesource.com/822420
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50063}
2017-12-13 08:51:14 +00:00
Sigurd Schneider
8ff8c11069 [turbofan] Thread feedback through to deoptimization entries
Bug: v8:7127
Change-Id: Iec65ead1540289aa99f496fd66595f2de88db68c
Reviewed-on: https://chromium-review.googlesource.com/817417
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50062}
2017-12-13 08:21:52 +00:00
peterwmwong
e2ce2e0aff [turbofan] Fix Array.p.find handling of holes in double elements
Bug: chromium:791045, v8:1956
Change-Id: I1400fc95b78e0f4771867d136377b14aed5bd4f4
Reviewed-on: https://chromium-review.googlesource.com/819510
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50061}
2017-12-13 05:38:17 +00:00
v8-autoroll
27da2f8ccf Update V8 DEPS.
Rolling v8/build: e796de3..3d92234

Rolling v8/buildtools: 282996b..1be57dc

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/cb82b10..fbee132

TBR=machenbach@chromium.org,hablich@chromium.org,sergiyb@chromium.org

Change-Id: Iea76a8896a0e92c76bf334922be62a3c60c8fcaa
Reviewed-on: https://chromium-review.googlesource.com/822305
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50060}
2017-12-13 04:57:09 +00:00
Alexei Filippov
5c10512ce8 Mark test-cpu-profiler/NativeFrameStackTrace test as flaky
BUG=v8:7202
TBR=mstarzinger@chromium.org

Change-Id: I5399eab9a04edf98d57ee9e18be76e69f7cc9fa2
Reviewed-on: https://chromium-review.googlesource.com/823566
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50059}
2017-12-13 01:54:23 +00:00
Alexei Filippov
f514cc967d [cpu-profiler] Introduce NativeFrame type.
The new frame type is inteneded to represent native C++ stack frames.
JS code may sometimes make calls to helper native functions that do not
provide any special stack layout besides the return address and frame pointer.

Currently the stack iterator bails out when it sees an unknown frame.
The patch allows the iterator to unwind stacks having such frames.

BUG=chromium:768540

Change-Id: I9c273c7015695a6733c0a0c52b522fca7b25de0d
Reviewed-on: https://chromium-review.googlesource.com/794991
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50058}
2017-12-13 00:05:45 +00:00
v8-autoroll
3b59a7954b Update V8 DEPS.
Rolling v8/build: ca599b0..e796de3

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/d624b3c..cb82b10

Rolling v8/tools/clang: 8688d26..73924d8

TBR=machenbach@chromium.org,hablich@chromium.org,sergiyb@chromium.org

Change-Id: I28fc53da5f713100b3d93cdac5e8a2708f7c5a5f
Reviewed-on: https://chromium-review.googlesource.com/821373
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50057}
2017-12-12 22:31:31 +00:00
Sergiy Byelozyorov
26f5c30b70 Whitespace CL
TBR=sergiyb@chromium.org

Bug: chromium:747960
Change-Id: Ib12ac093d1605ef4b409d8e73b0a75da83b2fb48
Reviewed-on: https://chromium-review.googlesource.com/817568
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50056}
2017-12-12 21:07:28 +00:00
Sergiy Byelozyorov
18d7c66131 Migrate 3 more builders to LUCI
TBR=machenbach@chromium.org

No-Try: true
Bug: chromium:793687
Change-Id: I08f54c20ad50c3f733505ce0c6769cc08281beb7
Reviewed-on: https://chromium-review.googlesource.com/822613
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50055}
2017-12-12 20:29:23 +00:00
Clemens Hammacher
aba57b1164 [wasm] Introduce LoadType and StoreType enums
These enums capture the "type" of a load and store in one value, with
accessors to get the value type, memory type, memory size etc.
This will simplify implementing memory operations in Liftoff.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ief673e90fe63292853f97e5e95b5c39da1296730
Reviewed-on: https://chromium-review.googlesource.com/822476
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50054}
2017-12-12 19:59:03 +00:00
Tobias Tebbi
1220809924 [profiler] allow non-existing source position of inlined call
Turbofan does not always maintain source positions. Since the profiler
is best-effort only, this is ok and we should not assert it.
Source positions for stack traces are computed with an independent
mechanism: the stack walker. It's impossible to use the stack walker
here since it assumes that the frames actually exist.

Bug: chromium:787959
Change-Id: I43c3c4e6de0a9b5f76b05c53af238cb1df6ea1c5
Reviewed-on: https://chromium-review.googlesource.com/822930
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50053}
2017-12-12 19:16:23 +00:00
Ali Ijaz Sheikh
4623b8223b [heap] replace DisableInlineAllocationSteps with PauseAllocationObservers
* DisableInlineAllocationSteps was a blunt hammer added to work around
  tests that needed to avoid artificially lower limits imposed by
  observers. PauseAllocationObserversScope can properly disable step on
  a temporary basis.
* Modify tests. Remove DisableInlineAllocationSteps.

This exposed a bug in allocation observers: we were not doing a step
when a fresh page is added.

Fix this by moving the step into UpdateAllocationInfo. We should be
doing a step (and keeping top_on_previous_step_ consistent) whenever
we move move top(). UpdateAllocationInfo is the correct place for this
rather than the callers of UpdateAllocationInfo.

Bug: 
Change-Id: I2edc238dc2e73bf9a2e9738c2a9b50efcac5cbf0
Reviewed-on: https://chromium-review.googlesource.com/821052
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50052}
2017-12-12 19:12:03 +00:00
Marja Hölttä
10d9c31488 [parser] Fix NaryOperation positions.
If an initializer is a NaryOperation, its position ends up as a start position
of a Scope, and a DCHECK used to fire.

Interestingly, this was not caught by our existing tests.

BUG=chromium:791256

Change-Id: Id47f850c7ad17ca580352f9bd56c9567b485c3b8
Reviewed-on: https://chromium-review.googlesource.com/822093
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50051}
2017-12-12 18:54:03 +00:00
Clemens Hammacher
a3a024f0e8 Reland^2 "[wasm] [cleanup] Only pass information really needed"
This is a reland of fa18e78dc7.

Mips compile error is fixed.

Original change's description:
> [wasm] [cleanup] Only pass information really needed
>
> Instead of always passing the MachineType, we can often just pass the
> accessed memory size or the MachineRepresentation, which is less
> information to pass and will simplify the upcoming refactoring for
> memory operations in Liftoff.
>
> R=titzer@chromium.org
>
> Bug: v8:6600
> Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
> Reviewed-on: https://chromium-review.googlesource.com/822194
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50041}

TBR=titzer@chromium.org

Bug: v8:6600
Change-Id: I3dff3072d6ceebd74873ace0c7dce7cccc3055d5
Reviewed-on: https://chromium-review.googlesource.com/822851
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50050}
2017-12-12 18:50:53 +00:00
Eugene Ostroukhov
64d145534c [inspector] allow generatePreview for wrapObject
This method is needed by some Blink agents to generate object previews.

Bug: 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2304a6e44ea65ec469f3a3216b8bed789f706d0c
Reviewed-on: https://chromium-review.googlesource.com/821596
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50049}
2017-12-12 18:02:13 +00:00
Clemens Hammacher
7b80915a69 Revert "Reland "[wasm] [cleanup] Only pass information really needed""
This reverts commit ee106cb907.

Reason for revert: Still failing on big endian mips. 

Original change's description:
> Reland "[wasm] [cleanup] Only pass information really needed"
> 
> This is a reland of fa18e78dc7.
> 
> Mips compile error is fixed.
> 
> Original change's description:
> > [wasm] [cleanup] Only pass information really needed
> >
> > Instead of always passing the MachineType, we can often just pass the
> > accessed memory size or the MachineRepresentation, which is less
> > information to pass and will simplify the upcoming refactoring for
> > memory operations in Liftoff.
> >
> > R=titzer@chromium.org
> >
> > Bug: v8:6600
> > Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
> > Reviewed-on: https://chromium-review.googlesource.com/822194
> > Reviewed-by: Ben Titzer <titzer@chromium.org>
> > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#50041}
> 
> TBR=titzer@chromium.org
> 
> Bug: v8:6600
> Change-Id: Ia2c47464277a7c7a70099e7f7d6e32003e34d87e
> Reviewed-on: https://chromium-review.googlesource.com/822342
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50047}

TBR=titzer@chromium.org,clemensh@chromium.org

Change-Id: I448e3ad433451fb468c2db66b4b297e8c72a8c69
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6600
Reviewed-on: https://chromium-review.googlesource.com/822696
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50048}
2017-12-12 17:59:25 +00:00
Clemens Hammacher
ee106cb907 Reland "[wasm] [cleanup] Only pass information really needed"
This is a reland of fa18e78dc7.

Mips compile error is fixed.

Original change's description:
> [wasm] [cleanup] Only pass information really needed
>
> Instead of always passing the MachineType, we can often just pass the
> accessed memory size or the MachineRepresentation, which is less
> information to pass and will simplify the upcoming refactoring for
> memory operations in Liftoff.
>
> R=titzer@chromium.org
>
> Bug: v8:6600
> Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
> Reviewed-on: https://chromium-review.googlesource.com/822194
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50041}

TBR=titzer@chromium.org

Bug: v8:6600
Change-Id: Ia2c47464277a7c7a70099e7f7d6e32003e34d87e
Reviewed-on: https://chromium-review.googlesource.com/822342
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50047}
2017-12-12 17:42:33 +00:00
Ben L. Titzer
65ac8ca0a1 [turbofan] Remove CheckedStore from TurboFan backend.
This operation was used to implement asm.js stores, but is obsolete
with asm.js stores now being lowered to normal graph nodes.

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

Bug: 
Change-Id: Iea90b1a62be2e273c0562058642adc5b63ae2cf8
Reviewed-on: https://chromium-review.googlesource.com/822570
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50046}
2017-12-12 17:26:03 +00:00
Georg Neis
585b39f53a Reland "Fix "this" value in lazily-parsed module functions."
This is a reland of c3bd741efd
Original change's description:
> Fix "this" value in lazily-parsed module functions.
>
> When preparsing top-level functions in a module, we didn't track
> unresolved variables. Consequently, "this" ended up referencing
> the global "this", which has the wrong value (in a module "this"
> is supposed to be the undefined value).
>
> This patch fixes that. This also lets us stop forcing context
> allocation of all variables in module scopes, which the patch
> takes care of as well.
>
> Bug: chromium:791334
> Change-Id: Ifac1f1adc033f3facfb3d29dd4bca32ee27bffcf
> Reviewed-on: https://chromium-review.googlesource.com/808938
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50025}

TBR=adamk@chromium.org
TBR=kozyatinskiy@chromium.org

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel

Bug: chromium:791334
Change-Id: I57acc7b84a345565b36cbb55924fa2ff9b449eec
Reviewed-on: https://chromium-review.googlesource.com/822341
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50045}
2017-12-12 17:23:35 +00:00
Ben L. Titzer
ea6bcbc0ff [asmjs] Implement asm.js stores in terms of regular branches.
The CheckedLoad and CheckedStore machine operators are a form of
macro node used in the backend of TurboFan. They express bounds-checked
accesses to typed arrays in the asm.js style. While their semantics
can be expressed as normal machine operations and branches in the
graph, they were originally used to save compile time when graphs
were very big. ASM->WASM->TF graphs are smaller.

This CL implements asm.js bounds checks for stores using normal
branch nodes and removes the need for CheckedStore, improving
maintainability at some small cost to compilation time.

R=mstarzinger@chromium.org
CC=​bradnelson@chromium.org

Bug: 
Change-Id: I928689cfe33acac5a422f32cb014850ba09196f1
Reviewed-on: https://chromium-review.googlesource.com/822471
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50044}
2017-12-12 16:26:53 +00:00
Michael Achenbach
dad3338b9a Revert "[wasm] [cleanup] Only pass information really needed"
This reverts commit fa18e78dc7.

Reason for revert:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/14055

Original change's description:
> [wasm] [cleanup] Only pass information really needed
> 
> Instead of always passing the MachineType, we can often just pass the
> accessed memory size or the MachineRepresentation, which is less
> information to pass and will simplify the upcoming refactoring for
> memory operations in Liftoff.
> 
> R=​titzer@chromium.org
> 
> Bug: v8:6600
> Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
> Reviewed-on: https://chromium-review.googlesource.com/822194
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50041}

TBR=titzer@chromium.org,clemensh@chromium.org

Change-Id: I3c85e3bc9b37c97b373b5e51a094be9561767f86
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6600
Reviewed-on: https://chromium-review.googlesource.com/822850
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50043}
2017-12-12 15:34:05 +00:00
Junliang Yan
af318e13cc PPC/s390: [runtime] Cleanup Map fields and bit fields definitions.
Port 7a159da151

R=ishell@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I669b665d7ef00dc6dcc80936d460e12c80bc1eb6
Reviewed-on: https://chromium-review.googlesource.com/818123
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#50042}
2017-12-12 15:29:13 +00:00
Clemens Hammacher
fa18e78dc7 [wasm] [cleanup] Only pass information really needed
Instead of always passing the MachineType, we can often just pass the
accessed memory size or the MachineRepresentation, which is less
information to pass and will simplify the upcoming refactoring for
memory operations in Liftoff.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I8748f8e00dcfdbc4082893143fe88bdafde99053
Reviewed-on: https://chromium-review.googlesource.com/822194
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50041}
2017-12-12 15:26:23 +00:00
Ulan Degenbaev
5bc1d29105 [heap] Make assert in Page::ShrinkToHighWaterMark more robust.
Currently Page::ShrinkToHighWaterMark checks that there is only one
filler in the to-be-freed area at the end of the page. This does not
hold if an allocation observer is active.

We should instead check that the to-be-freed area does not contain
allocated objects and will not contain allocated objects:
1) Following chain of fillers we arrive at the end of the page.
2) The free list of the page is empty.

This patch also changes PagedSpace::ResetFreeList to evict free list
entries of each page, instead of just reseting the global free list.

It also removes invalidation of free list categories.
Now FreeList::EvictFreeListItems simply evicts free list entries without
invalidating free list categories.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I6051578ec2c91c9614d14c7a6ce188d2db5ace3b
Reviewed-on: https://chromium-review.googlesource.com/822571
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50040}
2017-12-12 15:14:58 +00:00
Clemens Hammacher
cb35f165b8 [wasm] Remove redundant mem op decoding
Instead of specializing {DecodeLoadMem} and {DecodeStoreMem} for
prefixed opcodes, just pass the offset as parameter.

R=titzer@chromium.org

Change-Id: I0581f6e9cb562885709aaa0317bb550b175ad160
Reviewed-on: https://chromium-review.googlesource.com/822391
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50039}
2017-12-12 15:13:53 +00:00
Mike Stanton
7d699b938c [ICs] Eliminate trampoline ICs in TurboFan generic lowering
Trampoline ICs differ from normal ICs only in that they
load the feedback vector from the stack instead of accepting it
as an argument. We created them for FullCodeGen, where you always
have the feedback vector on the stack, and can reduce the amount
of code required to invoke an ICs by hiding the stack load down
in the trampoline IC.

Now the concept isn't really necessary, and we can achieve a
nice cleanup of our idea-space by removing it. The first step is
to remove their usage in TurboFan.

Bug: v8:7199
Change-Id: I08aefa5de199b1f19adea261b7086a84338c0805
Reviewed-on: https://chromium-review.googlesource.com/822193
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50038}
2017-12-12 15:06:13 +00:00
Mircea Trofin
a9d9001810 [wasm] Fix up mips & WasmCodeManager
Corrected mips code generation for WASM_CALL and JS_TO_WASM_CALL.

The logic for fetching raw call sites needed changing, too, in light
of mips' 2-instruction calls, where using target_address_address is
incorrect. The CL adds platform-specific accessors.

Bug: chromium:793292 chromium:793282
Change-Id: I879ea6bffdad60791d88a6f5ea15087cdcd3f2e9
Reviewed-on: https://chromium-review.googlesource.com/818460
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50037}
2017-12-12 15:02:23 +00:00
Michael Achenbach
62f09de9ab Revert "Fix "this" value in lazily-parsed module functions."
This reverts commit c3bd741efd.

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

Original change's description:
> Fix "this" value in lazily-parsed module functions.
> 
> When preparsing top-level functions in a module, we didn't track
> unresolved variables. Consequently, "this" ended up referencing
> the global "this", which has the wrong value (in a module "this"
> is supposed to be the undefined value).
> 
> This patch fixes that. This also lets us stop forcing context
> allocation of all variables in module scopes, which the patch
> takes care of as well.
> 
> Bug: chromium:791334
> Change-Id: Ifac1f1adc033f3facfb3d29dd4bca32ee27bffcf
> Reviewed-on: https://chromium-review.googlesource.com/808938
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50025}

TBR=adamk@chromium.org,marja@chromium.org,neis@chromium.org,kozyatinskiy@chromium.org

Change-Id: I81f69334ed2ce104c00e6205d50001e4bdf07d15
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:791334
Reviewed-on: https://chromium-review.googlesource.com/822258
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50036}
2017-12-12 14:08:25 +00:00
Georg Neis
10f392acf0 [csa] Clean up handling of type feedback variable.
This makes the code dealing with type feedback more concise and uniform
(at the cost of a few redundant comparisons).

Bug: 
Change-Id: If6b98bd1f0dddd392d7b00d65b600127bd30ff7e
Reviewed-on: https://chromium-review.googlesource.com/818984
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50035}
2017-12-12 13:56:23 +00:00
Georg Neis
e1f232330e [bigint,interpreter] Add more tests for type feedback.
R=jkummerow@chromium.org

Bug: v8:6791
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2b04e4d5c2f8dd8c7e57662c81778a3a77376cb5
Reviewed-on: https://chromium-review.googlesource.com/819271
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50034}
2017-12-12 13:19:23 +00:00
Michal Majewski
4f4654a013 [test] Deduplicate parsing source file flags.
Bug: v8:6917
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I12d62e28b8e22820d4358d0166fa5db5e09b8bc3
Reviewed-on: https://chromium-review.googlesource.com/819630
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50033}
2017-12-12 13:12:18 +00:00
Michal Majewski
222076d927 [test] Return analysis exit code for no tests.
NOTRY=true

Bug: v8:6917
Change-Id: I5f1edec76f3e67909b7d910187ab2d0bc774d10b
Reviewed-on: https://chromium-review.googlesource.com/822490
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50032}
2017-12-12 13:11:13 +00:00
Andreas Haas
bd732f7ddd Reland [turbofan] Implement on-stack returns (Intel)
The original CL introduced a test which uses a random number generator.
I disable the test for now, which is okay because this CL adds to a
work-in-progress feature anyways, and I will fix the problem in another
CL.

Original description:
Add the ability to return (multiple) return values on the stack:

- Extend stack frames with a new buffer region for return slots.
  This region is located at the end of a caller's frame such that
  its slots can be indexed as caller frame slots in a callee
  (located beyond its parameters) and assigned return values.
- Adjust stack frame constructon and deconstruction accordingly.
- Extend linkage computation to support register plus stack returns.
- Reserve return slots in caller frame when respective calls occur.
- Introduce and generate architecture instructions ('peek') for
  reading back results from return slots in the caller.
- Aggressive tests.
- Some minor clean-up.

So far, only ia32 and x64 are implemented.

Change-Id: I8b03fc4e53946daaa0e14a34603f4824a04fad7e
Reviewed-on: https://chromium-review.googlesource.com/819557
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50031}
2017-12-12 13:09:05 +00:00
Benjamin
f5a12d8661 [coverage] include 'else' in coverage range
'else' was missing in coverage range, resulting in odd looking reports

R=jgruber@chromium.org

Bug: v8:7179
Change-Id: I377cc557d51075256da27febdc8ab5442ea04d27
Reviewed-on: https://chromium-review.googlesource.com/816736
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50030}
2017-12-12 13:04:43 +00:00
Sergiy Byelozyorov
33373be03c Whitespace CL
TBR=sergiyb@chromium.org

Bug: 
Change-Id: I5dbbb9ace1a232b9441b81a897c28a997d549dec
Reviewed-on: https://chromium-review.googlesource.com/821070
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50029}
2017-12-12 12:57:18 +00:00
Jaroslav Sevcik
bee8c16895 [deoptimizer] Use empty fixed array when materializing empty arguments elements.
Bug: chromium:793863
Change-Id: I68860924c3252184f63dbea8561e5c4fe6bfa4ca
Reviewed-on: https://chromium-review.googlesource.com/822071
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50028}
2017-12-12 12:56:13 +00:00
Michael Achenbach
256bb274d1 [test] Skip memory-hungry test for gc fuzzer with tsan
TBR=majeski@google.com
NOTRY=true

Bug: v8:6972
Change-Id: I80f392c97e4120dc81745346b36f9c505da13461
Reviewed-on: https://chromium-review.googlesource.com/822410
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50027}
2017-12-12 12:45:13 +00:00
Andreas Haas
783376b0e0 [wasm] Turn on streaming compilation
I tested it with 30000 tests in the wasm spec test suite, and they all
pass.

Change-Id: Ice0fb64f56685f67521431213e3fc8fbc263750e
Reviewed-on: https://chromium-review.googlesource.com/822111
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50026}
2017-12-12 12:37:13 +00:00
Georg Neis
c3bd741efd Fix "this" value in lazily-parsed module functions.
When preparsing top-level functions in a module, we didn't track
unresolved variables. Consequently, "this" ended up referencing
the global "this", which has the wrong value (in a module "this"
is supposed to be the undefined value).

This patch fixes that. This also lets us stop forcing context
allocation of all variables in module scopes, which the patch
takes care of as well.

Bug: chromium:791334
Change-Id: Ifac1f1adc033f3facfb3d29dd4bca32ee27bffcf
Reviewed-on: https://chromium-review.googlesource.com/808938
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50025}
2017-12-12 12:09:49 +00:00