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

Side by Side Diff: runtime/vm/ast.h

Issue 1294113004: VM: Link native calls lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/code_patcher.h » ('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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 1798
1799 1799
1800 // The body of a Dart function marked as 'native' consists of this node. 1800 // The body of a Dart function marked as 'native' consists of this node.
1801 class NativeBodyNode : public AstNode { 1801 class NativeBodyNode : public AstNode {
1802 public: 1802 public:
1803 NativeBodyNode(intptr_t token_pos, 1803 NativeBodyNode(intptr_t token_pos,
1804 const Function& function, 1804 const Function& function,
1805 const String& native_c_function_name, 1805 const String& native_c_function_name,
1806 NativeFunction native_c_function, 1806 NativeFunction native_c_function,
1807 LocalScope* scope, 1807 LocalScope* scope,
1808 bool is_bootstrap_native) 1808 bool is_bootstrap_native,
1809 bool link_lazily = false)
1809 : AstNode(token_pos), 1810 : AstNode(token_pos),
1810 function_(function), 1811 function_(function),
1811 native_c_function_name_(native_c_function_name), 1812 native_c_function_name_(native_c_function_name),
1812 native_c_function_(native_c_function), 1813 native_c_function_(native_c_function),
1813 scope_(scope), 1814 scope_(scope),
1814 is_bootstrap_native_(is_bootstrap_native) { 1815 is_bootstrap_native_(is_bootstrap_native),
1816 link_lazily_(link_lazily) {
1815 ASSERT(function_.IsZoneHandle()); 1817 ASSERT(function_.IsZoneHandle());
1816 ASSERT(native_c_function_ != NULL); 1818 ASSERT(native_c_function_ != NULL);
1817 ASSERT(native_c_function_name_.IsZoneHandle()); 1819 ASSERT(native_c_function_name_.IsZoneHandle());
1818 ASSERT(native_c_function_name_.IsSymbol()); 1820 ASSERT(native_c_function_name_.IsSymbol());
1819 } 1821 }
1820 1822
1821 const Function& function() const { return function_; } 1823 const Function& function() const { return function_; }
1822 const String& native_c_function_name() const { 1824 const String& native_c_function_name() const {
1823 return native_c_function_name_; 1825 return native_c_function_name_;
1824 } 1826 }
1825 NativeFunction native_c_function() const { return native_c_function_; } 1827 NativeFunction native_c_function() const { return native_c_function_; }
1826 LocalScope* scope() const { return scope_; } 1828 LocalScope* scope() const { return scope_; }
1827 bool is_bootstrap_native() const { return is_bootstrap_native_; } 1829 bool is_bootstrap_native() const { return is_bootstrap_native_; }
1828 1830
1831 bool link_lazily() const { return link_lazily_; }
1832
1829 virtual void VisitChildren(AstNodeVisitor* visitor) const { } 1833 virtual void VisitChildren(AstNodeVisitor* visitor) const { }
1830 1834
1831 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode); 1835 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode);
1832 1836
1833 private: 1837 private:
1834 const Function& function_; // Native Dart function. 1838 const Function& function_; // Native Dart function.
1835 const String& native_c_function_name_; 1839 const String& native_c_function_name_;
1836 NativeFunction native_c_function_; // Actual non-Dart implementation. 1840 NativeFunction native_c_function_; // Actual non-Dart implementation.
1837 LocalScope* scope_; 1841 LocalScope* scope_;
1838 const bool is_bootstrap_native_; // Is a bootstrap native method. 1842 const bool is_bootstrap_native_; // Is a bootstrap native method.
1843 const bool link_lazily_;
1839 1844
1840 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode); 1845 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
1841 }; 1846 };
1842 1847
1843 1848
1844 class CatchClauseNode : public AstNode { 1849 class CatchClauseNode : public AstNode {
1845 public: 1850 public:
1846 static const intptr_t kInvalidTryIndex = -1; 1851 static const intptr_t kInvalidTryIndex = -1;
1847 1852
1848 CatchClauseNode(intptr_t token_pos, 1853 CatchClauseNode(intptr_t token_pos,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 const intptr_t try_index_; 2016 const intptr_t try_index_;
2012 2017
2013 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 2018 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
2014 }; 2019 };
2015 2020
2016 } // namespace dart 2021 } // namespace dart
2017 2022
2018 #undef DECLARE_COMMON_NODE_FUNCTIONS 2023 #undef DECLARE_COMMON_NODE_FUNCTIONS
2019 2024
2020 #endif // VM_AST_H_ 2025 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_patcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698