| 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 #include "src/external-reference-table.h" | 5 #include "src/external-reference-table.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/counters.h" | 9 #include "src/counters.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // rewritten to be mostly table driven, as the callback macro style tends to | 229 // rewritten to be mostly table driven, as the callback macro style tends to |
| 230 // very easily cause code bloat. Please be careful in the future when adding | 230 // very easily cause code bloat. Please be careful in the future when adding |
| 231 // new references. | 231 // new references. |
| 232 | 232 |
| 233 struct RefTableEntry { | 233 struct RefTableEntry { |
| 234 uint16_t id; | 234 uint16_t id; |
| 235 const char* name; | 235 const char* name; |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 static const RefTableEntry c_builtins[] = { | 238 static const RefTableEntry c_builtins[] = { |
| 239 #define DEF_ENTRY_C(name, ignore) {Builtins::c_##name, "Builtins::" #name}, | 239 #define DEF_ENTRY_C(name) {Builtins::c_##name, "Builtins::" #name}, |
| 240 BUILTIN_LIST_C(DEF_ENTRY_C) | 240 BUILTIN_LIST_C(DEF_ENTRY_C) |
| 241 #undef DEF_ENTRY_C | 241 #undef DEF_ENTRY_C |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 for (unsigned i = 0; i < arraysize(c_builtins); ++i) { | 244 for (unsigned i = 0; i < arraysize(c_builtins); ++i) { |
| 245 ExternalReference ref(static_cast<Builtins::CFunctionId>(c_builtins[i].id), | 245 ExternalReference ref(static_cast<Builtins::CFunctionId>(c_builtins[i].id), |
| 246 isolate); | 246 isolate); |
| 247 Add(ref.address(), c_builtins[i].name); | 247 Add(ref.address(), c_builtins[i].name); |
| 248 } | 248 } |
| 249 | 249 |
| 250 static const RefTableEntry builtins[] = { | 250 static const RefTableEntry builtins[] = { |
| 251 #define DEF_ENTRY_C(name, ignore) {Builtins::k##name, "Builtins::" #name}, | 251 #define DEF_ENTRY_C(name) {Builtins::k##name, "Builtins::" #name}, |
| 252 #define DEF_ENTRY_A(name, i1, i2) {Builtins::k##name, "Builtins::" #name}, | 252 #define DEF_ENTRY_A(name, i1, i2) {Builtins::k##name, "Builtins::" #name}, |
| 253 BUILTIN_LIST_C(DEF_ENTRY_C) BUILTIN_LIST_A(DEF_ENTRY_A) | 253 BUILTIN_LIST_C(DEF_ENTRY_C) BUILTIN_LIST_A(DEF_ENTRY_A) |
| 254 BUILTIN_LIST_DEBUG_A(DEF_ENTRY_A) | 254 BUILTIN_LIST_DEBUG_A(DEF_ENTRY_A) |
| 255 #undef DEF_ENTRY_C | 255 #undef DEF_ENTRY_C |
| 256 #undef DEF_ENTRY_A | 256 #undef DEF_ENTRY_A |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 for (unsigned i = 0; i < arraysize(builtins); ++i) { | 259 for (unsigned i = 0; i < arraysize(builtins); ++i) { |
| 260 ExternalReference ref(static_cast<Builtins::Name>(builtins[i].id), isolate); | 260 ExternalReference ref(static_cast<Builtins::Name>(builtins[i].id), isolate); |
| 261 Add(ref.address(), builtins[i].name); | 261 Add(ref.address(), builtins[i].name); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (api_external_references != nullptr) { | 382 if (api_external_references != nullptr) { |
| 383 while (*api_external_references != 0) { | 383 while (*api_external_references != 0) { |
| 384 Add(reinterpret_cast<Address>(*api_external_references), "<embedder>"); | 384 Add(reinterpret_cast<Address>(*api_external_references), "<embedder>"); |
| 385 api_external_references++; | 385 api_external_references++; |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace internal | 390 } // namespace internal |
| 391 } // namespace v8 | 391 } // namespace v8 |
| OLD | NEW |