Cleanup unused code from the type oracle.

Review URL: http://codereview.chromium.org/6135004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6514 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent af81c537
...@@ -665,19 +665,11 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle) { ...@@ -665,19 +665,11 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
} }
void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
TypeInfo left = oracle->BinaryType(this, TypeFeedbackOracle::LEFT);
TypeInfo right = oracle->BinaryType(this, TypeFeedbackOracle::RIGHT);
is_smi_only_ = left.IsSmi() && right.IsSmi();
}
void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
TypeInfo left = oracle->CompareType(this, TypeFeedbackOracle::LEFT); TypeInfo info = oracle->CompareType(this);
TypeInfo right = oracle->CompareType(this, TypeFeedbackOracle::RIGHT); if (info.IsSmi()) {
if (left.IsSmi() && right.IsSmi()) {
compare_type_ = SMI_ONLY; compare_type_ = SMI_ONLY;
} else if (left.IsNonPrimitive() && right.IsNonPrimitive()) { } else if (info.IsNonPrimitive()) {
compare_type_ = OBJECT_ONLY; compare_type_ = OBJECT_ONLY;
} else { } else {
ASSERT(compare_type_ == NONE); ASSERT(compare_type_ == NONE);
......
...@@ -1398,7 +1398,7 @@ class BinaryOperation: public Expression { ...@@ -1398,7 +1398,7 @@ class BinaryOperation: public Expression {
Expression* left, Expression* left,
Expression* right, Expression* right,
int pos) int pos)
: op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) { : op_(op), left_(left), right_(right), pos_(pos) {
ASSERT(Token::IsBinaryOp(op)); ASSERT(Token::IsBinaryOp(op));
right_id_ = (op == Token::AND || op == Token::OR) right_id_ = (op == Token::AND || op == Token::OR)
? static_cast<int>(GetNextId()) ? static_cast<int>(GetNextId())
...@@ -1419,10 +1419,6 @@ class BinaryOperation: public Expression { ...@@ -1419,10 +1419,6 @@ class BinaryOperation: public Expression {
Expression* right() const { return right_; } Expression* right() const { return right_; }
int position() const { return pos_; } int position() const { return pos_; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsSmiOnly() const { return is_smi_only_; }
// Bailout support. // Bailout support.
int RightId() const { return right_id_; } int RightId() const { return right_id_; }
...@@ -1431,7 +1427,6 @@ class BinaryOperation: public Expression { ...@@ -1431,7 +1427,6 @@ class BinaryOperation: public Expression {
Expression* left_; Expression* left_;
Expression* right_; Expression* right_;
int pos_; int pos_;
bool is_smi_only_;
// The short-circuit logical operations have an AST ID for their // The short-circuit logical operations have an AST ID for their
// right-hand subexpression. // right-hand subexpression.
int right_id_; int right_id_;
......
...@@ -3390,7 +3390,6 @@ void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { ...@@ -3390,7 +3390,6 @@ void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
// We have a second position recorded in the FullCodeGenerator to have // We have a second position recorded in the FullCodeGenerator to have
// type feedback for the binary operation. // type feedback for the binary operation.
BinaryOperation* operation = expr->binary_operation(); BinaryOperation* operation = expr->binary_operation();
operation->RecordTypeFeedback(oracle());
if (var != NULL) { if (var != NULL) {
if (!var->is_global() && !var->IsStackAllocated()) { if (!var->is_global() && !var->IsStackAllocated()) {
...@@ -4814,7 +4813,7 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr, ...@@ -4814,7 +4813,7 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr,
default: default:
UNREACHABLE(); UNREACHABLE();
} }
TypeInfo info = oracle()->BinaryType(expr, TypeFeedbackOracle::RESULT); TypeInfo info = oracle()->BinaryType(expr);
// If we hit an uninitialized binary op stub we will get type info // If we hit an uninitialized binary op stub we will get type info
// for a smi operation. If one of the operands is a constant string // for a smi operation. If one of the operands is a constant string
// do not generate code assuming it is a smi operation. // do not generate code assuming it is a smi operation.
...@@ -4965,7 +4964,7 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) { ...@@ -4965,7 +4964,7 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
HValue* left = Pop(); HValue* left = Pop();
Token::Value op = expr->op(); Token::Value op = expr->op();
TypeInfo info = oracle()->CompareType(expr, TypeFeedbackOracle::RESULT); TypeInfo info = oracle()->CompareType(expr);
HInstruction* instr = NULL; HInstruction* instr = NULL;
if (op == Token::INSTANCEOF) { if (op == Token::INSTANCEOF) {
// Check to see if the rhs of the instanceof is a global function not // Check to see if the rhs of the instanceof is a global function not
......
...@@ -171,7 +171,7 @@ bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { ...@@ -171,7 +171,7 @@ bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) {
} }
TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) { TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr) {
Handle<Object> object = GetElement(map_, expr->position()); Handle<Object> object = GetElement(map_, expr->position());
TypeInfo unknown = TypeInfo::Unknown(); TypeInfo unknown = TypeInfo::Unknown();
if (!object->IsCode()) return unknown; if (!object->IsCode()) return unknown;
...@@ -198,7 +198,7 @@ TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) { ...@@ -198,7 +198,7 @@ TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) {
} }
TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr, Side side) { TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr) {
Handle<Object> object = GetElement(map_, expr->position()); Handle<Object> object = GetElement(map_, expr->position());
TypeInfo unknown = TypeInfo::Unknown(); TypeInfo unknown = TypeInfo::Unknown();
if (!object->IsCode()) return unknown; if (!object->IsCode()) return unknown;
......
...@@ -236,12 +236,6 @@ class CaseClause; ...@@ -236,12 +236,6 @@ class CaseClause;
class TypeFeedbackOracle BASE_EMBEDDED { class TypeFeedbackOracle BASE_EMBEDDED {
public: public:
enum Side {
LEFT,
RIGHT,
RESULT
};
TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context); TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context);
bool LoadIsMonomorphic(Property* expr); bool LoadIsMonomorphic(Property* expr);
...@@ -261,8 +255,8 @@ class TypeFeedbackOracle BASE_EMBEDDED { ...@@ -261,8 +255,8 @@ class TypeFeedbackOracle BASE_EMBEDDED {
bool LoadIsBuiltin(Property* expr, Builtins::Name id); bool LoadIsBuiltin(Property* expr, Builtins::Name id);
// Get type information for arithmetic operations and compares. // Get type information for arithmetic operations and compares.
TypeInfo BinaryType(BinaryOperation* expr, Side side); TypeInfo BinaryType(BinaryOperation* expr);
TypeInfo CompareType(CompareOperation* expr, Side side); TypeInfo CompareType(CompareOperation* expr);
TypeInfo SwitchType(CaseClause* clause); TypeInfo SwitchType(CaseClause* clause);
private: private:
......
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