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/builtins/builtins.h" | 9 #include "src/builtins/builtins.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 } | 356 } |
357 | 357 |
358 void ExternalReferenceTable::AddAccessors(Isolate* isolate) { | 358 void ExternalReferenceTable::AddAccessors(Isolate* isolate) { |
359 // Accessors | 359 // Accessors |
360 struct AccessorRefTable { | 360 struct AccessorRefTable { |
361 Address address; | 361 Address address; |
362 const char* name; | 362 const char* name; |
363 }; | 363 }; |
364 | 364 |
365 static const AccessorRefTable getters[] = { | 365 static const AccessorRefTable getters[] = { |
366 #define ACCESSOR_INFO_DECLARATION(name) \ | 366 #define ACCESSOR_INFO_DECLARATION(name) \ |
367 { FUNCTION_ADDR(&Accessors::name##Getter), \ | 367 {FUNCTION_ADDR(&Accessors::name##Getter), "Accessors::" #name "Getter"}, |
368 "Redirect to Accessors::" #name "Getter"}, | |
369 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) | 368 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) |
370 #undef ACCESSOR_INFO_DECLARATION | 369 #undef ACCESSOR_INFO_DECLARATION |
371 }; | 370 }; |
372 static const AccessorRefTable setters[] = { | 371 static const AccessorRefTable setters[] = { |
373 #define ACCESSOR_SETTER_DECLARATION(name) \ | 372 #define ACCESSOR_SETTER_DECLARATION(name) \ |
374 { FUNCTION_ADDR(&Accessors::name), "Accessors::" #name}, | 373 { FUNCTION_ADDR(&Accessors::name), "Accessors::" #name}, |
375 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION) | 374 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION) |
376 #undef ACCESSOR_INFO_DECLARATION | 375 #undef ACCESSOR_INFO_DECLARATION |
377 }; | 376 }; |
378 | 377 |
379 for (unsigned i = 0; i < arraysize(getters); ++i) { | 378 for (unsigned i = 0; i < arraysize(getters); ++i) { |
380 const char* name = getters[i].name + 12; // Skip "Redirect to " prefix. | 379 Add(getters[i].address, getters[i].name); |
381 Add(getters[i].address, name); | |
382 Add(AccessorInfo::redirect(isolate, getters[i].address, ACCESSOR_GETTER), | |
383 getters[i].name); | |
384 } | 380 } |
385 | 381 |
386 for (unsigned i = 0; i < arraysize(setters); ++i) { | 382 for (unsigned i = 0; i < arraysize(setters); ++i) { |
387 Add(setters[i].address, setters[i].name); | 383 Add(setters[i].address, setters[i].name); |
388 } | 384 } |
389 } | 385 } |
390 | 386 |
391 void ExternalReferenceTable::AddStubCache(Isolate* isolate) { | 387 void ExternalReferenceTable::AddStubCache(Isolate* isolate) { |
392 StubCache* load_stub_cache = isolate->load_stub_cache(); | 388 StubCache* load_stub_cache = isolate->load_stub_cache(); |
393 | 389 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 while (*api_external_references != 0) { | 439 while (*api_external_references != 0) { |
444 Address address = reinterpret_cast<Address>(*api_external_references); | 440 Address address = reinterpret_cast<Address>(*api_external_references); |
445 Add(address, ResolveSymbol(address)); | 441 Add(address, ResolveSymbol(address)); |
446 api_external_references++; | 442 api_external_references++; |
447 } | 443 } |
448 } | 444 } |
449 } | 445 } |
450 | 446 |
451 } // namespace internal | 447 } // namespace internal |
452 } // namespace v8 | 448 } // namespace v8 |
OLD | NEW |