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

Unified Diff: test/mjsunit/keyed-load-with-symbol-key.js

Issue 1415333003: Alternative approach to using type feedback for Symbol-keyed properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/type-feedback-vector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/keyed-load-with-symbol-key.js
diff --git a/test/mjsunit/keyed-load-with-string-key.js b/test/mjsunit/keyed-load-with-symbol-key.js
similarity index 91%
copy from test/mjsunit/keyed-load-with-string-key.js
copy to test/mjsunit/keyed-load-with-symbol-key.js
index 43889460f622209a1e56a92293ce7cff25c197ab..15562be6bde2eb50ac8b2ce4464c66555240bb50 100644
--- a/test/mjsunit/keyed-load-with-string-key.js
+++ b/test/mjsunit/keyed-load-with-symbol-key.js
@@ -26,21 +26,24 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
-
+var s = Symbol("foo");
var o = {
- "foo": "bar",
+ [s]: "bar",
}
function get(obj, key) {
return obj[key];
}
-get(o, "foo");
-get(o, "foo");
-get(o, "foo");
+assertEquals("bar", get(o, s));
+get(o, s);
+get(o, s);
%OptimizeFunctionOnNextCall(get);
-get(o, "foo");
+assertEquals("bar", get(o, s));
assertOptimized(get);
+
+get(o, "funny");
+assertUnoptimized(get);
« no previous file with comments | « src/type-feedback-vector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698