-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged: [compiler] Fix typing JSLoadNamed of private brands
Private method loads are compiled to a named load of a private brand, which always loads a BlockContext. This BlockContext holds the private methods common to all instances of a class. TurboFan currently considers JSLoadNamed to be of Type::NonInternal(). Private methods break this assumption, since BlockContext is of Type::OtherInternal(). This CL changes the typing of JSLoadNamed of private brands to be Type::OtherInternal(). Bug: v8:12500, chromium:1287475 (cherry picked from commit d19a707d148ca9b9ab9dd8c294fe4c49e99f31d4) Change-Id: I91f39747bf9422bd419d299f44152f567d8be8db Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3399225 Reviewed-by: Maya Lekova <[email protected]> Commit-Queue: Shu-yu Guo <[email protected]> Cr-Commit-Position: refs/branch-heads/9.7@{#38} Cr-Branched-From: 49162da-refs/heads/9.7.106@{#1} Cr-Branched-From: a7e9b8f-refs/heads/main@{#77674}
- Loading branch information
Showing
4 changed files
with
46 additions
and
8 deletions.
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
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,22 @@ | ||
// Copyright 2021 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 A { | ||
a() { this.#b() } | ||
#b() {} | ||
} | ||
|
||
function InlinePrivateMethod() { | ||
for (let i = 0; i < 10; i++) { | ||
new A().a(); | ||
} | ||
} | ||
|
||
%PrepareFunctionForOptimization(A); | ||
%PrepareFunctionForOptimization(InlinePrivateMethod); | ||
InlinePrivateMethod(); | ||
%OptimizeFunctionOnNextCall(InlinePrivateMethod); | ||
InlinePrivateMethod(); |