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

Unified Diff: src/types.cc

Issue 186743002: Types: cache lub bitset to avoid heap access (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment Created 6 years, 9 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/types.h ('k') | 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 3840e6fd223f72c0210b49a386e3ca4462ef4a0b..cf41bb5d0ed597edced05a6227e6390ec69154f5 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -141,9 +141,11 @@ int TypeImpl<Config>::LubBitset() {
}
return bitset;
} else if (this->IsClass()) {
- return LubBitset(*this->AsClass());
+ int bitset = Config::lub_bitset(this);
+ return bitset ? bitset : LubBitset(*this->AsClass());
} else {
- return LubBitset(*this->AsConstant());
+ int bitset = Config::lub_bitset(this);
+ return bitset ? bitset : LubBitset(*this->AsConstant());
}
}
@@ -548,9 +550,9 @@ typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Convert(
if (type->IsBitset()) {
return Config::from_bitset(type->AsBitset(), region);
} else if (type->IsClass()) {
- return Config::from_class(type->AsClass(), region);
+ return Config::from_class(type->AsClass(), type->LubBitset(), region);
} else if (type->IsConstant()) {
- return Config::from_constant(type->AsConstant(), region);
+ return Config::from_constant(type->AsConstant(), type->LubBitset(), region);
} else {
ASSERT(type->IsUnion());
typename OtherType::UnionedHandle unioned = type->AsUnion();
« no previous file with comments | « src/types.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698