Reviewers: rossberg,

Description:
Minor clarifications and simplifications.

[email protected]
BUG=

Please review this at https://codereview.chromium.org/409743004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+12, -19 lines):
  M src/types.h
  M src/types.cc


Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index db638ed141d604e95ffe7ab9f9099aac0ba34a2d..da86ef2398130ec2dad1195e05d53b6d5def2e8d 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -313,16 +313,12 @@ bool TypeImpl<Config>::SlowIs(TypeImpl* that) {

   // T <= (T1 \/ ... \/ Tn)  <=>  (T <= T1) \/ ... \/ (T <= Tn)
   // (iff T is not a union)
-  ASSERT(!this->IsUnion());
-  if (that->IsUnion()) {
-    UnionHandle unioned = handle(that->AsUnion());
-    for (int i = 0; i < unioned->Length(); ++i) {
-      if (this->Is(unioned->Get(i))) return true;
- if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
-    }
-    return false;
+  ASSERT(!this->IsUnion() && that->IsUnion());
+  UnionHandle unioned = handle(that->AsUnion());
+  for (int i = 0; i < unioned->Length(); ++i) {
+    if (this->Is(unioned->Get(i))) return true;
+ if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
   }
-
   return false;
 }

@@ -382,11 +378,8 @@ bool TypeImpl<Config>::Maybe(TypeImpl* that) {
   }

   ASSERT(!this->IsUnion() && !that->IsUnion());
-  if (this->IsBitset()) {
-    return BitsetType::IsInhabited(this->AsBitset() & that->BitsetLub());
-  }
-  if (that->IsBitset()) {
-    return BitsetType::IsInhabited(this->BitsetLub() & that->AsBitset());
+  if (this->IsBitset() || that->IsBitset()) {
+    return BitsetType::IsInhabited(this->BitsetLub() & that->BitsetLub());
   }
   if (this->IsClass()) {
     return that->IsClass()
Index: src/types.h
diff --git a/src/types.h b/src/types.h
index 1b2cf66c96eab48cbff0a00a5a4e0a426c1cbd60..b39a763382747905dfc6ccc2e01ab8f7d76c1c2c 100644
--- a/src/types.h
+++ b/src/types.h
@@ -68,11 +68,11 @@ namespace internal {
 //   None <= R
 //   R <= Any
 //
-//   UntaggedInt <= UntaggedInt8 \/ UntaggedInt16 \/ UntaggedInt32)
-//   UntaggedFloat <= UntaggedFloat32 \/ UntaggedFloat64
-//   UntaggedNumber <= UntaggedInt \/ UntaggedFloat
-//   Untagged <= UntaggedNumber \/ UntaggedPtr
-//   Tagged <= TaggedInt \/ TaggedPtr
+//   UntaggedInt = UntaggedInt8 \/ UntaggedInt16 \/ UntaggedInt32)
+//   UntaggedFloat = UntaggedFloat32 \/ UntaggedFloat64
+//   UntaggedNumber = UntaggedInt \/ UntaggedFloat
+//   Untagged = UntaggedNumber \/ UntaggedPtr
+//   Tagged = TaggedInt \/ TaggedPtr
 //
 // Subtyping relates the two dimensions, for example:
 //


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to