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

Unified Diff: runtime/vm/intermediate_language.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/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 11663)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -54,6 +54,7 @@
#define FOR_EACH_COMPUTATION(M) \
M(AssertAssignable, AssertAssignableComp) \
M(AssertBoolean, AssertBooleanComp) \
+ M(ArgumentDefinitionTest, ArgumentDefinitionTestComp) \
M(CurrentContext, CurrentContextComp) \
M(StoreContext, StoreContextComp) \
M(ClosureCall, ClosureCallComp) \
@@ -550,6 +551,38 @@
};
+class ArgumentDefinitionTestComp : public TemplateComputation<1> {
+ public:
+ ArgumentDefinitionTestComp(ArgumentDefinitionTestNode* node,
+ Value* saved_arguments_descriptor)
+ : ast_node_(*node) {
+ ASSERT(saved_arguments_descriptor != NULL);
+ inputs_[0] = saved_arguments_descriptor;
+ }
+
+ DECLARE_COMPUTATION(ArgumentDefinitionTest)
+
+ intptr_t token_pos() const { return ast_node_.token_pos(); }
+ intptr_t formal_parameter_index() const {
+ return ast_node_.formal_parameter_index();
+ }
+ const String& formal_parameter_name() const {
+ return ast_node_.formal_parameter_name();
+ }
+ Value* saved_arguments_descriptor() const { return inputs_[0]; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kBoolCid; }
+
+ private:
+ const ArgumentDefinitionTestNode& ast_node_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestComp);
+};
+
+
// Denotes the current context, normally held in a register. This is
// a computation, not a value, because it's mutable.
class CurrentContextComp : public TemplateComputation<0> {

Powered by Google App Engine
This is Rietveld 408576698