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

Side by Side Diff: src/builtins.cc

Issue 939933002: Remove receiver as parameter to Get/Has Element in the accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/elements.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 659
660 Handle<JSObject> object = Handle<JSObject>::cast(receiver); 660 Handle<JSObject> object = Handle<JSObject>::cast(receiver);
661 Handle<FixedArrayBase> elms(object->elements(), isolate); 661 Handle<FixedArrayBase> elms(object->elements(), isolate);
662 662
663 ElementsKind kind = object->GetElementsKind(); 663 ElementsKind kind = object->GetElementsKind();
664 if (IsHoleyElementsKind(kind)) { 664 if (IsHoleyElementsKind(kind)) {
665 DisallowHeapAllocation no_gc; 665 DisallowHeapAllocation no_gc;
666 bool packed = true; 666 bool packed = true;
667 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); 667 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind);
668 for (int i = k; i < final; i++) { 668 for (int i = k; i < final; i++) {
669 if (!accessor->HasElement(object, object, i, elms)) { 669 if (!accessor->HasElement(object, i, elms)) {
670 packed = false; 670 packed = false;
671 break; 671 break;
672 } 672 }
673 } 673 }
674 if (packed) { 674 if (packed) {
675 kind = GetPackedElementsKind(kind); 675 kind = GetPackedElementsKind(kind);
676 } else if (!receiver->IsJSArray()) { 676 } else if (!receiver->IsJSArray()) {
677 AllowHeapAllocation allow_allocation; 677 AllowHeapAllocation allow_allocation;
678 return CallJsBuiltin(isolate, "ArraySlice", args); 678 return CallJsBuiltin(isolate, "ArraySlice", args);
679 } 679 }
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 } 1640 }
1641 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1641 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1642 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1642 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1643 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1643 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1644 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1644 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1645 #undef DEFINE_BUILTIN_ACCESSOR_C 1645 #undef DEFINE_BUILTIN_ACCESSOR_C
1646 #undef DEFINE_BUILTIN_ACCESSOR_A 1646 #undef DEFINE_BUILTIN_ACCESSOR_A
1647 1647
1648 1648
1649 } } // namespace v8::internal 1649 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698