OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 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_EXTERNAL_REFERENCE_TABLE_H_ | 5 #ifndef V8_EXTERNAL_REFERENCE_TABLE_H_ |
6 #define V8_EXTERNAL_REFERENCE_TABLE_H_ | 6 #define V8_EXTERNAL_REFERENCE_TABLE_H_ |
7 | 7 |
8 #include "src/address-map.h" | 8 #include "src/address-map.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifdef DEBUG | 28 #ifdef DEBUG |
29 void increment_count(uint32_t i) { refs_[i].count++; } | 29 void increment_count(uint32_t i) { refs_[i].count++; } |
30 int count(uint32_t i) { return refs_[i].count; } | 30 int count(uint32_t i) { return refs_[i].count; } |
31 void ResetCount(); | 31 void ResetCount(); |
32 void PrintCount(); | 32 void PrintCount(); |
33 #endif // DEBUG | 33 #endif // DEBUG |
34 | 34 |
35 static const char* ResolveSymbol(void* address); | 35 static const char* ResolveSymbol(void* address); |
36 | 36 |
37 static const int kDeoptTableSerializeEntryCount = 64; | |
38 | |
39 private: | 37 private: |
40 struct ExternalReferenceEntry { | 38 struct ExternalReferenceEntry { |
41 Address address; | 39 Address address; |
42 const char* name; | 40 const char* name; |
43 #ifdef DEBUG | 41 #ifdef DEBUG |
44 int count; | 42 int count; |
45 #endif // DEBUG | 43 #endif // DEBUG |
46 }; | 44 }; |
47 | 45 |
48 explicit ExternalReferenceTable(Isolate* isolate); | 46 explicit ExternalReferenceTable(Isolate* isolate); |
49 | 47 |
50 void Add(Address address, const char* name) { | 48 void Add(Address address, const char* name) { |
51 #ifdef DEBUG | 49 #ifdef DEBUG |
52 ExternalReferenceEntry entry = {address, name, 0}; | 50 ExternalReferenceEntry entry = {address, name, 0}; |
53 #else | 51 #else |
54 ExternalReferenceEntry entry = {address, name}; | 52 ExternalReferenceEntry entry = {address, name}; |
55 #endif // DEBUG | 53 #endif // DEBUG |
56 refs_.Add(entry); | 54 refs_.Add(entry); |
57 } | 55 } |
58 | 56 |
59 void AddReferences(Isolate* isolate); | 57 void AddReferences(Isolate* isolate); |
60 void AddBuiltins(Isolate* isolate); | 58 void AddBuiltins(Isolate* isolate); |
61 void AddRuntimeFunctions(Isolate* isolate); | 59 void AddRuntimeFunctions(Isolate* isolate); |
62 void AddIsolateAddresses(Isolate* isolate); | 60 void AddIsolateAddresses(Isolate* isolate); |
63 void AddAccessors(Isolate* isolate); | 61 void AddAccessors(Isolate* isolate); |
64 void AddStubCache(Isolate* isolate); | 62 void AddStubCache(Isolate* isolate); |
65 void AddDeoptEntries(Isolate* isolate); | |
66 void AddApiReferences(Isolate* isolate); | 63 void AddApiReferences(Isolate* isolate); |
67 | 64 |
68 List<ExternalReferenceEntry> refs_; | 65 List<ExternalReferenceEntry> refs_; |
69 uint32_t api_refs_start_; | 66 uint32_t api_refs_start_; |
70 | 67 |
71 DISALLOW_COPY_AND_ASSIGN(ExternalReferenceTable); | 68 DISALLOW_COPY_AND_ASSIGN(ExternalReferenceTable); |
72 }; | 69 }; |
73 | 70 |
74 } // namespace internal | 71 } // namespace internal |
75 } // namespace v8 | 72 } // namespace v8 |
76 #endif // V8_EXTERNAL_REFERENCE_TABLE_H_ | 73 #endif // V8_EXTERNAL_REFERENCE_TABLE_H_ |
OLD | NEW |