Umh, okay, thanks a lot!
Maybe I should elaborate my problem, hopefully I get some further help:
I (more or less with the help of a colleague) patched parts of the v8 code (mostly the String) and added a few functions to the String prototype. Let's call one of the function isPatched(), which checks whether a string is patched or not (by setting the heap of the string to a different, self-defined map).
Assume the following code:
var s = "patchedString"
for (var i = 0; i < s.length; i++) {
s[i].isPatched()
}
This is true for two times, and then turns false from the third iteration on. I fixed this behaviour by calling GenerateMiss(masm) as the first command in KeyedLoadIC::GenerateMegamorphic (ic-x64:286), but this is probably a very bad hack and I want to avoid that. Moreover, it did not fix the same problem with other "added" functions, where the IC also somehow interferes (return two times the right answer, from the third time on the wrong answer)
My guess is, that the two first lookups for the characters are cache misses (as shown in the ic-trace) and the "right" patched string is accessed. From the third character lookup on, it is somehow a cache hit and a non-patched string in the cache is accessed.
Is there any way to avoid this behaviour or to find a better way of having a "cache hit on the wrong string"?
Thanks a lot in advance!