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 EXPERIMENTAL, |
18 EXTRAS, | 19 EXTRAS, |
19 EXPERIMENTAL_EXTRAS, | 20 EXPERIMENTAL_EXTRAS, |
20 D8, | 21 D8, |
21 TEST | 22 TEST |
22 }; | 23 }; |
23 | 24 |
24 // Extra handling for V8_EXPORT_PRIVATE in combination with USING_V8_SHARED | 25 // Extra handling for V8_EXPORT_PRIVATE in combination with USING_V8_SHARED |
25 // since definition of methods of classes marked as dllimport is not allowed. | 26 // since definition of methods of classes marked as dllimport is not allowed. |
26 template <NativeType type> | 27 template <NativeType type> |
27 #ifdef USING_V8_SHARED | 28 #ifdef USING_V8_SHARED |
(...skipping 18 matching lines...) Expand all Loading... |
46 static Vector<const char> GetScriptSource(int index); | 47 static Vector<const char> GetScriptSource(int index); |
47 static Vector<const char> GetScriptName(int index); | 48 static Vector<const char> GetScriptName(int index); |
48 static Vector<const char> GetScriptsSource(); | 49 static Vector<const char> GetScriptsSource(); |
49 | 50 |
50 // The following methods are implemented in natives-common.cc: | 51 // The following methods are implemented in natives-common.cc: |
51 | 52 |
52 static FixedArray* GetSourceCache(Heap* heap); | 53 static FixedArray* GetSourceCache(Heap* heap); |
53 }; | 54 }; |
54 | 55 |
55 typedef NativesCollection<CORE> Natives; | 56 typedef NativesCollection<CORE> Natives; |
| 57 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives; |
56 typedef NativesCollection<EXTRAS> ExtraNatives; | 58 typedef NativesCollection<EXTRAS> ExtraNatives; |
57 typedef NativesCollection<EXPERIMENTAL_EXTRAS> ExperimentalExtraNatives; | 59 typedef NativesCollection<EXPERIMENTAL_EXTRAS> ExperimentalExtraNatives; |
58 | 60 |
59 | 61 |
60 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 62 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
61 // Used for reading the natives at runtime. Implementation in natives-empty.cc | 63 // Used for reading the natives at runtime. Implementation in natives-empty.cc |
62 void SetNativesFromFile(StartupData* natives_blob); | 64 void SetNativesFromFile(StartupData* natives_blob); |
63 void ReadNatives(); | 65 void ReadNatives(); |
64 void DisposeNatives(); | 66 void DisposeNatives(); |
65 #endif | 67 #endif |
66 | 68 |
67 } // namespace internal | 69 } // namespace internal |
68 } // namespace v8 | 70 } // namespace v8 |
69 | 71 |
70 #endif // V8_SNAPSHOT_NATIVES_H_ | 72 #endif // V8_SNAPSHOT_NATIVES_H_ |
OLD | NEW |