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

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

Issue 135913003: Optimize getField by caching a closure generated from a specialized function kind. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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') | no next file » | 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 602 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
603 kConstructor, 603 kConstructor,
604 kImplicitGetter, // represents an implicit getter for fields. 604 kImplicitGetter, // represents an implicit getter for fields.
605 kImplicitSetter, // represents an implicit setter for fields. 605 kImplicitSetter, // represents an implicit setter for fields.
606 kImplicitStaticFinalGetter, // represents an implicit getter for static 606 kImplicitStaticFinalGetter, // represents an implicit getter for static
607 // final fields (incl. static const fields). 607 // final fields (incl. static const fields).
608 kStaticInitializer, // used in implicit static getters. 608 kStaticInitializer, // used in implicit static getters.
609 kMethodExtractor, // converts method into implicit closure on the receiver. 609 kMethodExtractor, // converts method into implicit closure on the receiver.
610 kNoSuchMethodDispatcher, // invokes noSuchMethod. 610 kNoSuchMethodDispatcher, // invokes noSuchMethod.
611 kInvokeFieldDispatcher, // invokes a field as a closure. 611 kInvokeFieldDispatcher, // invokes a field as a closure.
612 kGetFieldClosure, // (x) => x.SELECTOR
613 kSetFieldClosure, // (x,y) => x.SELECTOR = y
612 }; 614 };
613 615
614 private: 616 private:
615 // So that the MarkingVisitor::DetachCode can null out the code fields. 617 // So that the MarkingVisitor::DetachCode can null out the code fields.
616 friend class MarkingVisitor; 618 friend class MarkingVisitor;
617 friend class Class; 619 friend class Class;
618 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); 620 RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
619 static bool SkipCode(RawFunction* raw_fun); 621 static bool SkipCode(RawFunction* raw_fun);
620 622
621 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 623 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 // Make sure this is updated when new TypedData types are added. 1789 // Make sure this is updated when new TypedData types are added.
1788 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); 1790 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14);
1789 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15); 1791 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15);
1790 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); 1792 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14);
1791 return (kNullCid - kTypedDataInt8ArrayCid); 1793 return (kNullCid - kTypedDataInt8ArrayCid);
1792 } 1794 }
1793 1795
1794 } // namespace dart 1796 } // namespace dart
1795 1797
1796 #endif // VM_RAW_OBJECT_H_ 1798 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698