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

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') | src/spaces.h » ('J')
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 8849 matching lines...) Expand 10 before | Expand all | Expand 10 after
8860 // Use as fallback for allocation in generated code when old pointer space 8860 // Use as fallback for allocation in generated code when old pointer space
8861 // is full. 8861 // is full.
8862 ASSERT(args.length() == 1); 8862 ASSERT(args.length() == 1);
8863 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0); 8863 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0);
8864 int size = size_smi->value(); 8864 int size = size_smi->value();
8865 RUNTIME_ASSERT(IsAligned(size, kPointerSize)); 8865 RUNTIME_ASSERT(IsAligned(size, kPointerSize));
8866 RUNTIME_ASSERT(size > 0); 8866 RUNTIME_ASSERT(size > 0);
8867 Heap* heap = isolate->heap(); 8867 Heap* heap = isolate->heap();
8868 Object* allocation; 8868 Object* allocation;
8869 { MaybeObject* maybe_allocation = 8869 { MaybeObject* maybe_allocation =
8870 heap->old_pointer_space()->AllocateRaw(size); 8870 heap->old_pointer_space()->AllocateRaw<FreeList::WORST_FIT>(size);
8871 if (maybe_allocation->ToObject(&allocation)) { 8871 if (maybe_allocation->ToObject(&allocation)) {
8872 heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size); 8872 heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size);
8873 } 8873 }
8874 return maybe_allocation; 8874 return maybe_allocation;
8875 } 8875 }
8876 } 8876 }
8877 8877
8878 8878
8879 // Push an object unto an array of objects if it is not already in the 8879 // Push an object unto an array of objects if it is not already in the
8880 // array. Returns true if the element was pushed on the stack and 8880 // array. Returns true if the element was pushed on the stack and
(...skipping 4228 matching lines...) Expand 10 before | Expand all | Expand 10 after
13109 // Handle last resort GC and make sure to allow future allocations 13109 // Handle last resort GC and make sure to allow future allocations
13110 // to grow the heap without causing GCs (if possible). 13110 // to grow the heap without causing GCs (if possible).
13111 isolate->counters()->gc_last_resort_from_js()->Increment(); 13111 isolate->counters()->gc_last_resort_from_js()->Increment();
13112 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13112 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13113 "Runtime::PerformGC"); 13113 "Runtime::PerformGC");
13114 } 13114 }
13115 } 13115 }
13116 13116
13117 13117
13118 } } // namespace v8::internal 13118 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.h » ('j') | src/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698