v8/test/mjsunit/regress/regress-642409.js
rmcilroy c950256013 [Turbofan] Fix CallSuper argument order in BytecodeGraphBuilder.
The constructor and new.target arguments were passed to CallConstruct in
the wrong order by BytecodeGraphBuilder, which caused subclassing to be
incorrect when optimizing from bytecode.

Also clean up some unecessary functions in interpreter.cc found while
figuring this out.

BUG=chromium:642409

Review-Url: https://codereview.chromium.org/2312103002
Cr-Commit-Position: refs/heads/master@{#39204}
2016-09-06 11:53:19 +00:00

23 lines
431 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
class SuperClass {
}
class SubClass extends SuperClass {
constructor() {
super();
this.doSomething();
}
doSomething() {
}
}
new SubClass();
new SubClass();
%OptimizeFunctionOnNextCall(SubClass);
new SubClass();