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

Side by Side Diff: src/heap.h

Issue 23477061: Make objects embedded in optimized code weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix names Created 7 years, 3 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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 1879
1880 #ifdef DEBUG 1880 #ifdef DEBUG
1881 static bool IsLockedByOptimizerThread(Heap* heap) { 1881 static bool IsLockedByOptimizerThread(Heap* heap) {
1882 return heap->relocation_mutex_locked_by_optimizer_thread_; 1882 return heap->relocation_mutex_locked_by_optimizer_thread_;
1883 } 1883 }
1884 #endif // DEBUG 1884 #endif // DEBUG
1885 1885
1886 private: 1886 private:
1887 Heap* heap_; 1887 Heap* heap_;
1888 }; 1888 };
1889 1889
Hannes Payer (out of office) 2013/10/01 13:13:50 What about? - Making weak_object_to_code, weak_obj
ulan 2013/10/01 14:50:29 I moved these methods up to the methods of the exi
1890 Object* weak_object_to_code() {
1891 return weak_object_to_code_;
1892 }
1893
1894 Object** weak_object_to_code_address() {
1895 return &weak_object_to_code_;
1896 }
1897
1898 void set_weak_object_to_code(Object* value) {
1899 ASSERT(!InNewSpace(value));
1900 weak_object_to_code_ = value;
1901 }
1902
1903 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep);
1904
1905 DependentCode* LookupWeakObjectToCodeDependency(Object* obj);
1906
1890 private: 1907 private:
1891 Heap(); 1908 Heap();
1892 1909
1893 // This can be calculated directly from a pointer to the heap; however, it is 1910 // This can be calculated directly from a pointer to the heap; however, it is
1894 // more expedient to get at the isolate directly from within Heap methods. 1911 // more expedient to get at the isolate directly from within Heap methods.
1895 Isolate* isolate_; 1912 Isolate* isolate_;
1896 1913
1897 Object* roots_[kRootListLength]; 1914 Object* roots_[kRootListLength];
1898 1915
1899 intptr_t code_range_size_; 1916 intptr_t code_range_size_;
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 2375
2359 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; 2376 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
2360 2377
2361 MemoryChunk* chunks_queued_for_free_; 2378 MemoryChunk* chunks_queued_for_free_;
2362 2379
2363 Mutex* relocation_mutex_; 2380 Mutex* relocation_mutex_;
2364 #ifdef DEBUG 2381 #ifdef DEBUG
2365 bool relocation_mutex_locked_by_optimizer_thread_; 2382 bool relocation_mutex_locked_by_optimizer_thread_;
2366 #endif // DEBUG; 2383 #endif // DEBUG;
2367 2384
2385 // WeakHashTable that maps objects embedded in optimized code to dependent
2386 // code list. It is initilized lazily and contains the undefined_value at
2387 // start.
2388 Object* weak_object_to_code_;
Hannes Payer (out of office) 2013/10/01 13:13:50 Can we move that up to the other weak list heads,
ulan 2013/10/01 14:50:29 Done.
2389
2368 friend class Factory; 2390 friend class Factory;
2369 friend class GCTracer; 2391 friend class GCTracer;
2370 friend class DisallowAllocationFailure; 2392 friend class DisallowAllocationFailure;
2371 friend class AlwaysAllocateScope; 2393 friend class AlwaysAllocateScope;
2372 friend class Page; 2394 friend class Page;
2373 friend class Isolate; 2395 friend class Isolate;
2374 friend class MarkCompactCollector; 2396 friend class MarkCompactCollector;
2375 friend class MarkCompactMarkingVisitor; 2397 friend class MarkCompactMarkingVisitor;
2376 friend class MapCompact; 2398 friend class MapCompact;
2377 #ifdef VERIFY_HEAP 2399 #ifdef VERIFY_HEAP
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
3040 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3062 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3041 3063
3042 private: 3064 private:
3043 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3065 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3044 }; 3066 };
3045 #endif // DEBUG 3067 #endif // DEBUG
3046 3068
3047 } } // namespace v8::internal 3069 } } // namespace v8::internal
3048 3070
3049 #endif // V8_HEAP_H_ 3071 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | src/incremental-marking.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698