Version 3.14.0
Fixed missing slot recording during clearing of CallICs. (Chromium issue 144230)
Fixed LBoundsCheck on x64 to handle (stack slot + constant) correctly. (Chromium issue 150729)
Fixed minus zero test. (Issue 2133)
Fixed setting array length to zero for slow elements. (Chromium issue 146910)
Fixed lost arguments dropping in HLeaveInlined. (Chromium issue 150545)
Fixed casting error for receiver of interceptors. (Chromium issue 149912)
Fixed lost arguments dropping in HLeaveInlined. (Chromium issue 150545)
Fixed casting error for receiver of interceptors. (Chromium issue 149912)
Throw a more descriptive exception when blocking 'eval' via CSP. (Chromium issue 140191)
Fixed debugger's eval when close to stack overflow. (issue 2318)
Added checks to live edit. (issue 2297)
Switched on code compaction on incremental GCs.
Fixed caching of optimized code for OSR. (issue 2326)
Not mask exception thrown by toString in String::UtfValue etc. (issue 2317)
Fixed API check for length of external arrays. (Chromium issue 148896)
Ensure correct enumeration indices in the dict (Chromium issue 148376)
Correctly initialize regexp global cache. (Chromium issue 148378)
Fixed arguments object materialization during deopt. (issue 2261)
Introduced new API to expose external string resource regardless of encoding.
Fixed CHECK failure in LCodeGen::DoWrapReceiver when --deopt-every-n-times flag is present (Chromium issue 148389)
Fixed edge case of extension with NULL as source string. (Chromium issue 144649)
Fixed array index dehoisting. (Chromium issue 141395)
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@12566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/include/v8.h b/include/v8.h
index ddde388..92d928b 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1018,6 +1018,11 @@
*/
class String : public Primitive {
public:
+ enum Encoding {
+ UNKNOWN_ENCODING = 0x1,
+ TWO_BYTE_ENCODING = 0x0,
+ ASCII_ENCODING = 0x4
+ };
/**
* Returns the number of characters in this string.
*/
@@ -1181,6 +1186,14 @@
};
/**
+ * If the string is an external string, return the ExternalStringResourceBase
+ * regardless of the encoding, otherwise return NULL. The encoding of the
+ * string is returned in encoding_out.
+ */
+ inline ExternalStringResourceBase* GetExternalStringResourceBase(
+ Encoding* encoding_out) const;
+
+ /**
* Get the ExternalStringResource for an external string. Returns
* NULL if IsExternal() doesn't return true.
*/
@@ -1343,6 +1356,8 @@
};
private:
+ V8EXPORT void VerifyExternalStringResourceBase(ExternalStringResourceBase* v,
+ Encoding encoding) const;
V8EXPORT void VerifyExternalStringResource(ExternalStringResource* val) const;
V8EXPORT static void CheckCast(v8::Value* obj);
};
@@ -3703,7 +3718,7 @@
* with the debugger to provide additional information on the context through
* the debugger API.
*/
- void SetData(Handle<String> data);
+ void SetData(Handle<Value> data);
Local<Value> GetData();
/**
@@ -3728,6 +3743,13 @@
bool IsCodeGenerationFromStringsAllowed();
/**
+ * Sets the error description for the exception that is thrown when
+ * code generation from strings is not allowed and 'eval' or the 'Function'
+ * constructor are called.
+ */
+ void SetErrorMessageForCodeGenerationFromStrings(Handle<String> message);
+
+ /**
* Stack-allocated class which sets the execution context for all
* operations executed within a local scope.
*/
@@ -4033,7 +4055,9 @@
static const int kForeignAddressOffset = kApiPointerSize;
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFullStringRepresentationMask = 0x07;
+ static const int kStringEncodingMask = 0x4;
static const int kExternalTwoByteRepresentationTag = 0x02;
+ static const int kExternalAsciiRepresentationTag = 0x06;
static const int kIsolateStateOffset = 0;
static const int kIsolateEmbedderDataOffset = 1 * kApiPointerSize;
@@ -4388,6 +4412,26 @@
}
+String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
+ String::Encoding* encoding_out) const {
+ typedef internal::Object O;
+ typedef internal::Internals I;
+ O* obj = *reinterpret_cast<O**>(const_cast<String*>(this));
+ int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
+ *encoding_out = static_cast<Encoding>(type & I::kStringEncodingMask);
+ ExternalStringResourceBase* resource = NULL;
+ if (type == I::kExternalAsciiRepresentationTag ||
+ type == I::kExternalTwoByteRepresentationTag) {
+ void* value = I::ReadField<void*>(obj, I::kStringResourceOffset);
+ resource = static_cast<ExternalStringResourceBase*>(value);
+ }
+#ifdef V8_ENABLE_CHECKS
+ VerifyExternalStringResourceBase(resource, *encoding_out);
+#endif
+ return resource;
+}
+
+
bool Value::IsUndefined() const {
#ifdef V8_ENABLE_CHECKS
return FullIsUndefined();