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

Unified Diff: src/identity-map.cc

Issue 1651133002: [interpreter] Move temporary register allocator into own file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments from rmcilroy. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/identity-map.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/identity-map.cc
diff --git a/src/identity-map.cc b/src/identity-map.cc
index 723cdfa2a6427d52ea20d9381c44360f0b85b050..2f5739dad99341031c4ade37182c82636dfe4c87 100644
--- a/src/identity-map.cc
+++ b/src/identity-map.cc
@@ -14,11 +14,18 @@ namespace internal {
static const int kInitialIdentityMapSize = 4;
static const int kResizeFactor = 4;
-IdentityMapBase::~IdentityMapBase() {
- if (keys_) heap_->UnregisterStrongRoots(keys_);
+IdentityMapBase::~IdentityMapBase() { Clear(); }
+
+void IdentityMapBase::Clear() {
+ if (keys_) {
+ heap_->UnregisterStrongRoots(keys_);
+ keys_ = nullptr;
+ values_ = nullptr;
+ size_ = 0;
+ mask_ = 0;
+ }
}
-
IdentityMapBase::RawEntry IdentityMapBase::Lookup(Object* key) {
int index = LookupIndex(key);
return index >= 0 ? &values_[index] : nullptr;
« no previous file with comments | « src/identity-map.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698