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

Unified Diff: src/heap/heap.h

Issue 2396923003: [turbofan][x64] Use the root register for comparisons with certain roots. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index cce467ff4f24deebbd53f8ef7f3652b3d8f44447..6225d582691ee6e7dec7938033096225992aeffa 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1023,6 +1023,14 @@ class Heap {
Handle<Object> root_handle(RootListIndex index) {
return Handle<Object>(&roots_[index]);
}
+ template <typename T>
+ bool IsRootHandle(Handle<T> handle, RootListIndex* index) const {
+ Object** const handle_location = bit_cast<Object**>(handle.address());
+ if (handle_location >= &roots_[kRootListLength]) return false;
+ if (handle_location < &roots_[0]) return false;
+ *index = static_cast<RootListIndex>(handle_location - &roots_[0]);
+ return true;
+ }
// Generated code can embed this address to get access to the roots.
Object** roots_array_start() { return roots_; }
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698