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

Unified Diff: src/external-reference-table.h

Issue 1812853002: Moved the ExternalReferenceTable class to src/external-reference-table.cc/.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 9 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 | « BUILD.gn ('k') | src/external-reference-table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/external-reference-table.h
diff --git a/src/external-reference-table.h b/src/external-reference-table.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ea4b14cf31cfe739d1f2f7cbe9cc44275e6a945
--- /dev/null
+++ b/src/external-reference-table.h
@@ -0,0 +1,50 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_EXTERNAL_REFERENCE_TABLE_H_
+#define V8_EXTERNAL_REFERENCE_TABLE_H_
+
+#include "src/address-map.h"
+
+namespace v8 {
+namespace internal {
+
+class Isolate;
+
+// ExternalReferenceTable is a helper class that defines the relationship
+// between external references and their encodings. It is used to build
+// hashmaps in ExternalReferenceEncoder and ExternalReferenceDecoder.
+class ExternalReferenceTable {
+ public:
+ static ExternalReferenceTable* instance(Isolate* isolate);
+
+ int size() const { return refs_.length(); }
+ Address address(int i) { return refs_[i].address; }
+ const char* name(int i) { return refs_[i].name; }
+
+ inline static Address NotAvailable() { return NULL; }
+
+ static const int kDeoptTableSerializeEntryCount = 64;
+
+ private:
+ struct ExternalReferenceEntry {
+ Address address;
+ const char* name;
+ };
+
+ explicit ExternalReferenceTable(Isolate* isolate);
+
+ void Add(Address address, const char* name) {
+ ExternalReferenceEntry entry = {address, name};
+ refs_.Add(entry);
+ }
+
+ List<ExternalReferenceEntry> refs_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExternalReferenceTable);
+};
+
+} // namespace internal
+} // namespace v8
+#endif // V8_EXTERNAL_REFERENCE_TABLE_H_
« no previous file with comments | « BUILD.gn ('k') | src/external-reference-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698