50 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
51 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
52 build configuration to ensure that at most one of these is set
55 #ifdef BUILDING_V8_SHARED
56 #define V8EXPORT __declspec(dllexport)
58 #define V8EXPORT __declspec(dllimport)
61 #endif // BUILDING_V8_SHARED
66 #if defined(__GNUC__) && ((__GNUC__ >= 4) || \
67 (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED)
68 #ifdef BUILDING_V8_SHARED
69 #define V8EXPORT __attribute__ ((visibility("default")))
102 class ImplementationUtilities;
104 class AccessorSignature;
144 #define TYPE_CHECK(T, S) \
146 *(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
174 template <
class T>
class Handle {
197 : val_(reinterpret_cast<
T*>(*that)) {
209 inline bool IsEmpty()
const {
return val_ == 0; }
229 if (a == 0)
return b == 0;
230 if (b == 0)
return false;
245 #ifdef V8_ENABLE_CHECKS
269 template <
class T>
class Local :
public Handle<T> {
273 :
Handle<
T>(reinterpret_cast<
T*>(*that)) {
283 #ifdef V8_ENABLE_CHECKS
286 if (that.IsEmpty())
return Local<T>();
320 template <
class T>
class Persistent :
public Handle<T> {
340 :
Handle<
T>(reinterpret_cast<
T*>(*that)) {
359 #ifdef V8_ENABLE_CHECKS
412 inline bool IsWeak()
const;
461 static int NumberOfHandles();
475 void*
operator new(
size_t size);
476 void operator delete(
void*, size_t);
485 inline void Initialize() {
534 static ScriptData* PreCompile(
const char* input,
int length);
553 static ScriptData* New(
const char* data,
int length);
558 virtual int Length() = 0;
564 virtual const char*
Data() = 0;
569 virtual bool HasError() = 0;
582 : resource_name_(resource_name),
583 resource_line_offset_(resource_line_offset),
584 resource_column_offset_(resource_column_offset) { }
724 int GetLineNumber()
const;
730 int GetStartPosition()
const;
736 int GetEndPosition()
const;
742 int GetStartColumn()
const;
748 int GetEndColumn()
const;
751 static void PrintCurrentStackTrace(FILE* out);
753 static const int kNoLineNumberInfo = 0;
754 static const int kNoColumnInfo = 0;
771 kColumnOffset = 1 << 1 | kLineNumber,
772 kScriptName = 1 << 2,
773 kFunctionName = 1 << 3,
775 kIsConstructor = 1 << 5,
776 kScriptNameOrSourceURL = 1 << 6,
777 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
778 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
789 int GetFrameCount()
const;
805 StackTraceOptions options = kOverview);
820 int GetLineNumber()
const;
829 int GetColumn()
const;
859 bool IsConstructor()
const;
881 inline bool IsNull()
const;
995 inline bool QuickIsUndefined()
const;
996 inline bool QuickIsNull()
const;
997 inline bool QuickIsString()
const;
998 V8EXPORT bool FullIsUndefined()
const;
1000 V8EXPORT bool FullIsString()
const;
1095 int* nchars_ref =
NULL,
1155 virtual const uint16_t* data()
const = 0;
1160 virtual size_t length()
const = 0;
1186 virtual const char* data()
const = 0;
1188 virtual size_t length()
const = 0;
1269 ExternalAsciiStringResource* resource);
1360 void operator=(
const Value&);
1364 V8EXPORT void VerifyExternalStringResourceBase(ExternalStringResourceBase* v,
1366 V8EXPORT void VerifyExternalStringResource(ExternalStringResource* val)
const;
1695 int number_of_elements);
1731 V8EXPORT void* SlowGetPointerFromInternalField(
int index);
1737 inline Local<Value> UncheckedGetInternalField(
int index);
2002 inline int Length()
const;
2012 static const int kIsolateIndex = 0;
2013 static const int kDataIndex = -1;
2014 static const int kCalleeIndex = -2;
2015 static const int kHolderIndex = -3;
2021 bool is_construct_call);
2025 bool is_construct_call_;
2037 inline Isolate* GetIsolate()
const;
2302 void SetHiddenPrototype(
bool value);
2308 void ReadOnlyPrototype();
2461 void MarkAsUndetectable();
2477 bool turned_on_by_default =
true);
2483 int InternalFieldCount();
2489 void SetInternalFieldCount(
int value);
2547 : data_(data), length_(length) {}
2548 const char*
data()
const {
return data_; }
2564 const char* source = 0,
2566 const char** deps = 0,
2567 int source_length = -1);
2574 const char*
name()
const {
return name_; }
2585 size_t source_length_;
2619 inline Handle<Primitive>
Undefined(Isolate* isolate);
2620 inline Handle<Primitive>
Null(Isolate* isolate);
2621 inline Handle<Boolean>
True(Isolate* isolate);
2622 inline Handle<Boolean>
False(Isolate* isolate);
2647 int max_young_space_size_;
2648 int max_old_space_size_;
2649 int max_executable_size_;
2650 uint32_t* stack_limit_;
2690 typedef int* (*CounterLookupCallback)(
const char* name);
2692 typedef void* (*CreateHistogramCallback)(
const char* name,
2780 void set_total_heap_size(
size_t size) { total_heap_size_ = size; }
2781 void set_total_heap_size_executable(
size_t size) {
2782 total_heap_size_executable_ = size;
2784 void set_used_heap_size(
size_t size) { used_heap_size_ = size; }
2785 void set_heap_size_limit(
size_t size) { heap_size_limit_ = size; }
2787 size_t total_heap_size_;
2788 size_t total_heap_size_executable_;
2789 size_t used_heap_size_;
2790 size_t heap_size_limit_;
2874 inline void SetData(
void* data);
2880 inline void* GetData();
2887 void*
operator new(
size_t size);
2888 void operator delete(
void*, size_t);
2920 virtual int DecompressData(
char* raw_data,
2922 const char* compressed_data,
2923 int compressed_data_size) = 0;
2951 uintptr_t return_addr_location);
2966 uintptr_t return_addr_location);
3053 static void SetAllowCodeGenerationFromStringsCallback(
3068 static void IgnoreOutOfMemoryException();
3074 static bool IsDead();
3096 static int GetCompressedStartupDataCount();
3097 static void GetCompressedStartupData(
StartupData* compressed_data);
3098 static void SetDecompressedStartupData(
StartupData* decompressed_data);
3117 static void SetCaptureStackTraceForUncaughtExceptions(
3119 int frame_limit = 10,
3125 static void SetFlagsFromString(
const char* str,
int length);
3130 static void SetFlagsFromCommandLine(
int* argc,
3135 static const char* GetVersion();
3156 static void EnableSlidingStateWindow();
3171 static void AddGCPrologueCallback(
3188 static void SetGlobalGCPrologueCallback(
GCCallback);
3200 static void AddGCEpilogueCallback(
3217 static void SetGlobalGCEpilogueCallback(
GCCallback);
3275 static bool Initialize();
3287 static void SetReturnAddressLocationResolver(
3341 static intptr_t AdjustAmountOfExternalAllocatedMemory(
3342 intptr_t change_in_bytes);
3353 static void PauseProfiler();
3359 static void ResumeProfiler();
3364 static bool IsProfilerPaused();
3372 static int GetCurrentThreadId();
3398 static void TerminateExecution(
int thread_id);
3410 static void TerminateExecution(
Isolate* isolate =
NULL);
3422 static bool IsExecutionTerminating(
Isolate* isolate =
NULL);
3433 static bool Dispose();
3465 static bool IdleNotification(
int hint = 1000);
3471 static void LowMemoryNotification();
3479 static int ContextDisposedNotification();
3523 bool HasCaught()
const;
3538 bool CanContinue()
const;
3591 void SetVerbose(
bool value);
3598 void SetCaptureMessage(
bool value);
3605 bool is_verbose_ : 1;
3606 bool can_continue_ : 1;
3607 bool capture_message_ : 1;
3623 : name_count_(name_count), names_(names) { }
3627 const char** names_;
3659 void DetachGlobal();
3716 void UseDefaultSecurityToken();
3736 bool HasOutOfMemoryException();
3739 static bool InContext();
3762 void AllowCodeGenerationFromStrings(
bool allow);
3768 bool IsCodeGenerationFromStringsAllowed();
3908 static void StartPreemption(
int every_n_ms);
3913 static void StopPreemption();
3924 static bool IsActive();
3931 static bool active_;
3935 void operator=(
const Locker&);
3959 virtual void EndOfStream() = 0;
3969 virtual WriteResult WriteAsciiChunk(
char* data,
int size) = 0;
3996 virtual ControlOption ReportProgressValue(
int done,
int total) = 0;
4003 namespace internal {
4027 return static_cast<int>(
reinterpret_cast<intptr_t
>(value)) >> shift_bits;
4043 return static_cast<int>(
reinterpret_cast<intptr_t
>(value) >> shift_bits);
4114 return PlatformSmiTagging::SmiToInt(value);
4129 const uintptr_t address =
reinterpret_cast<uintptr_t
>(value);
4150 return *
reinterpret_cast<int*
>(addr) == 1;
4154 uint8_t* addr =
reinterpret_cast<uint8_t*
>(isolate) +
4156 *
reinterpret_cast<void**
>(addr) = data;
4160 uint8_t* addr =
reinterpret_cast<uint8_t*
>(isolate) +
4162 return *
reinterpret_cast<void**
>(addr);
4170 template <
typename T>
4172 uint8_t* addr =
reinterpret_cast<uint8_t*
>(ptr) + offset -
kHeapObjectTag;
4173 return *
reinterpret_cast<T*
>(addr);
4194 if (that.IsEmpty())
return Local<T>();
4195 T* that_ptr = *that;
4199 reinterpret_cast<internal::HeapObject*>(*p))));
4209 return Persistent<T>(
reinterpret_cast<T*
>(V8::GlobalizeReference(p)));
4215 if (this->IsEmpty())
return false;
4216 return V8::IsGlobalIndependent(reinterpret_cast<internal::Object**>(**
this));
4222 if (this->IsEmpty())
return false;
4223 return V8::IsGlobalNearDeath(reinterpret_cast<internal::Object**>(**
this));
4229 if (this->IsEmpty())
return false;
4230 return V8::IsGlobalWeak(reinterpret_cast<internal::Object**>(**
this));
4236 if (this->IsEmpty())
return;
4237 V8::DisposeGlobal(reinterpret_cast<internal::Object**>(**
this));
4246 V8::MakeWeak(reinterpret_cast<internal::Object**>(**
this),
4253 V8::ClearWeak(reinterpret_cast<internal::Object**>(**
this));
4258 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**
this));
4263 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**
this), class_id);
4268 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**
this));
4273 bool is_construct_call)
4274 : implicit_args_(implicit_args),
4277 is_construct_call_(is_construct_call) { }
4288 &implicit_args_[kCalleeIndex]));
4299 &implicit_args_[kHolderIndex]));
4309 return *
reinterpret_cast<Isolate**
>(&implicit_args_[kIsolateIndex]);
4314 return is_construct_call_;
4327 return Local<T>(
reinterpret_cast<T*
>(after));
4331 return resource_name_;
4336 return resource_line_offset_;
4341 return resource_column_offset_;
4356 #ifndef V8_ENABLE_CHECKS
4357 Local<Value> quick_result = UncheckedGetInternalField(index);
4358 if (!quick_result.IsEmpty())
return quick_result;
4360 return CheckedGetInternalField(index);
4364 Local<Value> Object::UncheckedGetInternalField(
int index) {
4367 O* obj = *
reinterpret_cast<O**
>(
this);
4368 if (I::GetInstanceType(obj) == I::kJSObjectType) {
4373 O* value = I::ReadField<O*>(obj, offset);
4377 return Local<Value>();
4383 #ifdef V8_ENABLE_CHECKS
4384 return FullUnwrap(obj);
4386 return QuickUnwrap(obj);
4393 O* obj = *
reinterpret_cast<O**
>(
const_cast<v8::Value*
>(*wrapper));
4402 O* obj = *
reinterpret_cast<O**
>(
this);
4404 if (I::GetInstanceType(obj) == I::kJSObjectType) {
4409 O* value = I::ReadField<O*>(obj, offset);
4410 return I::GetExternalPointer(value);
4413 return SlowGetPointerFromInternalField(index);
4418 #ifdef V8_ENABLE_CHECKS
4421 return static_cast<String*
>(value);
4428 if (!I::IsInitialized(isolate))
return Empty();
4429 S* slot = I::GetRoot(isolate, I::kEmptySymbolRootIndex);
4437 O* obj = *
reinterpret_cast<O**
>(
const_cast<String*
>(
this));
4439 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
4440 void* value = I::ReadField<void*>(obj, I::kStringResourceOffset);
4445 #ifdef V8_ENABLE_CHECKS
4446 VerifyExternalStringResource(result);
4456 O* obj = *
reinterpret_cast<O**
>(
const_cast<String*
>(
this));
4457 int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
4460 if (type == I::kExternalAsciiRepresentationTag ||
4461 type == I::kExternalTwoByteRepresentationTag) {
4462 void* value = I::ReadField<void*>(obj, I::kStringResourceOffset);
4465 #ifdef V8_ENABLE_CHECKS
4466 VerifyExternalStringResourceBase(resource, *encoding_out);
4473 #ifdef V8_ENABLE_CHECKS
4474 return FullIsUndefined();
4476 return QuickIsUndefined();
4480 bool Value::QuickIsUndefined()
const {
4483 O* obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
4484 if (!I::HasHeapObjectTag(obj))
return false;
4485 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
4486 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
4491 #ifdef V8_ENABLE_CHECKS
4492 return FullIsNull();
4494 return QuickIsNull();
4498 bool Value::QuickIsNull()
const {
4501 O* obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
4502 if (!I::HasHeapObjectTag(obj))
return false;
4503 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
4504 return (I::GetOddballKind(obj) == I::kNullOddballKind);
4509 #ifdef V8_ENABLE_CHECKS
4510 return FullIsString();
4512 return QuickIsString();
4516 bool Value::QuickIsString()
const {
4519 O* obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
4520 if (!I::HasHeapObjectTag(obj))
return false;
4521 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
4526 #ifdef V8_ENABLE_CHECKS
4529 return static_cast<Number*
>(value);
4534 #ifdef V8_ENABLE_CHECKS
4537 return static_cast<Integer*
>(value);
4542 #ifdef V8_ENABLE_CHECKS
4545 return static_cast<Date*
>(value);
4550 #ifdef V8_ENABLE_CHECKS
4558 #ifdef V8_ENABLE_CHECKS
4566 #ifdef V8_ENABLE_CHECKS
4574 #ifdef V8_ENABLE_CHECKS
4577 return static_cast<RegExp*
>(value);
4582 #ifdef V8_ENABLE_CHECKS
4585 return static_cast<Object*
>(value);
4590 #ifdef V8_ENABLE_CHECKS
4593 return static_cast<Array*
>(value);
4598 #ifdef V8_ENABLE_CHECKS
4601 return static_cast<Function*
>(value);
4606 #ifdef V8_ENABLE_CHECKS
4609 return static_cast<External*
>(value);
4614 return *
reinterpret_cast<Isolate**
>(&args_[-3]);
4636 if (!I::IsInitialized(isolate))
return Undefined();
4637 S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
4645 if (!I::IsInitialized(isolate))
return Null();
4646 S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
4654 if (!I::IsInitialized(isolate))
return True();
4655 S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
4663 if (!I::IsInitialized(isolate))
return False();
4664 S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
4671 I::SetEmbedderData(
this, data);
4677 return I::GetEmbedderData(
this);
void MakeWeak(void *parameters, WeakReferenceCallback callback)
virtual v8::Handle< v8::FunctionTemplate > GetNativeFunction(v8::Handle< v8::String > name)
Handle< Array >(* NamedPropertyEnumerator)(const AccessorInfo &info)
const char * operator*() const
V8EXPORT int Length() const
V8EXPORT double NumberValue() const
static Object * Cast(Value *obj)
virtual ~ExternalStringResourceBase()
static bool IsExternalTwoByteString(int instance_type)
virtual void VisitPersistentHandle(Persistent< Value > value, uint16_t class_id)
V8EXPORT int WriteUtf8(char *buffer, int length=-1, int *nchars_ref=NULL, int options=NO_OPTIONS) const
const intptr_t kSmiTagMask
V8EXPORT bool HasRealIndexedProperty(uint32_t index)
void(* MemoryAllocationCallback)(ObjectSpace space, AllocationAction action, int size)
void set_max_young_space_size(int value)
static const int kExternalAsciiRepresentationTag
V8EXPORT bool BooleanValue() const
V8EXPORT bool IsTrue() const
V8EXPORT uint8_t * GetIndexedPropertiesPixelData()
V8EXPORT bool DeleteHiddenValue(Handle< String > key)
Handle< Boolean > V8EXPORT True()
V8EXPORT Local< String > GetSource() const
V8EXPORT const ExternalAsciiStringResource * GetExternalAsciiStringResource() const
static Date * Cast(v8::Value *obj)
void(* CallCompletedCallback)()
Handle< Value >(* NamedPropertySetter)(Local< String > property, Local< Value > value, const AccessorInfo &info)
#define I(name, number_of_args, result_size)
const int kPointerToSmiShift
ScriptOrigin(Handle< Value > resource_name, Handle< Integer > resource_line_offset=Handle< Integer >(), Handle< Integer > resource_column_offset=Handle< Integer >())
static bool IsInitialized(v8::Isolate *isolate)
V8EXPORT Local< Object > CloneElementAt(uint32_t index)
V8EXPORT bool StrictEquals(Handle< Value > that) const
Local< Object > Holder() const
bool IsIndependent() const
V8EXPORT Local< Value > Get(Handle< Value > key)
virtual ~PersistentHandleVisitor()
bool operator!=(Handle< S > that) const
static const int kOddballKindOffset
Handle< Integer > ResourceLineOffset() const
V8EXPORT bool IsNativeError() const
void V8EXPORT RegisterExtension(Extension *extension)
V8EXPORT PropertyAttribute GetPropertyAttributes(Handle< Value > key)
V8EXPORT Local< Array > GetOwnPropertyNames()
V8EXPORT bool IsBooleanObject() const
ExternalStringResourceBase * GetExternalStringResourceBase(Encoding *encoding_out) const
static const int kFirstNonstringType
static const int kNullValueRootIndex
static Array * Cast(Value *obj)
static V8EXPORT Local< String > New(const char *data, int length=-1)
Local< Function > Callee() const
Local< Object > This() const
V8EXPORT bool IsExternal() const
bool(* IndexedSecurityCallback)(Local< Object > host, uint32_t index, AccessType type, Local< Value > data)
static V8EXPORT Local< String > NewSymbol(const char *data, int length=-1)
V8EXPORT Local< String > GetConstructorName()
V8EXPORT Local< Int32 > ToInt32() const
static bool CanCastToHeapObject(String *o)
Handle< Primitive > V8EXPORT Null()
V8EXPORT Local< Context > CreationContext()
void * GetPointerFromInternalField(int index)
void(* MessageCallback)(Handle< Message > message, Handle< Value > error)
V8EXPORT bool HasRealNamedCallbackProperty(Handle< String > key)
V8EXPORT Local< Value > GetHiddenValue(Handle< String > key)
virtual ~ExternalStringResource()
static int SmiToInt(internal::Object *value)
static Handle< T > Cast(Handle< S > that)
ExternalAsciiStringResource()
int *(* CounterLookupCallback)(const char *name)
Handle< Object > SetAccessor(Handle< JSObject > obj, Handle< AccessorInfo > info)
V8EXPORT Local< Array > GetPropertyNames()
V8EXPORT ExternalArrayType GetIndexedPropertiesExternalArrayDataType()
V8EXPORT Local< Value > Call(Handle< Object > recv, int argc, Handle< Value > argv[])
V8EXPORT bool IsRegExp() const
static V8EXPORT const int kLineOffsetNotFound
void(* GCPrologueCallback)(GCType type, GCCallbackFlags flags)
V8EXPORT bool MayContainNonAscii() const
V8EXPORT Local< Number > ToNumber() const
V8EXPORT void * GetIndexedPropertiesExternalArrayData()
V8EXPORT bool IsCallable()
Local< Value > Data() const
Handle< Value > ResourceName() const
static V8EXPORT Local< Value > Wrap(void *data)
Local< Value > GetInternalField(int index)
void(* FatalErrorCallback)(const char *location, const char *message)
V8EXPORT Local< String > ToString() const
const uint16_t * operator*() const
Handle< Value >(* IndexedPropertySetter)(uint32_t index, Local< Value > value, const AccessorInfo &info)
static const int kStringResourceOffset
V8EXPORT Local< Value > CallAsConstructor(int argc, Handle< Value > argv[])
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
V8EXPORT bool CanMakeExternal()
void Set(Handle< String > name, Handle< Data > value, PropertyAttribute attributes=None)
static const int kJSObjectHeaderSize
static Function * Cast(Value *obj)
V8EXPORT Handle< Value > GetName() const
static int SmiToInt(internal::Object *value)
static V8EXPORT Local< String > NewUndetectable(const char *data, int length=-1)
static void * Unwrap(Handle< Value > obj)
V8EXPORT void SetIndexedPropertiesToExternalArrayData(void *data, ExternalArrayType array_type, int number_of_elements)
const intptr_t kHeapObjectTagMask
V8EXPORT Local< Uint32 > ToUint32() const
V8EXPORT bool Equals(Handle< Value > that) const
V8EXPORT Handle< Value > GetScriptId() const
static Number * Cast(v8::Value *obj)
V8EXPORT Local< Value > GetConstructor()
void(* FailedAccessCheckCallback)(Local< Object > target, AccessType type, Local< Value > data)
ExtensionConfiguration(int name_count, const char *names[])
V8EXPORT bool IsExternal() const
V8EXPORT bool HasIndexedPropertiesInExternalArrayData()
static void * GetExternalPointer(internal::Object *obj)
V8EXPORT void SetInternalField(int index, Handle< Value > value)
V8EXPORT void SetPointerInInternalField(int index, void *value)
static V8EXPORT Local< Integer > NewFromUnsigned(uint32_t value)
Local< Object > Holder() const
Handle< Value >(* IndexedPropertyGetter)(uint32_t index, const AccessorInfo &info)
V8EXPORT Local< Value > GetRealNamedProperty(Handle< String > key)
V8EXPORT bool IsExternalAscii() const
V8EXPORT bool IsStringObject() const
V8EXPORT bool MakeExternal(ExternalStringResource *resource)
V8EXPORT ScriptOrigin GetScriptOrigin() const
void(* FunctionEntryHook)(uintptr_t function, uintptr_t return_addr_location)
V8EXPORT bool IsUint32() const
HANDLE HANDLE LPSTACKFRAME64 StackFrame
V8EXPORT int InternalFieldCount()
static bool HasSmiTag(internal::Object *value)
Handle< Value >(* InvocationCallback)(const Arguments &args)
Handle< Value >(* NamedPropertyGetter)(Local< String > property, const AccessorInfo &info)
int max_old_space_size() const
V8EXPORT void * Value() const
V8EXPORT Local< String > ObjectProtoToString()
static V8EXPORT void DateTimeConfigurationChangeNotification()
void *(* CreateHistogramCallback)(const char *name, int min, int max, size_t buckets)
void set_max_old_space_size(int value)
ExternalAsciiStringResourceImpl()
V8EXPORT bool HasIndexedPropertiesInPixelData()
virtual ~ExternalAsciiStringResource()
int max_young_space_size() const
static const int kIsolateStateOffset
const char * operator*() const
Handle< Integer >(* NamedPropertyQuery)(Local< String > property, const AccessorInfo &info)
static const int kMapInstanceTypeOffset
virtual int GetChunkSize()
V8EXPORT Local< Value > GetPrototype()
V8EXPORT bool ForceDelete(Handle< Value > key)
bool(* AllowCodeGenerationFromStringsCallback)(Local< Context > context)
V8EXPORT int Utf8Length() const
bool operator==(Handle< S > that) const
uint16_t WrapperClassId() const
V8EXPORT bool HasIndexedLookupInterceptor()
Handle< Integer >(* IndexedPropertyQuery)(uint32_t index, const AccessorInfo &info)
uintptr_t(* ReturnAddressLocationResolver)(uintptr_t return_addr_location)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage message
const char * name() const
V8EXPORT int32_t Int32Value() const
void(* AccessorSetter)(Local< String > property, Local< Value > value, const AccessorInfo &info)
V8EXPORT bool IsBoolean() const
V8EXPORT Local< Object > NewInstance() const
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate *data, int count)
V8EXPORT void SetIndexedPropertiesToPixelData(uint8_t *data, int length)
V8EXPORT void TurnOnAccessCheck()
static RegExp * Cast(v8::Value *obj)
V8EXPORT int GetScriptColumnNumber() const
V8EXPORT bool Has(Handle< String > key)
ExternalStringResourceBase()
void SetWrapperClassId(uint16_t class_id)
void(* AddHistogramSampleCallback)(void *histogram, int sample)
V8EXPORT bool SetHiddenValue(Handle< String > key, Handle< Value > value)
void set_stack_limit(uint32_t *value)
static Persistent< T > New(Handle< T > that)
static void * GetEmbedderData(v8::Isolate *isolate)
static int SmiValue(internal::Object *value)
V8EXPORT Local< String > ToDetailString() const
static const int kUndefinedValueRootIndex
static const int kOddballType
int max_executable_size()
static Local< T > New(Handle< T > that)
static String * Cast(v8::Value *obj)
V8EXPORT bool HasNamedLookupInterceptor()
V8EXPORT bool BooleanValue() const
static External * Cast(Value *obj)
uint32_t * stack_limit() const
virtual ~ActivityControl()
V8EXPORT bool SetPrototype(Handle< Value > prototype)
static Integer * Cast(v8::Value *obj)
static void SetEmbedderData(v8::Isolate *isolate, void *data)
void(* WeakReferenceCallback)(Persistent< Value > object, void *parameter)
V8EXPORT bool IsFunction() const
static const int kFalseValueRootIndex
Handle< Boolean > V8EXPORT False()
static bool CanCastToHeapObject(Context *o)
ExternalStringResource * GetExternalStringResource() const
Local< Object > This() const
#define T(name, string, precedence)
V8EXPORT int64_t IntegerValue() const
static Local< T > Cast(Local< S > that)
V8EXPORT bool IsObject() const
void(* GCEpilogueCallback)(GCType type, GCCallbackFlags flags)
V8EXPORT void SetName(Handle< String > name)
V8EXPORT double Value() const
void(* JitCodeEventHandler)(const JitCodeEvent *event)
static V8EXPORT v8::Local< v8::String > Empty()
V8EXPORT Local< Value > CallAsFunction(Handle< Object > recv, int argc, Handle< Value > argv[])
V8EXPORT bool IsDate() const
const int kApiPointerSize
Handle< Integer > ResourceColumnOffset() const
AccessorInfo(internal::Object **args)
static internal::Object ** CreateHandle(internal::Object *value)
V8EXPORT int GetIndexedPropertiesExternalArrayDataLength()
V8EXPORT uint32_t Uint32Value() const
DeclareExtension(Extension *extension)
Local< Value > operator[](int i) const
static void * GetExternalPointerFromSmi(internal::Object *value)
static const int kHeapObjectMapOffset
struct v8::JitCodeEvent::@0::@2 name
static const int kEmptySymbolRootIndex
V8EXPORT bool IsNumber() const
Persistent(Persistent< S > that)
const String::ExternalAsciiStringResource * source() const
static T ReadField(Object *ptr, int offset)
V8EXPORT Local< String > StringValue() const
V8EXPORT bool ForceSet(Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
V8EXPORT bool Delete(Handle< String > key)
static bool CanCastToHeapObject(StackTrace *o)
ExternalAsciiStringResourceImpl(const char *data, size_t length)
const intptr_t kPointerAlignment
V8EXPORT Local< Object > Clone()
V8EXPORT bool SetAccessor(Handle< String > name, AccessorGetter getter, AccessorSetter setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
static const int kFullStringRepresentationMask
virtual void VisitExternalString(Handle< String > string)
V8EXPORT int GetIndexedPropertiesPixelDataLength()
bool(* NamedSecurityCallback)(Local< Object > host, Local< Value > key, AccessType type, Local< Value > data)
V8EXPORT bool IsFalse() const
V8EXPORT Flags GetFlags() const
static Persistent< T > Cast(Persistent< S > that)
bool(* EntropySource)(unsigned char *buffer, size_t length)
static NumberObject * Cast(v8::Value *obj)
static V8EXPORT Local< Integer > New(int32_t value)
V8EXPORT int GetScriptLineNumber() const
void set_auto_enable(bool value)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
V8EXPORT int64_t Value() const
Local< T > Close(Handle< T > value)
V8EXPORT bool IsNumberObject() const
static bool CanCastToHeapObject(void *o)
static const int kUndefinedOddballKind
V8EXPORT int WriteAscii(char *buffer, int start=0, int length=-1, int options=NO_OPTIONS) const
static int GetOddballKind(internal::Object *obj)
Persistent(Handle< S > that)
const int kHeapObjectTagSize
Handle< Primitive > V8EXPORT Undefined()
V8EXPORT Local< Value > GetRealNamedPropertyInPrototypeChain(Handle< String > key)
static V8EXPORT Local< Number > New(double value)
static bool CanCastToHeapObject(Message *o)
SmiTagging< kApiPointerSize > PlatformSmiTagging
static V8EXPORT Local< String > Concat(Handle< String > left, Handle< String > right)
V8EXPORT double NumberValue() const
V8EXPORT bool HasOwnProperty(Handle< String > key)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static const int kStringEncodingMask
Isolate * GetIsolate() const
V8EXPORT Local< Object > ToObject() const
V8EXPORT bool IsArray() const
const uintptr_t kEncodablePointerMask
V8EXPORT uint32_t Length() const
static int GetInstanceType(internal::Object *obj)
V8EXPORT Local< Boolean > ToBoolean() const
V8EXPORT Local< Integer > ToInteger() const
static const int kExternalTwoByteRepresentationTag
static const int kTrueValueRootIndex
static V8EXPORT Local< External > New(void *value)
Local< Value > Data() const
Handle< Boolean >(* IndexedPropertyDeleter)(uint32_t index, const AccessorInfo &info)
Isolate * GetIsolate() const
static BooleanObject * Cast(v8::Value *obj)
V8EXPORT bool IsInt32() const
V8EXPORT bool HasRealNamedProperty(Handle< String > key)
static bool HasHeapObjectTag(internal::Object *value)
static const int kForeignType
Scope(Handle< Context > context)
static Handle< Boolean > New(bool value)
static const int kIsolateRootsOffset
static V8EXPORT Local< String > NewExternal(ExternalStringResource *resource)
bool V8EXPORT SetResourceConstraints(ResourceConstraints *constraints)
V8EXPORT Handle< Value > GetInferredName() const
V8EXPORT Local< Object > FindInstanceInPrototypeChain(Handle< FunctionTemplate > tmpl)
const char * data() const
size_t source_length() const
static StringObject * Cast(v8::Value *obj)
Handle< Value > V8EXPORT ThrowException(Handle< Value > exception)
const char ** dependencies()
bool IsConstructCall() const
static const int kIsolateEmbedderDataOffset
Handle< Array >(* IndexedPropertyEnumerator)(const AccessorInfo &info)
static const int kNullOddballKind
V8EXPORT int32_t Value() const
Handle< Value >(* AccessorGetter)(Local< String > property, const AccessorInfo &info)
static bool CanCastToHeapObject(Object *o)
V8EXPORT int Write(uint16_t *buffer, int start=0, int length=-1, int options=NO_OPTIONS) const
static internal::Object ** GetRoot(v8::Isolate *isolate, int index)
static bool CanCastToHeapObject(StackFrame *o)
virtual ~ExternalResourceVisitor()
size_t total_heap_size_executable()
static V8EXPORT Local< Object > New()
V8EXPORT Local< Uint32 > ToArrayIndex() const
V8EXPORT uint32_t Value() const
const uint32_t kStringEncodingMask
V8EXPORT int GetIdentityHash()
virtual OutputEncoding GetOutputEncoding()
static const int kJSObjectType
void set_max_executable_size(int value)
Handle< Boolean >(* NamedPropertyDeleter)(Local< String > property, const AccessorInfo &info)
V8EXPORT bool Value() const
V8EXPORT bool Set(Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
static const int kForeignAddressOffset
V8EXPORT double NumberValue() const