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

Unified Diff: src/types.cc

Issue 413983005: Remove unnecesssary auxiliary definitions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « 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 f52346e4e37489dbe519d2cdd0a18606a7ba0c60..6205c4a8d810ddd76c8c3f6045a551f018ce81ef 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -248,12 +248,11 @@ bool TypeImpl<Config>::SlowIs(TypeImpl* that) {
// Fast path for bitsets.
if (this->IsNone()) return true;
if (that->IsBitset()) {
- return (BitsetType::Lub(this) | that->AsBitset()) == that->AsBitset();
+ return BitsetType::Is(BitsetType::Lub(this), that->AsBitset());
}
if (this->IsBitset() && SEMANTIC(this->AsBitset()) == BitsetType::kNone) {
// Bitsets only have non-bitset supertypes along the representation axis.
- int that_bitset = that->BitsetGlb();
- return (BitsetType::Is(this->AsBitset(), that_bitset));
+ return BitsetType::Is(this->AsBitset(), that->BitsetGlb());
}
if (that->IsClass()) {
@@ -486,7 +485,7 @@ int TypeImpl<Config>::IndexInUnion(
for (int i = 0; i < current_size; ++i) {
TypeHandle that = unioned->Get(i);
if (that->IsBitset()) {
- if ((bound | that->AsBitset()) == that->AsBitset()) return i;
+ if (BitsetType::Is(bound, that->AsBitset())) return i;
} else if (that->IsClass() && this->IsClass()) {
if (*this->AsClass()->Map() == *that->AsClass()->Map()) return i;
} else if (that->IsConstant() && this->IsConstant()) {
@@ -510,7 +509,6 @@ template<class Config>
int TypeImpl<Config>::ExtendUnion(
UnionHandle result, int size, TypeHandle type,
TypeHandle other, bool is_intersect, Region* region) {
- int old_size = size;
if (type->IsUnion()) {
UnionHandle unioned = handle(type->AsUnion());
for (int i = 0; i < unioned->Length(); ++i) {
@@ -529,7 +527,7 @@ int TypeImpl<Config>::ExtendUnion(
int new_bound =
is_intersect ? (old_bound & other_bound) : (old_bound | other_bound);
if (new_bound != BitsetType::kNone) {
- int i = type->IndexInUnion(new_bound, result, old_size);
+ int i = type->IndexInUnion(new_bound, result, size);
if (i == -1) {
i = size++;
} else if (result->Get(i)->IsBitset()) {
@@ -888,7 +886,7 @@ void TypeImpl<Config>::PrintTo(OStream& os, PrintDimension dim) { // NOLINT
BitsetType::Print(os, SEMANTIC(this->AsBitset()));
} else if (this->IsClass()) {
os << "Class(" << static_cast<void*>(*this->AsClass()->Map()) << " < ";
- return BitsetType::New(BitsetType::Lub(this))->PrintTo(os, dim);
+ BitsetType::New(BitsetType::Lub(this))->PrintTo(os, dim);
os << ")";
} else if (this->IsConstant()) {
os << "Constant(" << static_cast<void*>(*this->AsConstant()->Value())
« 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