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

Unified Diff: src/hydrogen.cc

Issue 14862009: Encapsulating Type information in the CompareICStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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/code-stubs.cc ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 5c573feb198c9cddc227186db482388bad94bdb7..21438cabfc71ad2a2befa421c9289e810bf01bee 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1807,27 +1807,27 @@ void HGraphBuilder::BuildCompareNil(
HIfContinuation* continuation) {
IfBuilder if_nil(this, position);
bool needs_or = false;
- if ((types & CompareNilICStub::kCompareAgainstNull) != 0) {
+ if (types.Contains(CompareNilICStub::NULL_TYPE)) {
if (needs_or) if_nil.Or();
if_nil.If<HCompareObjectEqAndBranch>(value, graph()->GetConstantNull());
needs_or = true;
}
- if ((types & CompareNilICStub::kCompareAgainstUndefined) != 0) {
+ if (types.Contains(CompareNilICStub::UNDEFINED)) {
if (needs_or) if_nil.Or();
if_nil.If<HCompareObjectEqAndBranch>(value,
graph()->GetConstantUndefined());
needs_or = true;
}
// Handle either undetectable or monomorphic, not both.
- ASSERT(((types & CompareNilICStub::kCompareAgainstUndetectable) == 0) ||
- ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) == 0));
- if ((types & CompareNilICStub::kCompareAgainstUndetectable) != 0) {
+ ASSERT(!types.Contains(CompareNilICStub::UNDETECTABLE) ||
+ !types.Contains(CompareNilICStub::MONOMORPHIC_MAP));
+ if (types.Contains(CompareNilICStub::UNDETECTABLE)) {
if (needs_or) if_nil.Or();
if_nil.If<HIsUndetectableAndBranch>(value);
} else {
if_nil.Then();
if_nil.Else();
- if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) {
+ if (types.Contains(CompareNilICStub::MONOMORPHIC_MAP)) {
BuildCheckNonSmi(value);
// For ICs, the map checked below is a sentinel map that gets replaced by
// the monomorphic map when the code is used as a template to generate a
@@ -10730,15 +10730,13 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
TypeFeedbackId id = expr->CompareOperationFeedbackId();
CompareNilICStub::Types types;
if (kind == kStrictEquality) {
- if (nil == kNullValue) {
- types = CompareNilICStub::kCompareAgainstNull;
- } else {
- types = CompareNilICStub::kCompareAgainstUndefined;
- }
+ types.Add((nil == kNullValue) ? CompareNilICStub::NULL_TYPE :
+ CompareNilICStub::UNDEFINED);
} else {
- types = static_cast<CompareNilICStub::Types>(
- oracle()->CompareNilTypes(id));
- if (types == 0) types = CompareNilICStub::kFullCompare;
+ types = CompareNilICStub::Types(oracle()->CompareNilTypes(id));
+ if (types.IsEmpty()) {
+ types = CompareNilICStub::Types::FullCompare();
+ }
}
Handle<Map> map_handle(oracle()->CompareNilMonomorphicReceiverType(id));
BuildCompareNil(value, kind, types, map_handle,
« no previous file with comments | « src/code-stubs.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698