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

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

Issue 188703004: Fix invocation of closures via .call in the VM (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/parser.cc ('k') | tests/language/call_test.dart » ('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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 584 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
585 kConstructor, 585 kConstructor,
586 kImplicitGetter, // represents an implicit getter for fields. 586 kImplicitGetter, // represents an implicit getter for fields.
587 kImplicitSetter, // represents an implicit setter for fields. 587 kImplicitSetter, // represents an implicit setter for fields.
588 kImplicitStaticFinalGetter, // represents an implicit getter for static 588 kImplicitStaticFinalGetter, // represents an implicit getter for static
589 // final fields (incl. static const fields). 589 // final fields (incl. static const fields).
590 kStaticInitializer, // used in implicit static getters. 590 kStaticInitializer, // used in implicit static getters.
591 kMethodExtractor, // converts method into implicit closure on the receiver. 591 kMethodExtractor, // converts method into implicit closure on the receiver.
592 kNoSuchMethodDispatcher, // invokes noSuchMethod. 592 kNoSuchMethodDispatcher, // invokes noSuchMethod.
593 kInvokeFieldDispatcher, // invokes a field as a closure. 593 kInvokeFieldDispatcher, // invokes a field as a closure.
594 kInvokeClosureDispatcher // invokes this as a closure (implements .call)
594 }; 595 };
595 596
596 private: 597 private:
597 // So that the MarkingVisitor::DetachCode can null out the code fields. 598 // So that the MarkingVisitor::DetachCode can null out the code fields.
598 friend class MarkingVisitor; 599 friend class MarkingVisitor;
599 friend class Class; 600 friend class Class;
600 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); 601 RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
601 static bool SkipCode(RawFunction* raw_fun); 602 static bool SkipCode(RawFunction* raw_fun);
602 603
603 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 604 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 // Make sure this is updated when new TypedData types are added. 1778 // Make sure this is updated when new TypedData types are added.
1778 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); 1779 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14);
1779 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15); 1780 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15);
1780 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); 1781 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14);
1781 return (kNullCid - kTypedDataInt8ArrayCid); 1782 return (kNullCid - kTypedDataInt8ArrayCid);
1782 } 1783 }
1783 1784
1784 } // namespace dart 1785 } // namespace dart
1785 1786
1786 #endif // VM_RAW_OBJECT_H_ 1787 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/call_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698