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

Unified Diff: runtime/vm/ast.h

Issue 10915022: Implement argument definition test in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 11663)
+++ runtime/vm/ast.h (working copy)
@@ -32,6 +32,7 @@
V(ForNode, "for") \
V(JumpNode, "jump") \
V(ArgumentListNode, "args") \
+ V(ArgumentDefinitionTestNode, "defined") \
V(ArrayNode, "array") \
V(ClosureNode, "closure") \
V(InstanceCallNode, "instance call") \
@@ -244,6 +245,41 @@
};
+class ArgumentDefinitionTestNode : public AstNode {
+ public:
+ ArgumentDefinitionTestNode(intptr_t token_pos,
+ intptr_t formal_parameter_index,
+ const String& formal_parameter_name,
+ LocalVariable* saved_arguments_descriptor)
+ : AstNode(token_pos),
+ formal_parameter_index_(formal_parameter_index),
+ formal_parameter_name_(formal_parameter_name),
+ saved_arguments_descriptor_(*saved_arguments_descriptor) {
+ ASSERT(formal_parameter_index_ >= 0);
+ ASSERT(formal_parameter_name_.IsZoneHandle());
+ ASSERT(formal_parameter_name_.IsSymbol());
+ ASSERT(saved_arguments_descriptor != NULL);
+ }
+
+ virtual void VisitChildren(AstNodeVisitor* visitor) const { }
+
+ intptr_t formal_parameter_index() const { return formal_parameter_index_; }
+ const String& formal_parameter_name() const { return formal_parameter_name_; }
+ const LocalVariable& saved_arguments_descriptor() const {
+ return saved_arguments_descriptor_;
+ }
+
+ DECLARE_COMMON_NODE_FUNCTIONS(ArgumentDefinitionTestNode);
+
+ private:
+ const intptr_t formal_parameter_index_;
+ const String& formal_parameter_name_;
+ const LocalVariable& saved_arguments_descriptor_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestNode);
+};
+
+
class ArrayNode : public AstNode {
public:
ArrayNode(intptr_t token_pos, const AbstractType& type)
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/ast_printer.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698