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

Unified Diff: src/js/array.js

Issue 1842563004: [runtime] Don't call GetArrayKeys on proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | test/mjsunit/array-sort.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/array.js
diff --git a/src/js/array.js b/src/js/array.js
index d9b097c84727e2aa7beb843b8895b46f25d85cd8..1406df336d03825cb8dac8f47abd0abd2f058323 100644
--- a/src/js/array.js
+++ b/src/js/array.js
@@ -1049,7 +1049,7 @@ function InnerArraySort(array, length, comparefn) {
var CopyFromPrototype = function CopyFromPrototype(obj, length) {
var max = 0;
for (var proto = %_GetPrototype(obj); proto; proto = %_GetPrototype(proto)) {
- var indices = %GetArrayKeys(proto, length);
+ var indices = IS_PROXY(proto) ? length : %GetArrayKeys(proto, length);
Camillo Bruni 2016/03/29 11:34:57 aah quelle elegance!
if (IS_NUMBER(indices)) {
// It's an interval.
var proto_length = indices;
@@ -1077,7 +1077,7 @@ function InnerArraySort(array, length, comparefn) {
// elements in that range.
var ShadowPrototypeElements = function(obj, from, to) {
for (var proto = %_GetPrototype(obj); proto; proto = %_GetPrototype(proto)) {
- var indices = %GetArrayKeys(proto, to);
+ var indices = IS_PROXY(proto) ? to : %GetArrayKeys(proto, to);
if (IS_NUMBER(indices)) {
// It's an interval.
var proto_length = indices;
« no previous file with comments | « no previous file | test/mjsunit/array-sort.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698