Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: src/snapshot/natives-external.cc

Issue 1475953002: [stubs] A new approach to TF stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win64 build Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/snapshot/natives-common.cc ('k') | src/snapshot/serialize.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 static StartupData* natives_blob_ = NULL; 150 static StartupData* natives_blob_ = NULL;
151 151
152 152
153 /** 153 /**
154 * Read the Natives blob, as previously set by SetNativesFromFile. 154 * Read the Natives blob, as previously set by SetNativesFromFile.
155 */ 155 */
156 void ReadNatives() { 156 void ReadNatives() {
157 if (natives_blob_ && NativesHolder<CORE>::empty()) { 157 if (natives_blob_ && NativesHolder<CORE>::empty()) {
158 SnapshotByteSource bytes(natives_blob_->data, natives_blob_->raw_size); 158 SnapshotByteSource bytes(natives_blob_->data, natives_blob_->raw_size);
159 NativesHolder<CORE>::set(NativesStore::MakeFromScriptsSource(&bytes)); 159 NativesHolder<CORE>::set(NativesStore::MakeFromScriptsSource(&bytes));
160 NativesHolder<CODE_STUB>::set(NativesStore::MakeFromScriptsSource(&bytes));
161 NativesHolder<EXPERIMENTAL>::set( 160 NativesHolder<EXPERIMENTAL>::set(
162 NativesStore::MakeFromScriptsSource(&bytes)); 161 NativesStore::MakeFromScriptsSource(&bytes));
163 NativesHolder<EXTRAS>::set(NativesStore::MakeFromScriptsSource(&bytes)); 162 NativesHolder<EXTRAS>::set(NativesStore::MakeFromScriptsSource(&bytes));
164 NativesHolder<EXPERIMENTAL_EXTRAS>::set( 163 NativesHolder<EXPERIMENTAL_EXTRAS>::set(
165 NativesStore::MakeFromScriptsSource(&bytes)); 164 NativesStore::MakeFromScriptsSource(&bytes));
166 DCHECK(!bytes.HasMore()); 165 DCHECK(!bytes.HasMore());
167 } 166 }
168 } 167 }
169 168
170 169
(...skipping 10 matching lines...) Expand all
181 natives_blob_ = natives_blob; 180 natives_blob_ = natives_blob;
182 ReadNatives(); 181 ReadNatives();
183 } 182 }
184 183
185 184
186 /** 185 /**
187 * Release memory allocated by SetNativesFromFile. 186 * Release memory allocated by SetNativesFromFile.
188 */ 187 */
189 void DisposeNatives() { 188 void DisposeNatives() {
190 NativesHolder<CORE>::Dispose(); 189 NativesHolder<CORE>::Dispose();
191 NativesHolder<CODE_STUB>::Dispose();
192 NativesHolder<EXPERIMENTAL>::Dispose(); 190 NativesHolder<EXPERIMENTAL>::Dispose();
193 NativesHolder<EXTRAS>::Dispose(); 191 NativesHolder<EXTRAS>::Dispose();
194 NativesHolder<EXPERIMENTAL_EXTRAS>::Dispose(); 192 NativesHolder<EXPERIMENTAL_EXTRAS>::Dispose();
195 } 193 }
196 194
197 195
198 // Implement NativesCollection<T> bsaed on NativesHolder + NativesStore. 196 // Implement NativesCollection<T> bsaed on NativesHolder + NativesStore.
199 // 197 //
200 // (The callers expect a purely static interface, since this is how the 198 // (The callers expect a purely static interface, since this is how the
201 // natives are usually compiled in. Since we implement them based on 199 // natives are usually compiled in. Since we implement them based on
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 232
235 // Explicit template instantiations. 233 // Explicit template instantiations.
236 #define INSTANTIATE_TEMPLATES(T) \ 234 #define INSTANTIATE_TEMPLATES(T) \
237 template int NativesCollection<T>::GetBuiltinsCount(); \ 235 template int NativesCollection<T>::GetBuiltinsCount(); \
238 template int NativesCollection<T>::GetDebuggerCount(); \ 236 template int NativesCollection<T>::GetDebuggerCount(); \
239 template int NativesCollection<T>::GetIndex(const char* name); \ 237 template int NativesCollection<T>::GetIndex(const char* name); \
240 template Vector<const char> NativesCollection<T>::GetScriptSource(int i); \ 238 template Vector<const char> NativesCollection<T>::GetScriptSource(int i); \
241 template Vector<const char> NativesCollection<T>::GetScriptName(int i); \ 239 template Vector<const char> NativesCollection<T>::GetScriptName(int i); \
242 template Vector<const char> NativesCollection<T>::GetScriptsSource(); 240 template Vector<const char> NativesCollection<T>::GetScriptsSource();
243 INSTANTIATE_TEMPLATES(CORE) 241 INSTANTIATE_TEMPLATES(CORE)
244 INSTANTIATE_TEMPLATES(CODE_STUB)
245 INSTANTIATE_TEMPLATES(EXPERIMENTAL) 242 INSTANTIATE_TEMPLATES(EXPERIMENTAL)
246 INSTANTIATE_TEMPLATES(EXTRAS) 243 INSTANTIATE_TEMPLATES(EXTRAS)
247 INSTANTIATE_TEMPLATES(EXPERIMENTAL_EXTRAS) 244 INSTANTIATE_TEMPLATES(EXPERIMENTAL_EXTRAS)
248 #undef INSTANTIATE_TEMPLATES 245 #undef INSTANTIATE_TEMPLATES
249 246
250 } // namespace internal 247 } // namespace internal
251 } // namespace v8 248 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/natives-common.cc ('k') | src/snapshot/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698