OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 | 1416 |
1417 | 1417 |
1418 class CountOperation: public Expression { | 1418 class CountOperation: public Expression { |
1419 public: | 1419 public: |
1420 CountOperation(Token::Value op, bool is_prefix, Expression* expr, int pos) | 1420 CountOperation(Token::Value op, bool is_prefix, Expression* expr, int pos) |
1421 : op_(op), | 1421 : op_(op), |
1422 is_prefix_(is_prefix), | 1422 is_prefix_(is_prefix), |
1423 expression_(expr), | 1423 expression_(expr), |
1424 pos_(pos), | 1424 pos_(pos), |
1425 assignment_id_(GetNextId()), | 1425 assignment_id_(GetNextId()), |
1426 count_id_(GetNextId()) { } | 1426 count_id_(GetNextId()), |
| 1427 receiver_types_(NULL) { } |
1427 | 1428 |
1428 DECLARE_NODE_TYPE(CountOperation) | 1429 DECLARE_NODE_TYPE(CountOperation) |
1429 | 1430 |
1430 bool is_prefix() const { return is_prefix_; } | 1431 bool is_prefix() const { return is_prefix_; } |
1431 bool is_postfix() const { return !is_prefix_; } | 1432 bool is_postfix() const { return !is_prefix_; } |
1432 | 1433 |
1433 Token::Value op() const { return op_; } | 1434 Token::Value op() const { return op_; } |
1434 Token::Value binary_op() { | 1435 Token::Value binary_op() { |
1435 return (op() == Token::INC) ? Token::ADD : Token::SUB; | 1436 return (op() == Token::INC) ? Token::ADD : Token::SUB; |
1436 } | 1437 } |
1437 | 1438 |
1438 Expression* expression() const { return expression_; } | 1439 Expression* expression() const { return expression_; } |
1439 virtual int position() const { return pos_; } | 1440 virtual int position() const { return pos_; } |
1440 | 1441 |
1441 virtual void MarkAsStatement() { is_prefix_ = true; } | 1442 virtual void MarkAsStatement() { is_prefix_ = true; } |
1442 | 1443 |
1443 virtual bool IsInlineable() const; | 1444 virtual bool IsInlineable() const; |
1444 | 1445 |
1445 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1446 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1446 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1447 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1447 virtual Handle<Map> GetMonomorphicReceiverType() { | 1448 virtual Handle<Map> GetMonomorphicReceiverType() { |
1448 return monomorphic_receiver_type_; | 1449 return monomorphic_receiver_type_; |
1449 } | 1450 } |
| 1451 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1450 | 1452 |
1451 // Bailout support. | 1453 // Bailout support. |
1452 int AssignmentId() const { return assignment_id_; } | 1454 int AssignmentId() const { return assignment_id_; } |
1453 int CountId() const { return count_id_; } | 1455 int CountId() const { return count_id_; } |
1454 | 1456 |
1455 private: | 1457 private: |
1456 Token::Value op_; | 1458 Token::Value op_; |
1457 bool is_prefix_; | 1459 bool is_prefix_; |
1458 bool is_monomorphic_; | 1460 bool is_monomorphic_; |
1459 Expression* expression_; | 1461 Expression* expression_; |
1460 int pos_; | 1462 int pos_; |
1461 int assignment_id_; | 1463 int assignment_id_; |
1462 int count_id_; | 1464 int count_id_; |
1463 Handle<Map> monomorphic_receiver_type_; | 1465 Handle<Map> monomorphic_receiver_type_; |
| 1466 ZoneMapList* receiver_types_; |
1464 }; | 1467 }; |
1465 | 1468 |
1466 | 1469 |
1467 class CompareOperation: public Expression { | 1470 class CompareOperation: public Expression { |
1468 public: | 1471 public: |
1469 CompareOperation(Token::Value op, | 1472 CompareOperation(Token::Value op, |
1470 Expression* left, | 1473 Expression* left, |
1471 Expression* right, | 1474 Expression* right, |
1472 int pos) | 1475 int pos) |
1473 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { | 1476 : op_(op), left_(left), right_(right), pos_(pos), compare_type_(NONE) { |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 | 2147 |
2145 private: | 2148 private: |
2146 Isolate* isolate_; | 2149 Isolate* isolate_; |
2147 bool stack_overflow_; | 2150 bool stack_overflow_; |
2148 }; | 2151 }; |
2149 | 2152 |
2150 | 2153 |
2151 } } // namespace v8::internal | 2154 } } // namespace v8::internal |
2152 | 2155 |
2153 #endif // V8_AST_H_ | 2156 #endif // V8_AST_H_ |
OLD | NEW |