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

Unified Diff: runtime/vm/intermediate_language.h

Issue 9559012: Adding Native Call node : a native function consists of that node, it does call into C runtime. In … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698