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

Unified Diff: test/mjsunit/compiler/inlined-call-mapcheck.js

Issue 588573002: Optimize Function.prototype.call (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 6 years, 3 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/compiler/inlined-call-mapcheck.js
diff --git a/test/mjsunit/regress/regress-333594.js b/test/mjsunit/compiler/inlined-call-mapcheck.js
similarity index 53%
copy from test/mjsunit/regress/regress-333594.js
copy to test/mjsunit/compiler/inlined-call-mapcheck.js
index 6f6dbaafcd64d8b752226a290df525ca200b69a0..84ec1d20e9e943ad074083fdaeee6452f0f7c07c 100644
--- a/test/mjsunit/regress/regress-333594.js
+++ b/test/mjsunit/compiler/inlined-call-mapcheck.js
@@ -3,15 +3,15 @@
// modification, are permitted provided that the following conditions are
// met:
//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -25,18 +25,19 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
+// Flags: --allow-natives-syntax --noalways-opt
-var a = { x: 1.1 };
-a.x = 0;
-var G = a.x;
-var o = { x: {} };
+(function() {
+ function f(x) {
+ for (i = 0; i < 1; i++) {
+ x.call(this);
+ }
+ }
-function func() {
- return {x: G};
-}
+ function g() {}
-func();
-func();
-%OptimizeFunctionOnNextCall(func);
-assertEquals(0, func().x);
+ f(g);
+ f(g);
+ %OptimizeFunctionOnNextCall(f);
+ assertThrows(function() { f('whatever') }, TypeError);
+})();

Powered by Google App Engine
This is Rietveld 408576698