This paves the way for custom poison values which we'll need for use in TypedArrays later.
<rdar://problem/36795513>
Created attachment 332087 [details] proposed patch.
Attachment 332087 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/JSCPoison.cpp:36: POISON_KEY_NAME is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] WARNING: This machine could support 4 simulators, but is only configured for 3. WARNING: Please see <https://trac.webkit.org/wiki/IncreasingKernelLimits>. Total errors found: 1 in 53 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 332087 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=332087&action=review > Source/WTF/wtf/Poisoned.h:203 > + ALWAYS_INLINE static PoisonedBits poison(const Poisoned* thisPoisoned, U ptr) { return ptr ? bitwise_cast<PoisonedBits>(ptr) ^ Poison::key(thisPoisoned) : 0; } Note sure if passing Poisoned does what you'll eventually want. The caller that poisons and unpoisons pointers may have any amount of context information available, and that information may not be in `this`. But, I'm OK with this change, because I can see how this would work for typed arrays.
Comment on attachment 332087 [details] proposed patch. r=me assuming breakage is gone.
(In reply to Filip Pizlo from comment #4) > Comment on attachment 332087 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=332087&action=review > > > Source/WTF/wtf/Poisoned.h:203 > > + ALWAYS_INLINE static PoisonedBits poison(const Poisoned* thisPoisoned, U ptr) { return ptr ? bitwise_cast<PoisonedBits>(ptr) ^ Poison::key(thisPoisoned) : 0; } > > Note sure if passing Poisoned does what you'll eventually want. Yes, it does what I want. I use the Poisoned this pointer to infer the this pointer of the object embedding it. The need for this will become clear later in my implementation for TypeArray poisoning. The poisoning there isn't based on a C++ compile time type, but rather needs to be runtime determined (for reasons I'll elaborate on later in that patch). > The caller that poisons and unpoisons pointers may have any amount of > context information available, and that information may not be in `this`. > But, I'm OK with this change, because I can see how this would work for > typed arrays.
Thanks for the review. Landed in r227527: <http://trac.webkit.org/r227527>.