Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: include/v8.h

Issue 90643003: Experimental implementation: Exposing SIMD instructions into JavaScript Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index a15edf2df4caf4c6550180170c3d178ae7c93edc..812edd71da53b26ad8496dbb2aebbc99bfd27fab 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1469,6 +1469,18 @@ class V8_EXPORT Value : public Data {
bool IsFloat32Array() const;
/**
+ * Returns true if this value is a Float32x4Array.
+ * This is an experimental feature.
+ */
+ bool IsFloat32x4Array() const;
+
+ /**
+ * Returns true if this value is a Int32x4Array.
+ * This is an experimental feature.
+ */
+ bool IsInt32x4Array() const;
+
+ /**
* Returns true if this value is a Float64Array.
* This is an experimental feature.
*/
@@ -2048,6 +2060,8 @@ enum ExternalArrayType {
kExternalIntArray,
kExternalUnsignedIntArray,
kExternalFloatArray,
+ kExternalFloat32x4Array,
+ kExternalInt32x4Array,
kExternalDoubleArray,
kExternalPixelArray
};
@@ -2886,6 +2900,30 @@ class V8_EXPORT Float32Array : public TypedArray {
};
+class V8_EXPORT Float32x4Array : public TypedArray {
+ public:
+ static Local<Float32x4Array> New(Handle<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ V8_INLINE static Float32x4Array* Cast(Value* obj);
+
+ private:
+ Float32x4Array();
+ static void CheckCast(Value* obj);
+};
+
+
+class V8_EXPORT Int32x4Array : public TypedArray {
+ public:
+ static Local<Int32x4Array> New(Handle<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ V8_INLINE static Int32x4Array* Cast(Value* obj);
+
+ private:
+ Int32x4Array();
+ static void CheckCast(Value* obj);
+};
+
+
/**
* An instance of Float64Array constructor (ES6 draft 15.13.6).
* This API is experimental and may change significantly.
@@ -5522,7 +5560,7 @@ class Internals {
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
static const int kContextHeaderSize = 2 * kApiPointerSize;
- static const int kContextEmbedderDataIndex = 65;
+ static const int kContextEmbedderDataIndex = 71;
static const int kFullStringRepresentationMask = 0x07;
static const int kStringEncodingMask = 0x4;
static const int kExternalTwoByteRepresentationTag = 0x02;
@@ -5534,7 +5572,7 @@ class Internals {
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
- static const int kEmptyStringRootIndex = 134;
+ static const int kEmptyStringRootIndex = 140;
static const int kNodeClassIdOffset = 1 * kApiPointerSize;
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
@@ -5545,10 +5583,10 @@ class Internals {
static const int kNodeIsIndependentShift = 4;
static const int kNodeIsPartiallyDependentShift = 5;
- static const int kJSObjectType = 0xb2;
+ static const int kJSObjectType = 0xb6;
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
- static const int kForeignType = 0x87;
+ static const int kForeignType = 0x89;
static const int kUndefinedOddballKind = 5;
static const int kNullOddballKind = 3;
@@ -6455,6 +6493,22 @@ Float32Array* Float32Array::Cast(v8::Value* value) {
}
+Float32x4Array* Float32x4Array::Cast(v8::Value* value) {
+#ifdef V8_ENABLE_CHECKS
+ CheckCast(value);
+#endif
+ return static_cast<Float32x4Array*>(value);
+}
+
+
+Int32x4Array* Int32x4Array::Cast(v8::Value* value) {
+#ifdef V8_ENABLE_CHECKS
+ CheckCast(value);
+#endif
+ return static_cast<Int32x4Array*>(value);
+}
+
+
Float64Array* Float64Array::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
CheckCast(value);
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698