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

Unified Diff: runtime/vm/intermediate_language.h

Issue 1420173006: Move resolving of natives to a late stage (during code emission). That eliminates unnecessary nativ… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index fbd405122c91180033136e47251ecbc3970f6abe..2b9b76252667df7db260b279a63281291af8a2ce 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -3393,7 +3393,9 @@ class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
class NativeCallInstr : public TemplateDefinition<0, Throws> {
public:
explicit NativeCallInstr(NativeBodyNode* node)
- : ast_node_(*node) {}
+ : ast_node_(*node),
+ native_c_function_(NULL),
+ is_bootstrap_native_(false) { }
DECLARE_INSTRUCTION(NativeCall)
@@ -3406,11 +3408,11 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
}
NativeFunction native_c_function() const {
- return ast_node_.native_c_function();
+ return native_c_function_;
}
bool is_bootstrap_native() const {
- return ast_node_.is_bootstrap_native();
+ return is_bootstrap_native_;
}
bool link_lazily() const {
@@ -3423,8 +3425,18 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::All(); }
+ void SetupNative();
+
private:
+ void set_native_c_function(NativeFunction value) {
+ native_c_function_ = value;
+ }
+
+ void set_is_bootstrap_native(bool value) { is_bootstrap_native_ = value; }
+
const NativeBodyNode& ast_node_;
+ NativeFunction native_c_function_;
+ bool is_bootstrap_native_;
DISALLOW_COPY_AND_ASSIGN(NativeCallInstr);
};
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698