OLD | NEW |
---|---|
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 5410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5421 { MaybeObject* maybe_result = AllocateFixedArray(length, pretenure); | 5421 { MaybeObject* maybe_result = AllocateFixedArray(length, pretenure); |
5422 if (!maybe_result->ToObject(&result)) return maybe_result; | 5422 if (!maybe_result->ToObject(&result)) return maybe_result; |
5423 } | 5423 } |
5424 reinterpret_cast<HeapObject*>(result)->set_map_no_write_barrier( | 5424 reinterpret_cast<HeapObject*>(result)->set_map_no_write_barrier( |
5425 hash_table_map()); | 5425 hash_table_map()); |
5426 ASSERT(result->IsHashTable()); | 5426 ASSERT(result->IsHashTable()); |
5427 return result; | 5427 return result; |
5428 } | 5428 } |
5429 | 5429 |
5430 | 5430 |
5431 MaybeObject* Heap::AllocateSymbol(PretenureFlag pretenure) { | 5431 MaybeObject* Heap::AllocateSymbol() { |
5432 // Statically ensure that it is safe to allocate symbols in paged spaces. | 5432 // Statically ensure that it is safe to allocate symbols in paged spaces. |
5433 STATIC_ASSERT(Symbol::kSize <= Page::kNonCodeObjectAreaSize); | 5433 STATIC_ASSERT(Symbol::kSize <= Page::kNonCodeObjectAreaSize); |
5434 AllocationSpace space = pretenure == TENURED ? OLD_POINTER_SPACE : NEW_SPACE; | 5434 AllocationSpace space = OLD_POINTER_SPACE; |
rossberg
2013/03/28 13:33:17
Nit: just inline this now trivial definition.
| |
5435 | 5435 |
5436 Object* result; | 5436 Object* result; |
5437 MaybeObject* maybe = AllocateRaw(Symbol::kSize, space, OLD_POINTER_SPACE); | 5437 MaybeObject* maybe = AllocateRaw(Symbol::kSize, space, OLD_POINTER_SPACE); |
5438 if (!maybe->ToObject(&result)) return maybe; | 5438 if (!maybe->ToObject(&result)) return maybe; |
5439 | 5439 |
5440 HeapObject::cast(result)->set_map_no_write_barrier(symbol_map()); | 5440 HeapObject::cast(result)->set_map_no_write_barrier(symbol_map()); |
5441 | 5441 |
5442 // Generate a random hash value. | 5442 // Generate a random hash value. |
5443 int hash; | 5443 int hash; |
5444 int attempts = 0; | 5444 int attempts = 0; |
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7817 static_cast<int>(object_sizes_last_time_[index])); | 7817 static_cast<int>(object_sizes_last_time_[index])); |
7818 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7818 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7819 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7819 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7820 | 7820 |
7821 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7821 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7822 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7822 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7823 ClearObjectStats(); | 7823 ClearObjectStats(); |
7824 } | 7824 } |
7825 | 7825 |
7826 } } // namespace v8::internal | 7826 } } // namespace v8::internal |
OLD | NEW |