| Index: src/ast.h
|
| diff --git a/src/ast.h b/src/ast.h
|
| index 219a69bc8ed3801d27e20fff45032f512fef25d4..b07456b8f789ed9f03d6aa8b82a2409bf0fe004b 100644
|
| --- a/src/ast.h
|
| +++ b/src/ast.h
|
| @@ -358,6 +358,7 @@ class Expression: public AstNode {
|
|
|
| // Expression type
|
| Handle<Type> type() { return type_; }
|
| + void set_type(Handle<Type> type) { type_ = type; }
|
|
|
| // Type feedback information for assignments and properties.
|
| virtual bool IsMonomorphic() {
|
| @@ -388,7 +389,7 @@ class Expression: public AstNode {
|
|
|
| protected:
|
| explicit Expression(Isolate* isolate)
|
| - : type_(Type::Any(), isolate),
|
| + : type_(Type::None(), isolate),
|
| id_(GetNextId(isolate)),
|
| test_id_(GetNextId(isolate)) {}
|
|
|
| @@ -1106,24 +1107,15 @@ class CaseClause: public ZoneObject {
|
| // Type feedback information.
|
| TypeFeedbackId CompareId() { return compare_id_; }
|
| void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
| - bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
|
| - bool IsNameCompare() { return compare_type_ == NAME_ONLY; }
|
| - bool IsStringCompare() { return compare_type_ == STRING_ONLY; }
|
| - bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
|
| + Handle<Type> compare_type() { return compare_type_; }
|
|
|
| private:
|
| Expression* label_;
|
| Label body_target_;
|
| ZoneList<Statement*>* statements_;
|
| int position_;
|
| - enum CompareTypeFeedback {
|
| - NONE,
|
| - SMI_ONLY,
|
| - NAME_ONLY,
|
| - STRING_ONLY,
|
| - OBJECT_ONLY
|
| - };
|
| - CompareTypeFeedback compare_type_;
|
| + Handle<Type> compare_type_;
|
| +
|
| const TypeFeedbackId compare_id_;
|
| const BailoutId entry_id_;
|
| };
|
| @@ -1705,7 +1697,7 @@ class Call: public Expression {
|
| // as the holder!
|
| Handle<JSObject> holder() { return holder_; }
|
|
|
| - Handle<JSGlobalPropertyCell> cell() { return cell_; }
|
| + Handle<Cell> cell() { return cell_; }
|
|
|
| bool ComputeTarget(Handle<Map> type, Handle<String> name);
|
| bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup);
|
| @@ -1745,7 +1737,7 @@ class Call: public Expression {
|
| SmallMapList receiver_types_;
|
| Handle<JSFunction> target_;
|
| Handle<JSObject> holder_;
|
| - Handle<JSGlobalPropertyCell> cell_;
|
| + Handle<Cell> cell_;
|
|
|
| const BailoutId return_id_;
|
| };
|
| @@ -1765,7 +1757,7 @@ class CallNew: public Expression {
|
| virtual bool IsMonomorphic() { return is_monomorphic_; }
|
| Handle<JSFunction> target() const { return target_; }
|
| ElementsKind elements_kind() const { return elements_kind_; }
|
| - Handle<JSGlobalPropertyCell> allocation_info_cell() const {
|
| + Handle<Cell> allocation_info_cell() const {
|
| return allocation_info_cell_;
|
| }
|
|
|
| @@ -1792,7 +1784,7 @@ class CallNew: public Expression {
|
| bool is_monomorphic_;
|
| Handle<JSFunction> target_;
|
| ElementsKind elements_kind_;
|
| - Handle<JSGlobalPropertyCell> allocation_info_cell_;
|
| + Handle<Cell> allocation_info_cell_;
|
|
|
| const BailoutId return_id_;
|
| };
|
| @@ -1845,7 +1837,7 @@ class UnaryOperation: public Expression {
|
|
|
| TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); }
|
| void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
| - TypeInfo type() const { return type_; }
|
| + Handle<Type> type() const { return type_; }
|
|
|
| protected:
|
| UnaryOperation(Isolate* isolate,
|
| @@ -1866,7 +1858,7 @@ class UnaryOperation: public Expression {
|
| Expression* expression_;
|
| int pos_;
|
|
|
| - TypeInfo type_;
|
| + Handle<Type> type_;
|
|
|
| // For unary not (Token::NOT), the AST ids where true and false will
|
| // actually be materialized, respectively.
|
| @@ -1890,9 +1882,9 @@ class BinaryOperation: public Expression {
|
|
|
| TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); }
|
| void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
| - TypeInfo left_type() const { return left_type_; }
|
| - TypeInfo right_type() const { return right_type_; }
|
| - TypeInfo result_type() const { return result_type_; }
|
| + Handle<Type> left_type() const { return left_type_; }
|
| + Handle<Type> right_type() const { return right_type_; }
|
| + Handle<Type> result_type() const { return result_type_; }
|
| bool has_fixed_right_arg() const { return has_fixed_right_arg_; }
|
| int fixed_right_arg_value() const { return fixed_right_arg_value_; }
|
|
|
| @@ -1917,9 +1909,9 @@ class BinaryOperation: public Expression {
|
| Expression* right_;
|
| int pos_;
|
|
|
| - TypeInfo left_type_;
|
| - TypeInfo right_type_;
|
| - TypeInfo result_type_;
|
| + Handle<Type> left_type_;
|
| + Handle<Type> right_type_;
|
| + Handle<Type> result_type_;
|
| bool has_fixed_right_arg_;
|
| int fixed_right_arg_value_;
|
|
|
| @@ -2003,11 +1995,10 @@ class CompareOperation: public Expression {
|
| // Type feedback information.
|
| TypeFeedbackId CompareOperationFeedbackId() const { return reuse(id()); }
|
| void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
| - TypeInfo left_type() const { return left_type_; }
|
| - TypeInfo right_type() const { return right_type_; }
|
| - TypeInfo overall_type() const { return overall_type_; }
|
| - byte compare_nil_types() const { return compare_nil_types_; }
|
| - Handle<Map> map() const { return map_; }
|
| + Handle<Type> left_type() const { return left_type_; }
|
| + Handle<Type> right_type() const { return right_type_; }
|
| + Handle<Type> overall_type() const { return overall_type_; }
|
| + Handle<Type> compare_nil_type() const { return compare_nil_type_; }
|
|
|
| // Match special cases.
|
| bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check);
|
| @@ -2034,11 +2025,10 @@ class CompareOperation: public Expression {
|
| Expression* right_;
|
| int pos_;
|
|
|
| - TypeInfo left_type_;
|
| - TypeInfo right_type_;
|
| - TypeInfo overall_type_;
|
| - byte compare_nil_types_;
|
| - Handle<Map> map_;
|
| + Handle<Type> left_type_;
|
| + Handle<Type> right_type_;
|
| + Handle<Type> overall_type_;
|
| + Handle<Type> compare_nil_type_;
|
| };
|
|
|
|
|
|
|