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

Unified Diff: src/debug/mirrors.js

Issue 1235283005: Add mirror debugger support for SIMD.float32x4. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | src/prologue.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/mirrors.js
diff --git a/src/debug/mirrors.js b/src/debug/mirrors.js
index 1b45b93d8d77208e16375d3c94dafa1031dd3cfd..2f58708cb1b0f82e54dc3e0f5e8778968d23d31d 100644
--- a/src/debug/mirrors.js
+++ b/src/debug/mirrors.js
@@ -8,6 +8,19 @@
// ----------------------------------------------------------------------------
// Imports
+macro SIMD_TYPES(FUNCTION)
+FUNCTION(FLOAT32X4_TYPE, Float32x4, float32x4)
+FUNCTION(INT32X4_TYPE, Int32x4, int32x4)
+FUNCTION(INT16X8_TYPE, Int16x8, int16x8)
+FUNCTION(INT8X16_TYPE, Int8x16, int8x16)
+FUNCTION(UINT32X4_TYPE, Uint32x4, uint32x4)
+FUNCTION(UINT16X8_TYPE, Uint16x8, uint16x8)
+FUNCTION(UINT8X16_TYPE, Uint8x16, uint8x16)
+FUNCTION(BOOL32X4_TYPE, Bool32x4, bool32x4)
+FUNCTION(BOOL16X8_TYPE, Bool16x8, bool16x8)
+FUNCTION(BOOL8X16_TYPE, Bool8x16, bool8x16)
+endmacro
+
var FunctionSourceString;
var GlobalArray = global.Array;
var IsNaN = global.isNaN;
@@ -18,10 +31,22 @@ var promiseValueSymbol = utils.GetPrivateSymbol("promise_value_symbol");
var ToBoolean;
var ToString;
+macro SIMD_DECLARE_TOSTRING(SIMD, Simd, simd)
+var SimdToString;
+endmacro
+
+SIMD_TYPES(SIMD_DECLARE_TOSTRING)
+
+macro SIMD_IMPORT_TOSTRING(SIMD, Simd, simd)
+SimdToString = from.SimdToString;
+endmacro
+
utils.Import(function(from) {
FunctionSourceString = from.FunctionSourceString;
ToBoolean = from.ToBoolean;
ToString = from.ToString;
+
+ SIMD_TYPES(SIMD_IMPORT_TOSTRING)
});
// ----------------------------------------------------------------------------
@@ -35,6 +60,16 @@ utils.Import(function(from) {
// - NumberMirror
// - StringMirror
// - SymbolMirror
+// - Float32x4Mirror
+// - Int32x4Mirror
+// - Int16x8Mirror
+// - Int8x16Mirror
+// - Uint32x4Mirror
+// - Uint16x8Mirror
+// - Uint8x16Mirror
+// - Bool32x4Mirror
+// - Bool16x8Mirror
+// - Bool8x16Mirror
// - ObjectMirror
// - FunctionMirror
// - UnresolvedFunctionMirror
@@ -53,6 +88,11 @@ utils.Import(function(from) {
// - ScriptMirror
// - ScopeMirror
+
+macro SIMD_DEFINE_TYPE(SIMD, Simd, simd)
+SIMD: 'simd',
+endmacro
+
// Type names of the different mirrors.
var MirrorType = {
UNDEFINED_TYPE : 'undefined',
@@ -76,6 +116,8 @@ var MirrorType = {
SET_TYPE : 'set',
ITERATOR_TYPE : 'iterator',
GENERATOR_TYPE : 'generator',
+
+ SIMD_TYPES(SIMD_DEFINE_TYPE)
}
@@ -118,6 +160,13 @@ function ObjectIsPromise(value) {
}
+macro SIMD_MAKE_MIRROR(SIMD, Simd, simd)
+case 'simd':
+ mirror = new SimdMirror(value);
+ break;
+endmacro
+
+
/**
* Returns the mirror for a specified value or object.
*
@@ -178,6 +227,10 @@ function MakeMirror(value, opt_transient) {
mirror = new PromiseMirror(value);
} else if (IS_GENERATOR(value)) {
mirror = new GeneratorMirror(value);
+ } else if (IS_SIMD_VALUE(value)) {
+ switch (typeof value) {
+ SIMD_TYPES(SIMD_MAKE_MIRROR)
+ }
} else {
mirror = new ObjectMirror(value, MirrorType.OBJECT_TYPE, opt_transient);
}
@@ -268,6 +321,7 @@ var ScopeType = { Global: 0,
Block: 5,
Script: 6 };
+
/**
* Base class for all mirror objects.
* @param {string} type The type of the mirror
@@ -346,6 +400,15 @@ Mirror.prototype.isSymbol = function() {
};
+macro SIMD_IS_FUNCTION(SIMD, Simd, simd)
+Mirror.prototype.isSimd = function() {
+ return this instanceof SimdMirror;
+};
+endmacro
+
+SIMD_TYPES(SIMD_IS_FUNCTION)
+
+
/**
* Check whether the mirror reflects an object.
* @returns {boolean} True if the mirror reflects an object
@@ -568,7 +631,17 @@ ValueMirror.prototype.isPrimitive = function() {
type === 'boolean' ||
type === 'number' ||
type === 'string' ||
- type === 'symbol';
+ type === 'symbol' ||
+ type === 'float32x4' ||
+ type === 'int32x4' ||
+ type === 'int16x8' ||
+ type === 'int8x16' ||
+ type === 'uint32x4' ||
+ type === 'uint16x8' ||
+ type === 'uint8x16' ||
+ type === 'bool32x4' ||
+ type === 'bool16x8' ||
+ type === 'bool8x16';
};
@@ -698,6 +771,21 @@ SymbolMirror.prototype.toText = function() {
}
+macro SIMD_MIRROR_FUNCTIONS(SIMD, Simd, simd)
+function SimdMirror(value) {
+ %_CallFunction(this, MirrorType.SIMD, value, ValueMirror);
+}
+inherits(SimdMirror, ValueMirror);
+
+
+SimdMirror.prototype.toText = function() {
+ return %_CallFunction(this.value_, SimdToString);
+}
+endmacro
+
+SIMD_TYPES(SIMD_MIRROR_FUNCTIONS)
+
+
/**
* Mirror object for objects.
* @param {object} value The object reflected by this mirror
@@ -2595,6 +2683,11 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) {
};
+macro SIMD_DEFINE_CASE(SIMD, Simd, simd)
+case MirrorType.SIMD:
+endmacro
+
+
/**
* Formats mirror object to protocol reference object with some data that can
* be used to display the value in debugger.
@@ -2628,6 +2721,7 @@ JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_ =
break;
case MirrorType.ERROR_TYPE:
case MirrorType.REGEXP_TYPE:
+ SIMD_TYPES(SIMD_DEFINE_CASE)
o.value = mirror.toText();
break;
case MirrorType.OBJECT_TYPE:
@@ -2697,6 +2791,10 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference,
content.description = mirror.description();
break;
+ SIMD_TYPES(SIMD_DEFINE_CASE)
+ content.value = mirror.toText();
+ break;
+
case MirrorType.OBJECT_TYPE:
case MirrorType.FUNCTION_TYPE:
case MirrorType.ERROR_TYPE:
@@ -3073,6 +3171,11 @@ utils.InstallFunctions(global, DONT_ENUM, [
"MirrorCacheIsEmpty", MirrorCacheIsEmpty,
]);
+
+macro SIMD_INSTALL(SIMD, Simd, simd)
+"SimdMirror", SimdMirror,
+endmacro
+
utils.InstallConstants(global, [
"ScopeType", ScopeType,
"PropertyKind", PropertyKind,
@@ -3104,6 +3207,8 @@ utils.InstallConstants(global, [
"ScriptMirror", ScriptMirror,
"ScopeMirror", ScopeMirror,
"FrameDetails", FrameDetails,
+
+ SIMD_TYPES(SIMD_INSTALL)
]);
// Functions needed by the debugger runtime.
« no previous file with comments | « no previous file | src/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698