| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 | 924 |
| 925 virtual bool IsValidLeftHandSide() { | 925 virtual bool IsValidLeftHandSide() { |
| 926 return var_ == NULL ? true : var_->IsValidLeftHandSide(); | 926 return var_ == NULL ? true : var_->IsValidLeftHandSide(); |
| 927 } | 927 } |
| 928 | 928 |
| 929 virtual bool IsLeaf() { | 929 virtual bool IsLeaf() { |
| 930 ASSERT(var_ != NULL); // Variable must be resolved. | 930 ASSERT(var_ != NULL); // Variable must be resolved. |
| 931 return var()->is_global() || var()->rewrite()->IsLeaf(); | 931 return var()->is_global() || var()->rewrite()->IsLeaf(); |
| 932 } | 932 } |
| 933 | 933 |
| 934 // Reading from a mutable variable is a side effect, but 'this' is |
| 935 // immutable. |
| 936 virtual bool IsTrivial() { return is_this(); } |
| 937 |
| 934 bool IsVariable(Handle<String> n) { | 938 bool IsVariable(Handle<String> n) { |
| 935 return !is_this() && name().is_identical_to(n); | 939 return !is_this() && name().is_identical_to(n); |
| 936 } | 940 } |
| 937 | 941 |
| 938 bool IsArguments() { | 942 bool IsArguments() { |
| 939 Variable* variable = AsVariable(); | 943 Variable* variable = AsVariable(); |
| 940 return (variable == NULL) ? false : variable->is_arguments(); | 944 return (variable == NULL) ? false : variable->is_arguments(); |
| 941 } | 945 } |
| 942 | 946 |
| 943 Handle<String> name() const { return name_; } | 947 Handle<String> name() const { return name_; } |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 #undef DEF_VISIT | 1849 #undef DEF_VISIT |
| 1846 | 1850 |
| 1847 private: | 1851 private: |
| 1848 bool stack_overflow_; | 1852 bool stack_overflow_; |
| 1849 }; | 1853 }; |
| 1850 | 1854 |
| 1851 | 1855 |
| 1852 } } // namespace v8::internal | 1856 } } // namespace v8::internal |
| 1853 | 1857 |
| 1854 #endif // V8_AST_H_ | 1858 #endif // V8_AST_H_ |
| OLD | NEW |