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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 int debugger_count_; | 112 int debugger_count_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(NativesStore); | 114 DISALLOW_COPY_AND_ASSIGN(NativesStore); |
115 }; | 115 }; |
116 | 116 |
117 | 117 |
118 template<NativeType type> | 118 template<NativeType type> |
119 class NativesHolder { | 119 class NativesHolder { |
120 public: | 120 public: |
121 static NativesStore* get() { | 121 static NativesStore* get() { |
122 DCHECK(holder_); | 122 CHECK(holder_); |
123 return holder_; | 123 return holder_; |
124 } | 124 } |
125 static void set(NativesStore* store) { | 125 static void set(NativesStore* store) { |
126 DCHECK(store); | 126 CHECK(store); |
127 holder_ = store; | 127 holder_ = store; |
128 } | 128 } |
129 static bool empty() { return holder_ == NULL; } | 129 static bool empty() { return holder_ == NULL; } |
130 static void Dispose() { | 130 static void Dispose() { |
131 delete holder_; | 131 delete holder_; |
132 holder_ = NULL; | 132 holder_ = NULL; |
133 } | 133 } |
134 | 134 |
135 private: | 135 private: |
136 static NativesStore* holder_; | 136 static NativesStore* holder_; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 template Vector<const char> NativesCollection<T>::GetScriptName(int i); \ | 233 template Vector<const char> NativesCollection<T>::GetScriptName(int i); \ |
234 template Vector<const char> NativesCollection<T>::GetScriptsSource(); | 234 template Vector<const char> NativesCollection<T>::GetScriptsSource(); |
235 INSTANTIATE_TEMPLATES(CORE) | 235 INSTANTIATE_TEMPLATES(CORE) |
236 INSTANTIATE_TEMPLATES(EXPERIMENTAL) | 236 INSTANTIATE_TEMPLATES(EXPERIMENTAL) |
237 INSTANTIATE_TEMPLATES(EXTRAS) | 237 INSTANTIATE_TEMPLATES(EXTRAS) |
238 INSTANTIATE_TEMPLATES(EXPERIMENTAL_EXTRAS) | 238 INSTANTIATE_TEMPLATES(EXPERIMENTAL_EXTRAS) |
239 #undef INSTANTIATE_TEMPLATES | 239 #undef INSTANTIATE_TEMPLATES |
240 | 240 |
241 } // namespace internal | 241 } // namespace internal |
242 } // namespace v8 | 242 } // namespace v8 |
OLD | NEW |