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

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

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode); 1510 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode);
1511 }; 1511 };
1512 1512
1513 1513
1514 // The body of a Dart function marked as 'native' consists of this node. 1514 // The body of a Dart function marked as 'native' consists of this node.
1515 class NativeBodyNode : public AstNode { 1515 class NativeBodyNode : public AstNode {
1516 public: 1516 public:
1517 NativeBodyNode(intptr_t token_pos, 1517 NativeBodyNode(intptr_t token_pos,
1518 const Function& function, 1518 const Function& function,
1519 const String& native_c_function_name, 1519 const String& native_c_function_name,
1520 NativeFunction native_c_function) 1520 NativeFunction native_c_function,
1521 bool is_bootstrap_native)
1521 : AstNode(token_pos), 1522 : AstNode(token_pos),
1522 function_(function), 1523 function_(function),
1523 native_c_function_name_(native_c_function_name), 1524 native_c_function_name_(native_c_function_name),
1524 native_c_function_(native_c_function) { 1525 native_c_function_(native_c_function),
1526 is_bootstrap_native_(is_bootstrap_native) {
1525 ASSERT(function_.IsZoneHandle()); 1527 ASSERT(function_.IsZoneHandle());
1526 ASSERT(native_c_function_ != NULL); 1528 ASSERT(native_c_function_ != NULL);
1527 ASSERT(native_c_function_name_.IsZoneHandle()); 1529 ASSERT(native_c_function_name_.IsZoneHandle());
1528 ASSERT(native_c_function_name_.IsSymbol()); 1530 ASSERT(native_c_function_name_.IsSymbol());
1529 } 1531 }
1530 1532
1531 const Function& function() const { return function_; } 1533 const Function& function() const { return function_; }
1532 const String& native_c_function_name() const { 1534 const String& native_c_function_name() const {
1533 return native_c_function_name_; 1535 return native_c_function_name_;
1534 } 1536 }
1535 NativeFunction native_c_function() const { return native_c_function_; } 1537 NativeFunction native_c_function() const { return native_c_function_; }
1538 bool is_bootstrap_native() const { return is_bootstrap_native_; }
1536 1539
1537 virtual void VisitChildren(AstNodeVisitor* visitor) const { } 1540 virtual void VisitChildren(AstNodeVisitor* visitor) const { }
1538 1541
1539 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode); 1542 DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode);
1540 1543
1541 private: 1544 private:
1542 const Function& function_; // Native Dart function. 1545 const Function& function_; // Native Dart function.
1543 const String& native_c_function_name_; 1546 const String& native_c_function_name_;
1544 NativeFunction native_c_function_; // Actual non-Dart implementation. 1547 NativeFunction native_c_function_; // Actual non-Dart implementation.
1548 bool is_bootstrap_native_; // Is a bootstrap native method.
srdjan 2013/08/06 17:06:28 const
siva 2013/08/06 19:04:26 Done.
1545 1549
1546 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode); 1550 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
1547 }; 1551 };
1548 1552
1549 1553
1550 class CatchClauseNode : public AstNode { 1554 class CatchClauseNode : public AstNode {
1551 public: 1555 public:
1552 static const int kInvalidTryIndex = -1; 1556 static const int kInvalidTryIndex = -1;
1553 1557
1554 CatchClauseNode(intptr_t token_pos, 1558 CatchClauseNode(intptr_t token_pos,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 const intptr_t try_index_; 1710 const intptr_t try_index_;
1707 1711
1708 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1712 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1709 }; 1713 };
1710 1714
1711 } // namespace dart 1715 } // namespace dart
1712 1716
1713 #undef DECLARE_COMMON_NODE_FUNCTIONS 1717 #undef DECLARE_COMMON_NODE_FUNCTIONS
1714 1718
1715 #endif // VM_AST_H_ 1719 #endif // VM_AST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698