v8/test/mjsunit/regress/regress-653407.js
mythria cad36659b1 [turbofan] When inlining JSCallConstruct receiver should be set to the hole.
When inlining JSCallConstruct in turbofan, receiver is initialized to model
the behaviour of constructor. When an implicit receiver is not required the
receiver value should be set to the hole value instead of undefined value.
When initializing the receiver via super calls, we check that the receiver
is the hole value.

BUG=chromium:653407

Review-Url: https://codereview.chromium.org/2424123002
Cr-Commit-Position: refs/heads/master@{#40396}
2016-10-18 11:48:15 +00:00

27 lines
587 B
JavaScript

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --ignition --turbo
// This is to test if 'this' gets correctly initialized when inlining
// constructors in turbofan.
class superClass {
constructor () {}
}
class subClass extends superClass {
constructor () {
super();
}
}
function f() {
new subClass();
}
f(); // We need this to collect feedback, so that subClass gets inlined in f.
%OptimizeFunctionOnNextCall(f)
f();