v8-debug.h | v8-debug.h | |||
---|---|---|---|---|
skipping to change at line 338 | skipping to change at line 338 | |||
* supplied TCP/IP port for remote debugger connection. | * supplied TCP/IP port for remote debugger connection. | |||
* \param name the name of the embedding application | * \param name the name of the embedding application | |||
* \param port the TCP/IP port to listen on | * \param port the TCP/IP port to listen on | |||
* \param wait_for_connection whether V8 should pause on a first statement | * \param wait_for_connection whether V8 should pause on a first statement | |||
* allowing remote debugger to connect before anything interesting happe ned | * allowing remote debugger to connect before anything interesting happe ned | |||
*/ | */ | |||
static bool EnableAgent(const char* name, int port, | static bool EnableAgent(const char* name, int port, | |||
bool wait_for_connection = false); | bool wait_for_connection = false); | |||
/** | /** | |||
* Disable the V8 builtin debug agent. The TCP/IP connection will be clo | ||||
sed. | ||||
*/ | ||||
static void DisableAgent(); | ||||
/** | ||||
* Makes V8 process all pending debug messages. | * Makes V8 process all pending debug messages. | |||
* | * | |||
* From V8 point of view all debug messages come asynchronously (e.g. fro m | * From V8 point of view all debug messages come asynchronously (e.g. fro m | |||
* remote debugger) but they all must be handled synchronously: V8 cannot | * remote debugger) but they all must be handled synchronously: V8 cannot | |||
* do 2 things at one time so normal script execution must be interrupted | * do 2 things at one time so normal script execution must be interrupted | |||
* for a while. | * for a while. | |||
* | * | |||
* Generally when message arrives V8 may be in one of 3 states: | * Generally when message arrives V8 may be in one of 3 states: | |||
* 1. V8 is running script; V8 will automatically interrupt and process a ll | * 1. V8 is running script; V8 will automatically interrupt and process a ll | |||
* pending messages (however auto_break flag should be enabled); | * pending messages (however auto_break flag should be enabled); | |||
End of changes. 1 change blocks. | ||||
6 lines changed or deleted | 0 lines changed or added | |||
v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 1155 | skipping to change at line 1155 | |||
/** | /** | |||
* Get the ExternalStringResource for an external string. Returns | * Get the ExternalStringResource for an external string. Returns | |||
* NULL if IsExternal() doesn't return true. | * NULL if IsExternal() doesn't return true. | |||
*/ | */ | |||
inline ExternalStringResource* GetExternalStringResource() const; | inline ExternalStringResource* GetExternalStringResource() const; | |||
/** | /** | |||
* Get the ExternalAsciiStringResource for an external ASCII string. | * Get the ExternalAsciiStringResource for an external ASCII string. | |||
* Returns NULL if IsExternalAscii() doesn't return true. | * Returns NULL if IsExternalAscii() doesn't return true. | |||
*/ | */ | |||
V8EXPORT const ExternalAsciiStringResource* GetExternalAsciiStringResourc | V8EXPORT ExternalAsciiStringResource* GetExternalAsciiStringResource() co | |||
e() | nst; | |||
const; | ||||
static inline String* Cast(v8::Value* obj); | static inline String* Cast(v8::Value* obj); | |||
/** | /** | |||
* Allocates a new string from either UTF-8 encoded or ASCII data. | * Allocates a new string from either UTF-8 encoded or ASCII data. | |||
* The second parameter 'length' gives the buffer length. | * The second parameter 'length' gives the buffer length. | |||
* If the data is UTF-8 encoded, the caller must | * If the data is UTF-8 encoded, the caller must | |||
* be careful to supply the length parameter. | * be careful to supply the length parameter. | |||
* If it is not given, the function calls | * If it is not given, the function calls | |||
* 'strlen' to determine the buffer length, it might be | * 'strlen' to determine the buffer length, it might be | |||
skipping to change at line 2401 | skipping to change at line 2400 | |||
public: | public: | |||
static Local<TypeSwitch> New(Handle<FunctionTemplate> type); | static Local<TypeSwitch> New(Handle<FunctionTemplate> type); | |||
static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]); | static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]); | |||
int match(Handle<Value> value); | int match(Handle<Value> value); | |||
private: | private: | |||
TypeSwitch(); | TypeSwitch(); | |||
}; | }; | |||
// --- Extensions --- | // --- Extensions --- | |||
class V8EXPORT ExternalAsciiStringResourceImpl | ||||
: public String::ExternalAsciiStringResource { | ||||
public: | ||||
ExternalAsciiStringResourceImpl() : data_(0), length_(0) {} | ||||
ExternalAsciiStringResourceImpl(const char* data, size_t length) | ||||
: data_(data), length_(length) {} | ||||
const char* data() const { return data_; } | ||||
size_t length() const { return length_; } | ||||
private: | ||||
const char* data_; | ||||
size_t length_; | ||||
}; | ||||
/** | /** | |||
* Ignore | * Ignore | |||
*/ | */ | |||
class V8EXPORT Extension { // NOLINT | class V8EXPORT Extension { // NOLINT | |||
public: | public: | |||
// Note that the strings passed into this constructor must live as long | ||||
// as the Extension itself. | ||||
Extension(const char* name, | Extension(const char* name, | |||
const char* source = 0, | const char* source = 0, | |||
int dep_count = 0, | int dep_count = 0, | |||
const char** deps = 0, | const char** deps = 0); | |||
int source_length = -1); | ||||
virtual ~Extension() { } | virtual ~Extension() { } | |||
virtual v8::Handle<v8::FunctionTemplate> | virtual v8::Handle<v8::FunctionTemplate> | |||
GetNativeFunction(v8::Handle<v8::String> name) { | GetNativeFunction(v8::Handle<v8::String> name) { | |||
return v8::Handle<v8::FunctionTemplate>(); | return v8::Handle<v8::FunctionTemplate>(); | |||
} | } | |||
const char* name() const { return name_; } | const char* name() { return name_; } | |||
size_t source_length() const { return source_length_; } | const char* source() { return source_; } | |||
const String::ExternalAsciiStringResource* source() const { | ||||
return &source_; } | ||||
int dependency_count() { return dep_count_; } | int dependency_count() { return dep_count_; } | |||
const char** dependencies() { return deps_; } | const char** dependencies() { return deps_; } | |||
void set_auto_enable(bool value) { auto_enable_ = value; } | void set_auto_enable(bool value) { auto_enable_ = value; } | |||
bool auto_enable() { return auto_enable_; } | bool auto_enable() { return auto_enable_; } | |||
private: | private: | |||
const char* name_; | const char* name_; | |||
size_t source_length_; // expected to initialize before source_ | const char* source_; | |||
ExternalAsciiStringResourceImpl source_; | ||||
int dep_count_; | int dep_count_; | |||
const char** deps_; | const char** deps_; | |||
bool auto_enable_; | bool auto_enable_; | |||
// Disallow copying and assigning. | // Disallow copying and assigning. | |||
Extension(const Extension&); | Extension(const Extension&); | |||
void operator=(const Extension&); | void operator=(const Extension&); | |||
}; | }; | |||
void V8EXPORT RegisterExtension(Extension* extension); | void V8EXPORT RegisterExtension(Extension* extension); | |||
skipping to change at line 3446 | skipping to change at line 3425 | |||
* Multiple threads in V8 are allowed, but only one thread at a time | * Multiple threads in V8 are allowed, but only one thread at a time | |||
* is allowed to use any given V8 isolate. See Isolate class | * is allowed to use any given V8 isolate. See Isolate class | |||
* comments. The definition of 'using V8 isolate' includes | * comments. The definition of 'using V8 isolate' includes | |||
* accessing handles or holding onto object pointers obtained | * accessing handles or holding onto object pointers obtained | |||
* from V8 handles while in the particular V8 isolate. It is up | * from V8 handles while in the particular V8 isolate. It is up | |||
* to the user of V8 to ensure (perhaps with locking) that this | * to the user of V8 to ensure (perhaps with locking) that this | |||
* constraint is not violated. | * constraint is not violated. | |||
* | * | |||
* v8::Locker is a scoped lock object. While it's | * v8::Locker is a scoped lock object. While it's | |||
* active (i.e. between its construction and destruction) the current threa d is | * active (i.e. between its construction and destruction) the current threa d is | |||
* allowed to use the locked isolate. V8 guarantees that an isolate can be | * allowed to use the locked isolate. V8 guarantees that an isolate can be | |||
* locked by at most one thread at any time. In other words, the scope of a | locked | |||
* v8::Locker is a critical section. | * by at most one thread at any time. In other words, the scope of a v8::Lo | |||
cker is | ||||
* a critical section. | ||||
* | * | |||
* Sample usage: | * Sample usage: | |||
* \code | * \code | |||
* ... | * ... | |||
* { | * { | |||
* v8::Locker locker(isolate); | * v8::Locker locker(isolate); | |||
* v8::Isolate::Scope isolate_scope(isolate); | * v8::Isolate::Scope isolate_scope(isolate); | |||
* ... | * ... | |||
* // Code using V8 and isolate goes here. | * // Code using V8 and isolate goes here. | |||
* ... | * ... | |||
skipping to change at line 3549 | skipping to change at line 3528 | |||
* for the V8 lock. | * for the V8 lock. | |||
*/ | */ | |||
static void StartPreemption(int every_n_ms); | static void StartPreemption(int every_n_ms); | |||
/** | /** | |||
* Stop preemption. | * Stop preemption. | |||
*/ | */ | |||
static void StopPreemption(); | static void StopPreemption(); | |||
/** | /** | |||
* Returns whether or not the locker for a given isolate, or default isol | * Returns whether or not the locker for a given isolate, or default isol | |||
ate | ate if NULL is given, | |||
* if NULL is given, is locked by the current thread. | * is locked by the current thread. | |||
*/ | */ | |||
static bool IsLocked(Isolate* isolate = NULL); | static bool IsLocked(Isolate* isolate = NULL); | |||
/** | /** | |||
* Returns whether v8::Locker is being used by this V8 instance. | * Returns whether v8::Locker is being used by this V8 instance. | |||
*/ | */ | |||
static bool IsActive(); | static bool IsActive(); | |||
private: | private: | |||
bool has_lock_; | bool has_lock_; | |||
skipping to change at line 3712 | skipping to change at line 3691 | |||
static const int kHeapObjectMapOffset = 0; | static const int kHeapObjectMapOffset = 0; | |||
static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze; | static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSi ze; | |||
static const int kStringResourceOffset = | static const int kStringResourceOffset = | |||
InternalConstants<kApiPointerSize>::kStringResourceOffset; | InternalConstants<kApiPointerSize>::kStringResourceOffset; | |||
static const int kForeignAddressOffset = kApiPointerSize; | static const int kForeignAddressOffset = kApiPointerSize; | |||
static const int kJSObjectHeaderSize = 3 * kApiPointerSize; | static const int kJSObjectHeaderSize = 3 * kApiPointerSize; | |||
static const int kFullStringRepresentationMask = 0x07; | static const int kFullStringRepresentationMask = 0x07; | |||
static const int kExternalTwoByteRepresentationTag = 0x02; | static const int kExternalTwoByteRepresentationTag = 0x02; | |||
static const int kJSObjectType = 0xa6; | static const int kJSObjectType = 0xa3; | |||
static const int kFirstNonstringType = 0x80; | static const int kFirstNonstringType = 0x80; | |||
static const int kForeignType = 0x85; | static const int kForeignType = 0x85; | |||
static inline bool HasHeapObjectTag(internal::Object* value) { | static inline bool HasHeapObjectTag(internal::Object* value) { | |||
return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == | return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == | |||
kHeapObjectTag); | kHeapObjectTag); | |||
} | } | |||
static inline bool HasSmiTag(internal::Object* value) { | static inline bool HasSmiTag(internal::Object* value) { | |||
return ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag); | return ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag); | |||
End of changes. 9 change blocks. | ||||
34 lines changed or deleted | 15 lines changed or added | |||