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

Unified Diff: test/mjsunit/array-push.js

Issue 143213003: Turn ArrayPush into a stub specialized on the elements kind and argc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Properly bind label Created 6 years, 11 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/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-push.js
diff --git a/test/mjsunit/array-push.js b/test/mjsunit/array-push.js
index 2a25a9cc9e31eaeab85273ce0a5f95f35533565f..c87fd128e4bd4a19ccf07d6fd293592283726d89 100644
--- a/test/mjsunit/array-push.js
+++ b/test/mjsunit/array-push.js
@@ -25,6 +25,8 @@
// (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
+
// Check pushes with various number of arguments.
(function() {
var a = [];
@@ -113,3 +115,34 @@
assertEquals(i + 1, x.length, i + 'th iteration');
}
})();
+
+(function() {
+ function f(a, i) {
+ a.push(i);
+ }
+
+ var a = [1,2,3];
+ a.f = function() { return 10; }
+ f(a, 4);
+ f(a, 5);
+ f(a, 6);
+ f(a, 7);
+ f(a, {});
+ assertEquals(10, a.f());
+})();
+
+(function() {
+ function f(a, i) {
+ a.push(i);
+ }
+
+ var a = [1,2,3];
+ a.f = function() { return 10; }
+ f(a, 4);
+ f(a, 5);
+ f(a, 6);
+ %OptimizeFunctionOnNextCall(f);
+ f(a, 7);
+ f(a, {});
+ assertEquals(10, a.f());
+})();
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698