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

Unified Diff: src/objects.cc

Issue 1153373003: Add new Float32x4 type for SIMD.js. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix int type mismatches. Created 5 years, 7 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 | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index b0222f660f79d6adb3d8e75d3210133353bb96f6..0ebbe2ce9995a03771b27278cf9a97f8c4d1fcc4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -97,6 +97,7 @@ bool Object::BooleanValue() {
if (IsUndetectableObject()) return false; // Undetectable object is false.
if (IsString()) return String::cast(this)->length() != 0;
if (IsHeapNumber()) return HeapNumber::cast(this)->HeapNumberBooleanValue();
+ if (IsFloat32x4()) return true; // Simd value types always evaluate to true.
return true;
}
@@ -1400,6 +1401,12 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) { // NOLINT
os << '>';
break;
}
+ case FLOAT32X4_TYPE: {
+ os << "<Float32x4: ";
+ Float32x4::cast(this)->Float32x4Print(os);
+ os << ">";
+ break;
+ }
case JS_PROXY_TYPE:
os << "<JSProxy>";
break;
@@ -1546,6 +1553,7 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
case HEAP_NUMBER_TYPE:
case MUTABLE_HEAP_NUMBER_TYPE:
+ case FLOAT32X4_TYPE:
case FILLER_TYPE:
case BYTE_ARRAY_TYPE:
case FREE_SPACE_TYPE:
@@ -1591,6 +1599,12 @@ void HeapNumber::HeapNumberPrint(std::ostream& os) { // NOLINT
}
+void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT
+ os << get_lane(0) << ", " << get_lane(1) << ", " << get_lane(2) << ", "
+ << get_lane(3);
+}
+
+
String* JSReceiver::class_name() {
if (IsJSFunction() || IsJSFunctionProxy()) {
return GetHeap()->Function_string();
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698