-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: v8/v8@7.9.317.23...7.9.317.25 PR-URL: #30679 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
- Loading branch information
1 parent
80ada94
commit b470354
Showing
7 changed files
with
69 additions
and
17 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
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,37 @@ | ||
// Copyright 2019 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 | ||
|
||
function f() { | ||
return r.test("abc"); | ||
} | ||
|
||
function to_dict(o) { | ||
r.a = 42; | ||
r.b = 42; | ||
delete r.a; | ||
} | ||
|
||
function to_fast(o) { | ||
const obj = {}; | ||
const obj2 = {}; | ||
delete o.a; | ||
obj.__proto__ = o; | ||
obj[0] = 1; | ||
obj.__proto__ = obj2; | ||
delete obj[0]; | ||
return o; | ||
} | ||
|
||
// Shrink the instance size by first transitioning to dictionary properties, | ||
// then back to fast properties. | ||
const r = /./; | ||
to_dict(r); | ||
to_fast(r); | ||
|
||
%PrepareFunctionForOptimization(f); | ||
assertTrue(f()); | ||
%OptimizeFunctionOnNextCall(f); | ||
assertTrue(f()); |