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

Unified Diff: src/ast.cc

Issue 16361015: Migrate Compare ICs to new type rep (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments Created 7 years, 6 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/ast.h ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index a94feb88e56412aeeb4ea0c97f58a4f90e864de4..0ebbd35be886cdef66de2bb459226000d41750a3 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -503,19 +503,7 @@ void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- TypeInfo info = oracle->SwitchType(this);
- if (info.IsUninitialized()) info = TypeInfo::Unknown();
- if (info.IsSmi()) {
- compare_type_ = SMI_ONLY;
- } else if (info.IsInternalizedString()) {
- compare_type_ = NAME_ONLY;
- } else if (info.IsNonInternalizedString()) {
- compare_type_ = STRING_ONLY;
- } else if (info.IsNonPrimitive()) {
- compare_type_ = OBJECT_ONLY;
- } else {
- ASSERT(compare_type_ == NONE);
- }
+ compare_type_ = oracle->ClauseType(CompareId());
}
@@ -685,17 +673,11 @@ void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
}
+// TODO(rossberg): this function (and all other RecordTypeFeedback functions)
+// should disappear once we use the common type field in the AST consistently.
void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- oracle->CompareType(this, &left_type_, &right_type_, &overall_type_);
- if (!overall_type_.IsUninitialized() && overall_type_.IsNonPrimitive() &&
- (op_ == Token::EQ || op_ == Token::EQ_STRICT)) {
- map_ = oracle->GetCompareMap(this);
- } else {
- // May be a compare to nil.
- map_ = oracle->CompareNilMonomorphicReceiverType(this);
- if (op_ != Token::EQ_STRICT)
- compare_nil_types_ = oracle->CompareNilTypes(this);
- }
+ oracle->CompareTypes(CompareOperationFeedbackId(),
+ &left_type_, &right_type_, &overall_type_, &compare_nil_type_);
}
@@ -1072,7 +1054,7 @@ CaseClause::CaseClause(Isolate* isolate,
: label_(label),
statements_(statements),
position_(pos),
- compare_type_(NONE),
+ compare_type_(Type::None(), isolate),
compare_id_(AstNode::GetNextId(isolate)),
entry_id_(AstNode::GetNextId(isolate)) {
}
« no previous file with comments | « src/ast.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698