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

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
« no previous file with comments | « src/handles-inl.h ('k') | src/heap.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 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 // ... 2409 // ...
2389 // } 2410 // }
2390 class AssertNoAllocation { 2411 class AssertNoAllocation {
2391 public: 2412 public:
2392 inline AssertNoAllocation(); 2413 inline AssertNoAllocation();
2393 inline ~AssertNoAllocation(); 2414 inline ~AssertNoAllocation();
2394 2415
2395 #ifdef DEBUG 2416 #ifdef DEBUG
2396 private: 2417 private:
2397 bool old_state_; 2418 bool old_state_;
2419 bool active_;
2398 #endif 2420 #endif
2399 }; 2421 };
2400 2422
2401 2423
2402 class DisableAssertNoAllocation { 2424 class DisableAssertNoAllocation {
2403 public: 2425 public:
2404 inline DisableAssertNoAllocation(); 2426 inline DisableAssertNoAllocation();
2405 inline ~DisableAssertNoAllocation(); 2427 inline ~DisableAssertNoAllocation();
2406 2428
2407 #ifdef DEBUG 2429 #ifdef DEBUG
2408 private: 2430 private:
2409 bool old_state_; 2431 bool old_state_;
2432 bool active_;
2410 #endif 2433 #endif
2411 }; 2434 };
2412 2435
2413 // GCTracer collects and prints ONE line after each garbage collector 2436 // GCTracer collects and prints ONE line after each garbage collector
2414 // invocation IFF --trace_gc is used. 2437 // invocation IFF --trace_gc is used.
2415 2438
2416 class GCTracer BASE_EMBEDDED { 2439 class GCTracer BASE_EMBEDDED {
2417 public: 2440 public:
2418 class Scope BASE_EMBEDDED { 2441 class Scope BASE_EMBEDDED {
2419 public: 2442 public:
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2751 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2729 2752
2730 private: 2753 private:
2731 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2754 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2732 }; 2755 };
2733 #endif // DEBUG || LIVE_OBJECT_LIST 2756 #endif // DEBUG || LIVE_OBJECT_LIST
2734 2757
2735 } } // namespace v8::internal 2758 } } // namespace v8::internal
2736 2759
2737 #endif // V8_HEAP_H_ 2760 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles-inl.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698