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

Side by Side Diff: src/objects.cc

Issue 7576003: Merge r8823 and r8824 into 3.2 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.2/
Patch Set: Created 9 years, 4 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 | « src/objects.h ('k') | src/runtime.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 8324 matching lines...) Expand 10 before | Expand all | Expand 10 after
8335 // mirrors. 8335 // mirrors.
8336 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) { 8336 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) {
8337 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index)); 8337 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index));
8338 if (HasFastProperties()) { 8338 if (HasFastProperties()) {
8339 DescriptorArray* descs = map()->instance_descriptors(); 8339 DescriptorArray* descs = map()->instance_descriptors();
8340 for (int i = 0; i < descs->number_of_descriptors(); i++) { 8340 for (int i = 0; i < descs->number_of_descriptors(); i++) {
8341 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i)); 8341 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i));
8342 } 8342 }
8343 ASSERT(storage->length() >= index); 8343 ASSERT(storage->length() >= index);
8344 } else { 8344 } else {
8345 property_dictionary()->CopyKeysTo(storage); 8345 property_dictionary()->CopyKeysTo(storage,
8346 index);
8346 } 8347 }
8347 } 8348 }
8348 8349
8349 8350
8350 int JSObject::NumberOfLocalElements(PropertyAttributes filter) { 8351 int JSObject::NumberOfLocalElements(PropertyAttributes filter) {
8351 return GetLocalElementKeys(NULL, filter); 8352 return GetLocalElementKeys(NULL, filter);
8352 } 8353 }
8353 8354
8354 8355
8355 int JSObject::NumberOfEnumElements() { 8356 int JSObject::NumberOfEnumElements() {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
8919 template void Dictionary<NumberDictionaryShape, uint32_t>::CopyKeysTo( 8920 template void Dictionary<NumberDictionaryShape, uint32_t>::CopyKeysTo(
8920 FixedArray*, PropertyAttributes); 8921 FixedArray*, PropertyAttributes);
8921 8922
8922 template Object* Dictionary<StringDictionaryShape, String*>::DeleteProperty( 8923 template Object* Dictionary<StringDictionaryShape, String*>::DeleteProperty(
8923 int, JSObject::DeleteMode); 8924 int, JSObject::DeleteMode);
8924 8925
8925 template Object* Dictionary<NumberDictionaryShape, uint32_t>::DeleteProperty( 8926 template Object* Dictionary<NumberDictionaryShape, uint32_t>::DeleteProperty(
8926 int, JSObject::DeleteMode); 8927 int, JSObject::DeleteMode);
8927 8928
8928 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo( 8929 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo(
8929 FixedArray*); 8930 FixedArray*, int);
8930 8931
8931 template int 8932 template int
8932 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes( 8933 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes(
8933 PropertyAttributes); 8934 PropertyAttributes);
8934 8935
8935 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add( 8936 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add(
8936 String*, Object*, PropertyDetails); 8937 String*, Object*, PropertyDetails);
8937 8938
8938 template MaybeObject* 8939 template MaybeObject*
8939 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices(); 8940 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices();
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
9975 sort_array->set(index, Smi::FromInt(details.index())); 9976 sort_array->set(index, Smi::FromInt(details.index()));
9976 index++; 9977 index++;
9977 } 9978 }
9978 } 9979 }
9979 storage->SortPairs(sort_array, sort_array->length()); 9980 storage->SortPairs(sort_array, sort_array->length());
9980 ASSERT(storage->length() >= index); 9981 ASSERT(storage->length() >= index);
9981 } 9982 }
9982 9983
9983 9984
9984 template<typename Shape, typename Key> 9985 template<typename Shape, typename Key>
9985 void Dictionary<Shape, Key>::CopyKeysTo(FixedArray* storage) { 9986 void Dictionary<Shape, Key>::CopyKeysTo(
9987 FixedArray* storage, int index) {
9986 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( 9988 ASSERT(storage->length() >= NumberOfElementsFilterAttributes(
9987 static_cast<PropertyAttributes>(NONE))); 9989 static_cast<PropertyAttributes>(NONE)));
9988 int capacity = HashTable<Shape, Key>::Capacity(); 9990 int capacity = HashTable<Shape, Key>::Capacity();
9989 int index = 0;
9990 for (int i = 0; i < capacity; i++) { 9991 for (int i = 0; i < capacity; i++) {
9991 Object* k = HashTable<Shape, Key>::KeyAt(i); 9992 Object* k = HashTable<Shape, Key>::KeyAt(i);
9992 if (HashTable<Shape, Key>::IsKey(k)) { 9993 if (HashTable<Shape, Key>::IsKey(k)) {
9993 PropertyDetails details = DetailsAt(i); 9994 PropertyDetails details = DetailsAt(i);
9994 if (details.IsDeleted()) continue; 9995 if (details.IsDeleted()) continue;
9995 storage->set(index++, k); 9996 storage->set(index++, k);
9996 } 9997 }
9997 } 9998 }
9998 ASSERT(storage->length() >= index); 9999 ASSERT(storage->length() >= index);
9999 } 10000 }
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
10401 if (break_point_objects()->IsUndefined()) return 0; 10402 if (break_point_objects()->IsUndefined()) return 0;
10402 // Single beak point. 10403 // Single beak point.
10403 if (!break_point_objects()->IsFixedArray()) return 1; 10404 if (!break_point_objects()->IsFixedArray()) return 1;
10404 // Multiple break points. 10405 // Multiple break points.
10405 return FixedArray::cast(break_point_objects())->length(); 10406 return FixedArray::cast(break_point_objects())->length();
10406 } 10407 }
10407 #endif 10408 #endif
10408 10409
10409 10410
10410 } } // namespace v8::internal 10411 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698