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 EXPERIMENTAL, |
19 EXTRAS, | 19 EXTRAS, |
20 EXPERIMENTAL_EXTRAS, | 20 EXPERIMENTAL_EXTRAS, |
21 D8, | 21 D8, |
22 TEST | 22 TEST |
23 }; | 23 }; |
24 | 24 |
| 25 // Extra handling for V8_EXPORT_PRIVATE in combination with USING_V8_SHARED |
| 26 // since definition of methods of classes marked as dllimport is not allowed. |
25 template <NativeType type> | 27 template <NativeType type> |
| 28 #ifdef USING_V8_SHARED |
26 class NativesCollection { | 29 class NativesCollection { |
| 30 #else |
| 31 class V8_EXPORT_PRIVATE NativesCollection { |
| 32 #endif // USING_V8_SHARED |
| 33 |
27 public: | 34 public: |
28 // The following methods are implemented in js2c-generated code: | 35 // The following methods are implemented in js2c-generated code: |
29 | 36 |
30 // Number of built-in scripts. | 37 // Number of built-in scripts. |
31 static int GetBuiltinsCount(); | 38 static int GetBuiltinsCount(); |
32 // Number of debugger implementation scripts. | 39 // Number of debugger implementation scripts. |
33 static int GetDebuggerCount(); | 40 static int GetDebuggerCount(); |
34 | 41 |
35 // These are used to access built-in scripts. The debugger implementation | 42 // These are used to access built-in scripts. The debugger implementation |
36 // scripts have an index in the interval [0, GetDebuggerCount()). The | 43 // scripts have an index in the interval [0, GetDebuggerCount()). The |
(...skipping 19 matching lines...) Expand all Loading... |
56 // 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 |
57 void SetNativesFromFile(StartupData* natives_blob); | 64 void SetNativesFromFile(StartupData* natives_blob); |
58 void ReadNatives(); | 65 void ReadNatives(); |
59 void DisposeNatives(); | 66 void DisposeNatives(); |
60 #endif | 67 #endif |
61 | 68 |
62 } // namespace internal | 69 } // namespace internal |
63 } // namespace v8 | 70 } // namespace v8 |
64 | 71 |
65 #endif // V8_SNAPSHOT_NATIVES_H_ | 72 #endif // V8_SNAPSHOT_NATIVES_H_ |
OLD | NEW |