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

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

Issue 2572543003: Treat dispatchers and implicit accessors the same for inlining decisions. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « runtime/vm/flow_graph_inliner.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 RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_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 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 // Returns ICData with aggregated receiver count, sorted by highest count. 2026 // Returns ICData with aggregated receiver count, sorted by highest count.
2027 // Smi not first!! (the convention for ICData used in code generation is that 2027 // Smi not first!! (the convention for ICData used in code generation is that
2028 // Smi check is first) 2028 // Smi check is first)
2029 // Used for printing and optimizations. 2029 // Used for printing and optimizations.
2030 RawICData* AsUnaryClassChecksSortedByCount() const; 2030 RawICData* AsUnaryClassChecksSortedByCount() const;
2031 2031
2032 // Consider only used entries. 2032 // Consider only used entries.
2033 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; 2033 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const;
2034 bool AllReceiversAreNumbers() const; 2034 bool AllReceiversAreNumbers() const;
2035 bool HasOneTarget() const; 2035 bool HasOneTarget() const;
2036 bool HasOnlyDispatcherTargets() const; 2036 bool HasOnlyDispatcherOrImplicitAccessorTargets() const;
2037 bool HasReceiverClassId(intptr_t class_id) const; 2037 bool HasReceiverClassId(intptr_t class_id) const;
2038 2038
2039 static RawICData* New(const Function& owner, 2039 static RawICData* New(const Function& owner,
2040 const String& target_name, 2040 const String& target_name,
2041 const Array& arguments_descriptor, 2041 const Array& arguments_descriptor,
2042 intptr_t deopt_id, 2042 intptr_t deopt_id,
2043 intptr_t num_args_tested, 2043 intptr_t num_args_tested,
2044 bool is_static_call); 2044 bool is_static_call);
2045 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); 2045 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested);
2046 2046
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 } 2642 }
2643 2643
2644 // Check the subtype or 'more specific' relationship. 2644 // Check the subtype or 'more specific' relationship.
2645 bool TypeTest(TypeTestKind test_kind, 2645 bool TypeTest(TypeTestKind test_kind,
2646 const TypeArguments& type_arguments, 2646 const TypeArguments& type_arguments,
2647 const Function& other, 2647 const Function& other,
2648 const TypeArguments& other_type_arguments, 2648 const TypeArguments& other_type_arguments,
2649 Error* bound_error, 2649 Error* bound_error,
2650 Heap::Space space) const; 2650 Heap::Space space) const;
2651 2651
2652 bool IsDispatcherOrImplicitAccessor() const {
2653 switch (kind()) {
2654 case RawFunction::kImplicitGetter:
2655 case RawFunction::kImplicitSetter:
2656 case RawFunction::kNoSuchMethodDispatcher:
2657 case RawFunction::kInvokeFieldDispatcher:
2658 return true;
2659 default:
2660 return false;
2661 }
2662 }
2663
2652 // Returns true if this function represents an explicit getter function. 2664 // Returns true if this function represents an explicit getter function.
2653 bool IsGetterFunction() const { 2665 bool IsGetterFunction() const {
2654 return kind() == RawFunction::kGetterFunction; 2666 return kind() == RawFunction::kGetterFunction;
2655 } 2667 }
2656 2668
2657 // Returns true if this function represents an implicit getter function. 2669 // Returns true if this function represents an implicit getter function.
2658 bool IsImplicitGetterFunction() const { 2670 bool IsImplicitGetterFunction() const {
2659 return kind() == RawFunction::kImplicitGetter; 2671 return kind() == RawFunction::kImplicitGetter;
2660 } 2672 }
2661 2673
(...skipping 6224 matching lines...) Expand 10 before | Expand all | Expand 10 after
8886 8898
8887 inline void TypeArguments::SetHash(intptr_t value) const { 8899 inline void TypeArguments::SetHash(intptr_t value) const {
8888 // This is only safe because we create a new Smi, which does not cause 8900 // This is only safe because we create a new Smi, which does not cause
8889 // heap allocation. 8901 // heap allocation.
8890 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8902 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8891 } 8903 }
8892 8904
8893 } // namespace dart 8905 } // namespace dart
8894 8906
8895 #endif // RUNTIME_VM_OBJECT_H_ 8907 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698