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

Side by Side Diff: src/runtime.cc

Issue 14208005: Use worst-fit allocation in old space for prentured objects. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/mark-compact.cc ('k') | src/spaces.h » ('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 9031 matching lines...) Expand 10 before | Expand all | Expand 10 after
9042 // Use as fallback for allocation in generated code when old pointer space 9042 // Use as fallback for allocation in generated code when old pointer space
9043 // is full. 9043 // is full.
9044 ASSERT(args.length() == 1); 9044 ASSERT(args.length() == 1);
9045 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0); 9045 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0);
9046 int size = size_smi->value(); 9046 int size = size_smi->value();
9047 RUNTIME_ASSERT(IsAligned(size, kPointerSize)); 9047 RUNTIME_ASSERT(IsAligned(size, kPointerSize));
9048 RUNTIME_ASSERT(size > 0); 9048 RUNTIME_ASSERT(size > 0);
9049 Heap* heap = isolate->heap(); 9049 Heap* heap = isolate->heap();
9050 Object* allocation; 9050 Object* allocation;
9051 { MaybeObject* maybe_allocation = 9051 { MaybeObject* maybe_allocation =
9052 heap->old_pointer_space()->AllocateRaw(size); 9052 heap->old_pointer_space()->AllocateRaw<FreeList::WORST_FIT>(size);
9053 if (maybe_allocation->ToObject(&allocation)) { 9053 if (maybe_allocation->ToObject(&allocation)) {
9054 heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size); 9054 heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size);
9055 } 9055 }
9056 return maybe_allocation; 9056 return maybe_allocation;
9057 } 9057 }
9058 } 9058 }
9059 9059
9060 9060
9061 // Push an object unto an array of objects if it is not already in the 9061 // Push an object unto an array of objects if it is not already in the
9062 // array. Returns true if the element was pushed on the stack and 9062 // array. Returns true if the element was pushed on the stack and
(...skipping 4228 matching lines...) Expand 10 before | Expand all | Expand 10 after
13291 // Handle last resort GC and make sure to allow future allocations 13291 // Handle last resort GC and make sure to allow future allocations
13292 // to grow the heap without causing GCs (if possible). 13292 // to grow the heap without causing GCs (if possible).
13293 isolate->counters()->gc_last_resort_from_js()->Increment(); 13293 isolate->counters()->gc_last_resort_from_js()->Increment();
13294 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13294 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13295 "Runtime::PerformGC"); 13295 "Runtime::PerformGC");
13296 } 13296 }
13297 } 13297 }
13298 13298
13299 13299
13300 } } // namespace v8::internal 13300 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698