OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_AST_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 MATERIALIZED_LITERAL, // Property value is a materialized literal. | 1407 MATERIALIZED_LITERAL, // Property value is a materialized literal. |
1408 GETTER, SETTER, // Property is an accessor function. | 1408 GETTER, SETTER, // Property is an accessor function. |
1409 PROTOTYPE // Property is __proto__. | 1409 PROTOTYPE // Property is __proto__. |
1410 }; | 1410 }; |
1411 | 1411 |
1412 Expression* key() { return key_; } | 1412 Expression* key() { return key_; } |
1413 Expression* value() { return value_; } | 1413 Expression* value() { return value_; } |
1414 Kind kind() { return kind_; } | 1414 Kind kind() { return kind_; } |
1415 | 1415 |
1416 // Type feedback information. | 1416 // Type feedback information. |
1417 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | |
1418 bool IsMonomorphic() { return !receiver_type_.is_null(); } | 1417 bool IsMonomorphic() { return !receiver_type_.is_null(); } |
1419 Handle<Map> GetReceiverType() { return receiver_type_; } | 1418 Handle<Map> GetReceiverType() { return receiver_type_; } |
1420 | 1419 |
1421 bool IsCompileTimeValue(); | 1420 bool IsCompileTimeValue(); |
1422 | 1421 |
1423 void set_emit_store(bool emit_store); | 1422 void set_emit_store(bool emit_store); |
1424 bool emit_store(); | 1423 bool emit_store(); |
1425 | 1424 |
1426 bool is_static() const { return is_static_; } | 1425 bool is_static() const { return is_static_; } |
1427 bool is_computed_name() const { return is_computed_name_; } | 1426 bool is_computed_name() const { return is_computed_name_; } |
1428 | 1427 |
| 1428 void set_receiver_type(Handle<Map> map) { receiver_type_ = map; } |
| 1429 |
1429 protected: | 1430 protected: |
1430 friend class AstNodeFactory; | 1431 friend class AstNodeFactory; |
1431 | 1432 |
1432 ObjectLiteralProperty(Expression* key, Expression* value, Kind kind, | 1433 ObjectLiteralProperty(Expression* key, Expression* value, Kind kind, |
1433 bool is_static, bool is_computed_name); | 1434 bool is_static, bool is_computed_name); |
1434 ObjectLiteralProperty(AstValueFactory* ast_value_factory, Expression* key, | 1435 ObjectLiteralProperty(AstValueFactory* ast_value_factory, Expression* key, |
1435 Expression* value, bool is_static, | 1436 Expression* value, bool is_static, |
1436 bool is_computed_name); | 1437 bool is_computed_name); |
1437 | 1438 |
1438 private: | 1439 private: |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 | 1905 |
1905 FeedbackVectorSlot CallNewFeedbackSlot() { | 1906 FeedbackVectorSlot CallNewFeedbackSlot() { |
1906 DCHECK(!callnew_feedback_slot_.IsInvalid()); | 1907 DCHECK(!callnew_feedback_slot_.IsInvalid()); |
1907 return callnew_feedback_slot_; | 1908 return callnew_feedback_slot_; |
1908 } | 1909 } |
1909 FeedbackVectorSlot AllocationSiteFeedbackSlot() { | 1910 FeedbackVectorSlot AllocationSiteFeedbackSlot() { |
1910 DCHECK(FLAG_pretenuring_call_new); | 1911 DCHECK(FLAG_pretenuring_call_new); |
1911 return CallNewFeedbackSlot().next(); | 1912 return CallNewFeedbackSlot().next(); |
1912 } | 1913 } |
1913 | 1914 |
1914 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | |
1915 bool IsMonomorphic() OVERRIDE { return is_monomorphic_; } | 1915 bool IsMonomorphic() OVERRIDE { return is_monomorphic_; } |
1916 Handle<JSFunction> target() const { return target_; } | 1916 Handle<JSFunction> target() const { return target_; } |
1917 Handle<AllocationSite> allocation_site() const { | 1917 Handle<AllocationSite> allocation_site() const { |
1918 return allocation_site_; | 1918 return allocation_site_; |
1919 } | 1919 } |
1920 | 1920 |
1921 static int num_ids() { return parent_num_ids() + 1; } | 1921 static int num_ids() { return parent_num_ids() + 1; } |
1922 static int feedback_slots() { return 1; } | 1922 static int feedback_slots() { return 1; } |
1923 BailoutId ReturnId() const { return BailoutId(local_id(0)); } | 1923 BailoutId ReturnId() const { return BailoutId(local_id(0)); } |
1924 | 1924 |
| 1925 void set_allocation_site(Handle<AllocationSite> site) { |
| 1926 allocation_site_ = site; |
| 1927 } |
| 1928 void set_is_monomorphic(bool monomorphic) { is_monomorphic_ = monomorphic; } |
| 1929 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1930 |
1925 protected: | 1931 protected: |
1926 CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, | 1932 CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, |
1927 int pos) | 1933 int pos) |
1928 : Expression(zone, pos), | 1934 : Expression(zone, pos), |
1929 expression_(expression), | 1935 expression_(expression), |
1930 arguments_(arguments), | 1936 arguments_(arguments), |
1931 is_monomorphic_(false), | 1937 is_monomorphic_(false), |
1932 callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {} | 1938 callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {} |
1933 | 1939 |
1934 static int parent_num_ids() { return Expression::num_ids(); } | 1940 static int parent_num_ids() { return Expression::num_ids(); } |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3490 | 3496 |
3491 private: | 3497 private: |
3492 Zone* zone_; | 3498 Zone* zone_; |
3493 AstValueFactory* ast_value_factory_; | 3499 AstValueFactory* ast_value_factory_; |
3494 }; | 3500 }; |
3495 | 3501 |
3496 | 3502 |
3497 } } // namespace v8::internal | 3503 } } // namespace v8::internal |
3498 | 3504 |
3499 #endif // V8_AST_H_ | 3505 #endif // V8_AST_H_ |
OLD | NEW |