Closed Bug 437647 Opened 16 years ago Closed 16 years ago

Set up dispatch mechanism for multiple dehydra/treehydra scripts

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Dispatch analyses (obsolete) — Splinter Review
As we add additional dehydra/treehydra scripts, we need to stop having everything be process_tree or process_function. For lack of an automatic dispatch mechanism, I have a manual mechanism which will dispatch process_tree to outparams_process_tree as well as other analyses we add (e.g. XPCOMGC finalizers, SQL analysis, etc)
Attachment #324067 - Flags: review?(dmandelin)
As an idea, we could use namespaces for this.
let treehydra_scripts = []
let treehydra_sql = {}
include('sql.js', treehydra_sql)
treehydra_scripts.push(treehydra_sql)
...

Then dispatch is a matter of 
for each (script in treehydra_scripts)
 script.process_tree(...)

I tried to make this work, but it doesn't: when you do the include, the global object doesn't have any of the normal functions (iter, treehydra.js stuff etc), so it just doesn't work.
This imports each analysis into its own global object and dispatches the callbacks to each one independently.
Attachment #324067 - Attachment is obsolete: true
Attachment #324091 - Flags: review?(dmandelin)
Attachment #324067 - Flags: review?(dmandelin)
Comment on attachment 324091 [details] [diff] [review]
Dispatch analyses, without hardcoding

Looks great. If there's some problem with include_path, feel free to file it so we can fix it.
Attachment #324091 - Flags: review?(dmandelin) → review+
Pushed to mozilla-central, revision 5cd633865e6d
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: