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

Side by Side Diff: src/heap.h

Issue 6026017: Fix/implement new write barrier for x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 11 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 30 matching lines...) Expand all
41 // Defines all the roots in Heap. 41 // Defines all the roots in Heap.
42 #define UNCONDITIONAL_STRONG_ROOT_LIST(V) \ 42 #define UNCONDITIONAL_STRONG_ROOT_LIST(V) \
43 /* Put the byte array map early. We need it to be in place by the time */ \ 43 /* Put the byte array map early. We need it to be in place by the time */ \
44 /* the deserializer hits the next page, since it wants to put a byte */ \ 44 /* the deserializer hits the next page, since it wants to put a byte */ \
45 /* array in the unused space at the end of the page. */ \ 45 /* array in the unused space at the end of the page. */ \
46 V(Map, byte_array_map, ByteArrayMap) \ 46 V(Map, byte_array_map, ByteArrayMap) \
47 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ 47 V(Map, one_pointer_filler_map, OnePointerFillerMap) \
48 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ 48 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
49 /* Cluster the most popular ones in a few cache lines here at the top. */ \ 49 /* Cluster the most popular ones in a few cache lines here at the top. */ \
50 V(Smi, stack_limit, StackLimit) \ 50 V(Smi, stack_limit, StackLimit) \
51 V(Smi, write_buffer_top, WriteBufferTop) \
51 V(Object, undefined_value, UndefinedValue) \ 52 V(Object, undefined_value, UndefinedValue) \
52 V(Object, the_hole_value, TheHoleValue) \ 53 V(Object, the_hole_value, TheHoleValue) \
53 V(Object, null_value, NullValue) \ 54 V(Object, null_value, NullValue) \
54 V(Object, true_value, TrueValue) \ 55 V(Object, true_value, TrueValue) \
55 V(Object, false_value, FalseValue) \ 56 V(Object, false_value, FalseValue) \
56 V(Map, heap_number_map, HeapNumberMap) \ 57 V(Map, heap_number_map, HeapNumberMap) \
57 V(Map, global_context_map, GlobalContextMap) \ 58 V(Map, global_context_map, GlobalContextMap) \
58 V(Map, fixed_array_map, FixedArrayMap) \ 59 V(Map, fixed_array_map, FixedArrayMap) \
59 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 60 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
60 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 61 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 899
899 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary). 900 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary).
900 static void public_set_non_monomorphic_cache(NumberDictionary* value) { 901 static void public_set_non_monomorphic_cache(NumberDictionary* value) {
901 roots_[kNonMonomorphicCacheRootIndex] = value; 902 roots_[kNonMonomorphicCacheRootIndex] = value;
902 } 903 }
903 904
904 static void public_set_empty_script(Script* script) { 905 static void public_set_empty_script(Script* script) {
905 roots_[kEmptyScriptRootIndex] = script; 906 roots_[kEmptyScriptRootIndex] = script;
906 } 907 }
907 908
909 static void public_set_write_buffer_top(Address* top) {
910 roots_[kWriteBufferTopRootIndex] = reinterpret_cast<Smi*>(top);
911 }
912
908 // Update the next script id. 913 // Update the next script id.
909 static inline void SetLastScriptId(Object* last_script_id); 914 static inline void SetLastScriptId(Object* last_script_id);
910 915
911 // Generated code can embed this address to get access to the roots. 916 // Generated code can embed this address to get access to the roots.
912 static Object** roots_address() { return roots_; } 917 static Object** roots_address() { return roots_; }
913 918
919 static Address* write_buffer_top_address() {
920 return reinterpret_cast<Address*>(&roots_[kWriteBufferTopRootIndex]);
921 }
922
914 // Get address of global contexts list for serialization support. 923 // Get address of global contexts list for serialization support.
915 static Object** global_contexts_list_address() { 924 static Object** global_contexts_list_address() {
916 return &global_contexts_list_; 925 return &global_contexts_list_;
917 } 926 }
918 927
919 #ifdef DEBUG 928 #ifdef DEBUG
920 static void Print(); 929 static void Print();
921 static void PrintHandles(); 930 static void PrintHandles();
922 931
923 // Verify the heap is in its normal state before or after a GC. 932 // Verify the heap is in its normal state before or after a GC.
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 // Return whether this object should be retained. If NULL is returned the 2131 // Return whether this object should be retained. If NULL is returned the
2123 // object has no references. Otherwise the address of the retained object 2132 // object has no references. Otherwise the address of the retained object
2124 // should be returned as in some GC situations the object has been moved. 2133 // should be returned as in some GC situations the object has been moved.
2125 virtual Object* RetainAs(Object* object) = 0; 2134 virtual Object* RetainAs(Object* object) = 0;
2126 }; 2135 };
2127 2136
2128 2137
2129 } } // namespace v8::internal 2138 } } // namespace v8::internal
2130 2139
2131 #endif // V8_HEAP_H_ 2140 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/heap-inl.h » ('j') | src/x64/code-stubs-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698