Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1311)

Unified Diff: test/mjsunit/field-type-tracking.js

Issue 2598543003: [runtime][ic] Constant field tracking support. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/field-type-tracking.js
diff --git a/test/mjsunit/field-type-tracking.js b/test/mjsunit/field-type-tracking.js
index b4901f34c34e706877316b65242dcfbaf75192d4..2db955f94b00eb2351d8bd667fc1f84120e6d854 100644
--- a/test/mjsunit/field-type-tracking.js
+++ b/test/mjsunit/field-type-tracking.js
@@ -7,6 +7,9 @@
(function() {
var o = { text: "Hello World!" };
function A() {
+ // Assign twice to make the field non-constant.
+ // TODO(ishell): update test once constant field tracking is done.
+ this.a = {text: 'foo'};
this.a = o;
}
function readA(x) {
@@ -107,6 +110,9 @@
(function() {
function Foo(x) { this.x = x; }
+ // TODO(ishell): update test once constant field tracking is done.
+ var f0 = new Foo({x: 0});
+ f0.x = {x: 0}; // make Foo.x non-constant here.
var f1 = new Foo({x: 1});
var f2 = new Foo({x: 2});
var f3 = new Foo({x: 3});
@@ -143,7 +149,9 @@
function baz(f, y) { f.y = y; }
baz(f1, {y: 9});
baz(f2, {y: 9});
+ baz(f2, {y: 9});
%OptimizeFunctionOnNextCall(baz);
+ baz(f2, {y: 9});
baz(f3, {a: -1});
assertUnoptimized(baz);
})();

Powered by Google App Engine
This is Rietveld 408576698