Closed
Bug 558003
Opened 15 years ago
Closed 15 years ago
TM: make NewObject inline
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Assigned: gal)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
(deleted),
patch
|
sayrer
:
review+
|
Details | Diff | Splinter Review |
if (clasp == &js_FunctionClass && !objectSize) {
obj = (JSObject*) js_NewGCFunction(cx);
#ifdef DEBUG
if (obj) {
memset((uint8 *) obj + sizeof(JSObject), JS_FREE_PATTERN,
sizeof(JSFunction) - sizeof(JSObject));
}
#endif
} else {
JS_ASSERT(!objectSize || objectSize == sizeof(JSObject));
obj = (clasp == &js_IteratorClass)
? js_NewGCIter(cx)
: js_NewGCObject(cx);
}
This should be a parameterized template that gets instantiated and then properly inlined. If we do this right the right path gets folded into the call based on a constant clasp == &ActualClass comparison.
Assignee | ||
Comment 1•15 years ago
|
||
Igor, interested or shall I?
Assignee | ||
Updated•15 years ago
|
Assignee: general → gal
Assignee | ||
Comment 2•15 years ago
|
||
Patch in a sec. For the following test case this is an 8% speedup:
var t = Date.now();
for (var i = 0; i < 500000; ++i)
({});
print(Date.now() - t);
Sunspider numbers next.
Assignee | ||
Comment 3•15 years ago
|
||
Looks like unpack-code allocates a lot of objects. The rest doesn't change significantly.
unpack-code: 1.064x as fast 84.5ms +/- 0.2% 79.4ms +/- 0.2% significant
Assignee | ||
Comment 4•15 years ago
|
||
Assignee | ||
Updated•15 years ago
|
Attachment #438004 -
Flags: review?(sayrer)
Assignee | ||
Updated•15 years ago
|
Summary: TM: don't dispatch over class in js_NewGCObject → TM: make NewObject inline
Updated•15 years ago
|
Attachment #438004 -
Flags: review?(sayrer) → review+
Assignee | ||
Updated•15 years ago
|
Assignee | ||
Comment 5•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 6•15 years ago
|
||
(In reply to comment #0)
> This should be a parameterized template that gets instantiated and then
> properly inlined. If we do this right the right path gets folded into the call
> based on a constant clasp == &ActualClass comparison.
The comparison clasp == &ActualClass cannot be constant since the compiler does not know the address of the ActualClass. On the other hand if we do the dispatch over the finalization kind then the compiler can optimize. I guess we need another patch about that.
Comment 7•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•