diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 12:50:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-22 20:03:06 +0100 |
commit | f87a203d89e1bbb6708282e0b64dbd13d59b723d (patch) | |
tree | d7658572059125113d4052a87e2e2c1251419c64 /include | |
parent | 0d5e116f6aee03185f237311a943491bb079a768 (diff) | |
download | android_external_v8-f87a203d89e1bbb6708282e0b64dbd13d59b723d.tar.gz android_external_v8-f87a203d89e1bbb6708282e0b64dbd13d59b723d.tar.bz2 android_external_v8-f87a203d89e1bbb6708282e0b64dbd13d59b723d.zip |
Update V8 to r5675 as required by WebKit r70209
Change-Id: Ib10adb470d41ca8c109ead5fc893b880e18d489f
Diffstat (limited to 'include')
-rwxr-xr-x[-rw-r--r--] | include/v8-debug.h | 5 | ||||
-rw-r--r-- | include/v8-profiler.h | 4 | ||||
-rw-r--r-- | include/v8.h | 65 |
3 files changed, 71 insertions, 3 deletions
diff --git a/include/v8-debug.h b/include/v8-debug.h index 414fd862..4314727a 100644..100755 --- a/include/v8-debug.h +++ b/include/v8-debug.h @@ -253,9 +253,12 @@ class EXPORT Debug { static bool SetDebugEventListener(v8::Handle<v8::Object> that, Handle<Value> data = Handle<Value>()); - // Break execution of JavaScript. + // Schedule a debugger break to happen when JavaScript code is run. static void DebugBreak(); + // Remove scheduled debugger break if it has not happened yet. + static void CancelDebugBreak(); + // Break execution of JavaScript (this method can be invoked from a // non-VM thread) for further client command execution on a VM // thread. Client data is then passed in EventDetails to diff --git a/include/v8-profiler.h b/include/v8-profiler.h index 27da4182..fb492d95 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -245,7 +245,9 @@ class V8EXPORT HeapGraphNode { kString = 2, // A string. kObject = 3, // A JS object (except for arrays and strings). kCode = 4, // Compiled code. - kClosure = 5 // Function closure. + kClosure = 5, // Function closure. + kRegExp = 6, // RegExp. + kHeapNumber = 7 // Number stored in the heap. }; /** Returns node type (see HeapGraphNode::Type). */ diff --git a/include/v8.h b/include/v8.h index 0613d586..ef9a4116 100644 --- a/include/v8.h +++ b/include/v8.h @@ -758,8 +758,9 @@ class V8EXPORT StackTrace { kFunctionName = 1 << 3, kIsEval = 1 << 4, kIsConstructor = 1 << 5, + kScriptNameOrSourceURL = 1 << 6, kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName, - kDetailed = kOverview | kIsEval | kIsConstructor + kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL }; /** @@ -819,6 +820,13 @@ class V8EXPORT StackFrame { Local<String> GetScriptName() const; /** + * Returns the name of the resource that contains the script for the + * function for this StackFrame or sourceURL value if the script name + * is undefined and its source ends with //@ sourceURL=... string. + */ + Local<String> GetScriptNameOrSourceURL() const; + + /** * Returns the name of the function associated with this stack frame. */ Local<String> GetFunctionName() const; @@ -1359,6 +1367,53 @@ class Date : public Value { }; +/** + * An instance of the built-in RegExp constructor (ECMA-262, 15.10). + */ +class RegExp : public Value { + public: + /** + * Regular expression flag bits. They can be or'ed to enable a set + * of flags. + */ + enum Flags { + kNone = 0, + kGlobal = 1, + kIgnoreCase = 2, + kMultiline = 4 + }; + + /** + * Creates a regular expression from the given pattern string and + * the flags bit field. May throw a JavaScript exception as + * described in ECMA-262, 15.10.4.1. + * + * For example, + * RegExp::New(v8::String::New("foo"), + * static_cast<RegExp::Flags>(kGlobal | kMultiline)) + * is equivalent to evaluating "/foo/gm". + */ + V8EXPORT static Local<RegExp> New(Handle<String> pattern, + Flags flags); + + /** + * Returns the value of the source property: a string representing + * the regular expression. + */ + V8EXPORT Local<String> GetSource() const; + + /** + * Returns the flags bit field. + */ + V8EXPORT Flags GetFlags() const; + + static inline RegExp* Cast(v8::Value* obj); + + private: + V8EXPORT static void CheckCast(v8::Value* obj); +}; + + enum PropertyAttribute { None = 0, ReadOnly = 1 << 0, @@ -3617,6 +3672,14 @@ Date* Date::Cast(v8::Value* value) { } +RegExp* RegExp::Cast(v8::Value* value) { +#ifdef V8_ENABLE_CHECKS + CheckCast(value); +#endif + return static_cast<RegExp*>(value); +} + + Object* Object::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); |