Open
Bug 361441
Opened 18 years ago
Updated 2 years ago
Use "new" evaluateToX methods rather than evaluate
Categories
(Core :: XSLT, defect)
Core
XSLT
Tracking
()
NEW
People
(Reporter: sicking, Assigned: peterv)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 6 obsolete files)
222.79 KB,
patch
|
Details | Diff | Splinter Review |
We should use the evaluateToX methods more, both implement them and call them. We have to watch out for bad call chains though, so calling evaluateToBoolean on an expression should not call evaluateToBoolean->evaluate->evaluateToNumber.
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•18 years ago
|
||
Have a patch, but it'll have to wait for attachment 247792 [details] [diff] [review] to land.
Assignee: xslt → peterv
Status: ASSIGNED → NEW
Assignee | ||
Comment 2•18 years ago
|
||
This adds quite a bit of code :-/. We could do away with some of it if we stop overriding evaluate() when we have a more specific evaluateToX(). That would replace one virtual function call (evaluate) with three: evaluate, getReturnType and evaluateToX.
Attachment #249452 -
Flags: superreview?(bugmail)
Attachment #249452 -
Flags: review?(bugmail)
Assignee | ||
Comment 3•18 years ago
|
||
Reporter | ||
Comment 4•18 years ago
|
||
I'm not too exited about using getReturnType. Why not create a set of base classes, txBaseNumberExpr, txBaseBoolExpr etc. txBaseNumberExpr would lack evaluateToNumber but would let all other functions forward to evaluateToNumber. You could simplify txCoreFunctionCall/txEXSLTFunctionCall two ways: Either put a switch(mType) statement in each evaluteToX. In evaluateToBoolean you'd directly handle the functions that return a bool. The functions that return a number forward directly to evaluateToNumber etc. Same thing in the other evaluate functions. The other solution is to put a switch(descriptTable[mType].mReturnType) in the beginning of evaluateToBoolean and forward directly to other evaluate functions if needed, and then a switch(mType) to handle the functions that do return a boolean. What do you think?
Assignee | ||
Comment 5•18 years ago
|
||
As I suspected, that actually adds even more to the codesize.
Assignee | ||
Comment 6•18 years ago
|
||
This gives a much smaller codesize increase.
Attachment #249452 -
Attachment is obsolete: true
Attachment #249453 -
Attachment is obsolete: true
Attachment #249779 -
Attachment is obsolete: true
Attachment #250051 -
Flags: superreview?(bugmail)
Attachment #250051 -
Flags: review?(bugmail)
Attachment #249452 -
Flags: superreview?(bugmail)
Attachment #249452 -
Flags: review?(bugmail)
Assignee | ||
Comment 7•18 years ago
|
||
Assignee | ||
Comment 8•16 years ago
|
||
Updated to trunk.
Attachment #250051 -
Attachment is obsolete: true
Attachment #250052 -
Attachment is obsolete: true
Attachment #324772 -
Flags: review?(jonas)
Attachment #250051 -
Flags: superreview?(jonas)
Attachment #250051 -
Flags: review?(jonas)
Updated•15 years ago
|
QA Contact: keith → xslt
Assignee | ||
Comment 9•15 years ago
|
||
Attachment #324772 -
Attachment is obsolete: true
Attachment #408012 -
Flags: review?(jonas)
Attachment #324772 -
Flags: review?(jonas)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•