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

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

Issue 1284413002: Add experimental, non-snapshotted V8 extras (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@non-experimental-extras
Patch Set: Missing gn entries Created 5 years, 4 months 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.h ('k') | src/snapshot/natives-external.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 // The common functionality when building with internal or external natives. 5 // The common functionality when building with internal or external natives.
6 6
7 #include "src/heap/heap.h" 7 #include "src/heap/heap.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 #include "src/snapshot/natives.h" 9 #include "src/snapshot/natives.h"
10 10
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 25
26 template <> 26 template <>
27 FixedArray* NativesCollection<EXTRAS>::GetSourceCache(Heap* heap) { 27 FixedArray* NativesCollection<EXTRAS>::GetSourceCache(Heap* heap) {
28 return heap->extra_natives_source_cache(); 28 return heap->extra_natives_source_cache();
29 } 29 }
30 30
31 31
32 template <> 32 template <>
33 FixedArray* NativesCollection<EXPERIMENTAL_EXTRAS>::GetSourceCache(Heap* heap) {
34 return heap->experimental_extra_natives_source_cache();
35 }
36
37
38 template <>
33 FixedArray* NativesCollection<CODE_STUB>::GetSourceCache(Heap* heap) { 39 FixedArray* NativesCollection<CODE_STUB>::GetSourceCache(Heap* heap) {
34 return heap->code_stub_natives_source_cache(); 40 return heap->code_stub_natives_source_cache();
35 } 41 }
36 42
37 43
38 template <NativeType type> 44 template <NativeType type>
39 void NativesCollection<type>::UpdateSourceCache(Heap* heap) { 45 void NativesCollection<type>::UpdateSourceCache(Heap* heap) {
40 for (int i = 0; i < GetBuiltinsCount(); i++) { 46 for (int i = 0; i < GetBuiltinsCount(); i++) {
41 Object* source = GetSourceCache(heap)->get(i); 47 Object* source = GetSourceCache(heap)->get(i);
42 if (!source->IsUndefined()) { 48 if (!source->IsUndefined()) {
43 ExternalOneByteString::cast(source)->update_data_cache(); 49 ExternalOneByteString::cast(source)->update_data_cache();
44 } 50 }
45 } 51 }
46 } 52 }
47 53
48 54
49 // Explicit template instantiations. 55 // Explicit template instantiations.
50 template void NativesCollection<CORE>::UpdateSourceCache(Heap* heap); 56 template void NativesCollection<CORE>::UpdateSourceCache(Heap* heap);
51 template void NativesCollection<CODE_STUB>::UpdateSourceCache(Heap* heap); 57 template void NativesCollection<CODE_STUB>::UpdateSourceCache(Heap* heap);
52 template void NativesCollection<EXPERIMENTAL>::UpdateSourceCache(Heap* heap); 58 template void NativesCollection<EXPERIMENTAL>::UpdateSourceCache(Heap* heap);
53 template void NativesCollection<EXTRAS>::UpdateSourceCache(Heap* heap); 59 template void NativesCollection<EXTRAS>::UpdateSourceCache(Heap* heap);
60 template void NativesCollection<EXPERIMENTAL_EXTRAS>::UpdateSourceCache(
61 Heap* heap);
54 62
55 } // namespace internal 63 } // namespace internal
56 } // namespace v8 64 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/natives.h ('k') | src/snapshot/natives-external.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698