OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 class CompileTimeValue: public AllStatic { | 881 class CompileTimeValue: public AllStatic { |
882 public: | 882 public: |
883 enum LiteralType { | 883 enum LiteralType { |
884 OBJECT_LITERAL_FAST_ELEMENTS, | 884 OBJECT_LITERAL_FAST_ELEMENTS, |
885 OBJECT_LITERAL_SLOW_ELEMENTS, | 885 OBJECT_LITERAL_SLOW_ELEMENTS, |
886 ARRAY_LITERAL | 886 ARRAY_LITERAL |
887 }; | 887 }; |
888 | 888 |
889 static bool IsCompileTimeValue(Expression* expression); | 889 static bool IsCompileTimeValue(Expression* expression); |
890 | 890 |
891 static bool ArrayLiteralElementNeedsInitialization(Expression* value); | |
892 | |
893 // Get the value as a compile time value. | 891 // Get the value as a compile time value. |
894 static Handle<FixedArray> GetValue(Expression* expression); | 892 static Handle<FixedArray> GetValue(Expression* expression); |
895 | 893 |
896 // Get the type of a compile time value returned by GetValue(). | 894 // Get the type of a compile time value returned by GetValue(). |
897 static LiteralType GetLiteralType(Handle<FixedArray> value); | 895 static LiteralType GetLiteralType(Handle<FixedArray> value); |
898 | 896 |
899 // Get the elements array of a compile time value returned by GetValue(). | 897 // Get the elements array of a compile time value returned by GetValue(). |
900 static Handle<FixedArray> GetElements(Handle<FixedArray> value); | 898 static Handle<FixedArray> GetElements(Handle<FixedArray> value); |
901 | 899 |
902 private: | 900 private: |
903 static const int kLiteralTypeSlot = 0; | 901 static const int kLiteralTypeSlot = 0; |
904 static const int kElementsSlot = 1; | 902 static const int kElementsSlot = 1; |
905 | 903 |
906 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 904 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
907 }; | 905 }; |
908 | 906 |
909 } } // namespace v8::internal | 907 } } // namespace v8::internal |
910 | 908 |
911 #endif // V8_PARSER_H_ | 909 #endif // V8_PARSER_H_ |
OLD | NEW |