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

Unified Diff: test/mjsunit/generic-monorphic-keyed-load.js

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: fixes Created 6 years 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
« src/ic/ic-compiler.cc ('K') | « src/typing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/generic-monorphic-keyed-load.js
diff --git a/test/mjsunit/regress/regress-334708.js b/test/mjsunit/generic-monorphic-keyed-load.js
similarity index 89%
copy from test/mjsunit/regress/regress-334708.js
copy to test/mjsunit/generic-monorphic-keyed-load.js
index f0291bbdab61128baad9df89457d045b66644f1b..43889460f622209a1e56a92293ce7cff25c197ab 100644
--- a/test/mjsunit/regress/regress-334708.js
+++ b/test/mjsunit/generic-monorphic-keyed-load.js
@@ -27,16 +27,20 @@
// Flags: --allow-natives-syntax
-function foo(x, y) {
- return Math.floor(x / y);
+
+var o = {
+ "foo": "bar",
}
-function bar(x, y) {
- return foo(x + 1, y + 1);
+function get(obj, key) {
+ return obj[key];
}
-foo(16, "4");
+get(o, "foo");
+get(o, "foo");
+get(o, "foo");
+
+%OptimizeFunctionOnNextCall(get);
+get(o, "foo");
-bar(64, 2);
-%OptimizeFunctionOnNextCall(bar);
-bar(64, 2);
+assertOptimized(get);
« src/ic/ic-compiler.cc ('K') | « src/typing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698