-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: [turbofan] Fix ObjectCreate's side effect annotation. Bug: chromium:888923 Change-Id: Ifb22cd9b34f53de3cf6e47cd92f3c0abeb10ac79 Reviewed-on: https://chromium-review.googlesource.com/1245763 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#56236} Refs: v8/v8@52a9e67 PR-URL: #25027 Refs: v8/v8@52a9e67 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
- Loading branch information
1 parent
4209e12
commit 17b55bf
Showing
3 changed files
with
33 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2018 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() { | ||
function f(o) { | ||
o.x; | ||
Object.create(o); | ||
return o.y.a; | ||
} | ||
|
||
f({ x : 0, y : { a : 1 } }); | ||
f({ x : 0, y : { a : 2 } }); | ||
%OptimizeFunctionOnNextCall(f); | ||
assertEquals(3, f({ x : 0, y : { a : 3 } })); | ||
})(); | ||
|
||
(function() { | ||
function f(o) { | ||
let a = o.y; | ||
Object.create(o); | ||
return o.x + a; | ||
} | ||
|
||
f({ x : 42, y : 21 }); | ||
f({ x : 42, y : 21 }); | ||
%OptimizeFunctionOnNextCall(f); | ||
assertEquals(63, f({ x : 42, y : 21 })); | ||
})(); |