| 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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 } | 1842 } |
| 1843 | 1843 |
| 1844 bool known_global_function() const { | 1844 bool known_global_function() const { |
| 1845 return global_call() && !target_.is_null(); | 1845 return global_call() && !target_.is_null(); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 Handle<JSFunction> target() { return target_; } | 1848 Handle<JSFunction> target() { return target_; } |
| 1849 | 1849 |
| 1850 Handle<AllocationSite> allocation_site() { return allocation_site_; } | 1850 Handle<AllocationSite> allocation_site() { return allocation_site_; } |
| 1851 | 1851 |
| 1852 void SetKnownGlobalTarget(Handle<JSFunction> target) { |
| 1853 target_ = target; |
| 1854 set_is_uninitialized(false); |
| 1855 } |
| 1852 void set_target(Handle<JSFunction> target) { target_ = target; } | 1856 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1853 void set_allocation_site(Handle<AllocationSite> site) { | 1857 void set_allocation_site(Handle<AllocationSite> site) { |
| 1854 allocation_site_ = site; | 1858 allocation_site_ = site; |
| 1855 } | 1859 } |
| 1856 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator* it); | |
| 1857 | 1860 |
| 1858 static int num_ids() { return parent_num_ids() + 2; } | 1861 static int num_ids() { return parent_num_ids() + 2; } |
| 1859 BailoutId ReturnId() const { return BailoutId(local_id(0)); } | 1862 BailoutId ReturnId() const { return BailoutId(local_id(0)); } |
| 1860 BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); } | 1863 BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); } |
| 1861 | 1864 |
| 1862 bool is_uninitialized() const { | 1865 bool is_uninitialized() const { |
| 1863 return IsUninitializedField::decode(bit_field_); | 1866 return IsUninitializedField::decode(bit_field_); |
| 1864 } | 1867 } |
| 1865 void set_is_uninitialized(bool b) { | 1868 void set_is_uninitialized(bool b) { |
| 1866 bit_field_ = IsUninitializedField::update(bit_field_, b); | 1869 bit_field_ = IsUninitializedField::update(bit_field_, b); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 | 1950 |
| 1948 static int num_ids() { return parent_num_ids() + 1; } | 1951 static int num_ids() { return parent_num_ids() + 1; } |
| 1949 static int feedback_slots() { return 1; } | 1952 static int feedback_slots() { return 1; } |
| 1950 BailoutId ReturnId() const { return BailoutId(local_id(0)); } | 1953 BailoutId ReturnId() const { return BailoutId(local_id(0)); } |
| 1951 | 1954 |
| 1952 void set_allocation_site(Handle<AllocationSite> site) { | 1955 void set_allocation_site(Handle<AllocationSite> site) { |
| 1953 allocation_site_ = site; | 1956 allocation_site_ = site; |
| 1954 } | 1957 } |
| 1955 void set_is_monomorphic(bool monomorphic) { is_monomorphic_ = monomorphic; } | 1958 void set_is_monomorphic(bool monomorphic) { is_monomorphic_ = monomorphic; } |
| 1956 void set_target(Handle<JSFunction> target) { target_ = target; } | 1959 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1960 void SetKnownGlobalTarget(Handle<JSFunction> target) { |
| 1961 target_ = target; |
| 1962 is_monomorphic_ = true; |
| 1963 } |
| 1957 | 1964 |
| 1958 protected: | 1965 protected: |
| 1959 CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, | 1966 CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, |
| 1960 int pos) | 1967 int pos) |
| 1961 : Expression(zone, pos), | 1968 : Expression(zone, pos), |
| 1962 expression_(expression), | 1969 expression_(expression), |
| 1963 arguments_(arguments), | 1970 arguments_(arguments), |
| 1964 is_monomorphic_(false), | 1971 is_monomorphic_(false), |
| 1965 callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {} | 1972 callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {} |
| 1966 | 1973 |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3529 | 3536 |
| 3530 private: | 3537 private: |
| 3531 Zone* zone_; | 3538 Zone* zone_; |
| 3532 AstValueFactory* ast_value_factory_; | 3539 AstValueFactory* ast_value_factory_; |
| 3533 }; | 3540 }; |
| 3534 | 3541 |
| 3535 | 3542 |
| 3536 } } // namespace v8::internal | 3543 } } // namespace v8::internal |
| 3537 | 3544 |
| 3538 #endif // V8_AST_H_ | 3545 #endif // V8_AST_H_ |
| OLD | NEW |