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

Issue 24403002: [ABANDONED] Implement ThenableCoercions for AP2 Promises (Closed)

Created:
7 years, 2 months ago by yusukesuzuki
Modified:
7 years, 2 months ago
CC:
blink-reviews, Nils Barth (inactive), kojih, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, do-not-use
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Implement ThenableCoercions for AP2 Promises ThenableCoercions is used for AP2 Promises[1] and it is represented as a WeakMap. However, V8 WeakMap is not exposed to embedders[2] and it cannot be used if the harmony collections flag is not set. Since V8 GC relocates the Object addresses, we cannot implement WeakMap without V8 internal information. So, at this time, we implement Weak Linked List instead. As a result, the search becomes linear. When V8 WeakMap becomes available, we replace the implementation. [1]: https://github.com/domenic/promises-unwrapping [2]: https://code.google.com/p/v8/issues/detail?id=2908 BUG=295420

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+380 lines, -0 lines) Patch
M Source/bindings/bindings.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
A Source/bindings/v8/ThenableCoercions.h View 1 2 1 chunk +108 lines, -0 lines 0 comments Download
A Source/bindings/v8/ThenableCoercions.cpp View 1 1 chunk +136 lines, -0 lines 0 comments Download
A Source/bindings/v8/ThenableCoercionsTest.cpp View 1 chunk +127 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8PerIsolateData.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8PerIsolateData.cpp View 1 2 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
yusukesuzuki
7 years, 2 months ago (2013-09-24 09:30:24 UTC) #1
yusukesuzuki
https://codereview.chromium.org/24403002/diff/4001/Source/bindings/v8/ThenableCoercions.cpp File Source/bindings/v8/ThenableCoercions.cpp (right): https://codereview.chromium.org/24403002/diff/4001/Source/bindings/v8/ThenableCoercions.cpp#newcode75 Source/bindings/v8/ThenableCoercions.cpp:75: if (!storedThenable.IsEmpty() && storedThenable->SameValue(thenable)) To follow the WeakMap spec ...
7 years, 2 months ago (2013-09-26 02:44:14 UTC) #2
yusukesuzuki
7 years, 2 months ago (2013-09-27 01:38:25 UTC) #3
I'm planning to use V8 hidden property instead of ThenableCoercions in the
Promise draft.
It makes the code and the role of WeakMap clear I think.

I'll show the implementation in the AP2 Promises implementation CL. Let's
discuss about Pros/Cons there :)

Powered by Google App Engine
This is Rietveld 408576698