OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #define STRING_ACCESSOR(name, str) \ | 59 #define STRING_ACCESSOR(name, str) \ |
60 String* Heap::name() { return String::cast(roots_[k##name##RootIndex]); } | 60 String* Heap::name() { return String::cast(roots_[k##name##RootIndex]); } |
61 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) | 61 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) |
62 #undef STRING_ACCESSOR | 62 #undef STRING_ACCESSOR |
63 | 63 |
64 #define SYMBOL_ACCESSOR(name) \ | 64 #define SYMBOL_ACCESSOR(name) \ |
65 Symbol* Heap::name() { return Symbol::cast(roots_[k##name##RootIndex]); } | 65 Symbol* Heap::name() { return Symbol::cast(roots_[k##name##RootIndex]); } |
66 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) | 66 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) |
67 #undef SYMBOL_ACCESSOR | 67 #undef SYMBOL_ACCESSOR |
68 | 68 |
69 #define SYMBOL_ACCESSOR(name, varname, description) \ | 69 #define SYMBOL_ACCESSOR(name, description) \ |
70 Symbol* Heap::name() { return Symbol::cast(roots_[k##name##RootIndex]); } | 70 Symbol* Heap::name() { return Symbol::cast(roots_[k##name##RootIndex]); } |
71 PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR) | 71 PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR) |
72 #undef SYMBOL_ACCESSOR | 72 #undef SYMBOL_ACCESSOR |
73 | 73 |
74 #define ROOT_ACCESSOR(type, name, camel_name) \ | 74 #define ROOT_ACCESSOR(type, name, camel_name) \ |
75 void Heap::set_##name(type* value) { \ | 75 void Heap::set_##name(type* value) { \ |
76 /* The deserializer makes use of the fact that these common roots are */ \ | 76 /* The deserializer makes use of the fact that these common roots are */ \ |
77 /* never in new space and never on a page that is being compacted. */ \ | 77 /* never in new space and never on a page that is being compacted. */ \ |
78 DCHECK(!deserialization_complete() || \ | 78 DCHECK(!deserialization_complete() || \ |
79 RootCanBeWrittenAfterInitialization(k##camel_name##RootIndex)); \ | 79 RootCanBeWrittenAfterInitialization(k##camel_name##RootIndex)); \ |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 784 |
785 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 785 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
786 for (Object** current = start; current < end; current++) { | 786 for (Object** current = start; current < end; current++) { |
787 CHECK((*current)->IsSmi()); | 787 CHECK((*current)->IsSmi()); |
788 } | 788 } |
789 } | 789 } |
790 } | 790 } |
791 } // namespace v8::internal | 791 } // namespace v8::internal |
792 | 792 |
793 #endif // V8_HEAP_HEAP_INL_H_ | 793 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |