| 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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 Expression* value_; | 963 Expression* value_; |
| 964 Kind kind_; | 964 Kind kind_; |
| 965 bool emit_store_; | 965 bool emit_store_; |
| 966 }; | 966 }; |
| 967 | 967 |
| 968 ObjectLiteral(Handle<FixedArray> constant_properties, | 968 ObjectLiteral(Handle<FixedArray> constant_properties, |
| 969 ZoneList<Property*>* properties, | 969 ZoneList<Property*>* properties, |
| 970 int literal_index, | 970 int literal_index, |
| 971 bool is_simple, | 971 bool is_simple, |
| 972 bool fast_elements, | 972 bool fast_elements, |
| 973 int depth) | 973 int depth, |
| 974 bool has_function) |
| 974 : MaterializedLiteral(literal_index, is_simple, depth), | 975 : MaterializedLiteral(literal_index, is_simple, depth), |
| 975 constant_properties_(constant_properties), | 976 constant_properties_(constant_properties), |
| 976 properties_(properties), | 977 properties_(properties), |
| 977 fast_elements_(fast_elements) {} | 978 fast_elements_(fast_elements), |
| 979 has_function_(has_function) {} |
| 978 | 980 |
| 979 DECLARE_NODE_TYPE(ObjectLiteral) | 981 DECLARE_NODE_TYPE(ObjectLiteral) |
| 980 | 982 |
| 981 Handle<FixedArray> constant_properties() const { | 983 Handle<FixedArray> constant_properties() const { |
| 982 return constant_properties_; | 984 return constant_properties_; |
| 983 } | 985 } |
| 984 ZoneList<Property*>* properties() const { return properties_; } | 986 ZoneList<Property*>* properties() const { return properties_; } |
| 985 | 987 |
| 986 bool fast_elements() const { return fast_elements_; } | 988 bool fast_elements() const { return fast_elements_; } |
| 987 | 989 |
| 990 bool has_function() { return has_function_; } |
| 988 | 991 |
| 989 // Mark all computed expressions that are bound to a key that | 992 // Mark all computed expressions that are bound to a key that |
| 990 // is shadowed by a later occurrence of the same key. For the | 993 // is shadowed by a later occurrence of the same key. For the |
| 991 // marked expressions, no store code is emitted. | 994 // marked expressions, no store code is emitted. |
| 992 void CalculateEmitStore(); | 995 void CalculateEmitStore(); |
| 993 | 996 |
| 997 enum Flags { |
| 998 kNoFlags = 0, |
| 999 kFastElements = 1, |
| 1000 kHasFunction = 1 << 1 |
| 1001 }; |
| 1002 |
| 994 private: | 1003 private: |
| 995 Handle<FixedArray> constant_properties_; | 1004 Handle<FixedArray> constant_properties_; |
| 996 ZoneList<Property*>* properties_; | 1005 ZoneList<Property*>* properties_; |
| 997 bool fast_elements_; | 1006 bool fast_elements_; |
| 1007 bool has_function_; |
| 998 }; | 1008 }; |
| 999 | 1009 |
| 1000 | 1010 |
| 1001 // Node for capturing a regexp literal. | 1011 // Node for capturing a regexp literal. |
| 1002 class RegExpLiteral: public MaterializedLiteral { | 1012 class RegExpLiteral: public MaterializedLiteral { |
| 1003 public: | 1013 public: |
| 1004 RegExpLiteral(Handle<String> pattern, | 1014 RegExpLiteral(Handle<String> pattern, |
| 1005 Handle<String> flags, | 1015 Handle<String> flags, |
| 1006 int literal_index) | 1016 int literal_index) |
| 1007 : MaterializedLiteral(literal_index, false, 1), | 1017 : MaterializedLiteral(literal_index, false, 1), |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2168 AST_NODE_LIST(DEF_VISIT) | 2178 AST_NODE_LIST(DEF_VISIT) |
| 2169 #undef DEF_VISIT | 2179 #undef DEF_VISIT |
| 2170 | 2180 |
| 2171 private: | 2181 private: |
| 2172 bool stack_overflow_; | 2182 bool stack_overflow_; |
| 2173 }; | 2183 }; |
| 2174 | 2184 |
| 2175 } } // namespace v8::internal | 2185 } } // namespace v8::internal |
| 2176 | 2186 |
| 2177 #endif // V8_AST_H_ | 2187 #endif // V8_AST_H_ |
| OLD | NEW |