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

Side by Side Diff: runtime/vm/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/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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 return OFFSET_OF(RawClass, num_native_fields_); 919 return OFFSET_OF(RawClass, num_native_fields_);
920 } 920 }
921 921
922 RawCode* allocation_stub() const { 922 RawCode* allocation_stub() const {
923 return raw_ptr()->allocation_stub_; 923 return raw_ptr()->allocation_stub_;
924 } 924 }
925 void set_allocation_stub(const Code& value) const; 925 void set_allocation_stub(const Code& value) const;
926 926
927 RawArray* constants() const; 927 RawArray* constants() const;
928 928
929 RawFunction* GetNoSuchMethodDispatcher(const String& target_name, 929 RawFunction* GetInvocationDispatcher(const String& target_name,
930 const Array& args_desc) const; 930 const Array& args_desc,
931 RawFunction::Kind kind) const;
931 932
932 void Finalize() const; 933 void Finalize() const;
933 934
934 const char* ApplyPatch(const Class& patch) const; 935 const char* ApplyPatch(const Class& patch) const;
935 936
936 RawError* EnsureIsFinalized(Isolate* isolate) const; 937 RawError* EnsureIsFinalized(Isolate* isolate) const;
937 938
938 // Allocate a class used for VM internal objects. 939 // Allocate a class used for VM internal objects.
939 template <class FakeObject> static RawClass* New(); 940 template <class FakeObject> static RawClass* New();
940 941
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 void set_signature_function(const Function& value) const; 1012 void set_signature_function(const Function& value) const;
1012 void set_signature_type(const AbstractType& value) const; 1013 void set_signature_type(const AbstractType& value) const;
1013 void set_class_state(RawClass::ClassState state) const; 1014 void set_class_state(RawClass::ClassState state) const;
1014 void set_state_bits(intptr_t bits) const; 1015 void set_state_bits(intptr_t bits) const;
1015 1016
1016 void set_constants(const Array& value) const; 1017 void set_constants(const Array& value) const;
1017 1018
1018 void set_canonical_types(const Array& value) const; 1019 void set_canonical_types(const Array& value) const;
1019 RawArray* canonical_types() const; 1020 RawArray* canonical_types() const;
1020 1021
1021 RawArray* no_such_method_cache() const; 1022 RawArray* invocation_dispatcher_cache() const;
1022 void set_no_such_method_cache(const Array& cache) const; 1023 void set_invocation_dispatcher_cache(const Array& cache) const;
1023 RawFunction* CreateNoSuchMethodDispatcher(const String& target_name, 1024 RawFunction* CreateInvocationDispatcher(const String& target_name,
1024 const Array& args_desc) const; 1025 const Array& args_desc,
1026 RawFunction::Kind kind) const;
1025 void CalculateFieldOffsets() const; 1027 void CalculateFieldOffsets() const;
1026 1028
1027 // Assigns empty array to all raw class array fields. 1029 // Assigns empty array to all raw class array fields.
1028 void InitEmptyFields(); 1030 void InitEmptyFields();
1029 1031
1030 static RawFunction* CheckFunctionType(const Function& func, intptr_t type); 1032 static RawFunction* CheckFunctionType(const Function& func, intptr_t type);
1031 RawFunction* LookupFunction(const String& name, intptr_t type) const; 1033 RawFunction* LookupFunction(const String& name, intptr_t type) const;
1032 RawFunction* LookupFunctionAllowPrivate(const String& name, 1034 RawFunction* LookupFunctionAllowPrivate(const String& name,
1033 intptr_t type) const; 1035 intptr_t type) const;
1034 RawField* LookupField(const String& name, intptr_t type) const; 1036 RawField* LookupField(const String& name, intptr_t type) const;
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 RawArray* saved_args_desc() const; 1434 RawArray* saved_args_desc() const;
1433 1435
1434 bool IsMethodExtractor() const { 1436 bool IsMethodExtractor() const {
1435 return kind() == RawFunction::kMethodExtractor; 1437 return kind() == RawFunction::kMethodExtractor;
1436 } 1438 }
1437 1439
1438 bool IsNoSuchMethodDispatcher() const { 1440 bool IsNoSuchMethodDispatcher() const {
1439 return kind() == RawFunction::kNoSuchMethodDispatcher; 1441 return kind() == RawFunction::kNoSuchMethodDispatcher;
1440 } 1442 }
1441 1443
1444 bool IsInvokeFieldDispatcher() const {
1445 return kind() == RawFunction::kInvokeFieldDispatcher;
1446 }
1447
1442 // Returns true iff an implicit closure function has been created 1448 // Returns true iff an implicit closure function has been created
1443 // for this function. 1449 // for this function.
1444 bool HasImplicitClosureFunction() const { 1450 bool HasImplicitClosureFunction() const {
1445 return implicit_closure_function() != null(); 1451 return implicit_closure_function() != null();
1446 } 1452 }
1447 1453
1448 // Return the closure function implicitly created for this function. 1454 // Return the closure function implicitly created for this function.
1449 // If none exists yet, create one and remember it. 1455 // If none exists yet, create one and remember it.
1450 RawFunction* ImplicitClosureFunction() const; 1456 RawFunction* ImplicitClosureFunction() const;
1451 1457
(...skipping 25 matching lines...) Expand all
1477 return false; 1483 return false;
1478 } 1484 }
1479 switch (kind()) { 1485 switch (kind()) {
1480 case RawFunction::kRegularFunction: 1486 case RawFunction::kRegularFunction:
1481 case RawFunction::kGetterFunction: 1487 case RawFunction::kGetterFunction:
1482 case RawFunction::kSetterFunction: 1488 case RawFunction::kSetterFunction:
1483 case RawFunction::kImplicitGetter: 1489 case RawFunction::kImplicitGetter:
1484 case RawFunction::kImplicitSetter: 1490 case RawFunction::kImplicitSetter:
1485 case RawFunction::kMethodExtractor: 1491 case RawFunction::kMethodExtractor:
1486 case RawFunction::kNoSuchMethodDispatcher: 1492 case RawFunction::kNoSuchMethodDispatcher:
1493 case RawFunction::kInvokeFieldDispatcher:
1487 return true; 1494 return true;
1488 case RawFunction::kClosureFunction: 1495 case RawFunction::kClosureFunction:
1489 case RawFunction::kConstructor: 1496 case RawFunction::kConstructor:
1490 case RawFunction::kConstImplicitGetter: 1497 case RawFunction::kConstImplicitGetter:
1491 return false; 1498 return false;
1492 default: 1499 default:
1493 UNREACHABLE(); 1500 UNREACHABLE();
1494 return false; 1501 return false;
1495 } 1502 }
1496 } 1503 }
(...skipping 4498 matching lines...) Expand 10 before | Expand all | Expand 10 after
5995 6002
5996 6003
5997 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6004 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5998 intptr_t index) { 6005 intptr_t index) {
5999 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6006 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6000 } 6007 }
6001 6008
6002 } // namespace dart 6009 } // namespace dart
6003 6010
6004 #endif // VM_OBJECT_H_ 6011 #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