OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "api.h" | 8 #include "api.h" |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 4276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4287 { MaybeObject* maybe_result = | 4287 { MaybeObject* maybe_result = |
4288 AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE); | 4288 AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE); |
4289 if (!maybe_result->ToObject(&result)) return maybe_result; | 4289 if (!maybe_result->ToObject(&result)) return maybe_result; |
4290 } | 4290 } |
4291 HeapObject::cast(result)->set_map_no_write_barrier(constant_pool_array_map()); | 4291 HeapObject::cast(result)->set_map_no_write_barrier(constant_pool_array_map()); |
4292 ConstantPoolArray::cast(result)->Init(0, 0, 0, 0); | 4292 ConstantPoolArray::cast(result)->Init(0, 0, 0, 0); |
4293 return result; | 4293 return result; |
4294 } | 4294 } |
4295 | 4295 |
4296 | 4296 |
4297 MaybeObject* Heap::AllocateHashTable(int length, PretenureFlag pretenure) { | |
4298 Object* result; | |
4299 { MaybeObject* maybe_result = AllocateFixedArray(length, pretenure); | |
4300 if (!maybe_result->ToObject(&result)) return maybe_result; | |
4301 } | |
4302 reinterpret_cast<HeapObject*>(result)->set_map_no_write_barrier( | |
4303 hash_table_map()); | |
4304 ASSERT(result->IsHashTable()); | |
4305 return result; | |
4306 } | |
4307 | |
4308 | |
4309 MaybeObject* Heap::AllocateSymbol() { | 4297 MaybeObject* Heap::AllocateSymbol() { |
4310 // Statically ensure that it is safe to allocate symbols in paged spaces. | 4298 // Statically ensure that it is safe to allocate symbols in paged spaces. |
4311 STATIC_ASSERT(Symbol::kSize <= Page::kMaxRegularHeapObjectSize); | 4299 STATIC_ASSERT(Symbol::kSize <= Page::kMaxRegularHeapObjectSize); |
4312 | 4300 |
4313 Object* result; | 4301 Object* result; |
4314 MaybeObject* maybe = | 4302 MaybeObject* maybe = |
4315 AllocateRaw(Symbol::kSize, OLD_POINTER_SPACE, OLD_POINTER_SPACE); | 4303 AllocateRaw(Symbol::kSize, OLD_POINTER_SPACE, OLD_POINTER_SPACE); |
4316 if (!maybe->ToObject(&result)) return maybe; | 4304 if (!maybe->ToObject(&result)) return maybe; |
4317 | 4305 |
4318 HeapObject::cast(result)->set_map_no_write_barrier(symbol_map()); | 4306 HeapObject::cast(result)->set_map_no_write_barrier(symbol_map()); |
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6497 static_cast<int>(object_sizes_last_time_[index])); | 6485 static_cast<int>(object_sizes_last_time_[index])); |
6498 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6486 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6499 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6487 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6500 | 6488 |
6501 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6489 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6502 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6490 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6503 ClearObjectStats(); | 6491 ClearObjectStats(); |
6504 } | 6492 } |
6505 | 6493 |
6506 } } // namespace v8::internal | 6494 } } // namespace v8::internal |
OLD | NEW |