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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/external-reference-table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_EXTERNAL_REFERENCE_TABLE_H_
6 #define V8_EXTERNAL_REFERENCE_TABLE_H_
7
8 #include "src/address-map.h"
9
10 namespace v8 {
11 namespace internal {
12
13 class Isolate;
14
15 // ExternalReferenceTable is a helper class that defines the relationship
16 // between external references and their encodings. It is used to build
17 // hashmaps in ExternalReferenceEncoder and ExternalReferenceDecoder.
18 class ExternalReferenceTable {
19 public:
20 static ExternalReferenceTable* instance(Isolate* isolate);
21
22 int size() const { return refs_.length(); }
23 Address address(int i) { return refs_[i].address; }
24 const char* name(int i) { return refs_[i].name; }
25
26 inline static Address NotAvailable() { return NULL; }
27
28 static const int kDeoptTableSerializeEntryCount = 64;
29
30 private:
31 struct ExternalReferenceEntry {
32 Address address;
33 const char* name;
34 };
35
36 explicit ExternalReferenceTable(Isolate* isolate);
37
38 void Add(Address address, const char* name) {
39 ExternalReferenceEntry entry = {address, name};
40 refs_.Add(entry);
41 }
42
43 List<ExternalReferenceEntry> refs_;
44
45 DISALLOW_COPY_AND_ASSIGN(ExternalReferenceTable);
46 };
47
48 } // namespace internal
49 } // namespace v8
50 #endif // V8_EXTERNAL_REFERENCE_TABLE_H_
OLDNEW
« 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