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

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

Issue 10821076: - Allow parsing of external methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 void set_closure_allocation_stub(const Code& value) const; 1394 void set_closure_allocation_stub(const Code& value) const;
1395 1395
1396 // Return the closure function implicitly created for this function. 1396 // Return the closure function implicitly created for this function.
1397 // If none exists yet, create one and remember it. 1397 // If none exists yet, create one and remember it.
1398 RawFunction* ImplicitClosureFunction() const; 1398 RawFunction* ImplicitClosureFunction() const;
1399 1399
1400 RawFunction::Kind kind() const { return raw_ptr()->kind_; } 1400 RawFunction::Kind kind() const { return raw_ptr()->kind_; }
1401 1401
1402 bool is_static() const { return raw_ptr()->is_static_; } 1402 bool is_static() const { return raw_ptr()->is_static_; }
1403 bool is_const() const { return raw_ptr()->is_const_; } 1403 bool is_const() const { return raw_ptr()->is_const_; }
1404 bool is_external() const { return raw_ptr()->is_external_; }
1404 bool IsConstructor() const { 1405 bool IsConstructor() const {
1405 return (kind() == RawFunction::kConstructor) && !is_static(); 1406 return (kind() == RawFunction::kConstructor) && !is_static();
1406 } 1407 }
1407 bool IsFactory() const { 1408 bool IsFactory() const {
1408 return (kind() == RawFunction::kConstructor) && is_static(); 1409 return (kind() == RawFunction::kConstructor) && is_static();
1409 } 1410 }
1410 bool IsAbstract() const { 1411 bool IsAbstract() const {
1411 return kind() == RawFunction::kAbstract; 1412 return kind() == RawFunction::kAbstract;
1412 } 1413 }
1413 bool IsDynamicFunction() const { 1414 bool IsDynamicFunction() const {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 1593
1593 1594
1594 static intptr_t InstanceSize() { 1595 static intptr_t InstanceSize() {
1595 return RoundedAllocationSize(sizeof(RawFunction)); 1596 return RoundedAllocationSize(sizeof(RawFunction));
1596 } 1597 }
1597 1598
1598 static RawFunction* New(const String& name, 1599 static RawFunction* New(const String& name,
1599 RawFunction::Kind kind, 1600 RawFunction::Kind kind,
1600 bool is_static, 1601 bool is_static,
1601 bool is_const, 1602 bool is_const,
1603 bool is_external,
1602 intptr_t token_pos); 1604 intptr_t token_pos);
1603 1605
1604 // Allocates a new Function object representing a closure function, as well as 1606 // Allocates a new Function object representing a closure function, as well as
1605 // a new associated Class object representing the signature class of the 1607 // a new associated Class object representing the signature class of the
1606 // function. 1608 // function.
1607 // The function and the class share the same given name. 1609 // The function and the class share the same given name.
1608 static RawFunction* NewClosureFunction(const String& name, 1610 static RawFunction* NewClosureFunction(const String& name,
1609 const Function& parent, 1611 const Function& parent,
1610 intptr_t token_pos); 1612 intptr_t token_pos);
1611 1613
1612 static const int kCtorPhaseInit = 1 << 0; 1614 static const int kCtorPhaseInit = 1 << 0;
1613 static const int kCtorPhaseBody = 1 << 1; 1615 static const int kCtorPhaseBody = 1 << 1;
1614 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); 1616 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody);
1615 1617
1616 private: 1618 private:
1617 void set_name(const String& value) const; 1619 void set_name(const String& value) const;
1618 void set_kind(RawFunction::Kind value) const; 1620 void set_kind(RawFunction::Kind value) const;
1619 void set_is_static(bool is_static) const; 1621 void set_is_static(bool is_static) const;
1620 void set_is_const(bool is_const) const; 1622 void set_is_const(bool is_const) const;
1623 void set_is_external(bool value) const;
1621 void set_parent_function(const Function& value) const; 1624 void set_parent_function(const Function& value) const;
1622 void set_token_pos(intptr_t value) const; 1625 void set_token_pos(intptr_t value) const;
1623 void set_implicit_closure_function(const Function& value) const; 1626 void set_implicit_closure_function(const Function& value) const;
1624 static RawFunction* New(); 1627 static RawFunction* New();
1625 1628
1626 RawString* BuildSignature(bool instantiate, 1629 RawString* BuildSignature(bool instantiate,
1627 NameVisibility name_visibility, 1630 NameVisibility name_visibility,
1628 const AbstractTypeArguments& instantiator) const; 1631 const AbstractTypeArguments& instantiator) const;
1629 1632
1630 // Check the subtype or 'more specific' relationship. 1633 // Check the subtype or 'more specific' relationship.
(...skipping 3575 matching lines...) Expand 10 before | Expand all | Expand 10 after
5206 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5209 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5207 return false; 5210 return false;
5208 } 5211 }
5209 } 5212 }
5210 return true; 5213 return true;
5211 } 5214 }
5212 5215
5213 } // namespace dart 5216 } // namespace dart
5214 5217
5215 #endif // VM_OBJECT_H_ 5218 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698