V8 Project
natives.h
Go to the documentation of this file.
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.
4 
5 #ifndef V8_NATIVES_H_
6 #define V8_NATIVES_H_
7 
8 #include "src/vector.h"
9 
10 namespace v8 { class StartupData; } // Forward declaration.
11 
12 namespace v8 {
13 namespace internal {
14 
16  Vector<const char> source,
17  int index);
18 
19 enum NativeType {
21 };
22 
23 template <NativeType type>
25  public:
26  // Number of built-in scripts.
27  static int GetBuiltinsCount();
28  // Number of debugger implementation scripts.
29  static int GetDebuggerCount();
30 
31  // These are used to access built-in scripts. The debugger implementation
32  // scripts have an index in the interval [0, GetDebuggerCount()). The
33  // non-debugger scripts have an index in the interval [GetDebuggerCount(),
34  // GetNativesCount()).
35  static int GetIndex(const char* name);
36  static int GetRawScriptsSize();
37  static Vector<const char> GetRawScriptSource(int index);
38  static Vector<const char> GetScriptName(int index);
40  static void SetRawScriptsSource(Vector<const char> raw_source);
41 };
42 
45 
46 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
47 // Used for reading the natives at runtime. Implementation in natives-empty.cc
48 void SetNativesFromFile(StartupData* natives_blob);
49 #endif
50 
51 } } // namespace v8::internal
52 
53 #endif // V8_NATIVES_H_
static Vector< const char > GetScriptName(int index)
static Vector< const char > GetRawScriptSource(int index)
static int GetIndex(const char *name)
static Vector< const byte > GetScriptsSource()
static void SetRawScriptsSource(Vector< const char > raw_source)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
NativesCollection< CORE > Natives
Definition: natives.h:43
NativesCollection< EXPERIMENTAL > ExperimentalNatives
Definition: natives.h:44
@ EXPERIMENTAL
Definition: natives.h:20
void SetNativesFromFile(StartupData *natives_blob)
Read the Natives (library sources) blob, as generated by js2c + the build system.
bool(* NativeSourceCallback)(Vector< const char > name, Vector< const char > source, int index)
Definition: natives.h:15
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20