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 | #include "src/external-reference-table.h" |
6 | |
7 | #include "src/accessors.h" |
8 | #include "src/counters.h" |
9 | #include "src/external-reference.h" |
10 | #include "src/ic/stub-cache.h" |
11 | |
12 | #if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID) |
13 | #define SYMBOLIZE_FUNCTION |
14 | #include <execinfo.h> |
15 | #include <vector> |
16 | #endif // DEBUG && V8_OS_LINUX && !V8_OS_ANDROID |
17 | |
18 | namespace v8 { |
19 | namespace internal { |
20 | |
21 | #define ADD_EXT_REF_NAME(name, desc) desc, |
22 | #define ADD_BUILTIN_NAME(Name, ...) "Builtin_" #Name, |
23 | #define ADD_RUNTIME_FUNCTION(name, ...) "Runtime::" #name, |
24 | #define ADD_ISOLATE_ADDR(Name, name) "Isolate::" #name "_address", |
25 | #define ADD_ACCESSOR_INFO_NAME(_, __, AccessorName, ...) \ |
26 | "Accessors::" #AccessorName "Getter", |
27 | #define ADD_ACCESSOR_SETTER_NAME(name) "Accessors::" #name, |
28 | #define ADD_STATS_COUNTER_NAME(name, ...) "StatsCounter::" #name, |
29 | // static |
30 | // clang-format off |
31 | const char* const |
32 | ExternalReferenceTable::ref_name_[ExternalReferenceTable::kSize] = { |
33 | // Special references: |
34 | "nullptr" , |
35 | // External references: |
36 | EXTERNAL_REFERENCE_LIST(ADD_EXT_REF_NAME) |
37 | EXTERNAL_REFERENCE_LIST_WITH_ISOLATE(ADD_EXT_REF_NAME) |
38 | // Builtins: |
39 | BUILTIN_LIST_C(ADD_BUILTIN_NAME) |
40 | // Runtime functions: |
41 | FOR_EACH_INTRINSIC(ADD_RUNTIME_FUNCTION) |
42 | // Isolate addresses: |
43 | FOR_EACH_ISOLATE_ADDRESS_NAME(ADD_ISOLATE_ADDR) |
44 | // Accessors: |
45 | ACCESSOR_INFO_LIST_GENERATOR(ADD_ACCESSOR_INFO_NAME, /* not used */) |
46 | ACCESSOR_SETTER_LIST(ADD_ACCESSOR_SETTER_NAME) |
47 | // Stub cache: |
48 | "Load StubCache::primary_->key" , |
49 | "Load StubCache::primary_->value" , |
50 | "Load StubCache::primary_->map" , |
51 | "Load StubCache::secondary_->key" , |
52 | "Load StubCache::secondary_->value" , |
53 | "Load StubCache::secondary_->map" , |
54 | "Store StubCache::primary_->key" , |
55 | "Store StubCache::primary_->value" , |
56 | "Store StubCache::primary_->map" , |
57 | "Store StubCache::secondary_->key" , |
58 | "Store StubCache::secondary_->value" , |
59 | "Store StubCache::secondary_->map" , |
60 | // Native code counters: |
61 | STATS_COUNTER_NATIVE_CODE_LIST(ADD_STATS_COUNTER_NAME) |
62 | }; |
63 | // clang-format on |
64 | #undef ADD_EXT_REF_NAME |
65 | #undef ADD_BUILTIN_NAME |
66 | #undef ADD_RUNTIME_FUNCTION |
67 | #undef ADD_ISOLATE_ADDR |
68 | #undef ADD_ACCESSOR_INFO_NAME |
69 | #undef ADD_ACCESSOR_SETTER_NAME |
70 | #undef ADD_STATS_COUNTER_NAME |
71 | |
72 | // Forward declarations for C++ builtins. |
73 | #define FORWARD_DECLARE(Name) \ |
74 | Address Builtin_##Name(int |
---|