title: V8 Hidden classes for two objects of the same type are not the same if property types are different
body: <p>I have read about the hidden classes in V8 and make some tests in d8 debugger shell.</p>
  
  <pre><code>function Vector(a, b) {
    this.a = a;
    this.b = b;
  }
  
  var x = new Vector(1, 2);
  var y = new Vector(1, 3);
  var z = new Vector(1, 'a');
  
  print( %HaveSameMap( x, y ) ); //true
  print( %HaveSameMap( x, z ) ); //false
  x.b;
  print( %HaveSameMap( x, z ) ); //true
  print( %HaveSameMap( y, z ) ); //false
  y.b;
  print( %HaveSameMap( y, z ) ); //true
  </code></pre>
  
  <p>as we can see if the object property types are different they don't share their hidden class until we try to access the property in elder object which type is different. Can anyone give a clear explanation what is happening "behind the scenes", maybe it has something to do with inline caches.</p>