| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 return local; | 122 return local; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Global init routines | 125 // Global init routines |
| 126 DEFINE_GLOBAL(QualifiedName, anyName, nullAtom, starAtom, starAtom) | 126 DEFINE_GLOBAL(QualifiedName, anyName, nullAtom, starAtom, starAtom) |
| 127 | 127 |
| 128 void QualifiedName::init() | 128 void QualifiedName::init() |
| 129 { | 129 { |
| 130 static bool initialized; | 130 static bool initialized; |
| 131 if (!initialized) { | 131 if (initialized) |
| 132 // Use placement new to initialize the globals. | 132 return; |
| 133 | 133 initialized = true; |
| 134 AtomicString::init(); | 134 |
| 135 new ((void*)&anyName) QualifiedName(nullAtom, starAtom, starAtom); | 135 ASSERT(starAtom.impl()); |
| 136 initialized = true; | 136 new ((void*)&anyName) QualifiedName(nullAtom, starAtom, starAtom); |
| 137 } | |
| 138 } | 137 } |
| 139 | 138 |
| 140 const QualifiedName& nullQName() | 139 const QualifiedName& nullQName() |
| 141 { | 140 { |
| 142 DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom))
; | 141 DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom))
; |
| 143 return nullName; | 142 return nullName; |
| 144 } | 143 } |
| 145 | 144 |
| 146 const AtomicString& QualifiedName::localNameUpper() const | 145 const AtomicString& QualifiedName::localNameUpper() const |
| 147 { | 146 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 176 { | 175 { |
| 177 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); | 176 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); |
| 178 } | 177 } |
| 179 | 178 |
| 180 void createQualifiedName(void* targetAddress, StringImpl* name) | 179 void createQualifiedName(void* targetAddress, StringImpl* name) |
| 181 { | 180 { |
| 182 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); | 181 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); |
| 183 } | 182 } |
| 184 | 183 |
| 185 } | 184 } |
| OLD | NEW |