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

Unified Diff: test/mjsunit/REMOVE_callic_behavior.js

Issue 445943002: CallIC must update type feedback info correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/REMOVE_callic_behavior.js
diff --git a/test/mjsunit/REMOVE_callic_behavior.js b/test/mjsunit/REMOVE_callic_behavior.js
new file mode 100644
index 0000000000000000000000000000000000000000..e25a7d1abdb2a1af533cd3aab780998252d80355
--- /dev/null
+++ b/test/mjsunit/REMOVE_callic_behavior.js
@@ -0,0 +1,37 @@
+function foo() {
+ var a = new Array();
+ a[0] = 1;
+ return a;
+}
+
+
+function foo_other() {
+ var a = new Array();
+ a[0] = 2;
+ return a;
+}
+
+
+function bar(f1, f2) {
+ var accum = 0;
+ for (var i = 0; i < 100; i++) {
+ var a = f1();
+ var b = f2();
+ accum = a[0] + b[0];
+ }
+}
+
+
+// We should see function bar referenced in --trace-opt like so:
+// [marking 0x5f540959 <JS Function bar (SharedFunctionInfo 0x5f5407d9)>
+// for recompilation, reason: small function,
+// ICs with typeinfo: 6/7 (85%), generic ICs: 1/7 (14%)]
+
+for (var i = 0; i < 100000; i++) {
+ if (i % 2 == 0) {
+ bar(foo, foo);
+ } else {
+ bar(foo, foo_other);
+ }
+}
+
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698