Chromium Code Reviews

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

Issue 2598543003: [runtime][ic] Constant field tracking support. (Closed)
Patch Set: Rebasing Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: test/mjsunit/field-type-tracking.js
diff --git a/test/mjsunit/field-type-tracking.js b/test/mjsunit/field-type-tracking.js
index 447ec1590e9e2019a823bace97fca8c783e875ed..e6b19b9bbc864de66ad3b91ab3248e6d46bdb9f9 100644
--- a/test/mjsunit/field-type-tracking.js
+++ b/test/mjsunit/field-type-tracking.js
@@ -8,6 +8,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) {
@@ -108,6 +111,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});
@@ -144,7 +150,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