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

Side by Side Diff: src/heap/heap.h

Issue 1095513003: Move GetRootListIndex into Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/heap/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 // 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_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 kStringTableRootIndex, 1159 kStringTableRootIndex,
1160 1160
1161 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, 1161 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
1162 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION) 1162 SMI_ROOT_LIST(ROOT_INDEX_DECLARATION)
1163 #undef ROOT_INDEX_DECLARATION 1163 #undef ROOT_INDEX_DECLARATION
1164 kRootListLength, 1164 kRootListLength,
1165 kStrongRootListLength = kStringTableRootIndex, 1165 kStrongRootListLength = kStringTableRootIndex,
1166 kSmiRootsStart = kStringTableRootIndex + 1 1166 kSmiRootsStart = kStringTableRootIndex + 1
1167 }; 1167 };
1168 1168
1169 // Get the root list index for {object} if such a root list index exists.
1170 bool GetRootListIndex(Handle<HeapObject> object,
1171 Heap::RootListIndex* index_return);
1172
1169 Object* root(RootListIndex index) { return roots_[index]; } 1173 Object* root(RootListIndex index) { return roots_[index]; }
1170 1174
1171 STATIC_ASSERT(kUndefinedValueRootIndex == 1175 STATIC_ASSERT(kUndefinedValueRootIndex ==
1172 Internals::kUndefinedValueRootIndex); 1176 Internals::kUndefinedValueRootIndex);
1173 STATIC_ASSERT(kNullValueRootIndex == Internals::kNullValueRootIndex); 1177 STATIC_ASSERT(kNullValueRootIndex == Internals::kNullValueRootIndex);
1174 STATIC_ASSERT(kTrueValueRootIndex == Internals::kTrueValueRootIndex); 1178 STATIC_ASSERT(kTrueValueRootIndex == Internals::kTrueValueRootIndex);
1175 STATIC_ASSERT(kFalseValueRootIndex == Internals::kFalseValueRootIndex); 1179 STATIC_ASSERT(kFalseValueRootIndex == Internals::kFalseValueRootIndex);
1176 STATIC_ASSERT(kempty_stringRootIndex == Internals::kEmptyStringRootIndex); 1180 STATIC_ASSERT(kempty_stringRootIndex == Internals::kEmptyStringRootIndex);
1177 1181
1178 // Generated code can embed direct references to non-writable roots if 1182 // Generated code can embed direct references to non-writable roots if
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2612 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2609 2613
2610 private: 2614 private:
2611 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2615 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2612 }; 2616 };
2613 #endif // DEBUG 2617 #endif // DEBUG
2614 } 2618 }
2615 } // namespace v8::internal 2619 } // namespace v8::internal
2616 2620
2617 #endif // V8_HEAP_HEAP_H_ 2621 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698