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

Side by Side Diff: src/heap.h

Issue 10807024: Optimize functions on a second thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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
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 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 if (type == CODE_TYPE) { 1613 if (type == CODE_TYPE) {
1614 ASSERT(sub_type <= Code::LAST_CODE_KIND); 1614 ASSERT(sub_type <= Code::LAST_CODE_KIND);
1615 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; 1615 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++;
1616 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; 1616 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size;
1617 } 1617 }
1618 } 1618 }
1619 } 1619 }
1620 1620
1621 void CheckpointObjectStats(); 1621 void CheckpointObjectStats();
1622 1622
1623 // We don't use a ScopedLock here since we want to lock the heap
1624 // only when FLAG_parallel_recompilation is true.
1625 class RelocationLock {
1626 public:
1627 explicit RelocationLock(Heap* heap) : heap_(heap) {
1628 if (FLAG_parallel_recompilation) {
1629 heap_->relocation_mutex_->Lock();
1630 }
1631 }
1632 ~RelocationLock() {
1633 if (FLAG_parallel_recompilation) {
1634 heap_->relocation_mutex_->Unlock();
1635 }
1636 }
1637
1638 private:
1639 Heap* heap_;
1640 };
1641
1623 private: 1642 private:
1624 Heap(); 1643 Heap();
1625 1644
1626 // This can be calculated directly from a pointer to the heap; however, it is 1645 // This can be calculated directly from a pointer to the heap; however, it is
1627 // more expedient to get at the isolate directly from within Heap methods. 1646 // more expedient to get at the isolate directly from within Heap methods.
1628 Isolate* isolate_; 1647 Isolate* isolate_;
1629 1648
1630 Object* roots_[kRootListLength]; 1649 Object* roots_[kRootListLength];
1631 1650
1632 intptr_t code_range_size_; 1651 intptr_t code_range_size_;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 // Flag is set when the heap has been configured. The heap can be repeatedly 2084 // Flag is set when the heap has been configured. The heap can be repeatedly
2066 // configured through the API until it is set up. 2085 // configured through the API until it is set up.
2067 bool configured_; 2086 bool configured_;
2068 2087
2069 ExternalStringTable external_string_table_; 2088 ExternalStringTable external_string_table_;
2070 2089
2071 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; 2090 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
2072 2091
2073 MemoryChunk* chunks_queued_for_free_; 2092 MemoryChunk* chunks_queued_for_free_;
2074 2093
2094 Mutex* relocation_mutex_;
2095
2075 friend class Factory; 2096 friend class Factory;
2076 friend class GCTracer; 2097 friend class GCTracer;
2077 friend class DisallowAllocationFailure; 2098 friend class DisallowAllocationFailure;
2078 friend class AlwaysAllocateScope; 2099 friend class AlwaysAllocateScope;
2079 friend class LinearAllocationScope; 2100 friend class LinearAllocationScope;
2080 friend class Page; 2101 friend class Page;
2081 friend class Isolate; 2102 friend class Isolate;
2082 friend class MarkCompactCollector; 2103 friend class MarkCompactCollector;
2083 friend class StaticMarkingVisitor; 2104 friend class StaticMarkingVisitor;
2084 friend class MapCompact; 2105 friend class MapCompact;
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2749 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2729 2750
2730 private: 2751 private:
2731 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2752 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2732 }; 2753 };
2733 #endif // DEBUG || LIVE_OBJECT_LIST 2754 #endif // DEBUG || LIVE_OBJECT_LIST
2734 2755
2735 } } // namespace v8::internal 2756 } } // namespace v8::internal
2736 2757
2737 #endif // V8_HEAP_H_ 2758 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698