michael@0: // Reduced from v8-raytrace. michael@0: michael@0: var Class = { michael@0: create : function() { michael@0: return function() { michael@0: this.initialize.apply(this, arguments); michael@0: } michael@0: } michael@0: } michael@0: michael@0: var Bar = Class.create(); michael@0: Bar.prototype = { michael@0: // Compiled third. michael@0: initialize : function() { } michael@0: } michael@0: michael@0: var Foo = Class.create(); michael@0: Foo.prototype = { michael@0: // Compiled second. Crashes when setting "bar". Uses LCallConstructor. michael@0: initialize : function() { michael@0: this.bar = new Bar(); michael@0: } michael@0: } michael@0: michael@0: // Compiled first. michael@0: function f() { michael@0: for (var i = 0; i < 100; i++) { michael@0: var foo = new Foo(); michael@0: } michael@0: } michael@0: michael@0: f();