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

Unified Diff: src/objects-inl.h

Issue 1273353003: [simd.js] Single SIMD128_VALUE_TYPE for all Simd128Values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow check failures. REBASE. 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 | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9e4b55212f8d6ff54ab764486895ef41e6e9db79..757511cbb29c060aa4ec18bc4acc47a6b5c831fa 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -166,23 +166,17 @@ bool Object::IsHeapObject() const {
TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE)
TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE)
TYPE_CHECKER(Symbol, SYMBOL_TYPE)
+TYPE_CHECKER(Simd128Value, SIMD128_VALUE_TYPE)
-bool Object::IsSimd128Value() const {
- if (!Object::IsHeapObject()) return false;
- InstanceType instance_type = HeapObject::cast(this)->map()->instance_type();
- return (instance_type >= FIRST_SIMD_VALUE_TYPE &&
- instance_type <= LAST_SIMD_VALUE_TYPE);
-}
-
-
-TYPE_CHECKER(Float32x4, FLOAT32X4_TYPE)
-TYPE_CHECKER(Int32x4, INT32X4_TYPE)
-TYPE_CHECKER(Bool32x4, BOOL32X4_TYPE)
-TYPE_CHECKER(Int16x8, INT16X8_TYPE)
-TYPE_CHECKER(Bool16x8, BOOL16X8_TYPE)
-TYPE_CHECKER(Int8x16, INT8X16_TYPE)
-TYPE_CHECKER(Bool8x16, BOOL8X16_TYPE)
+#define SIMD128_TYPE_CHECKER(TYPE, Type, type, lane_count, lane_type) \
+ bool Object::Is##Type() const { \
+ return Object::IsHeapObject() && \
+ HeapObject::cast(this)->map() == \
+ HeapObject::cast(this)->GetHeap()->type##_map(); \
+ }
+SIMD128_TYPES(SIMD128_TYPE_CHECKER)
+#undef SIMD128_TYPE_CHECKER
bool Object::IsString() const {
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698