| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/snapshot/natives.h" | 5 #include "src/snapshot/natives.h" |
| 6 | 6 |
| 7 #include "src/base/logging.h" | 7 #include "src/base/logging.h" |
| 8 #include "src/list.h" | 8 #include "src/list.h" |
| 9 #include "src/list-inl.h" | 9 #include "src/list-inl.h" |
| 10 #include "src/snapshot/snapshot-source-sink.h" | 10 #include "src/snapshot/snapshot-source-sink.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 Vector<const char> NativesCollection<type>::GetScriptName(int index) { | 222 Vector<const char> NativesCollection<type>::GetScriptName(int index) { |
| 223 return NativesHolder<type>::get()->GetScriptName(index); | 223 return NativesHolder<type>::get()->GetScriptName(index); |
| 224 } | 224 } |
| 225 | 225 |
| 226 template <NativeType type> | 226 template <NativeType type> |
| 227 Vector<const char> NativesCollection<type>::GetScriptsSource() { | 227 Vector<const char> NativesCollection<type>::GetScriptsSource() { |
| 228 return NativesHolder<type>::get()->GetScriptsSource(); | 228 return NativesHolder<type>::get()->GetScriptsSource(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 | 231 |
| 232 // The compiler can't 'see' all uses of the static methods and hence | 232 // Explicit template instantiations. |
| 233 // my choice to elide them. This we'll explicitly instantiate these. | 233 #define INSTANTIATE_TEMPLATES(T) \ |
| 234 template class NativesCollection<CORE>; | 234 template int NativesCollection<T>::GetBuiltinsCount(); \ |
| 235 template class NativesCollection<CODE_STUB>; | 235 template int NativesCollection<T>::GetDebuggerCount(); \ |
| 236 template class NativesCollection<EXPERIMENTAL>; | 236 template int NativesCollection<T>::GetIndex(const char* name); \ |
| 237 template class NativesCollection<EXTRAS>; | 237 template Vector<const char> NativesCollection<T>::GetScriptSource(int i); \ |
| 238 template Vector<const char> NativesCollection<T>::GetScriptName(int i); \ |
| 239 template Vector<const char> NativesCollection<T>::GetScriptsSource(); |
| 240 INSTANTIATE_TEMPLATES(CORE) |
| 241 INSTANTIATE_TEMPLATES(CODE_STUB) |
| 242 INSTANTIATE_TEMPLATES(EXPERIMENTAL) |
| 243 INSTANTIATE_TEMPLATES(EXTRAS) |
| 244 #undef INSTANTIATE_TEMPLATES |
| 245 |
| 238 } // namespace internal | 246 } // namespace internal |
| 239 } // namespace v8 | 247 } // namespace v8 |
| OLD | NEW |