aboutsummaryrefslogtreecommitdiff
path: root/src/parsing/rewriter.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2016-03-22 12:00:34 +0000
committerBen Murdoch <benm@google.com>2016-04-05 15:27:36 +0100
commit014dc512cdd3e367bee49a713fdc5ed92584a3e5 (patch)
tree742b8bb81c9998b13f6a801f8e0bec6ae9a568c1 /src/parsing/rewriter.h
parent094c92c64194bd11593e915f372914dcfccf9dd2 (diff)
downloadv8-014dc512cdd3e367bee49a713fdc5ed92584a3e5.tar.gz
Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28 Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
Diffstat (limited to 'src/parsing/rewriter.h')
-rw-r--r--src/parsing/rewriter.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/parsing/rewriter.h b/src/parsing/rewriter.h
new file mode 100644
index 00000000..477644a7
--- /dev/null
+++ b/src/parsing/rewriter.h
@@ -0,0 +1,36 @@
+// Copyright 2011 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_PARSING_REWRITER_H_
+#define V8_PARSING_REWRITER_H_
+
+namespace v8 {
+namespace internal {
+
+class AstValueFactory;
+class DoExpression;
+class ParseInfo;
+class Parser;
+
+class Rewriter {
+ public:
+ // Rewrite top-level code (ECMA 262 "programs") so as to conservatively
+ // include an assignment of the value of the last statement in the code to
+ // a compiler-generated temporary variable wherever needed.
+ //
+ // Assumes code has been parsed and scopes have been analyzed. Mutates the
+ // AST, so the AST should not continue to be used in the case of failure.
+ static bool Rewrite(ParseInfo* info);
+
+ // Rewrite a list of statements, using the same rules as a top-level program,
+ // to ensure identical behaviour of completion result.
+ static bool Rewrite(Parser* parser, DoExpression* expr,
+ AstValueFactory* factory);
+};
+
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_PARSING_REWRITER_H_