Added experimental API support for allocating V8 symbols as external strings.
Fixed bugs in debugging support on ARM.
Changed eval implementation to correctly detect whether or not a call to eval is aliased.
Fixed bug caused by a combination of the compilation cache and dictionary probing in native code. The bug caused us to sometimes call functions that had not yet been compiled.
Added platform support for FreeBSD.
Added support for building V8 on Windows with either the shared or static version of MSVCRT
Added the v8::jscre namespace around the jscre functions to avoid link errors (duplicate symbols) when building Google Chrome.
Added support for calling a JavaScript function with the current debugger execution context as its argument to the debugger interface.
Changed the type of names of counters from wchar_t to char.
Changed the Windows system call used to compute daylight savings time. The system call that we used to use became four times slower on WinXP SP3.
Added support in the d8 developer shell for memory-mapped counters and added a stats-viewer tool.
Fixed bug in upper/lower case mappings (issue 149).
git-svn-id: http://v8.googlecode.com/svn/trunk@911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/include/v8.h b/include/v8.h
index c99dc5a..accffc0 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1811,9 +1811,9 @@
};
-// --- C o u n t e r s C a l l b a c k s
+// --- C o u n t e r s C a l l b a c k s ---
-typedef int* (*CounterLookupCallback)(const wchar_t* name);
+typedef int* (*CounterLookupCallback)(const char* name);
// --- F a i l e d A c c e s s C h e c k C a l l b a c k ---
typedef void (*FailedAccessCheckCallback)(Local<Object> target,
@@ -1832,7 +1832,24 @@
typedef void (*GCCallback)();
-// --- C o n t e x t G e n e r a t o r
+// --- E x t e r n a l S y m b o l C a l l b a c k ---
+
+/**
+ * Callback used to allocate certain V8 symbols as external strings.
+ *
+ * The data passed to the callback is utf8 encoded.
+ *
+ * Allocations are not allowed in the callback function, you therefore
+ * cannot manipulate objects (set or delete properties for example)
+ * since it is possible such operations will result in the allocation
+ * of objects.
+ */
+typedef String::ExternalStringResource* (*ExternalSymbolCallback)(
+ const char* utf8,
+ size_t length);
+
+
+// --- C o n t e x t G e n e r a t o r ---
/**
* Applications must provide a callback function which is called to generate
@@ -1932,6 +1949,20 @@
static void SetGlobalGCEpilogueCallback(GCCallback);
/**
+ * Applications can register a callback that will be used when
+ * allocating most of the V8 symbols. The callback must return an
+ * external string resource that represents the symbols.
+ *
+ * Most often when performing a property lookup the key will be a
+ * symbol. Allocating symbols as external strings can reduce the
+ * amount of string conversions needed when using interceptors and
+ * accessors.
+ *
+ * \note This is an experimental feature and it might be removed.
+ */
+ static void SetExternalSymbolCallback(ExternalSymbolCallback);
+
+ /**
* Allows the host application to group objects together. If one
* object in the group is alive, all objects in the group are alive.
* After each garbage collection, object groups are removed. It is