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

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

Issue 1292533005: Remove heap-inl.h include from natives.h. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix again. argh templates. 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // The common functionality when building with internal or external natives.
6
7 #include "src/heap/heap.h"
8 #include "src/objects.h"
9 #include "src/snapshot/natives.h"
10
11 namespace v8 {
12 namespace internal {
13
14 template <NativeType type>
15 FixedArray* NativesCollectionBase<type>::GetSourceCache(Heap* heap) {
Michael Starzinger 2015/08/18 12:05:56 First trying to templatize NativesCollection and t
16 switch (type) {
17 case CORE:
18 return heap->natives_source_cache();
19 case EXPERIMENTAL:
20 return heap->experimental_natives_source_cache();
21 case CODE_STUB:
22 return heap->code_stub_natives_source_cache();
23 case EXTRAS:
24 return heap->extra_natives_source_cache();
25 default:
26 UNREACHABLE();
27 return NULL;
28 }
29 }
30
31
32 template <NativeType type>
33 void NativesCollectionBase<type>::UpdateSourceCache(Heap* heap) {
34 FixedArray* cache = GetSourceCache(heap);
35 for (int i = 0; i < cache->length(); i++) {
36 Object* source = cache->get(i);
37 if (!source->IsUndefined()) {
38 ExternalOneByteString::cast(source)->update_data_cache();
39 }
40 }
41 }
42
43
44 // Explicit template instantiation.
45 template class NativesCollectionBase<CORE>;
46 template class NativesCollectionBase<CODE_STUB>;
47 template class NativesCollectionBase<EXPERIMENTAL>;
48 template class NativesCollectionBase<EXTRAS>;
49 } // namespace internal
50 } // namespace v8
OLDNEW
« src/snapshot/natives.h ('K') | « src/snapshot/natives.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698