pcpratts/rootbeer1 — pull request #124 by millecker (2013-11-29 19:04:03+00:00)
Title: Add edu_syr_pcpratts_rootbeer_typeof and edu_syr_pcpratts_cmpstr

Hi Phil,

I added a _typeof_ method, which should verify if an object belongs to a certain type:

```bool edu_syr_pcpratts_rootbeer_typeof(char * gc_info, int thisref, char * type_name);```

```
__device__ bool edu_syr_pcpratts_rootbeer_typeof( char * gc_info, int thisref, char * type_name){
char * thisref_deref;
GC_OBJ_TYPE_TYPE type;
if(thisref == -1){
return false;
}
thisref_deref = edu_syr_pcpratts_gc_deref(gc_info, thisref);
type = edu_syr_pcpratts_gc_get_type(thisref_deref);
if((edu_syr_pcpratts_cmpstr("java.lang.Float",type_name)==0) && (12474==type)) {
return true;
}
if((edu_syr_pcpratts_cmpstr("java.lang.String",type_name)==0) && (2895==type)) {
return true;
}
else if((edu_syr_pcpratts_cmpstr("java.lang.Integer",type_name)==0) && (12478==type)) {
return true;
}
...
return false;
}
```

I have used the ```List types = RootbeerClassLoader.v().getDfsInfo().getNumberedTypes();``` for this purpose. If these methods are not used, they will be eliminated by your tweaks (deadmethods), so no further overhead.

Secondly, I made a small fix in CalcList.java, belonging the the wrong index range.

Martin