OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 ZoneList<Expression*>* arguments() const { return arguments_; } | 1568 ZoneList<Expression*>* arguments() const { return arguments_; } |
1569 virtual int position() const { return pos_; } | 1569 virtual int position() const { return pos_; } |
1570 | 1570 |
1571 // Type feedback information. | 1571 // Type feedback information. |
1572 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } | 1572 TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } |
1573 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1573 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1574 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1574 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1575 Handle<JSFunction> target() { return target_; } | 1575 Handle<JSFunction> target() { return target_; } |
1576 | 1576 |
1577 BailoutId ReturnId() const { return return_id_; } | 1577 BailoutId ReturnId() const { return return_id_; } |
1578 | 1578 ElementsKind elements_kind() const { return elements_kind_; } |
| 1579 |
1579 protected: | 1580 protected: |
1580 CallNew(Isolate* isolate, | 1581 CallNew(Isolate* isolate, |
1581 Expression* expression, | 1582 Expression* expression, |
1582 ZoneList<Expression*>* arguments, | 1583 ZoneList<Expression*>* arguments, |
1583 int pos) | 1584 int pos) |
1584 : Expression(isolate), | 1585 : Expression(isolate), |
1585 expression_(expression), | 1586 expression_(expression), |
1586 arguments_(arguments), | 1587 arguments_(arguments), |
1587 pos_(pos), | 1588 pos_(pos), |
1588 is_monomorphic_(false), | 1589 is_monomorphic_(false), |
1589 return_id_(GetNextId(isolate)) { } | 1590 return_id_(GetNextId(isolate)), |
| 1591 elements_kind_(GetInitialFastElementsKind()) { } |
1590 | 1592 |
1591 private: | 1593 private: |
1592 Expression* expression_; | 1594 Expression* expression_; |
1593 ZoneList<Expression*>* arguments_; | 1595 ZoneList<Expression*>* arguments_; |
1594 int pos_; | 1596 int pos_; |
1595 | 1597 |
1596 bool is_monomorphic_; | 1598 bool is_monomorphic_; |
1597 Handle<JSFunction> target_; | 1599 Handle<JSFunction> target_; |
1598 | 1600 |
1599 const BailoutId return_id_; | 1601 const BailoutId return_id_; |
| 1602 ElementsKind elements_kind_; |
1600 }; | 1603 }; |
1601 | 1604 |
1602 | 1605 |
1603 // The CallRuntime class does not represent any official JavaScript | 1606 // The CallRuntime class does not represent any official JavaScript |
1604 // language construct. Instead it is used to call a C or JS function | 1607 // language construct. Instead it is used to call a C or JS function |
1605 // with a set of arguments. This is used from the builtins that are | 1608 // with a set of arguments. This is used from the builtins that are |
1606 // implemented in JavaScript (see "v8natives.js"). | 1609 // implemented in JavaScript (see "v8natives.js"). |
1607 class CallRuntime: public Expression { | 1610 class CallRuntime: public Expression { |
1608 public: | 1611 public: |
1609 DECLARE_NODE_TYPE(CallRuntime) | 1612 DECLARE_NODE_TYPE(CallRuntime) |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 private: | 2906 private: |
2904 Isolate* isolate_; | 2907 Isolate* isolate_; |
2905 Zone* zone_; | 2908 Zone* zone_; |
2906 Visitor visitor_; | 2909 Visitor visitor_; |
2907 }; | 2910 }; |
2908 | 2911 |
2909 | 2912 |
2910 } } // namespace v8::internal | 2913 } } // namespace v8::internal |
2911 | 2914 |
2912 #endif // V8_AST_H_ | 2915 #endif // V8_AST_H_ |
OLD | NEW |