NEW54608
Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
https://bugs.webkit.org/show_bug.cgi?id=54608
Summary Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
Oliver Hunt
Reported 2011-02-16 19:20:15 PST
Refactor WriteBarrier and DeprecatedPtr to have less code duplication.
Attachments
Patch (22.89 KB, patch)
2011-02-17 11:16 PST, Oliver Hunt
no flags
Oliver Hunt
Comment 1 2011-02-17 11:16:26 PST
Geoffrey Garen
Comment 2 2011-02-17 11:25:16 PST
Comment on attachment 82833 [details] Patch r=me
Build Bot
Comment 3 2011-02-17 12:02:40 PST
WebKit Review Bot
Comment 4 2011-02-17 12:43:16 PST
http://trac.webkit.org/changeset/78856 might have broken Windows Release (Build)
Zoltan Herczeg
Comment 5 2011-02-18 04:50:16 PST
I saw this patch was rolled out, and I decided to help you a little. v8-crypto goes into an infinite loop because of the following expression: var a = new Array() a[0] = 1 print(a.length) It is "0" with this patch, and "1" after the patch was rolled out. I think the append does not happen, but I need some further investigation.
Zoltan Herczeg
Comment 6 2011-02-18 05:31:47 PST
emit_op_put_by_val: addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength)))); 0xb791027f: cmp 0x30(%eax),%ecx (gdb) x $eax+0x30 0xb78c2ff0: 0x00000003 (gdb) x $ecx 0x0: Cannot access memory at address 0x0 eax points to the array, and its length is 3, instead of 0. Thus the append is "successful".
Zoltan Herczeg
Comment 7 2011-02-18 06:28:32 PST
Forget about my previous comment, the initialCapacity is 3, so that is ok. However, the vector clear loop in JSArray constructor: JSArray::JSArray(JSGlobalData& globalData, NonNullPassRefPtr<Structure> structure, const ArgList& list) for (; i < initialStorage; i++) vector[i].clear(); was set the values to EmptyValueTag, but when this patch is applied, it set to 0 by WriteBarrier.h:78 void clear() { m_value = 0; } Zero is not even a valid JSValue32_64 tag, so this is totally wrong.
Zoltan Herczeg
Comment 8 2011-02-18 06:47:44 PST
was: WriteBarrier.h:122 void clear() { m_value = JSValue::encode(JSValue()); } which is: JSValue.h:403 u.asBits.tag = EmptyValueTag; now: WriteBarrier.h:78 void clear() { m_value = 0; } I'll try: WriteBarrier.h:78 void clear() { m_value = JSValue::encode(JSValue()); }
Adam Roben (:aroben)
Comment 9 2011-02-18 06:57:31 PST
Comment on attachment 82833 [details] Patch Note that this patch was landed in r78856 and rolled out in r78945 (see bug 54705).
Zoltan Herczeg
Comment 10 2011-02-18 06:59:30 PST
I know :) But the patch is not necessary wrong, maybe just there is small bug in it. Unfortunately this is not working when T is JSCell: WriteBarrier.h:78 void clear() { m_value = JSValue::encode(JSValue()); }
Note You need to log in before you can comment on or make changes to this bug.