DeHydra: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
(p)
Line 9: Line 9:
* Work on these scripts to make them progressively as sound and as complete as possible.
* Work on these scripts to make them progressively as sound and as complete as possible.


== Quickstart ==


== Future Direction ==
Step 1.


'''Strong reference domination'''
In a new file(test.js) define functions process & path_end:
function process(vars, state) {
if (!state)
  state = 0;
print(state + ": " + vars);
}


< roc> e.g. if I'm holding an nsCOMPtr reference to A, and A holds an nsCOMPtr reference to B, and I call A->GetB() and put the result in another nsCOMPtr H, and you can prove that there's no change to these references before H goes away, the refcount held by H is not needed
function patch_end(state) {
print(state)
}


Example:
<pre>
if (IsChromeURI(aLoadData->mURI)) {
1549      nsCOMPtr<nsIXULPrototypeCache> cache(do_GetService("@mozilla.org/xul/xul-prototype-cache;1"));
1550      if (cache) {
1551        PRBool enabled;
1552        cache->GetEnabled(&enabled);
1553        if (enabled) {
1554          nsCOMPtr<nsICSSStyleSheet> sheet;
1555          cache->GetStyleSheet(aLoadData->mURI, getter_AddRefs(sheet));
1556          if (!sheet) {
1557            LOG(("  Putting sheet in XUL prototype cache"));
1558            cache->PutStyleSheet(aLoadData->mSheet);
1559          }
1560        }
1561      }
1562    }
</pre>
in [http://lxr.mozilla.org/seamonkey/source/layout/style/nsCSSLoader.cpp#1554]


'''Ownership Analysis'''
== More Details ==


Show that ref count on some objects is always 1.
[http://people.mozilla.org/~tglek/dehydra/paper.pdf Dehydra Paper]
 
Also [http://suif.stanford.edu/~dlheine/ David Heine]'s thesis

Revision as of 17:22, 7 September 2007

DeHydra is a tool inspired by UNO.

DeHydra integrates a low level C++ core and a JavaScript engine for user scripts. More info.

C++ core deals with parsing, name resolution, scoping, control flow graphs.

A user can utilize the JS engine to:

  • Write scripts using that core to accomplish custom analyses without recompilation.
  • Work on these scripts to make them progressively as sound and as complete as possible.

Quickstart

Step 1.

In a new file(test.js) define functions process & path_end: function process(vars, state) {

if (!state)
  state = 0;
print(state + ": " + vars);

}

function patch_end(state) {

print(state)

}


More Details

Dehydra Paper