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

Side by Side Diff: src/heap.cc

Issue 65043006: Simplify current inline allocation tracking mechanism. (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/assembler.cc ('k') | src/heap-profiler.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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 Heap* heap, 833 Heap* heap,
834 AllocationSpace space, 834 AllocationSpace space,
835 const char* gc_reason = NULL) { 835 const char* gc_reason = NULL) {
836 heap->mark_compact_collector()->SetFlags(Heap::kAbortIncrementalMarkingMask); 836 heap->mark_compact_collector()->SetFlags(Heap::kAbortIncrementalMarkingMask);
837 bool result = heap->CollectGarbage(space, gc_reason); 837 bool result = heap->CollectGarbage(space, gc_reason);
838 heap->mark_compact_collector()->SetFlags(Heap::kNoGCFlags); 838 heap->mark_compact_collector()->SetFlags(Heap::kNoGCFlags);
839 return result; 839 return result;
840 } 840 }
841 841
842 842
843 void Heap::ReserveSpace( 843 void Heap::ReserveSpace(int *sizes, Address *locations_out) {
844 int *sizes,
845 Address *locations_out) {
846 bool gc_performed = true; 844 bool gc_performed = true;
847 int counter = 0; 845 int counter = 0;
848 static const int kThreshold = 20; 846 static const int kThreshold = 20;
849 while (gc_performed && counter++ < kThreshold) { 847 while (gc_performed && counter++ < kThreshold) {
850 gc_performed = false; 848 gc_performed = false;
851 ASSERT(NEW_SPACE == FIRST_PAGED_SPACE - 1); 849 ASSERT(NEW_SPACE == FIRST_PAGED_SPACE - 1);
852 for (int space = NEW_SPACE; space <= LAST_PAGED_SPACE; space++) { 850 for (int space = NEW_SPACE; space <= LAST_PAGED_SPACE; space++) {
853 if (sizes[space] != 0) { 851 if (sizes[space] != 0) {
854 MaybeObject* allocation; 852 MaybeObject* allocation;
855 if (space == NEW_SPACE) { 853 if (space == NEW_SPACE) {
(...skipping 7057 matching lines...) Expand 10 before | Expand all | Expand 10 after
7913 if (FLAG_concurrent_recompilation) { 7911 if (FLAG_concurrent_recompilation) {
7914 heap_->relocation_mutex_->Lock(); 7912 heap_->relocation_mutex_->Lock();
7915 #ifdef DEBUG 7913 #ifdef DEBUG
7916 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7914 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7917 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7915 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7918 #endif // DEBUG 7916 #endif // DEBUG
7919 } 7917 }
7920 } 7918 }
7921 7919
7922 } } // namespace v8::internal 7920 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698