Commit Graph

41555 Commits

Author SHA1 Message Date
Michael Achenbach
2d79d2c3a7 Revert "[async-iteration] implement spec-change to yield in async generators"
This reverts commit 409f84c93b.

Reason for revert: Breaks nosnap debug:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/14288

Original change's description:
> [async-iteration] implement spec-change to `yield` in async generators
> 
> Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
> 
> AsyncGeneratorResolve no longer unwraps a value component. Instead, the
> value is unwrapped before the builtin call via Await, allowing Promise
> rejections to affect the generator control flow.
> 
> Thus, all `yield <expr>` implicitly become `yield await <expr>`.
> 
> Additionally, `return <expr>` becomes `return await <expr>`. Finally, when
> the generator is resumed with `.return()`, the parameter passed to .return()
> is awaited before generator execution properly continues).
> 
> BUG=v8:5855
> R=​littledan@chromium.org, neis@chromium.org, adamk@chromium.org
> 
> Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
> Change-Id: Ife084076c3ed434b5467e6aeba14082f8b410ad5
> Reviewed-on: https://chromium-review.googlesource.com/523844
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47011}

TBR=rmcilroy@chromium.org,adamk@chromium.org,yangguo@chromium.org,neis@chromium.org,littledan@chromium.org,gsathya@chromium.org,caitp@igalia.com

Change-Id: Ie6ad7e5410a3a89aab7a5dc68de36eb27b9354fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5855
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/593952
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47013}
2017-07-31 15:23:56 +00:00
Jakob Gruber
17a26c0bc7 Revert "[builtins] Remove Builtins::Name() accessors"
This reverts commit 2f79e03560.

Reason for revert: Conflicts with successor CL.

Original change's description:
> [builtins] Remove Builtins::Name() accessors
> 
> Instead of auto-generating the Name() convenience accessor, use a macro to
> avoid wasting code space.
> 
>   BUILTIN_CODE(isolate, Name)
> 
> expands to
> 
>   isolate->builtins()->builtin_handle(Builtins::kName);
> 
> This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
> 
> Bug: v8:6624
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
> Reviewed-on: https://chromium-review.googlesource.com/593607
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47010}

TBR=yangguo@chromium.org,ahaas@chromium.org,jgruber@chromium.org,bmeurer@chromium.org

Change-Id: Ia9ef5c755b26c3f4e143d87a7c51033614ea435e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6624
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/594048
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47012}
2017-07-31 14:38:21 +00:00
Caitlin Potter
409f84c93b [async-iteration] implement spec-change to yield in async generators
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:

AsyncGeneratorResolve no longer unwraps a value component. Instead, the
value is unwrapped before the builtin call via Await, allowing Promise
rejections to affect the generator control flow.

Thus, all `yield <expr>` implicitly become `yield await <expr>`.

Additionally, `return <expr>` becomes `return await <expr>`. Finally, when
the generator is resumed with `.return()`, the parameter passed to .return()
is awaited before generator execution properly continues).

BUG=v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Ife084076c3ed434b5467e6aeba14082f8b410ad5
Reviewed-on: https://chromium-review.googlesource.com/523844
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47011}
2017-07-31 14:15:49 +00:00
jgruber
2f79e03560 [builtins] Remove Builtins::Name() accessors
Instead of auto-generating the Name() convenience accessor, use a macro to
avoid wasting code space.

  BUILTIN_CODE(isolate, Name)

expands to

  isolate->builtins()->builtin_handle(Builtins::kName);

This reduces the size of libv8.so by 134,752 bytes on a x64 release build.

Bug: v8:6624
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
Reviewed-on: https://chromium-review.googlesource.com/593607
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47010}
2017-07-31 14:04:19 +00:00
Leszek Swirski
e47d175738 [sfi] Remove opt_count
Remove opt_count from SFI, which only had two real uses:

  1. Detecting OSR in tests -- replaced with a stack walk in
     %GetOptimizationStatus
  2. Naming optimization log files -- replaced with the
     optimization id

This allows us to remove a field from the SFI, moving the
bailout reason into the counters field.

As a drive-by, add optimization marker information (e.g.
marked for optimization) to the optimization status.

Change-Id: Id77deb5dd5439dfba058a7e1e1748de26b717d0d
Reviewed-on: https://chromium-review.googlesource.com/592028
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47009}
2017-07-31 13:18:49 +00:00
Clemens Hammacher
20d25f4036 Revert "[wasm] Allow for arbitrarily long error messages"
This reverts commit 072d0e3eb6.

Reason for revert: Performance regressions (https://crbug.com/749041).

Original change's description:
> [wasm] Allow for arbitrarily long error messages
> 
> We currently have a fixed limit of 256 characters for error messages
> generated in the decoder. However, we sometimes embed names in it,
> which makes it easy to generate a crash by using long names (e.g. for
> exports) in invalid wasm modules.
> This CL fixes this by switching to a stream based interface, allowing
> to pass arbitrary objects to be printed. With this interface, we can
> easily limit the length of output later.
> 
> R=​titzer@chromium.org
> 
> Bug: chromium:740023
> Change-Id: I2848c31c63a015157e2a3a9458b54e523060cd69
> Reviewed-on: https://chromium-review.googlesource.com/565282
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46860}

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

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

Bug: chromium:740023, chromium:749041
Change-Id: I005a60d55dcf01d350230f8d98f715bab9c43886
Reviewed-on: https://chromium-review.googlesource.com/593807
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47008}
2017-07-31 13:00:54 +00:00
Peter Marshall
1a087f027f [test] Crash on InvalidStringLength for correctness fuzzer.
Now that the maximum string length varies between platforms, the
correctness fuzzer is unhappy. It will ignore crashes, so when we know
we have reached platform-dependant behavior just crash if
--abort_on_stack_overflow is enabled.

Also rename abort_on_stack_overflow to
abort_on_stack_or_string_length_overflow.

Bug: chromium:748137
Change-Id: Ie4e96709b90029b5ce3c8408064d928f841b3b9f
Reviewed-on: https://chromium-review.googlesource.com/589269
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47007}
2017-07-31 12:59:50 +00:00
Ross McIlroy
3c31e109ea [Interpreter] Internalize AST before print-ast is triggered
Print AST needs access to the internalized strings, so make sure AST
is internalized before we print it.

BUG=v8:5203

Change-Id: Ia4995147feb7ec466523a0c4a89620749b23dcab
Reviewed-on: https://chromium-review.googlesource.com/593648
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47006}
2017-07-31 12:16:48 +00:00
Clemens Hammacher
3532528f90 Add missing include guards
R=ahaas@chromium.org

Change-Id: Ie46dce0e417ce528bbd81aa6ef87ca63a9fcc869
Reviewed-on: https://chromium-review.googlesource.com/593613
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47005}
2017-07-31 11:31:28 +00:00
Clemens Hammacher
f1fb4c1c23 Fix mjsunit.js failure output
The bug was introduced in a previous refactoring:
https://chromium-review.googlesource.com/c/455555/14/test/mjsunit/mjsunit.js

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

Change-Id: I49d2797c3ba834c89011910a81cffd9e119e719f
Reviewed-on: https://chromium-review.googlesource.com/593612
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47004}
2017-07-31 11:23:28 +00:00
jgruber
5c184bf8f4 Reland "[coverage] Ship block coverage"
This is a reland of 7bb6cd63ed
Original change's description:
> [coverage] Ship block coverage
> 
> Enables block coverage by default.
> 
> Design doc: http://goo.gl/hSJhXn
> Tracking bug: http://crbug.com/v8/6000
> 
> Bug: v8:6000
> Change-Id: I8c56474473b60e4707b75dc601b3e88455861a27
> Reviewed-on: https://chromium-review.googlesource.com/583093
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46898}

Bug: v8:6000
Change-Id: I033d89a35c23fcff083f83103df45e33f7962d67
Reviewed-on: https://chromium-review.googlesource.com/592968
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47003}
2017-07-31 11:01:02 +00:00
Michael Lippautz
3d2b211a0c [heap] Scavenger: Restructure main processing method
- Add scopes
- Rename scopes to fit hierarchy
- Scavenge weak collections before parallel phase
- Remove semi space phase which doesn't exist anymore

Bug: chromium:738865
Change-Id: Id3b72793e764f8d3597917e45185d08675b57f5d
Reviewed-on: https://chromium-review.googlesource.com/593611
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47002}
2017-07-31 10:58:22 +00:00
Tobias Tebbi
68fb62152a Reland2: [turbofan] staging new implementation of escape analysis
Reland of https://chromium-review.googlesource.com/c/591667/, removing thread-local variable

Bug: 
Change-Id: Ia9bc73be4a46a6bf052220726193c8b6634eb73e
Reviewed-on: https://chromium-review.googlesource.com/593559
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47001}
2017-07-31 10:01:07 +00:00
Leszek Swirski
488b3e61bd [compiler-dispatcher] Rename ShortPrint to ShortPrintOnMainThread
Also enforce that it is called on the main thread.

Change-Id: I827beefe625bebf6c03fce5220cfbbd68e807984
Reviewed-on: https://chromium-review.googlesource.com/591372
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47000}
2017-07-31 09:49:07 +00:00
Ulan Degenbaev
3f820ebb0b [heap, runtime] Avoid redundant clearing of slots outside an object.
When an object shrinks, we can keep the recorded slots until the sweeper
removes them. It is safe because the recorded slots will not be over-
written with untagged values.

BUG=chromium:694255

Change-Id: I2b910c6345a306e00c7a10396876001e663f51ea
Reviewed-on: https://chromium-review.googlesource.com/591650
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46999}
2017-07-31 09:42:27 +00:00
Ulan Degenbaev
ed76f17b15 [heap, runtime] Avoid redundant clearing of slots in a trimmed array.
The slots outside the trimmed array will be cleared by the sweeper and
will not be overwritten with an untagged value.

BUG=chromium:694255

Change-Id: I3e814b9934ca95a09e883e237687434e6bb58c80
Reviewed-on: https://chromium-review.googlesource.com/591651
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46998}
2017-07-31 09:41:18 +00:00
Vladan Djeric
2f897f5625 Update AUTHORS file for Facebook organization
We are unblocking contributors from @fb.com and @oculus.com to contribute to Chromium. Our primary contributor group is still specified in our Facebook CLA group and should be consulted before allowing any contributions.

Bug: 
Change-Id: I21ee84a29382f034184d053b77b02c78e6055791
Reviewed-on: https://chromium-review.googlesource.com/558708
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46997}
2017-07-31 08:53:21 +00:00
Ulan Degenbaev
c8c3f3cf75 [heap] Clear old-to-old recorded slots in the sweeper.
Currently we clear only old-to-new slots in the sweeper.
For old-to-old slots we maintain the invariant that there are no
recorded slots in dead objects by explicitly clearing them
on object size change and array trimming.

The write barrier for concurrent marking will record slots
even when the host object is white. Thus, it can introduce slots
in dead objects, which will break evacuation phase if we do not
clear them in the sweeper.

Besides that, the patch makes handling of slots more uniform and
allows us to remove clearing of slots on object size changes.

BUG=chromium:694255

Change-Id: I48f60eb25ddc48c6948be4461367e3f7abf74672
Reviewed-on: https://chromium-review.googlesource.com/592207
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46996}
2017-07-31 08:52:16 +00:00
Loo Rong Jie
1dfaec2647 Partial revert of "Remove ~MaybeHandle and statically assert that handles are trivially copyable"
Reason: cause Blink regression on Android

Original CL: https://chromium-review.googlesource.com/c/538463/

Bug: chromium:735910
Change-Id: I405e71f6ffeaf9fa467036a6fafa0271a60de9d3
Reviewed-on: https://chromium-review.googlesource.com/593247
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Loo Rong Jie <loorongjie@gmail.com>
Cr-Commit-Position: refs/heads/master@{#46995}
2017-07-31 08:46:37 +00:00
jgruber
d4c157ee65 [builtins] Extract isolate-independent metadata
Instead of generating huge switch statements for builtin accessor functions,
simply store isolate-independent metadata in a struct indexed by builtin-id.

Drive-by-fix: Remove duplicate parameter-count lookup accessor.
Drive-by-fix: Print builtin kind with --print-builtin-size.

Bug: v8:6624
Change-Id: Ibe61eeee6b8849d5e1a2361ec8268b233be8bb13
Reviewed-on: https://chromium-review.googlesource.com/591847
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46994}
2017-07-31 08:33:14 +00:00
Michael Lippautz
6432301fc3 [heap] Scavenger: Remove dead code
Bug: chromium:738865
Change-Id: Ia9544707d4117187746fc50a416370b3c08ab842
Reviewed-on: https://chromium-review.googlesource.com/593313
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46993}
2017-07-31 08:15:49 +00:00
Alexey Kozyatinskiy
e20ef0249f [inspector] added Debugger.getPossibleBreakpoints perf test
We need this benchmark to measure speedup of getPossibleBreakpoints method by [1].

[1] https://chromium-review.googlesource.com/c/591027/

R=dgozman@chromium.org

Bug: none
Change-Id: I617a435d5a162800caae2fb85596839a57d4d9bd
Reviewed-on: https://chromium-review.googlesource.com/592308
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46992}
2017-07-31 08:05:29 +00:00
Jakob Gruber
793053fd76 [coverage] Don't skip collection if invocation_count is zero
Function-granularity coverage skips functions that are both uncovered
and have an uncovered parent. This optimization needs to be tweaked once
block coverage and incremental collection is in play, as it is possible
to have a function with invocation_count == 0 (i.e. uncovered at
function granularity) that still has relevant block-granularity
coverage.

Bug: v8:6000
Change-Id: I4cc81b8a6935aa58e29d383ed4fa749cbfe69352
Reviewed-on: https://chromium-review.googlesource.com/589508
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46991}
2017-07-31 07:56:28 +00:00
Ulan Degenbaev
962de532f5 [heap] Fix data race in IncrementalMarking::NotifyLeftTrimming.
BUG=chromium:694255
TBR=mlippautz@chromium.org

Change-Id: I7dd9623ff85fcc49f034c71a6f5149f9488a9abb
Reviewed-on: https://chromium-review.googlesource.com/593010
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46990}
2017-07-29 13:34:35 +00:00
Georg Neis
53db05840e Revert "[Memory] Add an OnCriticalMemoryPressure method to V8::Platform."
This reverts commit 3f90d9f994.

Reason for revert: https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/16510

Original change's description:
> [Memory] Add an OnCriticalMemoryPressure method to V8::Platform.
> 
> Adds virtual V8::Platform::OnCriticalMemoryPressure method, default
> implementation does nothing.
> 
> Calls this method on first allocation failures in NewArray, Malloced,
> and zone AccountingAllocator and adds retry logic.
> 
> Adds utility functions for allocating base::VirtualMemory to functions
> in allocation.h, which call this method and add retry logic.
> 
> Calls these utility functions in heap CodeRange, Spaces, StoreBuffer
> and SequentialMarkingDeque.
> 
> Bug: v8:6635
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I38afd394f3be556aca037d16675e9884658158cb
> Reviewed-on: https://chromium-review.googlesource.com/583543
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46988}

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

Change-Id: I79afea5982e62db1462cc5a5585a226f0ddbe752
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6635
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/592887
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46989}
2017-07-29 04:47:49 +00:00
Bill Budge
3f90d9f994 [Memory] Add an OnCriticalMemoryPressure method to V8::Platform.
Adds virtual V8::Platform::OnCriticalMemoryPressure method, default
implementation does nothing.

Calls this method on first allocation failures in NewArray, Malloced,
and zone AccountingAllocator and adds retry logic.

Adds utility functions for allocating base::VirtualMemory to functions
in allocation.h, which call this method and add retry logic.

Calls these utility functions in heap CodeRange, Spaces, StoreBuffer
and SequentialMarkingDeque.

Bug: v8:6635
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I38afd394f3be556aca037d16675e9884658158cb
Reviewed-on: https://chromium-review.googlesource.com/583543
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46988}
2017-07-29 02:49:44 +00:00
Bill Budge
f8d95d7266 [Turbofan] Fix 128 bit slot swaps on ia32.
- Use a sequence of push/pop instructions to move 128 bit values.
- Generalize HighOperand method to handle other offsets.

Bug: v8:6020
Change-Id: I21467c2f19637b0e6b86a3060952386dd0c5d77a
Reviewed-on: https://chromium-review.googlesource.com/583627
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46987}
2017-07-29 00:55:25 +00:00
Brad Nelson
7662e0634c Enable SharedArrayBuffer by default in standalone v8.
BUG=chromium:709179
R=binji@chromium.org,hablich@chromium.org

Change-Id: I2efb3becc1ca9fef84008c82cd882ef11e2aa3f2
Reviewed-on: https://chromium-review.googlesource.com/589768
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46986}
2017-07-28 22:40:25 +00:00
Alexey Kozyatinskiy
6b0bf1659e [inspector] move SetScriptSource call to native
To avoid using debugging context and debugger-script.js on inspector side we can move SetScriptSource call to v8::internal::Debug. Theoretically we can move live edit implementation to native completely but since it will be reimplemented it looks redundant.

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

Bug: chromium:652939
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id09492c2d2a93efbde429c9cc1bc181d5fdda19b
Reviewed-on: https://chromium-review.googlesource.com/590736
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46985}
2017-07-28 21:55:05 +00:00
Alexei Filippov
920025f523 [heap-profiler] Remove unused methods from Heap Profiler.
Remove GetProfilerMemorySize from HeapProfiler API.
Remove HeapObjectsMap::FindUntrackedObjects

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I32a9a0676485c17c08c068a8ca501525b0d2670e
Reviewed-on: https://chromium-review.googlesource.com/590651
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46984}
2017-07-28 20:56:24 +00:00
Georg Neis
4a9718c777 [modules] Blame correct module for ambiguous exports.
The error got attached to the module asking for the conflicting name.
This was incorrect in the case where the asking was itself via a star
export. We must attach the error to the module that explicitly asks
for the problematic name via a named import or named export statement.

Test will be added to Chromium:
https://chromium-review.googlesource.com/c/590369/

R=adamk@chromium.org

Bug: v8:1569
Change-Id: Ib3c297c6c5654ed1b8f2c7b2d6525202c78f87cd
Reviewed-on: https://chromium-review.googlesource.com/591307
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46983}
2017-07-28 19:43:36 +00:00
Ulan Degenbaev
774a4c5e24 Revert "[heap] Reland "[heap] Allow a minimum semi-space size of 512K.""
This reverts commit 176a2b24fb.

Reason for revert: performance regression on the benchmarks.

Original change's description:
> [heap] Reland "[heap] Allow a minimum semi-space size of 512K."
> 
> This patch changes the semi-space size to 512K.
> 
> > Original commit message:
> > Revert "[heap] Allow a minimum semi-space size of 512K."
> > This reverts commit 0d2ed6c328.
> > The CL introduced perf regressions: crbug.com/735649.
> > We are going to reland the CL in an isolated V8 roll to ensure
> > that perf regressions are attributed correctly.
> 
> > Original commit message:
> > > [heap] Allow a minimum semi-space size of 512K.
> > > This CL also reduces the minimum semi-space size to 512K.
> > > BUG=chromium:716032
> > BUG=chromium:735649
> 
> Change-Id: Iabc377cba2911b28d51b98bb5b85134d4e893632
> Reviewed-on: https://chromium-review.googlesource.com/575066
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46763}

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

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

Change-Id: I80f8b6699f41e91512f7cec38060c829252ff95e
Reviewed-on: https://chromium-review.googlesource.com/591309
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46982}
2017-07-28 19:42:31 +00:00
Jakob Kummerow
e567dd3ab4 Refactor TransitionArray access
in preparation for caching StoreIC-Transition handlers in there.
This CL should not change behavior or performance.

The TransitionArray class no longer serves a dual purpose; it is now
simply the data structure serving that role. Further, it now supports
storing transitioning handlers in its "target" slot, which in turn have
a WeakCell pointing to the transition target (but this functionality
is not being used yet).

The interface for accessing a map's transitions, previously implemented
as a set of static functions, is now handled by the TransitionsAccessor
class. It distinguishes the following internal states:
- kPrototypeInfo: map is a prototype map, will never cache any transitions.
- kUninitialized: map can cache transitions, but doesn't have any.
- kWeakCell: map caches a single transition, stored inline. Formerly known
             as "IsSimpleTransition".
- kFullTransitionArray: map uses a TransitionArray to store transitions.
- kTuple3Handler, kFixedArrayHandler: to be used in the future for caching
                                      transitioning handlers.

Change-Id: If2aa68390981f96f317b958445a6e0b935c2a14e
Reviewed-on: https://chromium-review.googlesource.com/550118
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46981}
2017-07-28 19:41:21 +00:00
Tobias Tebbi
c87a3ddaf1 Revert "Reland: [turbofan] staging new implementation of escape analysis"
This reverts commit ccd8bb692b.

Reason for revert: https://build.chromium.org/p/client.v8.fyi/builders/Mac%20Release%20%28Intel%29/builds/2643

Original change's description:
> Reland: [turbofan] staging new implementation of escape analysis
> 
> Reland of https://chromium-review.googlesource.com/c/565720, fixing compilation issues on the waterfall.
> 
> Bug: 
> Change-Id: Ide4f1ea4470e946820edc990c9bf027f04844efe
> Reviewed-on: https://chromium-review.googlesource.com/591667
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46975}

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

Change-Id: I30016fd8d71535c02bab8678b02147195c3e97a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/591672
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46980}
2017-07-28 19:16:17 +00:00
Adithya Srinivasan
59ddd6061c Change Accessor counters
Counters for some of the getters are renamed to remove the
AccessorNameGetterCallback_ prefix. The prefix causes these getters to
be categorized under Blink C++ (and they shouldn't be). Counters are
also added for some setters which are currently being counted under
GenericNamedPropertySetterCallback and AccessorNameSetterCallback which
are both categorized as Blink C++.

Bug: 
Change-Id: Ifc2c08d3eca0460ea6b5572c7a96b3625dd7d7ea
Reviewed-on: https://chromium-review.googlesource.com/587593
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46979}
2017-07-28 14:56:36 +00:00
Mircea Trofin
13532c0869 [wasm] Streaming API: own the promise.
Avoid leaking because the persistent handle isn't released. To further
clarify ownership, the v8 side owns now completely the promise.

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ief9e44e60235fe6199fc4884ad1ccbd9e34cce8a
Reviewed-on: https://chromium-review.googlesource.com/591067
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46978}
2017-07-28 14:51:16 +00:00
Mathias Bynens
8be73bad18 [printing] Print feedback vectors
This patch makes `%DebugPrint(fn)` print `fn`’s feedback vector when
available.

Example output:

```
d8> fn = (x) => x + '.'; fn(''); %DebugPrint(fn)
DebugPrint: 0x1c12b950df81: [Function]
 - map = 0x1c12b1802361 [FastProperties]
 - prototype = 0x1c12ec904591
 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS]
 - initial_map =
 - shared_info = 0x1c12ec92fde9 <SharedFunctionInfo fn>
 - name = 0x1c12ec92fcd1 <String[2]: fn>
 - formal_parameter_count = 1
 - kind = [ ArrowFunction ]
 - context = 0x1c12ec903cd1 <FixedArray[278]>
 - code = 0x220721125061 <Code BUILTIN>
 - interpreted
 - bytecode = 0x1c12ec930181
 - source code = (x) => x + '.'
 - properties = 0x1c12f5702241 <FixedArray[0]> {
    #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor)
    #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor)
 }

 - feedback vector: 0x1c12ec9301f9: [FeedbackVector] in OldSpace
 - length: 1
 SharedFunctionInfo: 0x1c12ec92fde9 <SharedFunctionInfo fn>
 Optimized Code: 0
 Invocation Count: 1
 Profiler Ticks: 0
 Slot #0 BinaryOp MONOMORPHIC
  [0]: 8
0x1c12b1802361: [Map]
 - type: JS_FUNCTION_TYPE
 - instance size: 72
 - inobject properties: 0
 - elements kind: HOLEY_ELEMENTS
 - unused property fields: 0
 - enum length: invalid
 - callable
 - back pointer: 0x1c12f57022d1 <undefined>
 - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]>
 - layout descriptor: 0x0
 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)>
 - constructor: 0x1c12f5702201 <null>
 - code cache: 0x1c12f5702241 <FixedArray[0]>
 - dependent code: 0x1c12f5702241 <FixedArray[0]>
 - construction counter: 0

(x) => x + '.'
```

Example output when feedback vector is not available:

```
d8> %DebugPrint(() => {})
DebugPrint: 0x1c12b950bf49: [Function]
 - map = 0x1c12b1802361 [FastProperties]
 - prototype = 0x1c12ec904591
 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS]
 - initial_map =
 - shared_info = 0x1c12ec92c021 <SharedFunctionInfo>
 - name = 0x1c12f5702431 <String[0]: >
 - formal_parameter_count = 0
 - kind = [ ArrowFunction ]
 - context = 0x1c12ec903cd1 <FixedArray[278]>
 - code = 0x220721004861 <Code BUILTIN>
 - source code = () => {}
 - properties = 0x1c12f5702241 <FixedArray[0]> {
    #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor)
    #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor)
 }

 - feedback vector: not available
0x1c12b1802361: [Map]
 - type: JS_FUNCTION_TYPE
 - instance size: 72
 - inobject properties: 0
 - elements kind: HOLEY_ELEMENTS
 - unused property fields: 0
 - enum length: invalid
 - callable
 - back pointer: 0x1c12f57022d1 <undefined>
 - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]>
 - layout descriptor: 0x0
 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)>
 - constructor: 0x1c12f5702201 <null>
 - code cache: 0x1c12f5702241 <FixedArray[0]>
 - dependent code: 0x1c12f5702241 <FixedArray[0]>
 - construction counter: 0

() => {}
```

Change-Id: Ic80289bff652cfc8d04182c68740843c61c87849
Reviewed-on: https://chromium-review.googlesource.com/591369
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46977}
2017-07-28 14:39:36 +00:00
Jaroslav Sevcik
4229ca207e [profiler] Fix logging addresses on Windows.
Change-Id: Iff0dcec95d04b85d31a452fed31b1500ad17a9f0
Reviewed-on: https://chromium-review.googlesource.com/591373
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46976}
2017-07-28 14:36:14 +00:00
Tobias Tebbi
ccd8bb692b Reland: [turbofan] staging new implementation of escape analysis
Reland of https://chromium-review.googlesource.com/c/565720, fixing compilation issues on the waterfall.

Bug: 
Change-Id: Ide4f1ea4470e946820edc990c9bf027f04844efe
Reviewed-on: https://chromium-review.googlesource.com/591667
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46975}
2017-07-28 14:29:34 +00:00
Daniel Clifford
d0579a4beb [csa] Move common FixedArray initialization into AllocateUninitializedJSArrayWithElements
Change-Id: Ifb689a6d5bc5290c6612a92fa45aae6f5db2d81c
Reviewed-on: https://chromium-review.googlesource.com/589433
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46974}
2017-07-28 13:52:14 +00:00
Mathias Bynens
27e3921ba8 Add .editorconfig
This file codifies the preferred editor configuration when working
on V8. Including it in the repository makes it easier for contributors
to follow the existing coding style.

See http://editorconfig.org/ for more information.

Change-Id: Iea69c29fc0d88e0fd085e4b3ffc46697d0cd1202
Reviewed-on: https://chromium-review.googlesource.com/591427
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46973}
2017-07-28 13:39:24 +00:00
Michael Lippautz
d9d059175e [heap] Decouple RootMarkingVisitor used for seeding items from Minor MC
This visitor can be reused by the full MC when seeding root items.

Bug: chromium:750084
Change-Id: I9d46ce55737961d8f72a34b06f3314c8f75f3b4d
Reviewed-on: https://chromium-review.googlesource.com/591451
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46972}
2017-07-28 13:35:24 +00:00
Michael Lippautz
ca33118d32 [heap] Fix smaller issues in MarkCompactMarkingVisitor
Bug: chromium:750084
Change-Id: I17560b2ab31ad494637a7498a089f4d2b7377907
Reviewed-on: https://chromium-review.googlesource.com/591450
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46971}
2017-07-28 13:30:52 +00:00
Michael Lippautz
52a9b5cb8f [heap] Scavenger: Remove left-over
Also remove the comment on LayoutDescriptor as we want to pretenure
those.

Bug: chromium:738865
Change-Id: I5bdf66d383b481edc3250623e155b97d1081a7cc
Reviewed-on: https://chromium-review.googlesource.com/590235
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46970}
2017-07-28 13:09:05 +00:00
Juliana Patricia Vicente Franco
a193fde97c Revert "Changing the return address on the stack."
This reverts commit e15f554427.

Reason for revert: it breaks the GC stress. 

Original change's description:
> Changing the return address on the stack.
> 
> Rather than patching code, the deoptimizer now replaces the
> return address in the frames with respective trampolines. 
> This change required to change the way we search for Safepoint 
> entries and for Exception Handlers. 
> It's working in architectures: x64, ia32, arm, arm64 and mips. 
> 
> Bug: V8:6563
> Change-Id: I3cbd4d192c3513f307b3a6a2ac99e60d03c753d3
> Reviewed-on: https://chromium-review.googlesource.com/586707
> Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46967}

TBR=jarin@chromium.org,bmeurer@chromium.org,jupvfranco@google.com

Change-Id: I430fa9123beef2e0723b38cdef9537181203f7e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: V8:6563
Reviewed-on: https://chromium-review.googlesource.com/591371
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46969}
2017-07-28 12:41:57 +00:00
Tobias Tebbi
8616be0c94 Revert "[turbofan] staging new implementation of escape analysis"
This reverts commit d230b44f0c.

Reason for revert: compile errors on the waterfall

Original change's description:
> [turbofan] staging new implementation of escape analysis
> 
> Bug: 
> Change-Id: Idebe4fa6d651a404a0dc1947ed4a34a8dc9707a9
> Reviewed-on: https://chromium-review.googlesource.com/565720
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46966}

TBR=mstarzinger@chromium.org,jarin@chromium.org,tebbi@chromium.org

Change-Id: I73c3cb270d498aeb181e31bad04f1c73d5ca6741
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/591370
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46968}
2017-07-28 12:18:38 +00:00
Juliana Franco
e15f554427 Changing the return address on the stack.
Rather than patching code, the deoptimizer now replaces the
return address in the frames with respective trampolines. 
This change required to change the way we search for Safepoint 
entries and for Exception Handlers. 
It's working in architectures: x64, ia32, arm, arm64 and mips. 

Bug: V8:6563
Change-Id: I3cbd4d192c3513f307b3a6a2ac99e60d03c753d3
Reviewed-on: https://chromium-review.googlesource.com/586707
Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46967}
2017-07-28 11:53:45 +00:00
Tobias Tebbi
d230b44f0c [turbofan] staging new implementation of escape analysis
Bug: 
Change-Id: Idebe4fa6d651a404a0dc1947ed4a34a8dc9707a9
Reviewed-on: https://chromium-review.googlesource.com/565720
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46966}
2017-07-28 11:45:25 +00:00
Michael Lippautz
7c8a75e508 Pretenure LayoutDescriptor
LayoutDescriptor is currently the only case where the Scavenger needs to
potentially follow an updated slot to iterate an object. This scenario
requires at least Acq/Rel semantics.

In order to use relaxed store/load for the slots we need to allocate it
pretenured.

Bug: chromium:738865
Change-Id: I353fa6f252b436918b60fff54ece5ce5c7783072
Reviewed-on: https://chromium-review.googlesource.com/590429
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46965}
2017-07-28 11:43:35 +00:00
Ulan Degenbaev
047e906da5 [heap] Process weak cells in concurrent marking visitor.
BUG=chromium:694255

Change-Id: I6684850ae9759f719e3ed665157eaea2581a65cf
Reviewed-on: https://chromium-review.googlesource.com/590008
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46964}
2017-07-28 11:32:40 +00:00