Closed
Bug 1061318
Opened 11 years ago
Closed 11 years ago
Output type of CreateRegExpMatch becomes AnyObject in octane-regexp
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: h4writer, Assigned: bhackett1024)
References
Details
Attachments
(1 file)
|
3.53 KB,
patch
|
h4writer
:
review+
|
Details | Diff | Splinter Review |
So the function Exec in octane-regexp is quite hot and we want to have good code there. E.g. we expect an array from re.exec() and we should be able to find out ".length" will result in a array length lookup
Now I noticed that running re.exec() in octane-regexp will result in an AnyObject. The result in CreateRegExpMatchResult using NewDenseAllocatedArrayWithTemplate doesn't aggregate to 1 TypeObject which is required here.
| Reporter | ||
Comment 1•11 years ago
|
||
Brian, can you have a look at how we need to adjust this to have a TypeObject instead of AnyObject when aggregating multiple re.exec() results?
Flags: needinfo?(bhackett1024)
| Assignee | ||
Comment 2•11 years ago
|
||
The default type for new arrays (and new plain objects) has unknown type, so this gives the regexp exec template a new type and makes sure its type information is filled in properly.
This doesn't seem to move the octane-regexp score much, if at all. Do you know where we're spending our time on this benchmark?
Assignee: nobody → bhackett1024
Attachment #8484393 -
Flags: review?(hv1989)
Flags: needinfo?(bhackett1024)
| Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8484393 [details] [diff] [review]
patch
Review of attachment 8484393 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks! It was expected this wouldn't bring a major win.
But it definitely generates better code. Possibly this might have been more visible if we fixed the other things first.
Nonetheless when I first created the code I wanted it to have this type information. So glad it is fixed.
Your question about where we spend our time:
I think it is mostly overhead. Jumping into C++ code. Checking all cornercases etc. It might be good to selfhost more of this code. (Like v8 does).
A lot of time is spend in CreateMatchResult. Having this in jit-code will improve our allocation speed.
Also v8 has this trampoline from jit to irregexp, instead of having a vm call in between, right?
This might also bring a big speed increase.
Attachment #8484393 -
Flags: review?(hv1989) → review+
| Assignee | ||
Comment 4•11 years ago
|
||
Hmm, the ABI for our irregexp-generated jitcode is pretty simple and was designed so it would be relatively easy to call it directly from Ion code, so that would be good to actually do. I might be able to work on this soon (bug 1058340 is kind of stalled right now waiting for other folks' patches to land).
| Assignee | ||
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
| Reporter | ||
Comment 7•11 years ago
|
||
Comment on attachment 8484393 [details] [diff] [review]
patch
Review of attachment 8484393 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/RegExpObject.cpp
@@ +710,5 @@
>
> + // Create a new type for the template.
> + Rooted<TaggedProto> proto(cx, templateObject->getTaggedProto());
> + types::TypeObject *type =
> + cx->compartment()->types.newTypeObject(cx, templateObject->getClass(), proto);
decoder made me aware I oversaw an possible issue here. We need to check if type is not a nullptr. and return if it is.
You need to log in
before you can comment on or make changes to this bug.
Description
•