| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 class CompileTimeValue: public AllStatic { | 168 class CompileTimeValue: public AllStatic { |
| 169 public: | 169 public: |
| 170 enum Type { | 170 enum Type { |
| 171 OBJECT_LITERAL_FAST_ELEMENTS, | 171 OBJECT_LITERAL_FAST_ELEMENTS, |
| 172 OBJECT_LITERAL_SLOW_ELEMENTS, | 172 OBJECT_LITERAL_SLOW_ELEMENTS, |
| 173 ARRAY_LITERAL | 173 ARRAY_LITERAL |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 static bool IsCompileTimeValue(Expression* expression); | 176 static bool IsCompileTimeValue(Expression* expression); |
| 177 | 177 |
| 178 static bool ArrayLiteralElementNeedsInitialization(Expression* value); |
| 179 |
| 178 // Get the value as a compile time value. | 180 // Get the value as a compile time value. |
| 179 static Handle<FixedArray> GetValue(Expression* expression); | 181 static Handle<FixedArray> GetValue(Expression* expression); |
| 180 | 182 |
| 181 // Get the type of a compile time value returned by GetValue(). | 183 // Get the type of a compile time value returned by GetValue(). |
| 182 static Type GetType(Handle<FixedArray> value); | 184 static Type GetType(Handle<FixedArray> value); |
| 183 | 185 |
| 184 // Get the elements array of a compile time value returned by GetValue(). | 186 // Get the elements array of a compile time value returned by GetValue(). |
| 185 static Handle<FixedArray> GetElements(Handle<FixedArray> value); | 187 static Handle<FixedArray> GetElements(Handle<FixedArray> value); |
| 186 | 188 |
| 187 private: | 189 private: |
| 188 static const int kTypeSlot = 0; | 190 static const int kTypeSlot = 0; |
| 189 static const int kElementsSlot = 1; | 191 static const int kElementsSlot = 1; |
| 190 | 192 |
| 191 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 193 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 192 }; | 194 }; |
| 193 | 195 |
| 194 | 196 |
| 195 } } // namespace v8::internal | 197 } } // namespace v8::internal |
| 196 | 198 |
| 197 #endif // V8_PARSER_H_ | 199 #endif // V8_PARSER_H_ |
| OLD | NEW |