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

Unified Diff: src/types.cc

Issue 230893002: Fix symmetry of Maybe predicate Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Style Created 6 years, 8 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 | test/cctest/test-types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index f6a430bbc962934128d089fb1af6baa2d1a51ab6..ea3a3a754170567048c6c4c6d2b2de1f3593ba16 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -320,14 +320,6 @@ bool TypeImpl<Config>::NowIs(TypeImpl* that) {
// Check this overlaps that.
template<class Config>
bool TypeImpl<Config>::Maybe(TypeImpl* that) {
- // Fast path for bitsets.
- if (this->IsBitset()) {
- return IsInhabited(this->AsBitset() & that->LubBitset());
- }
- if (that->IsBitset()) {
- return IsInhabited(this->LubBitset() & that->AsBitset());
- }
-
// (T1 \/ ... \/ Tn) overlaps T <=> (T1 overlaps T) \/ ... \/ (Tn overlaps T)
if (this->IsUnion()) {
StructHandle unioned = this->AsUnion();
@@ -349,6 +341,13 @@ bool TypeImpl<Config>::Maybe(TypeImpl* that) {
}
ASSERT(!this->IsUnion() && !that->IsUnion());
+ if (this->IsBitset()) {
+ return IsInhabited(this->AsBitset() & that->LubBitset());
+ }
+ if (that->IsBitset()) {
+ return IsInhabited(this->LubBitset() & that->AsBitset());
+ }
+
if (this->IsClass()) {
return that->IsClass() && *this->AsClass() == *that->AsClass();
}
« no previous file with comments | « no previous file | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698