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

Unified Diff: src/mirror-debugger.js

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months 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
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index dbdc68e68f88e282a88737c26dd68ea6d631ce06..a7742a983e21ada091c93ab50ee6cfed862468f1 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -66,6 +66,8 @@ function MakeMirror(value, opt_transient) {
mirror = new BooleanMirror(value);
} else if (IS_NUMBER(value)) {
mirror = new NumberMirror(value);
+ } else if (IS_FLOAT32X4(value)) {
+ mirror = new Float32x4Mirror(value);
} else if (IS_STRING(value)) {
mirror = new StringMirror(value);
} else if (IS_SYMBOL(value)) {
@@ -151,6 +153,7 @@ var UNDEFINED_TYPE = 'undefined';
var NULL_TYPE = 'null';
var BOOLEAN_TYPE = 'boolean';
var NUMBER_TYPE = 'number';
+var FLOAT32X4_TYPE = 'float32x4';
var STRING_TYPE = 'string';
var SYMBOL_TYPE = 'symbol';
var OBJECT_TYPE = 'object';
@@ -211,6 +214,7 @@ var ScopeType = { Global: 0,
// - UndefinedMirror
// - NullMirror
// - NumberMirror
+// - Float32x4Mirror
// - StringMirror
// - SymbolMirror
// - ObjectMirror
@@ -292,6 +296,15 @@ Mirror.prototype.isNumber = function() {
/**
+ * Check whether the mirror reflects a Float32x4 value.
+ * @returns {boolean} True if the mirror reflects a Float32x4 value
+ */
+Mirror.prototype.isFloat32x4 = function() {
+ return this instanceof Float32x4Mirror;
+};
+
+
+/**
* Check whether the mirror reflects a string value.
* @returns {boolean} True if the mirror reflects a string value
*/
@@ -530,6 +543,7 @@ ValueMirror.prototype.isPrimitive = function() {
type === 'null' ||
type === 'boolean' ||
type === 'number' ||
+ type === 'float32x4' ||
type === 'string' ||
type === 'symbol';
};
@@ -611,6 +625,23 @@ NumberMirror.prototype.toText = function() {
/**
+ * Mirror object for Float32x4 values.
+ * @param {Float32x4} value The float32x4 value reflected by this mirror
+ * @constructor
+ * @extends ValueMirror
+ */
+function Float32x4Mirror(value) {
+ %_CallFunction(this, Float32x4_TYPE, value, ValueMirror);
rossberg 2015/07/02 13:35:43 Isn't this spelled FLOAT32X4_TYPE?
bbudge 2015/07/06 23:59:04 Yes, thanks.
+}
+inherits(Float32x4Mirror, ValueMirror);
+
+
+Float32x4Mirror.prototype.toText = function() {
+ return $float32x4ToString(this.value_);
+};
+
+
+/**
* Mirror object for string values.
* @param {string} value The string value reflected by this mirror
* @constructor
@@ -2575,6 +2606,7 @@ JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_ =
case NULL_TYPE:
case BOOLEAN_TYPE:
case NUMBER_TYPE:
+ case FLOAT32X4_TYPE:
o.value = mirror.value();
break;
case STRING_TYPE:

Powered by Google App Engine
This is Rietveld 408576698