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

Side by Side Diff: src/elements.cc

Issue 2087823002: Optionally invoke an interceptor on failed access checks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 5 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 | « src/api.cc ('k') | src/isolate.cc » ('j') | src/keys.cc » ('J')
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/elements.h" 5 #include "src/elements.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 920 }
921 921
922 *nof_items = count; 922 *nof_items = count;
923 return Just(true); 923 return Just(true);
924 } 924 }
925 925
926 void CollectElementIndices(Handle<JSObject> object, 926 void CollectElementIndices(Handle<JSObject> object,
927 Handle<FixedArrayBase> backing_store, 927 Handle<FixedArrayBase> backing_store,
928 KeyAccumulator* keys) final { 928 KeyAccumulator* keys) final {
929 if (keys->filter() & ONLY_ALL_CAN_READ) return; 929 if (keys->filter() & ONLY_ALL_CAN_READ) return;
930 if (keys->filter() & USE_ACCESS_CHECK_INTERCEPTOR) return;
930 Subclass::CollectElementIndicesImpl(object, backing_store, keys); 931 Subclass::CollectElementIndicesImpl(object, backing_store, keys);
931 } 932 }
932 933
933 static void CollectElementIndicesImpl(Handle<JSObject> object, 934 static void CollectElementIndicesImpl(Handle<JSObject> object,
934 Handle<FixedArrayBase> backing_store, 935 Handle<FixedArrayBase> backing_store,
935 KeyAccumulator* keys) { 936 KeyAccumulator* keys) {
936 DCHECK_NE(DICTIONARY_ELEMENTS, kind()); 937 DCHECK_NE(DICTIONARY_ELEMENTS, kind());
937 // Non-dictionary elements can't have all-can-read accessors. 938 // Non-dictionary elements can't have all-can-read accessors.
938 uint32_t length = Subclass::GetMaxIndex(*object, *backing_store); 939 uint32_t length = Subclass::GetMaxIndex(*object, *backing_store);
939 PropertyFilter filter = keys->filter(); 940 PropertyFilter filter = keys->filter();
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } 1336 }
1336 } 1337 }
1337 1338
1338 static Handle<FixedArray> DirectCollectElementIndicesImpl( 1339 static Handle<FixedArray> DirectCollectElementIndicesImpl(
1339 Isolate* isolate, Handle<JSObject> object, 1340 Isolate* isolate, Handle<JSObject> object,
1340 Handle<FixedArrayBase> backing_store, GetKeysConversion convert, 1341 Handle<FixedArrayBase> backing_store, GetKeysConversion convert,
1341 PropertyFilter filter, Handle<FixedArray> list, uint32_t* nof_indices, 1342 PropertyFilter filter, Handle<FixedArray> list, uint32_t* nof_indices,
1342 uint32_t insertion_index = 0) { 1343 uint32_t insertion_index = 0) {
1343 if (filter & SKIP_STRINGS) return list; 1344 if (filter & SKIP_STRINGS) return list;
1344 if (filter & ONLY_ALL_CAN_READ) return list; 1345 if (filter & ONLY_ALL_CAN_READ) return list;
1346 if (filter & USE_ACCESS_CHECK_INTERCEPTOR) return list;
1345 1347
1346 Handle<SeededNumberDictionary> dictionary = 1348 Handle<SeededNumberDictionary> dictionary =
1347 Handle<SeededNumberDictionary>::cast(backing_store); 1349 Handle<SeededNumberDictionary>::cast(backing_store);
1348 uint32_t capacity = dictionary->Capacity(); 1350 uint32_t capacity = dictionary->Capacity();
1349 for (uint32_t i = 0; i < capacity; i++) { 1351 for (uint32_t i = 0; i < capacity; i++) {
1350 uint32_t key = GetKeyForEntryImpl(isolate, dictionary, i, filter); 1352 uint32_t key = GetKeyForEntryImpl(isolate, dictionary, i, filter);
1351 if (key == kMaxUInt32) continue; 1353 if (key == kMaxUInt32) continue;
1352 Handle<Object> index = isolate->factory()->NewNumberFromUint(key); 1354 Handle<Object> index = isolate->factory()->NewNumberFromUint(key);
1353 list->set(insertion_index, *index); 1355 list->set(insertion_index, *index);
1354 insertion_index++; 1356 insertion_index++;
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 insertion_index += len; 3028 insertion_index += len;
3027 } 3029 }
3028 3030
3029 DCHECK_EQ(insertion_index, result_len); 3031 DCHECK_EQ(insertion_index, result_len);
3030 return result_array; 3032 return result_array;
3031 } 3033 }
3032 3034
3033 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 3035 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
3034 } // namespace internal 3036 } // namespace internal
3035 } // namespace v8 3037 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/isolate.cc » ('j') | src/keys.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698