Commit 4380812b authored by iposva@chromium.org's avatar iposva@chromium.org

- 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
parent b1721d4c
......@@ -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_;
};
......
......@@ -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<Object> 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");
......
......@@ -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<Object> constant_operand,
SmiAnalysis* type,
StaticType* type,
bool reversed,
OverwriteMode overwrite_mode);
......
......@@ -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<Object> 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()));
......
......@@ -102,7 +102,7 @@ class AstPrinter: public PrettyPrinter {
void PrintLiteralWithModeIndented(const char* info,
Variable* var,
Handle<Object> value,
SmiAnalysis* type);
StaticType* type);
void PrintLabelsIndented(const char* info, ZoneStringList* labels);
void inc_indent() { indent_++; }
......
......@@ -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()) {
......
......@@ -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";
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment