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

Side by Side Diff: runtime/vm/ast.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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/code_generator_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_H_ 5 #ifndef VM_AST_H_
6 #define VM_AST_H_ 6 #define VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode); 1807 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode);
1808 }; 1808 };
1809 1809
1810 1810
1811 // The body of a Dart function marked as 'native' consists of this node. 1811 // The body of a Dart function marked as 'native' consists of this node.
1812 class NativeBodyNode : public AstNode { 1812 class NativeBodyNode : public AstNode {
1813 public: 1813 public:
1814 NativeBodyNode(intptr_t token_pos, 1814 NativeBodyNode(intptr_t token_pos,
1815 const Function& function, 1815 const Function& function,
1816 const String& native_c_function_name, 1816 const String& native_c_function_name,
1817 NativeFunction native_c_function,
1818 LocalScope* scope, 1817 LocalScope* scope,
1819 bool is_bootstrap_native,
1820 bool link_lazily = false) 1818 bool link_lazily = false)
1821 : AstNode(token_pos), 1819 : AstNode(token_pos),
1822 function_(function), 1820 function_(function),
1823 native_c_function_name_(native_c_function_name), 1821 native_c_function_name_(native_c_function_name),
1824 native_c_function_(native_c_function),
1825 scope_(scope), 1822 scope_(scope),
1826 is_bootstrap_native_(is_bootstrap_native),
1827 link_lazily_(link_lazily) { 1823 link_lazily_(link_lazily) {
1828 ASSERT(function_.IsZoneHandle()); 1824 ASSERT(function_.IsZoneHandle());
1829 ASSERT(native_c_function_ != NULL);
1830 ASSERT(native_c_function_name_.IsZoneHandle()); 1825 ASSERT(native_c_function_name_.IsZoneHandle());
1831 ASSERT(native_c_function_name_.IsSymbol()); 1826 ASSERT(native_c_function_name_.IsSymbol());
1832 } 1827 }
1833 1828
1834 const Function& function() const { return function_; } 1829 const Function& function() const { return function_; }
1835 const String& native_c_function_name() const { 1830 const String& native_c_function_name() const {
1836 return native_c_function_name_; 1831 return native_c_function_name_;
1837 } 1832 }
1838 NativeFunction native_c_function() const { return native_c_function_; }
1839 LocalScope* scope() const { return scope_; } 1833 LocalScope* scope() const { return scope_; }
1840 bool is_bootstrap_native() const { return is_bootstrap_native_; }
1841 1834
1842 bool link_lazily() const { return link_lazily_; } 1835 bool link_lazily() const { return link_lazily_; }
1843 1836
1844 virtual void VisitChildren(AstNodeVisitor* visitor) const { } 1837 virtual void VisitChildren(AstNodeVisitor* visitor) const { }
1845 1838
1846 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode); 1839 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode);
1847 1840
1848 private: 1841 private:
1849 const Function& function_; // Native Dart function. 1842 const Function& function_; // Native Dart function.
1850 const String& native_c_function_name_; 1843 const String& native_c_function_name_;
1851 NativeFunction native_c_function_; // Actual non-Dart implementation.
1852 LocalScope* scope_; 1844 LocalScope* scope_;
1853 const bool is_bootstrap_native_; // Is a bootstrap native method.
1854 const bool link_lazily_; 1845 const bool link_lazily_;
1855 1846
1856 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode); 1847 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
1857 }; 1848 };
1858 1849
1859 1850
1860 class CatchClauseNode : public AstNode { 1851 class CatchClauseNode : public AstNode {
1861 public: 1852 public:
1862 static const intptr_t kInvalidTryIndex = -1; 1853 static const intptr_t kInvalidTryIndex = -1;
1863 1854
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 const intptr_t try_index_; 2018 const intptr_t try_index_;
2028 2019
2029 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 2020 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
2030 }; 2021 };
2031 2022
2032 } // namespace dart 2023 } // namespace dart
2033 2024
2034 #undef DECLARE_COMMON_NODE_FUNCTIONS 2025 #undef DECLARE_COMMON_NODE_FUNCTIONS
2035 2026
2036 #endif // VM_AST_H_ 2027 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698