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

Side by Side Diff: src/handles.cc

Issue 10911054: If we are trimming the whole array, just return the empty fixed array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 // many properties were added but subsequently deleted. 792 // many properties were added but subsequently deleted.
793 int next_enumeration = dictionary->NextEnumerationIndex(); 793 int next_enumeration = dictionary->NextEnumerationIndex();
794 if (next_enumeration > (length * 3) / 2) { 794 if (next_enumeration > (length * 3) / 2) {
795 StringDictionary::DoGenerateNewEnumerationIndices(dictionary); 795 StringDictionary::DoGenerateNewEnumerationIndices(dictionary);
796 next_enumeration = dictionary->NextEnumerationIndex(); 796 next_enumeration = dictionary->NextEnumerationIndex();
797 } 797 }
798 798
799 Handle<FixedArray> storage = 799 Handle<FixedArray> storage =
800 isolate->factory()->NewFixedArray(next_enumeration); 800 isolate->factory()->NewFixedArray(next_enumeration);
801 801
802 dictionary->CopyEnumKeysTo(*storage); 802 storage = Handle<FixedArray>(dictionary->CopyEnumKeysTo(*storage));
803 ASSERT(storage->length() == object->NumberOfLocalProperties(DONT_ENUM)); 803 ASSERT(storage->length() == object->NumberOfLocalProperties(DONT_ENUM));
804 return storage; 804 return storage;
805 } 805 }
806 } 806 }
807 807
808 808
809 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table, 809 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table,
810 Handle<Object> key) { 810 Handle<Object> key) {
811 CALL_HEAP_FUNCTION(table->GetIsolate(), 811 CALL_HEAP_FUNCTION(table->GetIsolate(),
812 table->Add(*key), 812 table->Add(*key),
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 data->next = prev_next_; 1026 data->next = prev_next_;
1027 data->limit = prev_limit_; 1027 data->limit = prev_limit_;
1028 #ifdef DEBUG 1028 #ifdef DEBUG
1029 handles_detached_ = true; 1029 handles_detached_ = true;
1030 #endif 1030 #endif
1031 return deferred; 1031 return deferred;
1032 } 1032 }
1033 1033
1034 1034
1035 } } // namespace v8::internal 1035 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698