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

Unified Diff: src/elements.cc

Issue 1002203003: Speed up FastElementsAccessor::ValidContents by removing redundant handle scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index cd7ba984af092c426fe539a4260681912208e251..c523818d87646805ec149c76564d7cb2674b9eb4 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -991,10 +991,10 @@ class FastElementsAccessor
(IsFastDoubleElementsKind(KindTraits::Kind) ==
((map == isolate->heap()->fixed_array_map() && length == 0) ||
map == isolate->heap()->fixed_double_array_map())));
+ if (length == 0) return; // nothing to do!
DisallowHeapAllocation no_gc;
+ Handle<BackingStore> backing_store = Handle<BackingStore>::cast(elements);
for (int i = 0; i < length; i++) {
- HandleScope scope(isolate);
- Handle<BackingStore> backing_store = Handle<BackingStore>::cast(elements);
DCHECK((!IsFastSmiElementsKind(KindTraits::Kind) ||
BackingStore::get(backing_store, i)->IsSmi()) ||
(IsFastHoleyElementsKind(KindTraits::Kind) ==
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698