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

Side by Side Diff: src/snapshot/natives.h

Issue 1213203007: Create a internal, global native context used only for generated code stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 5 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
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/snapshot/natives-external.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/vector.h" 8 #include "src/vector.h"
9 9
10 namespace v8 { class StartupData; } // Forward declaration. 10 namespace v8 { class StartupData; } // Forward declaration.
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 enum NativeType { CORE, EXPERIMENTAL, EXTRAS, D8, TEST }; 15 enum NativeType { CORE, CODE_STUB, EXPERIMENTAL, EXTRAS, D8, TEST };
16 16
17 template <NativeType type> 17 template <NativeType type>
18 class NativesCollection { 18 class NativesCollection {
19 public: 19 public:
20 // Number of built-in scripts. 20 // Number of built-in scripts.
21 static int GetBuiltinsCount(); 21 static int GetBuiltinsCount();
22 // Number of debugger implementation scripts. 22 // Number of debugger implementation scripts.
23 static int GetDebuggerCount(); 23 static int GetDebuggerCount();
24 24
25 // These are used to access built-in scripts. The debugger implementation 25 // These are used to access built-in scripts. The debugger implementation
26 // scripts have an index in the interval [0, GetDebuggerCount()). The 26 // scripts have an index in the interval [0, GetDebuggerCount()). The
27 // non-debugger scripts have an index in the interval [GetDebuggerCount(), 27 // non-debugger scripts have an index in the interval [GetDebuggerCount(),
28 // GetNativesCount()). 28 // GetNativesCount()).
29 static int GetIndex(const char* name); 29 static int GetIndex(const char* name);
30 static Vector<const char> GetScriptSource(int index); 30 static Vector<const char> GetScriptSource(int index);
31 static Vector<const char> GetScriptName(int index); 31 static Vector<const char> GetScriptName(int index);
32 static Vector<const char> GetScriptsSource(); 32 static Vector<const char> GetScriptsSource();
33 }; 33 };
34 34
35 typedef NativesCollection<CORE> Natives; 35 typedef NativesCollection<CORE> Natives;
36 typedef NativesCollection<CODE_STUB> CodeStubNatives;
36 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives; 37 typedef NativesCollection<EXPERIMENTAL> ExperimentalNatives;
37 typedef NativesCollection<EXTRAS> ExtraNatives; 38 typedef NativesCollection<EXTRAS> ExtraNatives;
38 39
39 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 40 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
40 // Used for reading the natives at runtime. Implementation in natives-empty.cc 41 // Used for reading the natives at runtime. Implementation in natives-empty.cc
41 void SetNativesFromFile(StartupData* natives_blob); 42 void SetNativesFromFile(StartupData* natives_blob);
42 void ReadNatives(); 43 void ReadNatives();
43 void DisposeNatives(); 44 void DisposeNatives();
44 #endif 45 #endif
45 46
46 } } // namespace v8::internal 47 } } // namespace v8::internal
47 48
48 #endif // V8_SNAPSHOT_NATIVES_H_ 49 #endif // V8_SNAPSHOT_NATIVES_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/snapshot/natives-external.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698