Fixed two crash-bugs in irregexp (issue 231 and 233).
Fixed a number of minor bugs (issue 87, 227 and 228).
Added support for morphing strings to external strings on demand to avoid having to create copies in the embedding code.
Removed experimental support for external symbol callbacks.
git-svn-id: http://v8.googlecode.com/svn/trunk@1266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/include/v8.h b/include/v8.h
index c9ec030..a048acd 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -834,6 +834,16 @@
* external string resource.
*/
static Local<String> NewExternal(ExternalStringResource* resource);
+
+ /**
+ * Associate an external string resource with this string by transforming it
+ * in place so that existing references to this string in the JavaScript heap
+ * will use the external string resource. The external string resource's
+ * character contents needs to be equivalent to this string.
+ * Returns true if the string has been changed to be an external string.
+ * The string is not modified if the operation fails.
+ */
+ bool MakeExternal(ExternalStringResource* resource);
/**
* Creates a new external string using the ascii data defined in the given
@@ -844,6 +854,16 @@
* external string resource.
*/
static Local<String> NewExternal(ExternalAsciiStringResource* resource);
+
+ /**
+ * Associate an external string resource with this string by transforming it
+ * in place so that existing references to this string in the JavaScript heap
+ * will use the external string resource. The external string resource's
+ * character contents needs to be equivalent to this string.
+ * Returns true if the string has been changed to be an external string.
+ * The string is not modified if the operation fails.
+ */
+ bool MakeExternal(ExternalAsciiStringResource* resource);
/** Creates an undetectable string from the supplied ascii or utf-8 data.*/
static Local<String> NewUndetectable(const char* data, int length = -1);
@@ -1808,23 +1828,6 @@
typedef void (*GCCallback)();
-// --- 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 ---
/**
@@ -1925,20 +1928,6 @@
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