53 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
54 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
55 build configuration to ensure that at most one of these is set
58 #ifdef BUILDING_V8_SHARED
59 # define V8_EXPORT __declspec(dllexport)
61 # define V8_EXPORT __declspec(dllimport)
64 #endif // BUILDING_V8_SHARED
69 #if V8_HAS_ATTRIBUTE_VISIBILITY && defined(V8_SHARED)
70 # ifdef BUILDING_V8_SHARED
71 # define V8_EXPORT __attribute__ ((visibility("default")))
86 class AccessorSignature;
94 class DeclaredAccessorDescriptor;
97 class FunctionTemplate;
99 class ImplementationUtilities;
106 class ObjectOperationDescriptor;
107 class ObjectTemplate;
110 class RawOperationDescriptor;
144 class CallHandlerHelper;
170 return data_ == other.data_;
174 return data_ != other.data_;
178 return data_ < other.data_;
187 #define TYPE_CHECK(T, S) \
189 *(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
218 template <
class T>
class Handle {
236 : val_(reinterpret_cast<
T*>(*that)) {
268 if (a == 0)
return b == 0;
269 if (b == 0)
return false;
277 if (a == 0)
return b == 0;
278 if (b == 0)
return false;
298 #ifdef V8_ENABLE_CHECKS
311 return New(isolate, that.val_);
315 return New(isolate, that.val_);
318 #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
332 template<
class F>
friend class Local;
358 template <
class T>
class Local :
public Handle<T> {
362 :
Handle<
T>(reinterpret_cast<
T*>(*that)) {
373 #ifdef V8_ENABLE_CHECKS
381 :
Handle<
T>(reinterpret_cast<
T*>(*that)) {
398 #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
410 template<
class F>
friend class Local;
426 template <
class T>
class Eternal {
431 Set(isolate, handle);
439 static const int kInitialValue = -1;
444 template<
class T,
class P>
456 : isolate_(isolate), handle_(handle), parameter_(parameter) { }
476 template <
class T>
class PersistentBase {
503 if (a == 0)
return b == 0;
504 if (b == 0)
return false;
511 if (a == 0)
return b == 0;
512 if (b == 0)
return false;
530 template<
typename S,
typename P>
583 template<
class F>
friend class Local;
607 class NonCopyablePersistentTraits {
611 template<
class S,
class M>
614 Uncompilable<Object>();
631 template<
class S,
class M>
647 template <
class T,
class M>
class Persistent :
public PersistentBase<T> {
667 template <
class S,
class M2>
681 template <
class S,
class M2>
689 template <
class S,
class M2>
700 if (M::kResetInDestructor) this->
Reset();
706 #ifdef V8_ENABLE_CHECKS
709 if (!that.IsEmpty()) T::Cast(*that);
723 #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
729 V8_INLINE T* operator*()
const {
return this->val_; }
735 template<
class F>
friend class Local;
739 template<
class S,
class M2>
786 rvalue.object->val_ = 0;
796 this->val_ = rhs.val_;
838 static int NumberOfHandles(
Isolate* isolate);
841 return reinterpret_cast<Isolate*
>(isolate_);
847 void Initialize(
Isolate* isolate);
861 void*
operator new(
size_t size);
862 void operator delete(
void*, size_t);
869 template<
class F>
friend class Local;
894 Escape(reinterpret_cast<internal::Object**>(*value));
895 return Local<T>(
reinterpret_cast<T*
>(slot));
905 void*
operator new(
size_t size);
906 void operator delete(
void*, size_t);
966 static ScriptData* New(
const char* data,
int length);
971 virtual int Length() = 0;
977 virtual const char*
Data() = 0;
982 virtual bool HasError() = 0;
996 : resource_name_(resource_name),
997 resource_line_offset_(resource_line_offset),
998 resource_column_offset_(resource_column_offset),
999 resource_is_shared_cross_origin_(resource_is_shared_cross_origin) { }
1029 int GetLineNumber(
int code_pos);
1031 static const int kNoScriptId = 0;
1068 return GetUnboundScript()->GetId();
1074 return GetUnboundScript()->GetScriptName();
1082 int GetLineNumber(
int code_pos)) {
1083 return GetUnboundScript()->GetLineNumber(code_pos);
1113 BufferPolicy buffer_policy = BufferNotOwned);
1148 Source(
const Source&);
1149 Source& operator=(
const Source&);
1167 kProduceDataToCache = 1 << 0
1178 Isolate* isolate, Source* source,
1179 CompileOptions options = kNoCompileOptions);
1193 Isolate* isolate, Source* source,
1194 CompileOptions options = kNoCompileOptions);
1228 int GetLineNumber()
const;
1234 int GetStartPosition()
const;
1240 int GetEndPosition()
const;
1246 int GetStartColumn()
const;
1252 int GetEndColumn()
const;
1258 bool IsSharedCrossOrigin()
const;
1261 static void PrintCurrentStackTrace(
Isolate* isolate, FILE* out);
1263 static const int kNoLineNumberInfo = 0;
1264 static const int kNoColumnInfo = 0;
1265 static const int kNoScriptIdInfo = 0;
1282 kColumnOffset = 1 << 1 | kLineNumber,
1283 kScriptName = 1 << 2,
1284 kFunctionName = 1 << 3,
1286 kIsConstructor = 1 << 5,
1287 kScriptNameOrSourceURL = 1 << 6,
1289 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
1290 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
1301 int GetFrameCount()
const;
1318 StackTraceOptions options = kOverview);
1333 int GetLineNumber()
const;
1342 int GetColumn()
const;
1350 int GetScriptId()
const;
1375 bool IsEval()
const;
1381 bool IsConstructor()
const;
1424 bool IsTrue()
const;
1429 bool IsFalse()
const;
1441 bool IsSymbol()
const;
1446 bool IsFunction()
const;
1451 bool IsArray()
const;
1456 bool IsObject()
const;
1461 bool IsBoolean()
const;
1466 bool IsNumber()
const;
1471 bool IsExternal()
const;
1476 bool IsInt32()
const;
1481 bool IsUint32()
const;
1486 bool IsDate()
const;
1491 bool IsBooleanObject()
const;
1496 bool IsNumberObject()
const;
1501 bool IsStringObject()
const;
1507 bool IsSymbolObject()
const;
1512 bool IsNativeError()
const;
1517 bool IsRegExp()
const;
1523 bool IsPromise()
const;
1529 bool IsArrayBuffer()
const;
1535 bool IsArrayBufferView()
const;
1541 bool IsTypedArray()
const;
1547 bool IsUint8Array()
const;
1553 bool IsUint8ClampedArray()
const;
1559 bool IsInt8Array()
const;
1565 bool IsUint16Array()
const;
1571 bool IsInt16Array()
const;
1577 bool IsUint32Array()
const;
1583 bool IsInt32Array()
const;
1589 bool IsFloat32Array()
const;
1595 bool IsFloat64Array()
const;
1601 bool IsDataView()
const;
1618 bool BooleanValue()
const;
1619 double NumberValue()
const;
1620 int64_t IntegerValue()
const;
1621 uint32_t Uint32Value()
const;
1632 V8_INLINE bool QuickIsUndefined()
const;
1635 bool FullIsUndefined()
const;
1636 bool FullIsNull()
const;
1637 bool FullIsString()
const;
1664 UNKNOWN_ENCODING = 0x1,
1665 TWO_BYTE_ENCODING = 0x0,
1666 ASCII_ENCODING = 0x4,
1667 ONE_BYTE_ENCODING = 0x4
1678 int Utf8Length()
const;
1685 bool IsOneByte()
const;
1691 bool ContainsOnlyOneByte()
const;
1720 HINT_MANY_WRITES_EXPECTED = 1,
1721 NO_NULL_TERMINATION = 2,
1722 PRESERVE_ASCII_NULL = 4,
1726 REPLACE_INVALID_UTF8 = 8
1733 int options = NO_OPTIONS)
const;
1735 int WriteOneByte(uint8_t* buffer,
1738 int options = NO_OPTIONS)
const;
1740 int WriteUtf8(
char* buffer,
1742 int* nchars_ref =
NULL,
1743 int options = NO_OPTIONS)
const;
1753 bool IsExternal()
const;
1758 bool IsExternalAscii()
const;
1801 virtual const uint16_t* data()
const = 0;
1806 virtual size_t length()
const = 0;
1832 virtual const char* data()
const = 0;
1834 virtual size_t length()
const = 0;
1864 kNormalString, kInternalizedString, kUndetectableString
1870 NewStringType type = kNormalString,
1876 const uint8_t* data,
1877 NewStringType type = kNormalString,
1884 NewStringType type = kNormalString,
1902 ExternalStringResource* resource);
1913 bool MakeExternal(ExternalStringResource* resource);
1924 ExternalAsciiStringResource* resource);
1935 bool MakeExternal(ExternalAsciiStringResource* resource);
1940 bool CanMakeExternal();
1984 void operator=(
const Value&);
1988 void VerifyExternalStringResourceBase(ExternalStringResourceBase* v,
1989 Encoding encoding)
const;
1990 void VerifyExternalStringResource(ExternalStringResource* val)
const;
2060 double Value()
const;
2076 int64_t
Value()
const;
2100 uint32_t
Value()
const;
2215 bool Has(uint32_t index);
2217 bool Delete(uint32_t index);
2303 int InternalFieldCount();
2308 return object.val_->InternalFieldCount();
2322 V8_INLINE void* GetAlignedPointerFromInternalField(
int index);
2327 return object.val_->GetAlignedPointerFromInternalField(index);
2335 void SetAlignedPointerInInternalField(
int index,
void* value);
2340 bool HasRealIndexedProperty(uint32_t index);
2357 bool HasNamedLookupInterceptor();
2360 bool HasIndexedLookupInterceptor();
2367 void TurnOnAccessCheck();
2376 int GetIdentityHash();
2415 void SetIndexedPropertiesToPixelData(uint8_t* data,
int length);
2416 bool HasIndexedPropertiesInPixelData();
2417 uint8_t* GetIndexedPropertiesPixelData();
2418 int GetIndexedPropertiesPixelDataLength();
2427 void SetIndexedPropertiesToExternalArrayData(
void* data,
2429 int number_of_elements);
2430 bool HasIndexedPropertiesInExternalArrayData();
2431 void* GetIndexedPropertiesExternalArrayData();
2433 int GetIndexedPropertiesExternalArrayDataLength();
2465 void* SlowGetAlignedPointerFromInternalField(
int index);
2474 uint32_t Length()
const;
2491 static void CheckCast(
Value* obj);
2495 template<
typename T>
2499 : value_(that.value_) {
2535 template<
typename T>
2536 class FunctionCallbackInfo {
2564 bool is_construct_call);
2576 template<
typename T>
2654 bool IsBuiltin()
const;
2659 int ScriptId()
const;
2673 static void CheckCast(
Value* obj);
2706 static void CheckCast(
Value* obj);
2726 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
2728 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
2752 virtual void* Allocate(
size_t length) = 0;
2758 virtual void* AllocateUninitialized(
size_t length) = 0;
2763 virtual void Free(
void* data,
size_t length) = 0;
2780 void*
Data()
const {
return data_; }
2785 size_t byte_length_;
2794 size_t ByteLength()
const;
2811 size_t byte_length);
2817 bool IsExternal()
const;
2848 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
2850 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
2869 size_t ByteOffset();
2873 size_t ByteLength();
2877 static const int kInternalFieldCount =
2882 static void CheckCast(
Value* obj);
2903 static void CheckCast(
Value* obj);
2914 size_t byte_offset,
size_t length);
2919 static void CheckCast(
Value* obj);
2930 size_t byte_offset,
size_t length);
2935 static void CheckCast(
Value* obj);
2945 size_t byte_offset,
size_t length);
2950 static void CheckCast(
Value* obj);
2961 size_t byte_offset,
size_t length);
2966 static void CheckCast(
Value* obj);
2977 size_t byte_offset,
size_t length);
2982 static void CheckCast(
Value* obj);
2993 size_t byte_offset,
size_t length);
2998 static void CheckCast(
Value* obj);
3009 size_t byte_offset,
size_t length);
3014 static void CheckCast(
Value* obj);
3025 size_t byte_offset,
size_t length);
3030 static void CheckCast(
Value* obj);
3041 size_t byte_offset,
size_t length);
3046 static void CheckCast(
Value* obj);
3057 size_t byte_offset,
size_t length);
3062 static void CheckCast(
Value* obj);
3077 double ValueOf()
const;
3093 static void DateTimeConfigurationChangeNotification(
Isolate* isolate);
3107 double ValueOf()
const;
3123 bool ValueOf()
const;
3203 Flags GetFlags()
const;
3220 void*
Value()
const;
3239 void SetAccessorProperty(
3538 void SetLength(
int length);
3571 void SetHiddenPrototype(
bool value);
3577 void ReadOnlyPrototype();
3583 void RemovePrototype();
3669 void SetNamedPropertyHandler(
3693 void SetIndexedPropertyHandler(
3718 void MarkAsUndetectable();
3734 bool turned_on_by_default =
true);
3740 int InternalFieldCount();
3746 void SetInternalFieldCount(
int value);
3799 int internal_field);
3821 void* compare_value);
3825 uint8_t bool_offset = 0);
3828 uint8_t compare_value);
3836 uint32_t compare_value);
3864 : data_(data), length_(length) {}
3865 const char*
data()
const {
return data_; }
3881 const char* source = 0,
3883 const char** deps = 0,
3884 int source_length = -1);
3891 const char*
name()
const {
return name_; }
3902 size_t source_length_;
3947 void ConfigureDefaults(uint64_t physical_memory,
3948 uint32_t number_of_processors);
3962 max_available_threads_ = value;
3966 int max_young_space_size_;
3967 int max_old_space_size_;
3968 int max_executable_size_;
3969 uint32_t* stack_limit_;
3970 int max_available_threads_;
3978 ResourceConstraints* constraints);
4009 typedef int* (*CounterLookupCallback)(
const char*
name);
4011 typedef void* (*CreateHistogramCallback)(
const char*
name,
4102 size_t total_heap_size_;
4103 size_t total_heap_size_executable_;
4104 size_t total_physical_size_;
4105 size_t used_heap_size_;
4106 size_t heap_size_limit_;
4177 void* internal_throws_;
4178 void* internal_assert_;
4192 kMinorGarbageCollection
4241 V8_INLINE void SetData(uint32_t slot,
void* data);
4253 V8_INLINE static uint32_t GetNumberOfDataSlots();
4273 int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes);
4323 template<
typename T>
void SetObjectGroupId(
const Persistent<T>&
object,
4333 template<
typename T>
void SetReferenceFromGroup(
UniqueId id,
4342 template<
typename T,
typename S>
4361 void AddGCPrologueCallback(
4379 void AddGCEpilogueCallback(
4403 void ClearInterrupt();
4428 void*
operator new(
size_t size);
4429 void operator delete(
void*, size_t);
4464 virtual int DecompressData(
char* raw_data,
4466 const char* compressed_data,
4467 int compressed_data_size) = 0;
4495 uintptr_t return_addr_location);
4510 uintptr_t return_addr_location);
4631 static void SetAllowCodeGenerationFromStringsCallback(
4646 static bool IsDead();
4668 static int GetCompressedStartupDataCount();
4669 static void GetCompressedStartupData(
StartupData* compressed_data);
4670 static void SetDecompressedStartupData(
StartupData* decompressed_data);
4693 static void SetCaptureStackTraceForUncaughtExceptions(
4695 int frame_limit = 10,
4701 static void SetFlagsFromString(
const char* str,
int length);
4706 static void SetFlagsFromCommandLine(
int* argc,
4711 static const char* GetVersion();
4741 static void AddGCPrologueCallback(
4760 static void AddGCEpilogueCallback(
4799 static void RunMicrotasks(
Isolate* isolate);
4810 static void SetAutorunMicrotasks(
Isolate *source,
bool autorun);
4817 static bool Initialize();
4829 static void SetReturnAddressLocationResolver(
4845 static bool SetFunctionEntryHook(
Isolate* isolate,
4881 static void TerminateExecution(
Isolate* isolate =
NULL);
4893 static bool IsExecutionTerminating(
Isolate* isolate =
NULL);
4911 static void CancelTerminateExecution(
Isolate* isolate);
4922 static bool Dispose();
4944 static void VisitHandlesForPartialDependence(
4959 static bool IdleNotification(
int hint = 1000);
4965 static void LowMemoryNotification();
4973 static int ContextDisposedNotification();
4988 static void InitializePlatform(
Platform* platform);
4994 static void ShutdownPlatform();
5006 WeakCallback weak_callback);
5008 static void Eternalize(
Isolate* isolate,
5042 bool HasCaught()
const;
5052 bool CanContinue()
const;
5066 bool HasTerminated()
const;
5119 void SetVerbose(
bool value);
5126 void SetCaptureMessage(
bool value);
5132 void*
operator new(
size_t size);
5133 void operator delete(
void*, size_t);
5139 void* message_script_;
5140 int message_start_pos_;
5141 int message_end_pos_;
5142 bool is_verbose_ : 1;
5143 bool can_continue_ : 1;
5144 bool capture_message_ : 1;
5146 bool has_terminated_ : 1;
5162 : name_count_(name_count), names_(names) { }
5164 const char**
begin()
const {
return &names_[0]; }
5165 const char**
end()
const {
return &names_[name_count_]; }
5168 const int name_count_;
5169 const char** names_;
5197 void DetachGlobal();
5230 void UseDefaultSecurityToken();
5275 V8_INLINE void* GetAlignedPointerFromEmbedderData(
int index);
5282 void SetAlignedPointerInEmbedderData(
int index,
void* value);
5297 void AllowCodeGenerationFromStrings(
bool allow);
5303 bool IsCodeGenerationFromStringsAllowed();
5334 void* SlowGetAlignedPointerFromEmbedderData(
int index);
5423 void Initialize(
Isolate* isolate);
5442 static bool IsLocked(
Isolate* isolate);
5447 static bool IsActive();
5450 void Initialize(
Isolate* isolate);
5456 static bool active_;
5460 void operator=(
const Locker&);
5467 namespace internal {
5484 template<
int kSmiShiftSize>
5487 intptr_t tagged_value =
5488 (
static_cast<intptr_t
>(value) << smi_shift_bits) |
kSmiTag;
5499 return static_cast<int>(
reinterpret_cast<intptr_t
>(value)) >> shift_bits;
5502 return internal::IntToSmi<kSmiShiftSize>(value);
5516 return static_cast<uintptr_t
>(value + 0x40000000
U) < 0x80000000U;
5527 return static_cast<int>(
reinterpret_cast<intptr_t
>(value) >> shift_bits);
5530 return internal::IntToSmi<kSmiShiftSize>(value);
5534 return (value == static_cast<int32_t>(value));
5597 #ifdef V8_ENABLE_CHECKS
5608 return PlatformSmiTagging::SmiToInt(value);
5616 return PlatformSmiTagging::IsValidSmi(value);
5637 return *addr &
static_cast<uint8_t
>(1
U <<
shift);
5641 bool value,
int shift) {
5643 uint8_t mask =
static_cast<uint8_t
>(1 <<
shift);
5644 *addr =
static_cast<uint8_t
>((*addr & ~mask) | (value << shift));
5661 uint8_t *addr =
reinterpret_cast<uint8_t *
>(isolate) +
5663 *
reinterpret_cast<void**
>(addr) = data;
5667 uint8_t* addr =
reinterpret_cast<uint8_t*
>(isolate) +
5669 return *
reinterpret_cast<void**
>(addr);
5679 uint8_t* addr =
reinterpret_cast<uint8_t*
>(ptr) + offset -
kHeapObjectTag;
5680 return *
reinterpret_cast<T*
>(addr);
5683 template <
typename T>
5687 O* ctx = *
reinterpret_cast<O**
>(context);
5688 int embedder_data_offset = I::kContextHeaderSize +
5690 O* embedder_data = I::ReadField<O*>(ctx, embedder_data_offset);
5693 return I::ReadField<T>(embedder_data, value_offset);
5714 return New(isolate, that.val_);
5719 return New(isolate, that.val_);
5728 reinterpret_cast<internal::Isolate*>(isolate), *p)));
5734 if (that ==
NULL)
return Local<T>();
5738 reinterpret_cast<internal::Isolate*>(isolate), *p)));
5746 V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle), &this->index_);
5752 return Local<T>(
reinterpret_cast<T*
>(*V8::GetEternal(isolate, index_)));
5760 return reinterpret_cast<T*
>(
5761 V8::GlobalizeReference(reinterpret_cast<internal::Isolate*>(isolate),
5766 template <
class T,
class M>
5767 template <
class S,
class M2>
5771 if (that.IsEmpty())
return;
5773 this->val_ =
reinterpret_cast<T*
>(V8::CopyPersistent(p));
5774 M::Copy(that,
this);
5781 if (this->IsEmpty())
return false;
5782 return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
5783 I::kNodeIsIndependentShift);
5790 if (this->IsEmpty())
return false;
5791 uint8_t node_state =
5792 I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_));
5793 return node_state == I::kNodeStateIsNearDeathValue ||
5794 node_state == I::kNodeStateIsPendingValue;
5801 if (this->IsEmpty())
return false;
5802 return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) ==
5803 I::kNodeStateIsWeakValue;
5809 if (this->IsEmpty())
return;
5810 V8::DisposeGlobal(reinterpret_cast<internal::Object**>(this->val_));
5820 if (other.IsEmpty())
return;
5821 this->val_ = New(isolate, other.val_);
5831 if (other.IsEmpty())
return;
5832 this->val_ = New(isolate, other.val_);
5837 template <
typename S,
typename P>
5843 V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_),
5845 reinterpret_cast<Callback>(callback));
5850 template <
typename P>
5854 SetWeak<T, P>(parameter, callback);
5859 template<
typename P>
5861 return reinterpret_cast<P*
>(
5862 V8::ClearWeak(reinterpret_cast<internal::Object**>(this->val_)));
5869 if (this->IsEmpty())
return;
5870 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
5872 I::kNodeIsIndependentShift);
5879 if (this->IsEmpty())
return;
5880 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
5882 I::kNodeIsPartiallyDependentShift);
5886 template <
class T,
class M>
5898 if (this->IsEmpty())
return;
5900 uint8_t* addr =
reinterpret_cast<uint8_t*
>(
obj) + I::kNodeClassIdOffset;
5901 *
reinterpret_cast<uint16_t*
>(addr) = class_id;
5908 if (this->IsEmpty())
return 0;
5910 uint8_t* addr =
reinterpret_cast<uint8_t*
>(
obj) + I::kNodeClassIdOffset;
5911 return *
reinterpret_cast<uint16_t*
>(addr);
5915 template<
typename T>
5918 template<
typename T>
5919 template<
typename S>
5923 *value_ = GetDefaultValue();
5929 template<
typename T>
5930 template<
typename S>
5934 *value_ = GetDefaultValue();
5940 template<
typename T>
5946 template<
typename T>
5957 template<
typename T>
5961 bool fits_into_int32_t = (i & (1
U << 31)) == 0;
5963 Set(static_cast<int32_t>(i));
5969 template<
typename T>
5975 root_index = I::kTrueValueRootIndex;
5977 root_index = I::kFalseValueRootIndex;
5979 *value_ = *I::GetRoot(GetIsolate(), root_index);
5982 template<
typename T>
5986 *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
5989 template<
typename T>
5993 *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
5996 template<
typename T>
6000 *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
6003 template<
typename T>
6006 return *
reinterpret_cast<Isolate**
>(&value_[-2]);
6009 template<
typename T>
6016 template<
typename T>
6020 bool is_construct_call)
6021 : implicit_args_(implicit_args),
6024 is_construct_call_(is_construct_call) { }
6027 template<
typename T>
6034 template<
typename T>
6037 &implicit_args_[kCalleeIndex]));
6041 template<
typename T>
6047 template<
typename T>
6050 &implicit_args_[kHolderIndex]));
6054 template<
typename T>
6060 template<
typename T>
6062 return *
reinterpret_cast<Isolate**
>(&implicit_args_[kIsolateIndex]);
6066 template<
typename T>
6072 template<
typename T>
6074 return is_construct_call_;
6078 template<
typename T>
6085 return resource_name_;
6090 return resource_line_offset_;
6095 return resource_column_offset_;
6099 return resource_is_shared_cross_origin_;
6105 : source_string(string),
6106 resource_name(origin.ResourceName()),
6107 resource_line_offset(origin.ResourceLineOffset()),
6108 resource_column_offset(origin.ResourceColumnOffset()),
6109 resource_is_shared_cross_origin(origin.ResourceIsSharedCrossOrigin()),
6110 cached_data(data) {}
6115 : source_string(string), cached_data(data) {}
6130 return value ?
True(isolate) :
False(isolate);
6140 #ifndef V8_ENABLE_CHECKS
6144 O*
obj = *
reinterpret_cast<O**
>(
this);
6147 if (I::GetInstanceType(obj) == I::kJSObjectType) {
6149 O* value = I::ReadField<O*>(
obj, offset);
6154 return SlowGetInternalField(index);
6159 #ifndef V8_ENABLE_CHECKS
6162 O*
obj = *
reinterpret_cast<O**
>(
this);
6165 if (
V8_LIKELY(I::GetInstanceType(obj) == I::kJSObjectType)) {
6167 return I::ReadField<void*>(
obj, offset);
6170 return SlowGetAlignedPointerFromInternalField(index);
6175 #ifdef V8_ENABLE_CHECKS
6178 return static_cast<String*
>(value);
6185 I::CheckInitialized(isolate);
6186 S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex);
6194 O*
obj = *
reinterpret_cast<O**
>(
const_cast<String*
>(
this));
6196 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
6197 void* value = I::ReadField<void*>(
obj, I::kStringResourceOffset);
6202 #ifdef V8_ENABLE_CHECKS
6203 VerifyExternalStringResource(result);
6213 O*
obj = *
reinterpret_cast<O**
>(
const_cast<String*
>(
this));
6214 int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
6217 if (type == I::kExternalAsciiRepresentationTag ||
6218 type == I::kExternalTwoByteRepresentationTag) {
6219 void* value = I::ReadField<void*>(
obj, I::kStringResourceOffset);
6222 #ifdef V8_ENABLE_CHECKS
6223 VerifyExternalStringResourceBase(resource, *encoding_out);
6230 #ifdef V8_ENABLE_CHECKS
6231 return FullIsUndefined();
6233 return QuickIsUndefined();
6237 bool Value::QuickIsUndefined()
const {
6240 O*
obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
6241 if (!I::HasHeapObjectTag(obj))
return false;
6242 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
6243 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
6248 #ifdef V8_ENABLE_CHECKS
6249 return FullIsNull();
6251 return QuickIsNull();
6255 bool Value::QuickIsNull()
const {
6258 O* obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
6259 if (!I::HasHeapObjectTag(obj))
return false;
6260 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
6261 return (I::GetOddballKind(obj) == I::kNullOddballKind);
6266 #ifdef V8_ENABLE_CHECKS
6267 return FullIsString();
6269 return QuickIsString();
6273 bool Value::QuickIsString()
const {
6276 O* obj = *
reinterpret_cast<O**
>(
const_cast<Value*
>(
this));
6277 if (!I::HasHeapObjectTag(obj))
return false;
6278 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
6283 return static_cast<Value*
>(value);
6288 #ifdef V8_ENABLE_CHECKS
6291 return static_cast<Symbol*
>(value);
6296 #ifdef V8_ENABLE_CHECKS
6299 return static_cast<Number*
>(value);
6304 #ifdef V8_ENABLE_CHECKS
6307 return static_cast<Integer*
>(value);
6312 #ifdef V8_ENABLE_CHECKS
6315 return static_cast<Date*
>(value);
6320 #ifdef V8_ENABLE_CHECKS
6328 #ifdef V8_ENABLE_CHECKS
6336 #ifdef V8_ENABLE_CHECKS
6344 #ifdef V8_ENABLE_CHECKS
6352 #ifdef V8_ENABLE_CHECKS
6355 return static_cast<RegExp*
>(value);
6360 #ifdef V8_ENABLE_CHECKS
6363 return static_cast<Object*
>(value);
6368 #ifdef V8_ENABLE_CHECKS
6371 return static_cast<Array*
>(value);
6376 #ifdef V8_ENABLE_CHECKS
6379 return static_cast<Promise*
>(value);
6384 #ifdef V8_ENABLE_CHECKS
6392 #ifdef V8_ENABLE_CHECKS
6400 #ifdef V8_ENABLE_CHECKS
6408 #ifdef V8_ENABLE_CHECKS
6416 #ifdef V8_ENABLE_CHECKS
6424 #ifdef V8_ENABLE_CHECKS
6432 #ifdef V8_ENABLE_CHECKS
6440 #ifdef V8_ENABLE_CHECKS
6448 #ifdef V8_ENABLE_CHECKS
6456 #ifdef V8_ENABLE_CHECKS
6464 #ifdef V8_ENABLE_CHECKS
6472 #ifdef V8_ENABLE_CHECKS
6480 #ifdef V8_ENABLE_CHECKS
6488 #ifdef V8_ENABLE_CHECKS
6491 return static_cast<DataView*
>(value);
6496 #ifdef V8_ENABLE_CHECKS
6499 return static_cast<Function*
>(value);
6504 #ifdef V8_ENABLE_CHECKS
6507 return static_cast<External*
>(value);
6511 template<
typename T>
6513 return *
reinterpret_cast<Isolate**
>(&args_[kIsolateIndex]);
6517 template<
typename T>
6523 template<
typename T>
6529 template<
typename T>
6535 template<
typename T>
6544 I::CheckInitialized(isolate);
6545 S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
6553 I::CheckInitialized(isolate);
6554 S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
6562 I::CheckInitialized(isolate);
6563 S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
6571 I::CheckInitialized(isolate);
6572 S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
6579 I::SetEmbedderData(
this, slot, data);
6585 return I::GetEmbedderData(
this, slot);
6591 return I::kNumIsolateDataSlots;
6595 template<
typename T>
6599 SetObjectGroupId(reinterpret_cast<v8::internal::Object**>(
object.val_),
id);
6603 template<
typename T>
6607 SetReferenceFromGroup(
id,
6608 reinterpret_cast<v8::internal::Object**>(
object.val_));
6612 template<
typename T,
typename S>
6617 SetReference(reinterpret_cast<v8::internal::Object**>(parent.val_),
6618 reinterpret_cast<v8::internal::Object**>(child.val_));
6623 #ifndef V8_ENABLE_CHECKS
6627 HO* context = *
reinterpret_cast<HO**
>(
this);
6632 return SlowGetEmbedderData(index);
6638 #ifndef V8_ENABLE_CHECKS
6640 return I::ReadEmbedderData<void*>(
this, index);
6642 return SlowGetAlignedPointerFromEmbedderData(index);
V8_INLINE UniquePersistent Pass()
static V8_INLINE bool CanCastToHeapObject(Message *o)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static V8_INLINE bool CanCastToHeapObject(StackFrame *o)
V8_INLINE Local< Value > GetEmbedderData(int index)
static V8_INLINE Local< T > New(Isolate *isolate, Handle< T > that)
static V8_INLINE bool CanCastToHeapObject(String *o)
static V8_INLINE Object * Cast(Value *obj)
static V8_INLINE Persistent< T > & Cast(Persistent< S > &that)
virtual ~ExternalStringResourceBase()
static V8_INLINE Uint8ClampedArray * Cast(Value *obj)
Persistent< T, CopyablePersistentTraits< T > > CopyablePersistent
V8_INLINE void SetWrapperClassId(uint16_t class_id)
const intptr_t kSmiTagMask
static V8_INLINE void Uncompilable()
void(* MemoryAllocationCallback)(ObjectSpace space, AllocationAction action, int size)
void set_max_young_space_size(int value)
static const int kExternalAsciiRepresentationTag
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
void(* Callback)(const WeakCallbackData< T, P > &data)
static V8_INLINE int SmiValue(internal::Object *value)
static V8_INLINE int SmiToInt(internal::Object *value)
static V8_INLINE int GetOddballKind(internal::Object *obj)
static internal::Object ** CreateHandle(internal::Isolate *isolate, internal::Object *value)
static V8_INLINE Int8Array * Cast(Value *obj)
static V8_INLINE Date * Cast(v8::Value *obj)
void(* CallCompletedCallback)()
V8_INLINE bool operator==(const PersistentBase< S > &that) const
V8_INLINE Persistent & operator=(const Persistent< S, M2 > &that)
static V8_INLINE ArrayBufferView * Cast(Value *obj)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
V8_INLINE Eternal(Isolate *isolate, Local< S > handle)
#define I(name, number_of_args, result_size)
V8_INLINE void SetUndefined()
static V8_INLINE Float32Array * Cast(Value *obj)
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
V8_INLINE UniquePersistent(RValue rvalue)
V8_INLINE Isolate * GetIsolate() const
bool HasOutOfMemoryException()
V8_INLINE void * GetAlignedPointerFromInternalField(int index)
virtual ~PersistentHandleVisitor()
static V8_INLINE Uint32Array * Cast(Value *obj)
static const int kOddballKindOffset
V8_INLINE Handle< Integer > ResourceLineOffset() const
virtual v8::Handle< v8::FunctionTemplate > GetNativeFunctionTemplate(v8::Isolate *isolate, v8::Handle< v8::String > name)
void SetObjectGroupId(const Persistent< T > &object, UniqueId id)
void V8_EXPORT RegisterExtension(Extension *extension)
static V8_INLINE uint8_t GetNodeState(internal::Object **obj)
V8_INLINE ReturnValue< T > GetReturnValue() const
bool operator!=(const UniqueId &other) const
const char ** begin() const
static const int kArgsLength
friend class PersistentBase
V8_INLINE ExternalStringResourceBase * GetExternalStringResourceBase(Encoding *encoding_out) const
static const int kFirstNonstringType
static const int kNullValueRootIndex
static const uint32_t kNumIsolateDataSlots
static V8_INLINE int SmiToInt(internal::Object *value)
static V8_INLINE Array * Cast(Value *obj)
static const int kHolderIndex
V8_INLINE Persistent & operator=(const Persistent &that)
V8_INLINE void * GetAlignedPointerFromEmbedderData(int index)
static V8_INLINE bool CanCastToHeapObject(Object *o)
V8_INLINE int Length() const
bool(* IndexedSecurityCallback)(Local< Object > host, uint32_t index, AccessType type, Local< Value > data)
bool InitializeICU(const char *icu_data_file)
kSerializedDataOffset Object
static V8_INLINE Float64Array * Cast(Value *obj)
static const bool kResetInDestructor
V8_INLINE PropertyCallbackInfo(internal::Object **args)
static V8_INLINE internal::Object ** GetRoot(v8::Isolate *isolate, int index)
V8_INLINE Local< Function > Callee() const
void(* MessageCallback)(Handle< Message > message, Handle< Value > error)
static V8_INLINE uint32_t GetNumberOfDataSlots()
friend Handle< Primitive > Undefined(Isolate *isolate)
virtual ~ExternalStringResource()
V8_INLINE Local< Object > Holder() const
ExternalAsciiStringResource()
V8_INLINE bool operator!=(const Handle< S > &that) const
int *(* CounterLookupCallback)(const char *name)
V8_INLINE Local< T > GetValue() const
static V8_INLINE bool HasHeapObjectTag(internal::Object *value)
V8_INLINE Local< T > Escape(Local< T > value)
static const int kLineOffsetNotFound
void(* IndexedPropertyDeleterCallback)(uint32_t index, const PropertyCallbackInfo< Boolean > &info)
V8_INLINE void Set(const Persistent< S > &handle)
void(* GCPrologueCallback)(GCType type, GCCallbackFlags flags)
V8_INLINE Persistent(const Persistent< S, M2 > &that)
static V8_INLINE Resolver * Cast(Value *obj)
bool operator==(const UniqueId &other) const
Persistent< T, NonCopyablePersistentTraits< T > > NonCopyablePersistent
V8_INLINE bool operator!=(const Persistent< S > &that) const
static const bool kResetInDestructor
BufferPolicy buffer_policy
void(* AccessorSetterCallback)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
V8_INLINE const CachedData * GetCachedData() const
internal::Object ** args_
V8_INLINE Handle< Value > ResourceName() const
static Local< Integer > New(Isolate *isolate, int32_t value)
V8_INLINE Local< Value > GetInternalField(int index)
static V8_INLINE bool IsValidSmi(intptr_t value)
void(* FatalErrorCallback)(const char *location, const char *message)
static V8_INLINE bool CanCastToHeapObject(Context *o)
static V8_INLINE T ReadEmbedderData(Context *context, int index)
const uint16_t * operator*() const
internal::Object ** values_
static const int kStringResourceOffset
int GetScriptColumnNumber(Handle< Script > script, int code_pos)
void(* IndexedPropertySetterCallback)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info)
V8_INLINE bool IsConstructCall() const
static V8_INLINE void Copy(const Persistent< S, M > &source, CopyablePersistent *dest)
static V8_INLINE Handle< T > New(Isolate *isolate, Handle< T > that)
void Set(Handle< String > name, Handle< Data > value, PropertyAttribute attributes=None)
static const int kJSObjectHeaderSize
V8_INLINE void Set(Isolate *isolate, Local< S > handle)
static V8_INLINE Function * Cast(Value *obj)
V8_INLINE Persistent(Isolate *isolate, const Persistent< S, M2 > &that)
void(* IndexedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing 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 statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage message
V8_INLINE bool operator==(const Handle< S > &that) const
static V8_INLINE Symbol * Cast(v8::Value *obj)
static const int kArgsLength
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing 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 statistics of the maximum memory committed for the heap in name
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
const intptr_t kHeapObjectTagMask
static const int kNodeStateIsNearDeathValue
V8_INLINE P * ClearWeak()
static V8_INLINE Number * Cast(v8::Value *obj)
V8_INLINE void MarkPartiallyDependent()
static V8_INLINE bool CanCastToHeapObject(StackTrace *o)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing 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 statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including flags
void(* FailedAccessCheckCallback)(Local< Object > target, AccessType type, Local< Value > data)
ExtensionConfiguration(int name_count, const char *names[])
V8_INLINE ~EscapableHandleScope()
static V8_INLINE SymbolObject * Cast(v8::Value *obj)
void(* LogEventCallback)(const char *name, int event)
size_t total_physical_size()
V8_INLINE Handle< Boolean > True(Isolate *isolate)
static V8_INLINE Int32Array * Cast(Value *obj)
static const int kDataIndex
V8_INLINE Local< Value > operator[](int i) const
void(* AccessorGetterCallback)(Local< String > property, const PropertyCallbackInfo< Value > &info)
V8_INLINE T * operator*() const
static V8_INLINE bool CanCastToHeapObject(void *o)
static const int kContextEmbedderDataIndex
void(* IndexedPropertyGetterCallback)(uint32_t index, const PropertyCallbackInfo< Value > &info)
V8_INLINE internal::Object * IntToSmi(int value)
void(* FunctionEntryHook)(uintptr_t function, uintptr_t return_addr_location)
V8_INLINE bool IsNull() const
HANDLE HANDLE LPSTACKFRAME64 StackFrame
static const int kNodeFlagsOffset
static const int kFixedArrayHeaderSize
static V8_INLINE void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
int max_old_space_size() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths true
void *(* CreateHistogramCallback)(const char *name, int min, int max, size_t buckets)
void(* NamedPropertyQueryCallback)(Local< String > property, const PropertyCallbackInfo< Integer > &info)
void set_max_old_space_size(int value)
V8_INLINE ReturnValue(const ReturnValue< S > &that)
static const int kNodeStateIsPendingValue
V8_INLINE Local< Value > Data() const
void(* NamedPropertySetterCallback)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)
ExternalAsciiStringResourceImpl()
V8_INLINE Isolate * GetIsolate() const
V8_INLINE Isolate * GetIsolate() const
static const int kReturnValueDefaultValueIndex
V8_INLINE bool IsWeak() const
virtual ~ExternalAsciiStringResource()
static const int kNodeStateIsWeakValue
static V8_INLINE bool IsExternalTwoByteString(int instance_type)
int max_young_space_size() const
V8_INLINE Isolate * GetIsolate() const
bool V8_EXPORT SetResourceConstraints(Isolate *isolate, ResourceConstraints *constraints)
friend Handle< Primitive > Null(Isolate *isolate)
static const int kReturnValueIndex
const char * operator*() const
static const int kMapInstanceTypeOffset
friend Handle< Boolean > True(Isolate *isolate)
bool(* AllowCodeGenerationFromStringsCallback)(Local< Context > context)
static V8_INLINE void CheckInitialized(v8::Isolate *isolate)
V8_INLINE bool IsIndependent() const
V8_INLINE Local< Object > Holder() const
static V8_INLINE bool IsValidSmi(intptr_t value)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array shift
static V8_INLINE Handle< T > New(Isolate *isolate, const PersistentBase< T > &that)
V8_INLINE ~UniquePersistent()
uintptr_t(* ReturnAddressLocationResolver)(uintptr_t return_addr_location)
V8_INLINE UniquePersistent(Isolate *isolate, const PersistentBase< S > &that)
const char * name() const
V8_INLINE void SetData(uint32_t slot, void *data)
V8_INLINE bool operator!=(const Handle< S > &that) const
static V8_INLINE Handle< T > Cast(Handle< S > that)
V8_INLINE UniquePersistent & operator=(UniquePersistent< S > rhs)
friend Handle< Boolean > False(Isolate *isolate)
V8_INLINE Unlocker(Isolate *isolate)
internal::Object ** implicit_args_
V8_INLINE ReturnValue< T > GetReturnValue() const
static V8_INLINE RegExp * Cast(v8::Value *obj)
static const int kReturnValueDefaultValueIndex
#define V8_UNLIKELY(condition)
ExternalStringResourceBase()
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
V8_INLINE Local< Object > This() const
void(* AddHistogramSampleCallback)(void *histogram, int sample)
void set_stack_limit(uint32_t *value)
static const int kUndefinedValueRootIndex
static V8_INLINE void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
static V8_INLINE T ReadField(Object *ptr, int offset)
static const int kOddballType
static V8_INLINE String * Cast(v8::Value *obj)
static V8_INLINE External * Cast(Value *obj)
static Local< Number > New(Isolate *isolate, double value)
uint32_t * stack_limit() const
V8_DEPRECATED("Use GetUnboundScript()->GetId()", Handle< Value > GetScriptName())
static V8_INLINE bool IsValidSmi(intptr_t value)
static V8_INLINE Integer * Cast(v8::Value *obj)
V8_INLINE bool IsUndefined() const
static const int kFalseValueRootIndex
V8_INLINE Handle< Primitive > Undefined(Isolate *isolate)
static V8_INLINE ArrayBuffer * Cast(Value *obj)
static V8_INLINE Local< T > Cast(Local< S > that)
V8_INLINE uint16_t WrapperClassId() const
void(* IndexedPropertyQueryCallback)(uint32_t index, const PropertyCallbackInfo< Integer > &info)
struct line_info_t line_info
V8_INLINE P * GetParameter() const
V8_INLINE ExternalStringResource * GetExternalStringResource() const
V8_INLINE Local(Local< S > that)
#define T(name, string, precedence)
static V8_INLINE internal::Object * IntToSmi(int value)
void(* NamedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)
static const int kEmptyStringRootIndex
V8_INLINE bool IsString() const
size_t ByteLength() const
void(* GCEpilogueCallback)(GCType type, GCCallbackFlags flags)
void SetReferenceFromGroup(UniqueId id, const Persistent< T > &child)
void(* JitCodeEventHandler)(const JitCodeEvent *event)
static V8_INLINE int GetInstanceType(internal::Object *obj)
int GetScriptLineNumber(Handle< Script > script, int code_pos)
static V8_INLINE void Copy(const Persistent< S, M > &source, NonCopyablePersistent *dest)
static const int kNodeIsIndependentShift
V8_INLINE bool operator!=(const PersistentBase< S > &that) const
static const int kIsolateIndex
int ToNumber(Register reg)
V8_INLINE Handle< Boolean > False(Isolate *isolate)
const int kApiPointerSize
int max_executable_size() const
V8_INLINE Handle< Integer > ResourceColumnOffset() const
static V8_INLINE uint8_t GetNodeFlag(internal::Object **obj, int shift)
V8_INLINE bool IsNearDeath() const
static const int kNodeIsPartiallyDependentShift
V8_INLINE Local< S > As()
void set_max_available_threads(int value)
void SetReference(const Persistent< T > &parent, const Persistent< S > &child)
static const int kHeapObjectMapOffset
V8_INLINE Local< Object > This() const
Handle< T > handle(T *t, Isolate *isolate)
V8_INLINE bool IsEmpty() const
static const int kCalleeIndex
V8_INLINE Persistent< S > & As()
V8_INLINE void ClearWeak()
const String::ExternalAsciiStringResource * source() const
V8_INLINE UniquePersistent(Isolate *isolate, Handle< S > that)
ExternalAsciiStringResourceImpl(const char *data, size_t length)
V8_INLINE bool IsEmpty() const
static V8_INLINE DataView * Cast(Value *obj)
static V8_INLINE internal::Object * IntToSmi(int value)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
static V8_INLINE Promise * Cast(Value *obj)
void(* NamedPropertyGetterCallback)(Local< String > property, const PropertyCallbackInfo< Value > &info)
static const int kIsolateIndex
V8_INLINE bool operator==(const Handle< S > &that) const
static V8_INLINE void UpdateNodeState(internal::Object **obj, uint8_t value)
Handle< Object > GetScriptNameOrSourceURL(Handle< Script > script)
V8_INLINE Local(Handle< S > that)
V8_INLINE void * GetData(uint32_t slot)
static const int kFullStringRepresentationMask
static const int kContextHeaderSize
virtual void VisitExternalString(Handle< String > string)
bool(* NamedSecurityCallback)(Local< Object > host, Local< Value > key, AccessType type, Local< Value > data)
ExternalAsciiStringResource ExternalOneByteStringResource
void(* InterruptCallback)(Isolate *isolate, void *data)
bool(* EntropySource)(unsigned char *buffer, size_t length)
static V8_INLINE NumberObject * Cast(v8::Value *obj)
V8_INLINE Isolate * GetIsolate()
void set_auto_enable(bool value)
virtual void VisitPersistentHandle(Persistent< Value > *value, uint16_t class_id)
static const int kThisIndex
DeclaredAccessorDescriptorDataType
IN DWORD64 OUT PDWORD64 OUT PIMAGEHLP_SYMBOL64 Symbol
static const int kUndefinedOddballKind
const int kHeapObjectTagSize
SmiTagging< kApiPointerSize > PlatformSmiTagging
static const int kNodeStateMask
static const int kStringEncodingMask
V8_INLINE void SetEmptyString()
static const int kHolderIndex
static V8_INLINE void UpdateNodeFlag(internal::Object **obj, bool value, int shift)
static V8_INLINE Uint16Array * Cast(Value *obj)
bool operator<(const UniqueId &other) const
V8_DEPRECATED("Use GetUnboundScript()->GetLineNumber()", int GetLineNumber(int code_pos))
V8_INLINE Handle< Boolean > ResourceIsSharedCrossOrigin() const
friend class MacroAssembler
V8_INLINE Source(Local< String > source_string, const ScriptOrigin &origin, CachedData *cached_data=NULL)
V8_INLINE Persistent(const Persistent &that)
V8_INLINE FunctionCallbackInfo(internal::Object **implicit_args, internal::Object **values, int length, bool is_construct_call)
static const int kExternalTwoByteRepresentationTag
static const int kTrueValueRootIndex
V8_INLINE Handle< S > As()
V8_INLINE bool operator==(const PersistentBase< S > &that) const
static V8_EXPORT void CheckInitializedImpl(v8::Isolate *isolate)
static V8_INLINE Uint8Array * Cast(Value *obj)
static V8_INLINE BooleanObject * Cast(v8::Value *obj)
const char ** end() const
int max_available_threads() const
static const int kForeignType
V8_INLINE T * operator->() const
static V8_INLINE TypedArray * Cast(Value *obj)
static V8_INLINE Value * Cast(T *value)
V8_INLINE ScriptOrigin(Handle< Value > resource_name, Handle< Integer > resource_line_offset=Handle< Integer >(), Handle< Integer > resource_column_offset=Handle< Integer >(), Handle< Boolean > resource_is_shared_cross_origin=Handle< Boolean >())
static const int kIsolateRootsOffset
V8_INLINE Scope(Handle< Context > context)
V8_INLINE Local< T > Get(Isolate *isolate)
V8_INLINE void SetWeak(P *parameter, typename WeakCallbackData< T, P >::Callback callback)
const char * data() const
size_t source_length() const
static V8_INLINE StringObject * Cast(v8::Value *obj)
static V8_INLINE internal::Object * IntToSmi(int value)
static V8_INLINE int InternalFieldCount(const PersistentBase< Object > &object)
V8_INLINE Local< Value > Data() const
static const int kReturnValueIndex
const char ** dependencies()
static const int kIsolateEmbedderDataOffset
V8_INLINE void MarkIndependent()
static const int kNullOddballKind
static const int kContextSaveIndex
V8_INLINE Locker(Isolate *isolate)
static V8_INLINE v8::Local< v8::String > Empty(Isolate *isolate)
void(* NamedPropertyDeleterCallback)(Local< String > property, const PropertyCallbackInfo< Boolean > &info)
V8_INLINE Handle< Primitive > Null(Isolate *isolate)
static V8_INLINE Int16Array * Cast(Value *obj)
static V8_INLINE void * GetEmbedderData(v8::Isolate *isolate, uint32_t slot)
#define V8_LIKELY(condition)
static const int kDataIndex
virtual ~ExternalResourceVisitor()
size_t total_heap_size_executable()
V8_INLINE Persistent(Isolate *isolate, Handle< S > that)
V8_INLINE T * ClearAndLeak()
static V8_INLINE Handle< Boolean > New(Isolate *isolate, bool value)
static const int kNodeClassIdOffset
const uint32_t kStringEncodingMask
V8_INLINE UniquePersistent()
static const int kJSObjectType
void set_max_executable_size(int value)
static Local< Integer > NewFromUnsigned(Isolate *isolate, uint32_t value)
static const int kForeignAddressOffset
static Local< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=kNormalString, int length=-1)
PositionType position_type
V8_INLINE Handle(Handle< S > that)