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

Side by Side Diff: src/heap-inl.h

Issue 68663002: Move old-space allocation tracking into Heap::AllocateRaw. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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.cc ('k') | src/mark-compact.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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 result = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE); 252 result = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE);
253 } else if (CELL_SPACE == space) { 253 } else if (CELL_SPACE == space) {
254 result = cell_space_->AllocateRaw(size_in_bytes); 254 result = cell_space_->AllocateRaw(size_in_bytes);
255 } else if (PROPERTY_CELL_SPACE == space) { 255 } else if (PROPERTY_CELL_SPACE == space) {
256 result = property_cell_space_->AllocateRaw(size_in_bytes); 256 result = property_cell_space_->AllocateRaw(size_in_bytes);
257 } else { 257 } else {
258 ASSERT(MAP_SPACE == space); 258 ASSERT(MAP_SPACE == space);
259 result = map_space_->AllocateRaw(size_in_bytes); 259 result = map_space_->AllocateRaw(size_in_bytes);
260 } 260 }
261 if (result->IsFailure()) old_gen_exhausted_ = true; 261 if (result->IsFailure()) old_gen_exhausted_ = true;
262 if (profiler->is_tracking_allocations() && result->To(&object)) {
263 profiler->NewObjectEvent(object->address(), size_in_bytes);
264 }
262 return result; 265 return result;
263 } 266 }
264 267
265 268
266 MaybeObject* Heap::NumberFromInt32( 269 MaybeObject* Heap::NumberFromInt32(
267 int32_t value, PretenureFlag pretenure) { 270 int32_t value, PretenureFlag pretenure) {
268 if (Smi::IsValid(value)) return Smi::FromInt(value); 271 if (Smi::IsValid(value)) return Smi::FromInt(value);
269 // Bypass NumberFromDouble to avoid various redundant checks. 272 // Bypass NumberFromDouble to avoid various redundant checks.
270 return AllocateHeapNumber(FastI2D(value), pretenure); 273 return AllocateHeapNumber(FastI2D(value), pretenure);
271 } 274 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 #ifdef DEBUG 864 #ifdef DEBUG
862 Isolate* isolate = Isolate::Current(); 865 Isolate* isolate = Isolate::Current();
863 isolate->heap()->disallow_allocation_failure_ = old_state_; 866 isolate->heap()->disallow_allocation_failure_ = old_state_;
864 #endif 867 #endif
865 } 868 }
866 869
867 870
868 } } // namespace v8::internal 871 } } // namespace v8::internal
869 872
870 #endif // V8_HEAP_INL_H_ 873 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698