From 4380812b39ae4eb6f2d9fee61ecf2782273f7729 Mon Sep 17 00:00:00 2001 From: "iposva@chromium.org" Date: Thu, 17 Dec 2009 06:21:50 +0000 Subject: [PATCH] - Undo unfortunate renaming of StaticType. Review URL: http://codereview.chromium.org/506050 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ast.h | 4 ++-- src/ia32/codegen-ia32.cc | 6 +++--- src/ia32/codegen-ia32.h | 4 ++-- src/prettyprinter.cc | 10 +++++----- src/prettyprinter.h | 2 +- src/rewriter.cc | 2 +- src/variables.cc | 4 ++-- src/variables.h | 14 +++++++------- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ast.h b/src/ast.h index 00f36290a..52b1b0629 100644 --- a/src/ast.h +++ b/src/ast.h @@ -192,13 +192,13 @@ class Expression: public AstNode { virtual void MarkAsStatement() { /* do nothing */ } // Static type information for this expression. - SmiAnalysis* type() { return &type_; } + StaticType* type() { return &type_; } Context context() { return context_; } void set_context(Context context) { context_ = context; } private: - SmiAnalysis type_; + StaticType type_; Context context_; }; diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index b26558848..9c42f0205 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -818,7 +818,7 @@ void DeferredInlineBinaryOperation::Generate() { void CodeGenerator::GenericBinaryOperation(Token::Value op, - SmiAnalysis* type, + StaticType* type, OverwriteMode overwrite_mode) { Comment cmnt(masm_, "[ BinaryOperation"); Comment cmnt_token(masm_, Token::String(op)); @@ -1499,7 +1499,7 @@ void DeferredInlineSmiSub::Generate() { void CodeGenerator::ConstantSmiBinaryOperation(Token::Value op, Result* operand, Handle value, - SmiAnalysis* type, + StaticType* type, bool reversed, OverwriteMode overwrite_mode) { // NOTE: This is an attempt to inline (a bit) more of the code for @@ -6446,7 +6446,7 @@ void Reference::SetValue(InitState init_state) { // a loop and the key is likely to be a smi. Property* property = expression()->AsProperty(); ASSERT(property != NULL); - SmiAnalysis* key_smi_analysis = property->key()->type(); + StaticType* key_smi_analysis = property->key()->type(); if (cgen_->loop_nesting() > 0 && key_smi_analysis->IsLikelySmi()) { Comment cmnt(masm, "[ Inlined store to keyed Property"); diff --git a/src/ia32/codegen-ia32.h b/src/ia32/codegen-ia32.h index cf1cb8a8f..684f1e725 100644 --- a/src/ia32/codegen-ia32.h +++ b/src/ia32/codegen-ia32.h @@ -434,7 +434,7 @@ class CodeGenerator: public AstVisitor { void GenericBinaryOperation( Token::Value op, - SmiAnalysis* type, + StaticType* type, OverwriteMode overwrite_mode); // If possible, combine two constant smi values using op to produce @@ -447,7 +447,7 @@ class CodeGenerator: public AstVisitor { void ConstantSmiBinaryOperation(Token::Value op, Result* operand, Handle constant_operand, - SmiAnalysis* type, + StaticType* type, bool reversed, OverwriteMode overwrite_mode); diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc index 87da02642..9ef727026 100644 --- a/src/prettyprinter.cc +++ b/src/prettyprinter.cc @@ -594,11 +594,11 @@ class IndentedScope BASE_EMBEDDED { ast_printer_->inc_indent(); } - explicit IndentedScope(const char* txt, SmiAnalysis* type = NULL) { + explicit IndentedScope(const char* txt, StaticType* type = NULL) { ast_printer_->PrintIndented(txt); if ((type != NULL) && (type->IsKnown())) { ast_printer_->Print(" (type = "); - ast_printer_->Print(SmiAnalysis::Type2String(type)); + ast_printer_->Print(StaticType::Type2String(type)); ast_printer_->Print(")"); } ast_printer_->Print("\n"); @@ -657,7 +657,7 @@ void AstPrinter::PrintLiteralIndented(const char* info, void AstPrinter::PrintLiteralWithModeIndented(const char* info, Variable* var, Handle value, - SmiAnalysis* type) { + StaticType* type) { if (var == NULL) { PrintLiteralIndented(info, value, true); } else { @@ -665,7 +665,7 @@ void AstPrinter::PrintLiteralWithModeIndented(const char* info, if (type->IsKnown()) { OS::SNPrintF(buf, "%s (mode = %s, type = %s)", info, Variable::Mode2String(var->mode()), - SmiAnalysis::Type2String(type)); + StaticType::Type2String(type)); } else { OS::SNPrintF(buf, "%s (mode = %s)", info, Variable::Mode2String(var->mode())); @@ -1072,7 +1072,7 @@ void AstPrinter::VisitCountOperation(CountOperation* node) { OS::SNPrintF(buf, "%s %s (type = %s)", (node->is_prefix() ? "PRE" : "POST"), Token::Name(node->op()), - SmiAnalysis::Type2String(node->type())); + StaticType::Type2String(node->type())); } else { OS::SNPrintF(buf, "%s %s", (node->is_prefix() ? "PRE" : "POST"), Token::Name(node->op())); diff --git a/src/prettyprinter.h b/src/prettyprinter.h index f885cb31f..dfff49a45 100644 --- a/src/prettyprinter.h +++ b/src/prettyprinter.h @@ -102,7 +102,7 @@ class AstPrinter: public PrettyPrinter { void PrintLiteralWithModeIndented(const char* info, Variable* var, Handle value, - SmiAnalysis* type); + StaticType* type); void PrintLabelsIndented(const char* info, ZoneStringList* labels); void inc_indent() { indent_++; } diff --git a/src/rewriter.cc b/src/rewriter.cc index de1b95b99..b05cfae30 100644 --- a/src/rewriter.cc +++ b/src/rewriter.cc @@ -367,7 +367,7 @@ void AstOptimizer::VisitAssignment(Assignment* node) { if (proxy != NULL) { Variable* var = proxy->AsVariable(); if (var != NULL) { - SmiAnalysis* var_type = var->type(); + StaticType* var_type = var->type(); if (var_type->IsUnknown()) { var_type->CopyFrom(node->type()); } else if (var_type->IsLikelySmi()) { diff --git a/src/variables.cc b/src/variables.cc index d9a78a5e7..3bcd48a8b 100644 --- a/src/variables.cc +++ b/src/variables.cc @@ -86,10 +86,10 @@ void UseCount::Print() { // ---------------------------------------------------------------------------- -// Implementation SmiAnalysis. +// Implementation StaticType. -const char* SmiAnalysis::Type2String(SmiAnalysis* type) { +const char* StaticType::Type2String(StaticType* type) { switch (type->kind_) { case UNKNOWN: return "UNKNOWN"; diff --git a/src/variables.h b/src/variables.h index ca78b5fc1..ac7f2940d 100644 --- a/src/variables.h +++ b/src/variables.h @@ -65,14 +65,14 @@ class UseCount BASE_EMBEDDED { // Variables and AST expression nodes can track their "type" to enable // optimizations and removal of redundant checks when generating code. -class SmiAnalysis { +class StaticType { public: enum Kind { UNKNOWN, LIKELY_SMI }; - SmiAnalysis() : kind_(UNKNOWN) {} + StaticType() : kind_(UNKNOWN) {} bool Is(Kind kind) const { return kind_ == kind; } @@ -80,11 +80,11 @@ class SmiAnalysis { bool IsUnknown() const { return Is(UNKNOWN); } bool IsLikelySmi() const { return Is(LIKELY_SMI); } - void CopyFrom(SmiAnalysis* other) { + void CopyFrom(StaticType* other) { kind_ = other->kind_; } - static const char* Type2String(SmiAnalysis* type); + static const char* Type2String(StaticType* type); // LIKELY_SMI accessors void SetAsLikelySmi() { @@ -100,7 +100,7 @@ class SmiAnalysis { private: Kind kind_; - DISALLOW_COPY_AND_ASSIGN(SmiAnalysis); + DISALLOW_COPY_AND_ASSIGN(StaticType); }; @@ -203,7 +203,7 @@ class Variable: public ZoneObject { Expression* rewrite() const { return rewrite_; } Slot* slot() const; - SmiAnalysis* type() { return &type_; } + StaticType* type() { return &type_; } private: Scope* scope_; @@ -220,7 +220,7 @@ class Variable: public ZoneObject { UseCount obj_uses_; // uses of the object the variable points to // Static type information - SmiAnalysis type_; + StaticType type_; // Code generation. // rewrite_ is usually a Slot or a Property, but may be any expression. -- 2.34.1