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

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

Issue 18750004: Faster invocation of fields as methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/standalone/debugger/closure_debugger_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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 RawGrowableObjectArray* direct_subclasses_; // Array of Class. 481 RawGrowableObjectArray* direct_subclasses_; // Array of Class.
482 RawScript* script_; 482 RawScript* script_;
483 RawLibrary* library_; 483 RawLibrary* library_;
484 RawTypeArguments* type_parameters_; // Array of TypeParameter. 484 RawTypeArguments* type_parameters_; // Array of TypeParameter.
485 RawAbstractType* super_type_; 485 RawAbstractType* super_type_;
486 RawType* mixin_; 486 RawType* mixin_;
487 RawClass* patch_class_; 487 RawClass* patch_class_;
488 RawFunction* signature_function_; // Associated function for signature class. 488 RawFunction* signature_function_; // Associated function for signature class.
489 RawArray* constants_; // Canonicalized values of this class. 489 RawArray* constants_; // Canonicalized values of this class.
490 RawArray* canonical_types_; // Canonicalized types of this class. 490 RawArray* canonical_types_; // Canonicalized types of this class.
491 RawArray* no_such_method_cache_; // Dispatcher functions for noSuchMethod. 491 RawArray* invocation_dispatcher_cache_; // Cache for dispatcher functions.
492 RawCode* allocation_stub_; // Stub code for allocation of instances. 492 RawCode* allocation_stub_; // Stub code for allocation of instances.
493 RawObject** to() { 493 RawObject** to() {
494 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_); 494 return reinterpret_cast<RawObject**>(&ptr()->allocation_stub_);
495 } 495 }
496 496
497 cpp_vtable handle_vtable_; 497 cpp_vtable handle_vtable_;
498 intptr_t instance_size_in_words_; // Size if fixed len or 0 if variable len. 498 intptr_t instance_size_in_words_; // Size if fixed len or 0 if variable len.
499 intptr_t id_; // Class Id, also index in the class table. 499 intptr_t id_; // Class Id, also index in the class table.
500 intptr_t type_arguments_field_offset_in_words_; // Offset of type args fld. 500 intptr_t type_arguments_field_offset_in_words_; // Offset of type args fld.
501 intptr_t next_field_offset_in_words_; // Offset of the next instance field. 501 intptr_t next_field_offset_in_words_; // Offset of the next instance field.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 kClosureFunction, 593 kClosureFunction,
594 kSignatureFunction, // represents a signature only without actual code. 594 kSignatureFunction, // represents a signature only without actual code.
595 kGetterFunction, // represents getter functions e.g: get foo() { .. }. 595 kGetterFunction, // represents getter functions e.g: get foo() { .. }.
596 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 596 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
597 kConstructor, 597 kConstructor,
598 kImplicitGetter, // represents an implicit getter for fields. 598 kImplicitGetter, // represents an implicit getter for fields.
599 kImplicitSetter, // represents an implicit setter for fields. 599 kImplicitSetter, // represents an implicit setter for fields.
600 kConstImplicitGetter, // represents an implicit const getter for fields. 600 kConstImplicitGetter, // represents an implicit const getter for fields.
601 kMethodExtractor, // converts method into implicit closure on the receiver. 601 kMethodExtractor, // converts method into implicit closure on the receiver.
602 kNoSuchMethodDispatcher, // invokes noSuchMethod. 602 kNoSuchMethodDispatcher, // invokes noSuchMethod.
603 kInvokeFieldDispatcher, // invokes a field as a closure.
603 }; 604 };
604 605
605 private: 606 private:
606 friend class Class; 607 friend class Class;
607 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); 608 RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
608 609
609 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 610 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
610 RawString* name_; 611 RawString* name_;
611 RawObject* owner_; // Class or patch class or mixin class 612 RawObject* owner_; // Class or patch class or mixin class
612 // where this function is defined. 613 // where this function is defined.
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 // Make sure this is updated when new TypedData types are added. 1707 // Make sure this is updated when new TypedData types are added.
1707 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); 1708 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12);
1708 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); 1709 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13);
1709 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); 1710 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12);
1710 return (kNullCid - kTypedDataInt8ArrayCid); 1711 return (kNullCid - kTypedDataInt8ArrayCid);
1711 } 1712 }
1712 1713
1713 } // namespace dart 1714 } // namespace dart
1714 1715
1715 #endif // VM_RAW_OBJECT_H_ 1716 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/standalone/debugger/closure_debugger_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698