OLD | NEW |
1 {% from "macros.tmpl" import license %} | 1 {% from "macros.tmpl" import license %} |
2 {{ license() }} | 2 {{ license() }} |
3 | 3 |
4 #include "config.h" | 4 #include "config.h" |
5 | 5 |
6 #include "{{namespace}}{{suffix}}Names.h" | 6 #include "{{namespace}}{{suffix}}Names.h" |
7 | 7 |
8 #include "wtf/StdLibExtras.h" | 8 #include "wtf/StdLibExtras.h" |
9 | 9 |
10 // Generated from: | 10 // Generated from: |
11 {% for entry in in_files|sort %} | 11 {% for entry in in_files|sort %} |
12 // - {{entry}} | 12 // - {{entry}} |
13 {% endfor %} | 13 {% endfor %} |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 namespace {{namespace}}Names { | 16 namespace {{namespace}}Names { |
17 | 17 |
18 using namespace WTF; | 18 using namespace WTF; |
19 | 19 |
20 const int k{{suffix}}NameCount = {{entries|length}}; | 20 void* {{suffix}}NamesStorage[{{namespace}}{{suffix}}NamesCount * ((sizeof(Atomic
String) + sizeof(void *) - 1) / sizeof(void *))]; |
21 | |
22 void* {{suffix}}NamesStorage[k{{suffix}}NameCount * ((sizeof(AtomicString) + siz
eof(void *) - 1) / sizeof(void *))]; | |
23 | 21 |
24 {% for entry in entries|sort(attribute='name', case_sensitive=True) %} | 22 {% for entry in entries|sort(attribute='name', case_sensitive=True) %} |
25 {% filter enable_conditional(entry.Conditional) %} | 23 {% filter enable_conditional(entry.Conditional) %} |
26 const AtomicString& {{entry|symbol}} = reinterpret_cast<AtomicString*>(&{{suffix
}}NamesStorage)[{{loop.index0}}]; | 24 const AtomicString& {{entry|symbol}} = reinterpret_cast<AtomicString*>(&{{suffix
}}NamesStorage)[{{loop.index0}}]; |
27 {% endfilter %} | 25 {% endfilter %} |
28 {% endfor %} | 26 {% endfor %} |
29 | 27 |
30 void init{{suffix}}() | 28 void init{{suffix}}() |
31 { | 29 { |
32 struct NameEntry { | 30 struct NameEntry { |
(...skipping 10 matching lines...) Expand all Loading... |
43 | 41 |
44 for (size_t i = 0; i < WTF_ARRAY_LENGTH(kNames); i++) { | 42 for (size_t i = 0; i < WTF_ARRAY_LENGTH(kNames); i++) { |
45 StringImpl* stringImpl = StringImpl::createStatic(kNames[i].name, kNames
[i].length, kNames[i].hash); | 43 StringImpl* stringImpl = StringImpl::createStatic(kNames[i].name, kNames
[i].length, kNames[i].hash); |
46 void* address = reinterpret_cast<AtomicString*>(&{{suffix}}NamesStorage)
+ i; | 44 void* address = reinterpret_cast<AtomicString*>(&{{suffix}}NamesStorage)
+ i; |
47 new (address) AtomicString(stringImpl); | 45 new (address) AtomicString(stringImpl); |
48 } | 46 } |
49 } | 47 } |
50 | 48 |
51 } // {{namespace}}Names | 49 } // {{namespace}}Names |
52 } // namespace blink | 50 } // namespace blink |
OLD | NEW |