Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| =================================================================== |
| --- runtime/vm/intermediate_language.h (revision 4774) |
| +++ runtime/vm/intermediate_language.h (working copy) |
| @@ -6,6 +6,7 @@ |
| #define VM_INTERMEDIATE_LANGUAGE_H_ |
| #include "vm/allocation.h" |
| +#include "vm/ast.h" |
| #include "vm/growable_array.h" |
| #include "vm/handles_impl.h" |
| #include "vm/object.h" |
| @@ -14,6 +15,7 @@ |
| class FlowGraphVisitor; |
| class LocalVariable; |
| +class NativeBodyNode; |
|
Kevin Millikin (Google)
2012/03/01 09:26:22
Do you want both the include of ast.h and the forw
srdjan
2012/03/01 17:25:42
Forgot to remove. Removed.
|
| // Computations and values. |
| // |
| @@ -24,6 +26,7 @@ |
| // | LoadLocal <LocalVariable> |
| // | StoreLocal <LocalVariable> <Value> |
| // | StrictCompare <Token::kind> <Value> <Value> |
| +// | NativeCall <String> <NativeFunction> <int> <bool> |
| // |
| // <Value> ::= Temp <int> |
| // | Constant <Instance> |
| @@ -40,10 +43,11 @@ |
| FOR_EACH_VALUE(M) \ |
| M(AssertAssignable, AssertAssignableComp) \ |
| M(InstanceCall, InstanceCallComp) \ |
| - M(StrictCompare, StrictCompareComp) \ |
| M(StaticCall, StaticCallComp) \ |
| M(LoadLocal, LoadLocalComp) \ |
| - M(StoreLocal, StoreLocalComp) |
| + M(StoreLocal, StoreLocalComp) \ |
| + M(StrictCompare, StrictCompareComp) \ |
| + M(NativeCall, NativeCallComp) \ |
| #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; |
| @@ -236,6 +240,23 @@ |
| DISALLOW_COPY_AND_ASSIGN(StoreLocalComp); |
| }; |
| + |
| +class NativeCallComp : public Computation { |
| + public: |
| + explicit NativeCallComp(NativeBodyNode* node) : ast_node_(*node) {} |
|
Kevin Millikin (Google)
2012/03/01 09:26:22
I think this is fine to store the AST node and for
|
| + |
| + DECLARE_COMPUTATION(NativeCall) |
| + |
| + const String& native_name() const { |
| + return ast_node_.native_c_function_name(); |
| + } |
| + |
| + private: |
| + const NativeBodyNode& ast_node_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NativeCallComp); |
| +}; |
| + |
| #undef DECLARE_COMPUTATION |