Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Issue 2734173002: postMessage(): transfer allocation costs along with value. (Closed)

Created:
3 years, 9 months ago by sof
Modified:
3 years, 9 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews, jbroman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

postMessage(): transfer allocation costs along with value. A MessageEvent's data value will in some cases hold on to significant amounts of off-heap memory, so we take care of registering that external allocation with v8, so that it can be taken into consideration by the GC triggering logic. However, when posting a message to another context, we must arrange for its total 'external allocation' to be associated with the target context. Including the sizes of any transferables (array buffers), so balance the books more accurately by also transferring the external allocation cost of those transferables. R= BUG=698981 Review-Url: https://codereview.chromium.org/2734173002 Cr-Commit-Position: refs/heads/master@{#456009} Committed: https://chromium.googlesource.com/chromium/src/+/c7711215a15658e8932087b6a9676859a89f7609

Patch Set 1 #

Patch Set 2 : sync binding test results #

Patch Set 3 : update comment #

Total comments: 8

Patch Set 4 : change rep to int64_t #

Patch Set 5 : add method for (dis)charging ArrayBufferContents allocation costs #

Patch Set 6 : shorten out unnecessary local binding #

Total comments: 3

Patch Set 7 : adjust #

Total comments: 4

Patch Set 8 : loop tweak #

Patch Set 9 : check for successful ownership transfer before unregistering #

Patch Set 10 : rebased upto r455878 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -13 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp View 1 2 3 4 5 6 7 8 3 chunks +43 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h View 1 2 3 4 2 chunks +25 lines, -1 line 0 comments Download

Messages

Total messages: 65 (40 generated)
sof
please take a look.
3 years, 9 months ago (2017-03-07 17:36:13 UTC) #7
jbroman
https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode448 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:448: if (m_externallyAllocatedMemory == 1) Use of this magic value ...
3 years, 9 months ago (2017-03-07 18:00:04 UTC) #9
haraken
The allocation accounting is getting more complex. Would it be possible to add a DCHECK ...
3 years, 9 months ago (2017-03-07 18:16:05 UTC) #10
sof
https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode448 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:448: if (m_externallyAllocatedMemory == 1) On 2017/03/07 18:00:04, jbroman wrote: ...
3 years, 9 months ago (2017-03-07 19:14:03 UTC) #13
jbroman
https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode448 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:448: if (m_externallyAllocatedMemory == 1) On 2017/03/07 at 19:14:03, sof ...
3 years, 9 months ago (2017-03-07 19:29:05 UTC) #14
sof
https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode448 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:448: if (m_externallyAllocatedMemory == 1) On 2017/03/07 19:14:03, sof wrote: ...
3 years, 9 months ago (2017-03-07 19:30:20 UTC) #16
sof
https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h (right): https://codereview.chromium.org/2734173002/diff/40001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h#newcode144 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h:144: void unregisterMemoryAllocatedByCurrentScriptContext(); On 2017/03/07 19:29:05, jbroman wrote: > On ...
3 years, 9 months ago (2017-03-08 07:07:17 UTC) #21
haraken
LGTM https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode466 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:466: m_externallyAllocatedMemory = -1; I'd prefer preparing a dedicated ...
3 years, 9 months ago (2017-03-08 09:15:22 UTC) #26
sof
https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode466 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:466: m_externallyAllocatedMemory = -1; On 2017/03/08 09:15:22, haraken wrote: > ...
3 years, 9 months ago (2017-03-08 09:40:20 UTC) #27
haraken
On 2017/03/08 09:40:20, sof wrote: > https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp > File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp > (right): > > https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode466 ...
3 years, 9 months ago (2017-03-08 09:41:39 UTC) #28
sof
On 2017/03/08 09:41:39, haraken wrote: > On 2017/03/08 09:40:20, sof wrote: > > > https://codereview.chromium.org/2734173002/diff/100001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp ...
3 years, 9 months ago (2017-03-08 10:04:01 UTC) #29
jbroman
Apologies for twisting your arm, but I still don't understand the need to use negative ...
3 years, 9 months ago (2017-03-08 16:56:46 UTC) #32
sof
done.
3 years, 9 months ago (2017-03-08 18:41:55 UTC) #33
jbroman
lgtm https://codereview.chromium.org/2734173002/diff/120001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/120001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode460 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:460: for (size_t i = 0; i < m_arrayBufferContentsArray->size(); ...
3 years, 9 months ago (2017-03-08 22:43:17 UTC) #38
sof
https://codereview.chromium.org/2734173002/diff/120001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp File third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp (right): https://codereview.chromium.org/2734173002/diff/120001/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp#newcode460 third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp:460: for (size_t i = 0; i < m_arrayBufferContentsArray->size(); ++i) ...
3 years, 9 months ago (2017-03-09 06:24:33 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734173002/140001
3 years, 9 months ago (2017-03-09 06:25:05 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/403535)
3 years, 9 months ago (2017-03-09 07:23:53 UTC) #44
sof
Last trybot run (thankfully) flushed out a condition that hadn't been accounted for -- we ...
3 years, 9 months ago (2017-03-09 08:59:38 UTC) #47
jbroman
lgtm
3 years, 9 months ago (2017-03-09 21:48:02 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734173002/160001
3 years, 9 months ago (2017-03-09 22:01:26 UTC) #53
commit-bot: I haz the power
Failed to apply patch for third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-09 22:08:01 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734173002/180001
3 years, 9 months ago (2017-03-09 22:19:02 UTC) #58
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/380584)
3 years, 9 months ago (2017-03-09 23:47:02 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734173002/180001
3 years, 9 months ago (2017-03-10 05:49:56 UTC) #62
commit-bot: I haz the power
3 years, 9 months ago (2017-03-10 06:30:58 UTC) #65
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/c7711215a15658e8932087b6a967...

Powered by Google App Engine
This is Rietveld 408576698