hi, 
im working on js code coverage implemented directly to the compilation 
process of v8. at first stage i need to "snatch" the code at the start of 
compile function , do some transformation on the code directly (add prints 
essentially) 
and switch it with the original code , to be compiled as usual.
so far i have encountered 2 ways to ways to extract the string value from 
handle<Internal::String> , one is by using GET , the other by toCstring 
method of the class string. efficiency aside, assume we use the Get method.
now we have got the code and successfully done the transformation we 
needed. now i want to create Handle<Internal::String> taht will contain 
 this string instead of the original.
unlike the v8::String , Internal::String does not have a New option. so 
i've discovered i can use the original Handle<Internal::String> to get the 
isolate , and from there i go the the factory and create a string from 
ascii.
it looks something like this : 
source = 
 source->isolate()->factory->newStringFromAscii(cStrVector(newJsCode,length));

 now , the compilation fails because it arrives to isString() function 
along some test and fails there (some characters in the print are not 
recognized) .
i have 2 quesstions:
1. should i use NewStringFromUtf8? or is there another way to create 
handle<Internal::String> ?
2. i don't yet understand what is exactly isolate? can someone explain it? 
and is my new "source" variable will catually contain the same isolate as 
the original?

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

Reply via email to