result = map_space_->AllocateRaw(size_in_bytes);
}
if (result->IsFailure()) old_gen_exhausted_ = true;
+ if (profiler->is_tracking_allocations() && result->To(&object)) {
+ profiler->NewObjectEvent(object->address(), size_in_bytes);
+ }
return result;
}
if (force_lo_space) {
maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(obj_size);
+ maybe_result = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE);
}
if (!maybe_result->To<HeapObject>(&result)) return maybe_result;
if (obj_size > code_space()->AreaSize()) {
maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(obj_size);
+ maybe_result = AllocateRaw(obj_size, CODE_SPACE, CODE_SPACE);
}
Object* result;
if (new_obj_size > code_space()->AreaSize()) {
maybe_result = lo_space_->AllocateRaw(new_obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(new_obj_size);
+ maybe_result = AllocateRaw(new_obj_size, CODE_SPACE, CODE_SPACE);
}
Object* result;
ASSERT(target_space == heap()->old_pointer_space() ||
target_space == heap()->old_data_space());
Object* result;
- MaybeObject* maybe_result = target_space->AllocateRaw(
- object_size,
- PagedSpace::MOVE_OBJECT);
+ MaybeObject* maybe_result = target_space->AllocateRaw(object_size);
if (maybe_result->ToObject(&result)) {
HeapObject* target = HeapObject::cast(result);
MigrateObject(target->address(),
int size = object->Size();
- MaybeObject* target = space->AllocateRaw(size, PagedSpace::MOVE_OBJECT);
+ MaybeObject* target = space->AllocateRaw(size);
if (target->IsFailure()) {
// OS refused to give us memory.
V8::FatalProcessOutOfMemory("Evacuation");
// Raw allocation.
-MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes,
- AllocationType event) {
- HeapProfiler* profiler = heap()->isolate()->heap_profiler();
-
+MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
HeapObject* object = AllocateLinearly(size_in_bytes);
if (object != NULL) {
if (identity() == CODE_SPACE) {
SkipList::Update(object->address(), size_in_bytes);
}
- if (event == NEW_OBJECT && profiler->is_tracking_allocations()) {
- profiler->NewObjectEvent(object->address(), size_in_bytes);
- }
return object;
}
if (identity() == CODE_SPACE) {
SkipList::Update(object->address(), size_in_bytes);
}
- if (event == NEW_OBJECT && profiler->is_tracking_allocations()) {
- profiler->NewObjectEvent(object->address(), size_in_bytes);
- }
return object;
}
if (identity() == CODE_SPACE) {
SkipList::Update(object->address(), size_in_bytes);
}
- if (event == NEW_OBJECT && profiler->is_tracking_allocations()) {
- profiler->NewObjectEvent(object->address(), size_in_bytes);
- }
return object;
}
return allocation_info_.limit_address();
}
- enum AllocationType {
- NEW_OBJECT,
- MOVE_OBJECT
- };
-
// Allocate the requested number of bytes in the space if possible, return a
// failure object if not.
- MUST_USE_RESULT inline MaybeObject* AllocateRaw(
- int size_in_bytes,
- AllocationType event = NEW_OBJECT);
+ MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes);
virtual bool ReserveSpace(int bytes);