Chromium Code Reviews| 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 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1872 void set_target(Handle<JSFunction> target) { target_ = target; } | 1872 void set_target(Handle<JSFunction> target) { target_ = target; } |
| 1873 void set_allocation_site(Handle<AllocationSite> site) { | 1873 void set_allocation_site(Handle<AllocationSite> site) { |
| 1874 allocation_site_ = site; | 1874 allocation_site_ = site; |
| 1875 } | 1875 } |
| 1876 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator* it); | 1876 bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator* it); |
| 1877 | 1877 |
| 1878 static int num_ids() { return parent_num_ids() + 2; } | 1878 static int num_ids() { return parent_num_ids() + 2; } |
| 1879 BailoutId ReturnId() const { return BailoutId(local_id(0)); } | 1879 BailoutId ReturnId() const { return BailoutId(local_id(0)); } |
| 1880 BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); } | 1880 BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); } |
| 1881 | 1881 |
| 1882 bool is_uninitialized() const { | |
| 1883 return IsUninitializedField::decode(bit_field_); | |
| 1884 } | |
| 1885 void set_is_uninitialized(bool b) { | |
| 1886 bit_field_ = IsUninitializedField::update(bit_field_, b); | |
| 1887 } | |
| 1888 | |
| 1882 enum CallType { | 1889 enum CallType { |
| 1883 POSSIBLY_EVAL_CALL, | 1890 POSSIBLY_EVAL_CALL, |
| 1884 GLOBAL_CALL, | 1891 GLOBAL_CALL, |
| 1885 LOOKUP_SLOT_CALL, | 1892 LOOKUP_SLOT_CALL, |
| 1886 PROPERTY_CALL, | 1893 PROPERTY_CALL, |
| 1887 SUPER_CALL, | 1894 SUPER_CALL, |
| 1888 OTHER_CALL | 1895 OTHER_CALL |
| 1889 }; | 1896 }; |
| 1890 | 1897 |
| 1891 // Helpers to determine how to handle the call. | 1898 // Helpers to determine how to handle the call. |
| 1892 CallType GetCallType(Isolate* isolate) const; | 1899 CallType GetCallType(Isolate* isolate) const; |
| 1893 bool IsUsingCallFeedbackSlot(Isolate* isolate) const; | 1900 bool IsUsingCallFeedbackSlot(Isolate* isolate) const; |
| 1894 | 1901 |
| 1895 #ifdef DEBUG | 1902 #ifdef DEBUG |
| 1896 // Used to assert that the FullCodeGenerator records the return site. | 1903 // Used to assert that the FullCodeGenerator records the return site. |
| 1897 bool return_is_recorded_; | 1904 bool return_is_recorded_; |
| 1898 #endif | 1905 #endif |
| 1899 | 1906 |
| 1900 protected: | 1907 protected: |
| 1901 Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, | 1908 Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, |
| 1902 int pos) | 1909 int pos) |
| 1903 : Expression(zone, pos), | 1910 : Expression(zone, pos), |
| 1904 call_feedback_slot_(FeedbackVectorICSlot::Invalid()), | 1911 call_feedback_slot_(FeedbackVectorICSlot::Invalid()), |
| 1905 expression_(expression), | 1912 expression_(expression), |
| 1906 arguments_(arguments) { | 1913 arguments_(arguments), |
| 1914 bit_field_(IsUninitializedField::encode(false)) { | |
| 1907 if (expression->IsProperty()) { | 1915 if (expression->IsProperty()) { |
| 1908 expression->AsProperty()->mark_for_call(); | 1916 expression->AsProperty()->mark_for_call(); |
| 1909 } | 1917 } |
| 1910 } | 1918 } |
| 1911 static int parent_num_ids() { return Expression::num_ids(); } | 1919 static int parent_num_ids() { return Expression::num_ids(); } |
| 1912 | 1920 |
| 1913 private: | 1921 private: |
| 1914 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 1922 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 1915 | 1923 |
| 1916 FeedbackVectorICSlot call_feedback_slot_; | 1924 FeedbackVectorICSlot call_feedback_slot_; |
| 1917 Expression* expression_; | 1925 Expression* expression_; |
| 1918 ZoneList<Expression*>* arguments_; | 1926 ZoneList<Expression*>* arguments_; |
| 1919 Handle<JSFunction> target_; | 1927 Handle<JSFunction> target_; |
| 1920 Handle<Cell> cell_; | 1928 Handle<Cell> cell_; |
| 1921 Handle<AllocationSite> allocation_site_; | 1929 Handle<AllocationSite> allocation_site_; |
| 1930 class IsUninitializedField : public BitField8<bool, 0, 1> {}; | |
|
Sven Panne
2014/11/21 07:34:27
This is not so good for 2 reasons: Even on 32bit,
| |
| 1931 uint8_t bit_field_; | |
| 1922 }; | 1932 }; |
| 1923 | 1933 |
| 1924 | 1934 |
| 1925 class CallNew FINAL : public Expression { | 1935 class CallNew FINAL : public Expression { |
| 1926 public: | 1936 public: |
| 1927 DECLARE_NODE_TYPE(CallNew) | 1937 DECLARE_NODE_TYPE(CallNew) |
| 1928 | 1938 |
| 1929 Expression* expression() const { return expression_; } | 1939 Expression* expression() const { return expression_; } |
| 1930 ZoneList<Expression*>* arguments() const { return arguments_; } | 1940 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 1931 | 1941 |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3533 | 3543 |
| 3534 private: | 3544 private: |
| 3535 Zone* zone_; | 3545 Zone* zone_; |
| 3536 AstValueFactory* ast_value_factory_; | 3546 AstValueFactory* ast_value_factory_; |
| 3537 }; | 3547 }; |
| 3538 | 3548 |
| 3539 | 3549 |
| 3540 } } // namespace v8::internal | 3550 } } // namespace v8::internal |
| 3541 | 3551 |
| 3542 #endif // V8_AST_H_ | 3552 #endif // V8_AST_H_ |
| OLD | NEW |