forked from v8/v8
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maglev] Fix default constructor instantiation
The new.target may not be in the correct state for fast instantiation. Bug: v8:7700, chromium:1465326 Change-Id: I09f92576c0b5573e902ae3b2210a7b5fdbd1e415 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4694007 Commit-Queue: Toon Verwaest <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/heads/main@{#89006}
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2023 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: --maglev --allow-natives-syntax | ||
|
||
class A {} | ||
|
||
var x = Function; | ||
|
||
class B extends A { | ||
constructor() { | ||
x = new.target; | ||
super(); | ||
} | ||
} | ||
function construct() { | ||
return Reflect.construct(B, [], Function); | ||
} | ||
%PrepareFunctionForOptimization(B); | ||
construct(); | ||
construct(); | ||
%OptimizeMaglevOnNextCall(B); | ||
var arr = construct(); | ||
console.log(arr.prototype); |