Hi v8-folks,

I have some doubts regarding inline cache behaviour. If you don't mind I 
would like to ask some questions here.

The example is as below:
```
$ cat simple.js
function foo(_prop) {
  this.my_prop = _prop;
}

var a = new foo(3);            // expects this.my_prop to be premonomorphic
var b = new foo(5);            // expects this.my_prop to be monomorphic
var c = new foo(7);            // expects to stay in monomorphic
var d = new foo("hello");    // expects this.my_prop to be polymorphic
```

I run the example with trace_ic option.
```
$ ./d8 --trace_ic simple.js | grep my_prop
[StoreIC in ~foo+64 at simple.js:2 (0->.) #my_prop]
[StoreIC in ~foo+64 at simple.js:2 (.->1) #my_prop]
[StoreIC in ~foo+64 at simple.js:2 (^->1) #my_prop]
```

In the above example, how come inline cache of my_prop is changed as below?
1. UNINITIALIZED(0) -> PREMONOMORPHIC(.)
2. PREMONOMORPHIC(.) -> MONOMORPHIC(1)
3. suddenly PROTOTYPE_FAILURE(^) -> MONOMORPHIC(1)

I don't understand the transition from step 2 to step 3. As far as I 
understood, it has to be MONOMORPHIC -> POLYMORPHIC.
Is this correct behaviour?

Best regards,
Honggyu

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to