OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_SNAPSHOT_NATIVES_H_ | 5 #ifndef V8_SNAPSHOT_NATIVES_H_ |
6 #define V8_SNAPSHOT_NATIVES_H_ | 6 #define V8_SNAPSHOT_NATIVES_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 #include "src/vector.h" | 9 #include "src/vector.h" |
10 | 10 |
11 namespace v8 { class StartupData; } // Forward declaration. | 11 namespace v8 { class StartupData; } // Forward declaration. |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 enum NativeType { | 16 enum NativeType { |
17 CORE, | 17 CORE, |
18 CODE_STUB, | |
19 EXPERIMENTAL, | 18 EXPERIMENTAL, |
20 EXTRAS, | 19 EXTRAS, |
21 EXPERIMENTAL_EXTRAS, | 20 EXPERIMENTAL_EXTRAS, |
22 D8, | 21 D8, |
23 TEST | 22 TEST |
24 }; | 23 }; |
25 | 24 |
26 template <NativeType type> | 25 template <NativeType type> |
27 class NativesCollection { | 26 class NativesCollection { |
28 public: | 27 public: |
(...skipping 13 matching lines...) Loading... |
42 static Vector<const char> GetScriptName(int index); | 41 static Vector<const char> GetScriptName(int index); |
43 static Vector<const char> GetScriptsSource(); | 42 static Vector<const char> GetScriptsSource(); |
44 | 43 |
45 // The following methods are implemented in natives-common.cc: | 44 // The following methods are implemented in natives-common.cc: |
46 | 45 |
47 static FixedArray* GetSourceCache(Heap* heap); | 46 static FixedArray* GetSourceCache(Heap* heap); |
48 static void UpdateSourceCache(Heap* heap); | 47 static void UpdateSourceCache(Heap* heap); |
49 }; | 48 }; |
50 | 49 |
51 typedef NativesCollection<CORE> Natives; | 50 typedef NativesCollection<CORE> Natives; |
52 typedef NativesCollection<CODE_STUB> CodeStubNatives; | |
53 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives; | 51 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives; |
54 typedef NativesCollection<EXTRAS> ExtraNatives; | 52 typedef NativesCollection<EXTRAS> ExtraNatives; |
55 typedef NativesCollection<EXPERIMENTAL_EXTRAS> ExperimentalExtraNatives; | 53 typedef NativesCollection<EXPERIMENTAL_EXTRAS> ExperimentalExtraNatives; |
56 | 54 |
57 | 55 |
58 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 56 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
59 // Used for reading the natives at runtime. Implementation in natives-empty.cc | 57 // Used for reading the natives at runtime. Implementation in natives-empty.cc |
60 void SetNativesFromFile(StartupData* natives_blob); | 58 void SetNativesFromFile(StartupData* natives_blob); |
61 void ReadNatives(); | 59 void ReadNatives(); |
62 void DisposeNatives(); | 60 void DisposeNatives(); |
63 #endif | 61 #endif |
64 | 62 |
65 } // namespace internal | 63 } // namespace internal |
66 } // namespace v8 | 64 } // namespace v8 |
67 | 65 |
68 #endif // V8_SNAPSHOT_NATIVES_H_ | 66 #endif // V8_SNAPSHOT_NATIVES_H_ |
OLD | NEW |