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

Unified Diff: src/array.js

Issue 233293005: Remove hand-written assembly ArrayPush stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test comments Created 6 years, 8 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/arm64/code-stubs-arm64.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index ea4f3b41cb8949e666d9ede4cea1ed629f60a7af..a233c63972d7a7bca667e481735a7e6d378e299f 100644
--- a/src/array.js
+++ b/src/array.js
@@ -468,7 +468,13 @@ function ArrayPush() {
return ObservedArrayPush.apply(this, arguments);
for (var i = 0; i < m; i++) {
- this[i+n] = %_Arguments(i);
+ // Use SetProperty rather than a direct keyed store to ensure that the store
+ // site doesn't become poisened with an elements transition KeyedStoreIC.
+ //
+ // TODO(danno): Using %SetProperty is a temporary workaround. The spec says
+ // that ToObject needs to be called for primitive values (and
+ // Runtime_SetProperty seem to ignore them).
+ %SetProperty(this, i+n, %_Arguments(i), 0, kStrictMode);
}
var new_length = n + m;
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698