Chromium Code Reviews| Index: src/ast.h |
| diff --git a/src/ast.h b/src/ast.h |
| index e9a06ec5bf784b4f0054312003d5a0d0c5f9dd26..04195cdc926eceb88b9e46339f2e5a7e98854337 100644 |
| --- a/src/ast.h |
| +++ b/src/ast.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright 2010 the V8 project authors. All rights reserved. |
| +// Copyright 2011 the V8 project authors. All rights reserved. |
| // Redistribution and use in source and binary forms, with or without |
| // modification, are permitted provided that the following conditions are |
| // met: |
| @@ -222,6 +222,11 @@ class Expression: public AstNode { |
| Expression() : bitfields_(0) {} |
| + virtual int position() const { |
| + UNREACHABLE(); |
| + return 0; |
| + } |
| + |
| virtual Expression* AsExpression() { return this; } |
| virtual bool IsTrivial() { return false; } |
| @@ -318,6 +323,14 @@ class Expression: public AstNode { |
| bitfields_ |= NumBitOpsField::encode(num_bit_ops); |
| } |
| + ExternalArrayType external_array_type() const { |
| + return ExternalArrayTypeField::decode(bitfields_); |
| + } |
| + void set_external_array_type(ExternalArrayType array_type) { |
| + bitfields_ &= ~ExternalArrayTypeField::mask(); |
| + bitfields_ |= ExternalArrayTypeField::encode(array_type); |
| + } |
| + |
| private: |
| static const int kMaxNumBitOps = (1 << 5) - 1; |
| @@ -330,6 +343,7 @@ class Expression: public AstNode { |
| class ToInt32Field : public BitField<bool, 2, 1> {}; |
| class NumBitOpsField : public BitField<int, 3, 5> {}; |
| class LoopConditionField: public BitField<bool, 8, 1> {}; |
| + class ExternalArrayTypeField: public BitField<ExternalArrayType, 9, 4> {}; |
| }; |
| @@ -696,7 +710,7 @@ class CaseClause: public ZoneObject { |
| JumpTarget* body_target() { return &body_target_; } |
| ZoneList<Statement*>* statements() const { return statements_; } |
| - int position() { return position_; } |
| + int position() const { return position_; } |
|
Mads Ager (chromium)
2011/04/06 16:45:15
Repeat the virtual keyword all the way down for vi
|
| void set_position(int pos) { position_ = pos; } |
| int EntryId() { return entry_id_; } |
| @@ -1255,11 +1269,6 @@ class Property: public Expression { |
| } |
| bool is_arguments_access() const { return is_arguments_access_; } |
| - ExternalArrayType GetExternalArrayType() const { return array_type_; } |
| - void SetExternalArrayType(ExternalArrayType array_type) { |
| - array_type_ = array_type; |
| - } |
| - |
| // Type feedback information. |
| void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| virtual bool IsMonomorphic() { return is_monomorphic_; } |
| @@ -1283,7 +1292,6 @@ class Property: public Expression { |
| bool is_function_prototype_ : 1; |
| bool is_arguments_access_ : 1; |
| Handle<Map> monomorphic_receiver_type_; |
| - ExternalArrayType array_type_; |
| }; |
| @@ -1305,7 +1313,7 @@ class Call: public Expression { |
| Expression* expression() const { return expression_; } |
| ZoneList<Expression*>* arguments() const { return arguments_; } |
| - int position() { return pos_; } |
| + int position() const { return pos_; } |
| void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
| @@ -1383,7 +1391,7 @@ class CallNew: public Expression { |
| Expression* expression() const { return expression_; } |
| ZoneList<Expression*>* arguments() const { return arguments_; } |
| - int position() { return pos_; } |
| + int position() const { return pos_; } |
| private: |
| Expression* expression_; |
| @@ -1527,14 +1535,22 @@ class CountOperation: public Expression { |
| virtual bool IsInlineable() const; |
| + void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| + virtual bool IsMonomorphic() { return is_monomorphic_; } |
| + virtual Handle<Map> GetMonomorphicReceiverType() { |
| + return monomorphic_receiver_type_; |
| + } |
| + |
| // Bailout support. |
| int AssignmentId() const { return assignment_id_; } |
| private: |
| bool is_prefix_; |
| + bool is_monomorphic_; |
| IncrementOperation* increment_; |
| int pos_; |
| int assignment_id_; |
| + Handle<Map> monomorphic_receiver_type_; |
| }; |
| @@ -1648,7 +1664,7 @@ class Assignment: public Expression { |
| Token::Value op() const { return op_; } |
| Expression* target() const { return target_; } |
| Expression* value() const { return value_; } |
| - int position() { return pos_; } |
| + int position() const { return pos_; } |
| BinaryOperation* binary_operation() const { return binary_operation_; } |
| // This check relies on the definition order of token in token.h. |
| @@ -1670,10 +1686,6 @@ class Assignment: public Expression { |
| virtual Handle<Map> GetMonomorphicReceiverType() { |
| return monomorphic_receiver_type_; |
| } |
| - ExternalArrayType GetExternalArrayType() const { return array_type_; } |
| - void SetExternalArrayType(ExternalArrayType array_type) { |
| - array_type_ = array_type; |
| - } |
| // Bailout support. |
| int CompoundLoadId() const { return compound_load_id_; } |
| @@ -1694,7 +1706,6 @@ class Assignment: public Expression { |
| bool is_monomorphic_; |
| ZoneMapList* receiver_types_; |
| Handle<Map> monomorphic_receiver_type_; |
| - ExternalArrayType array_type_; |
| }; |