[webkit-dev] Tracking global variables.

arijit chattopadhyay arijit_nitdgp06 at yahoo.co.in
Mon Sep 16 17:49:13 PDT 2013

   I would like to create a map of the all the globally declared variables and their values. I tried to iterate over IdentifierTable using this code.
IdentifierTable *iTable = identifierTable;
LiteralIdentifierTable& literalTable = iTable->literalTable();
//if(literalTable) {
cout<<"Hashmap capacity : "<<literalTable.size()<<endl; 
LiteralIdentifierTable::iterator itr = literalTable.begin();
while(itr != literalTable.end()) {
const char *data = itr->first;
if(data && strcmp(data,"var") == 0) {

cout<<"The literal is : "<<data<<endl;
//cout<<"And the value is : "<<*itr->second<<endl;
      //  cout<<(*itr)->first()<<endl;
//const char* key =  itr->begin();
//cout<<"The Key is : "<<key<<endl;

However I am not able to get the values corresponding to the variable. Is that IdentifierTable does not store global variables? 
I am chaing the source code for the Javascript engine, so I don't have have to use the api. I would like to know the datastructure(s) that stores global variables and how get the value of a variable?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130917/4ad7482f/attachment.html>

More information about the webkit-dev mailing list