Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: src/parser.h

Issue 48006: Reapply revisions 1432, 1433, 1469 and 1472 while fixing issue 279. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/objects.h ('K') | « src/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
===================================================================
--- src/parser.h (revision 1544)
+++ src/parser.h (working copy)
@@ -29,6 +29,7 @@
#define V8_PARSER_H_
#include "scanner.h"
+#include "allocation.h"
namespace v8 { namespace internal {
@@ -165,6 +166,35 @@
int end_position,
bool is_expression);
+
+// Support for handling complex values (array and object literals) that
+// can be fully handled at compile time.
+class CompileTimeValue: public AllStatic {
+ public:
+ enum Type {
+ OBJECT_LITERAL,
+ ARRAY_LITERAL
+ };
+
+ static bool IsCompileTimeValue(Expression* expression);
+
+ // Get the value as a compile time value.
+ static Handle<FixedArray> GetValue(Expression* expression);
+
+ // Get the type of a compile time value returned by GetValue().
+ static Type GetType(Handle<FixedArray> value);
+
+ // Get the elements array of a compile time value returned by GetValue().
+ static Handle<FixedArray> GetElements(Handle<FixedArray> value);
+
+ private:
+ static const int kTypeSlot = 0;
+ static const int kElementsSlot = 1;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
+};
+
+
} } // namespace v8::internal
#endif // V8_PARSER_H_
« src/objects.h ('K') | « src/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698