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
3 // found in the LICENSE file.
8 #include "src/vector.h"
10 namespace v8 { class StartupData; } // Forward declaration.
16 CORE, EXPERIMENTAL, D8, TEST
19 template <NativeType type>
20 class NativesCollection {
22 // Number of built-in scripts.
23 static int GetBuiltinsCount();
24 // Number of debugger implementation scripts.
25 static int GetDebuggerCount();
27 // These are used to access built-in scripts. The debugger implementation
28 // scripts have an index in the interval [0, GetDebuggerCount()). The
29 // non-debugger scripts have an index in the interval [GetDebuggerCount(),
30 // GetNativesCount()).
31 static int GetIndex(const char* name);
32 static Vector<const char> GetScriptSource(int index);
33 static Vector<const char> GetScriptName(int index);
34 static Vector<const char> GetScriptsSource();
37 typedef NativesCollection<CORE> Natives;
38 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives;
40 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
41 // Used for reading the natives at runtime. Implementation in natives-empty.cc
42 void SetNativesFromFile(StartupData* natives_blob);
45 } } // namespace v8::internal
47 #endif // V8_NATIVES_H_