Closed Bug 1067009 Opened 5 years ago Closed 5 years ago

CPOWs can't wrap regular expressions

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: billm, Assigned: bholley)

Details

Attachments

(5 files)

The basic problem is that CPOWs don't implement the regexp_toShared hook. I think we would need to send the source over IPC and then compile locally.

Bobby, would you be interested in this bug?
Yeah sure.
Assignee: nobody → bobbyholley
Flags: needinfo?(bobbyholley)
Note that most regexp operations actually work over CPOWs on trunk right now - stuff like .test() and .toString() is all generic and works like it should. The only problems crop up when we actually trigger the RegExpToShared machinery, which happens for stuff like "".search() and RegExp.prototype.compile.

The current failure mode is a crash though, so we should definitely fix this.
https://tbpl.mozilla.org/?tree=Try&rev=ea48a0d53787
Flags: needinfo?(bobbyholley)
Attachment #8497497 - Flags: review?(wmccloskey)
Attachment #8497502 - Flags: review?(wmccloskey)
Attachment #8497497 - Flags: review?(wmccloskey) → review+
Attachment #8497499 - Flags: review?(wmccloskey) → review+
Attachment #8497500 - Flags: review?(wmccloskey) → review+
Comment on attachment 8497501 [details] [diff] [review]
Part 4 - Implement regexp_toShared for CPOWs. v1

Review of attachment 8497501 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/ipc/WrapperAnswer.cpp
@@ +570,5 @@
> +    nsAutoJSString sourceStr;
> +    if (!sourceStr.init(cx, sourceJSStr))
> +        return fail(cx, rs);
> +    source->Assign(sourceStr);
> +    *flags = JS_GetRegExpFlags(cx, obj);

Micronit: could you put a line break before this line?
Attachment #8497501 - Flags: review?(wmccloskey) → review+
Comment on attachment 8497502 [details] [diff] [review]
Part 5 - Tests. v1

Review of attachment 8497502 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8497502 - Flags: review?(wmccloskey) → review+
You need to log in before you can comment on or make changes to this bug.