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

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

Issue 200193002: Alternative fix for .call invocation of closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.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_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 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 } 1537 }
1538 1538
1539 bool IsNoSuchMethodDispatcher() const { 1539 bool IsNoSuchMethodDispatcher() const {
1540 return kind() == RawFunction::kNoSuchMethodDispatcher; 1540 return kind() == RawFunction::kNoSuchMethodDispatcher;
1541 } 1541 }
1542 1542
1543 bool IsInvokeFieldDispatcher() const { 1543 bool IsInvokeFieldDispatcher() const {
1544 return kind() == RawFunction::kInvokeFieldDispatcher; 1544 return kind() == RawFunction::kInvokeFieldDispatcher;
1545 } 1545 }
1546 1546
1547 bool IsInvokeClosureDispatcher() const {
1548 return kind() == RawFunction::kInvokeClosureDispatcher;
1549 }
1550
1551 // Returns true iff an implicit closure function has been created 1547 // Returns true iff an implicit closure function has been created
1552 // for this function. 1548 // for this function.
1553 bool HasImplicitClosureFunction() const { 1549 bool HasImplicitClosureFunction() const {
1554 return implicit_closure_function() != null(); 1550 return implicit_closure_function() != null();
1555 } 1551 }
1556 1552
1557 // Return the closure function implicitly created for this function. 1553 // Return the closure function implicitly created for this function.
1558 // If none exists yet, create one and remember it. 1554 // If none exists yet, create one and remember it.
1559 RawFunction* ImplicitClosureFunction() const; 1555 RawFunction* ImplicitClosureFunction() const;
1560 1556
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 } 1589 }
1594 switch (kind()) { 1590 switch (kind()) {
1595 case RawFunction::kRegularFunction: 1591 case RawFunction::kRegularFunction:
1596 case RawFunction::kGetterFunction: 1592 case RawFunction::kGetterFunction:
1597 case RawFunction::kSetterFunction: 1593 case RawFunction::kSetterFunction:
1598 case RawFunction::kImplicitGetter: 1594 case RawFunction::kImplicitGetter:
1599 case RawFunction::kImplicitSetter: 1595 case RawFunction::kImplicitSetter:
1600 case RawFunction::kMethodExtractor: 1596 case RawFunction::kMethodExtractor:
1601 case RawFunction::kNoSuchMethodDispatcher: 1597 case RawFunction::kNoSuchMethodDispatcher:
1602 case RawFunction::kInvokeFieldDispatcher: 1598 case RawFunction::kInvokeFieldDispatcher:
1603 case RawFunction::kInvokeClosureDispatcher:
1604 return true; 1599 return true;
1605 case RawFunction::kClosureFunction: 1600 case RawFunction::kClosureFunction:
1606 case RawFunction::kConstructor: 1601 case RawFunction::kConstructor:
1607 case RawFunction::kImplicitStaticFinalGetter: 1602 case RawFunction::kImplicitStaticFinalGetter:
1608 case RawFunction::kStaticInitializer: 1603 case RawFunction::kStaticInitializer:
1609 return false; 1604 return false;
1610 default: 1605 default:
1611 UNREACHABLE(); 1606 UNREACHABLE();
1612 return false; 1607 return false;
1613 } 1608 }
(...skipping 5123 matching lines...) Expand 10 before | Expand all | Expand 10 after
6737 6732
6738 6733
6739 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6734 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6740 intptr_t index) { 6735 intptr_t index) {
6741 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6736 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6742 } 6737 }
6743 6738
6744 } // namespace dart 6739 } // namespace dart
6745 6740
6746 #endif // VM_OBJECT_H_ 6741 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698