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

Unified Diff: src/objects-inl.h

Issue 1298603002: [runtime] Unify and fix the strict equality comparison. (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
« src/api.cc ('K') | « src/objects.cc ('k') | src/ppc/code-stubs-ppc.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 1cb246b30ac51681ff31c266222f00c66efb1f07..2afd802f534629dc7b4335c677ec59388bf5c6ed 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1521,6 +1521,29 @@ int HeapNumber::get_sign() {
}
+bool Simd128Value::Equals(Simd128Value* that) {
+#define SIMD128_VALUE(TYPE, Type, type, lane_count, lane_type) \
+ if (this->Is##Type()) { \
+ if (!that->Is##Type()) return false; \
+ return Type::cast(this)->Equals(Type::cast(that)); \
+ }
+ SIMD128_TYPES(SIMD128_VALUE)
+#undef SIMD128_VALUE
+ return false;
+}
+
+
+#define SIMD128_VALUE_EQUALS(TYPE, Type, type, lane_count, lane_type) \
+ bool Type::Equals(Type* that) { \
+ for (int lane = 0; lane < lane_count; ++lane) { \
+ if (this->get_lane(lane) != that->get_lane(lane)) return false; \
+ } \
+ return true; \
+ }
+SIMD128_TYPES(SIMD128_VALUE_EQUALS)
+#undef SIMD128_VALUE_EQUALS
+
+
float Float32x4::get_lane(int lane) const {
DCHECK(lane < 4 && lane >= 0);
#if defined(V8_TARGET_LITTLE_ENDIAN)
« src/api.cc ('K') | « src/objects.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698