| 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/natives.h" | 5 #include "src/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-source-sink.h" | 10 #include "src/snapshot-source-sink.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 /** | 141 /** |
| 142 * Read the Natives (library sources) blob, as generated by js2c + the build | 142 * Read the Natives (library sources) blob, as generated by js2c + the build |
| 143 * system. | 143 * system. |
| 144 */ | 144 */ |
| 145 void SetNativesFromFile(StartupData* natives_blob) { | 145 void SetNativesFromFile(StartupData* natives_blob) { |
| 146 DCHECK(natives_blob); | 146 DCHECK(natives_blob); |
| 147 DCHECK(natives_blob->data); | 147 DCHECK(natives_blob->data); |
| 148 DCHECK(natives_blob->raw_size > 0); | 148 DCHECK(natives_blob->raw_size > 0); |
| 149 | 149 |
| 150 SnapshotByteSource bytes(reinterpret_cast<const byte*>(natives_blob->data), | 150 SnapshotByteSource bytes( |
| 151 natives_blob->raw_size); | 151 reinterpret_cast<const byte*>(natives_blob->data), |
| 152 natives_blob->raw_size); |
| 152 NativesHolder<CORE>::set(NativesStore::MakeFromScriptsSource(&bytes)); | 153 NativesHolder<CORE>::set(NativesStore::MakeFromScriptsSource(&bytes)); |
| 153 NativesHolder<EXPERIMENTAL>::set(NativesStore::MakeFromScriptsSource(&bytes)); | 154 NativesHolder<EXPERIMENTAL>::set(NativesStore::MakeFromScriptsSource(&bytes)); |
| 154 DCHECK(!bytes.HasMore()); | 155 DCHECK(!bytes.HasMore()); |
| 155 } | 156 } |
| 156 | 157 |
| 157 | 158 |
| 158 // Implement NativesCollection<T> bsaed on NativesHolder + NativesStore. | 159 // Implement NativesCollection<T> bsaed on NativesHolder + NativesStore. |
| 159 // | 160 // |
| 160 // (The callers expect a purely static interface, since this is how the | 161 // (The callers expect a purely static interface, since this is how the |
| 161 // natives are usually compiled in. Since we implement them based on | 162 // natives are usually compiled in. Since we implement them based on |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 | 206 |
| 206 // The compiler can't 'see' all uses of the static methods and hence | 207 // The compiler can't 'see' all uses of the static methods and hence |
| 207 // my chose to elide them. This we'll explicitly instantiate these. | 208 // my chose to elide them. This we'll explicitly instantiate these. |
| 208 template class NativesCollection<CORE>; | 209 template class NativesCollection<CORE>; |
| 209 template class NativesCollection<EXPERIMENTAL>; | 210 template class NativesCollection<EXPERIMENTAL>; |
| 210 | 211 |
| 211 } // namespace v8::internal | 212 } // namespace v8::internal |
| 212 } // namespace v8 | 213 } // namespace v8 |
| OLD | NEW |