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

Side by Side Diff: src/heap.cc

Issue 240393003: Allocate filler objects in the factory. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/heap.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 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 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 map->set_bit_field2(1 << Map::kIsExtensible); 2401 map->set_bit_field2(1 << Map::kIsExtensible);
2402 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | 2402 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) |
2403 Map::OwnsDescriptors::encode(true); 2403 Map::OwnsDescriptors::encode(true);
2404 map->set_bit_field3(bit_field3); 2404 map->set_bit_field3(bit_field3);
2405 map->set_elements_kind(elements_kind); 2405 map->set_elements_kind(elements_kind);
2406 2406
2407 return map; 2407 return map;
2408 } 2408 }
2409 2409
2410 2410
2411 MaybeObject* Heap::AllocateFillerObject(int size,
2412 bool double_align,
2413 AllocationSpace space) {
2414 HeapObject* allocation;
2415 { MaybeObject* maybe_allocation = AllocateRaw(size, space, space);
2416 if (!maybe_allocation->To(&allocation)) return maybe_allocation;
2417 }
2418 #ifdef DEBUG
2419 MemoryChunk* chunk = MemoryChunk::FromAddress(allocation->address());
2420 ASSERT(chunk->owner()->identity() == space);
2421 #endif
2422 CreateFillerObjectAt(allocation->address(), size);
2423 return allocation;
2424 }
2425
2426
2411 MaybeObject* Heap::AllocatePolymorphicCodeCache() { 2427 MaybeObject* Heap::AllocatePolymorphicCodeCache() {
2412 return AllocateStruct(POLYMORPHIC_CODE_CACHE_TYPE); 2428 return AllocateStruct(POLYMORPHIC_CODE_CACHE_TYPE);
2413 } 2429 }
2414 2430
2415 2431
2416 const Heap::StringTypeTable Heap::string_type_table[] = { 2432 const Heap::StringTypeTable Heap::string_type_table[] = {
2417 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ 2433 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \
2418 {type, size, k##camel_name##MapRootIndex}, 2434 {type, size, k##camel_name##MapRootIndex},
2419 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) 2435 STRING_TYPE_LIST(STRING_TYPE_ELEMENT)
2420 #undef STRING_TYPE_ELEMENT 2436 #undef STRING_TYPE_ELEMENT
(...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after
6714 static_cast<int>(object_sizes_last_time_[index])); 6730 static_cast<int>(object_sizes_last_time_[index]));
6715 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6731 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6716 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6732 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6717 6733
6718 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6734 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6719 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6735 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6720 ClearObjectStats(); 6736 ClearObjectStats();
6721 } 6737 }
6722 6738
6723 } } // namespace v8::internal 6739 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698