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

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

Issue 2831073004: Use trail in type tests involving the call function (fixes #29405). (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
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 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2672 // Returns true if this function has parameters that are compatible with the 2672 // Returns true if this function has parameters that are compatible with the
2673 // parameters of the other function in order for this function to override the 2673 // parameters of the other function in order for this function to override the
2674 // other function. 2674 // other function.
2675 bool HasCompatibleParametersWith(const Function& other, 2675 bool HasCompatibleParametersWith(const Function& other,
2676 Error* bound_error) const; 2676 Error* bound_error) const;
2677 2677
2678 // Returns true if the type of this function is a subtype of the type of 2678 // Returns true if the type of this function is a subtype of the type of
2679 // the other function. 2679 // the other function.
2680 bool IsSubtypeOf(const Function& other, 2680 bool IsSubtypeOf(const Function& other,
2681 Error* bound_error, 2681 Error* bound_error,
2682 TrailPtr bound_trail,
2682 Heap::Space space) const { 2683 Heap::Space space) const {
2683 return TypeTest(kIsSubtypeOf, other, bound_error, space); 2684 return TypeTest(kIsSubtypeOf, other, bound_error, bound_trail, space);
2684 } 2685 }
2685 2686
2686 // Returns true if the type of this function is more specific than the type of 2687 // Returns true if the type of this function is more specific than the type of
2687 // the other function. 2688 // the other function.
2688 bool IsMoreSpecificThan(const Function& other, 2689 bool IsMoreSpecificThan(const Function& other,
2689 Error* bound_error, 2690 Error* bound_error,
2691 TrailPtr bound_trail,
2690 Heap::Space space) const { 2692 Heap::Space space) const {
2691 return TypeTest(kIsMoreSpecificThan, other, bound_error, space); 2693 return TypeTest(kIsMoreSpecificThan, other, bound_error, bound_trail,
2694 space);
2692 } 2695 }
2693 2696
2694 // Check the subtype or 'more specific' relationship. 2697 // Check the subtype or 'more specific' relationship.
2695 bool TypeTest(TypeTestKind test_kind, 2698 bool TypeTest(TypeTestKind test_kind,
2696 const Function& other, 2699 const Function& other,
2697 Error* bound_error, 2700 Error* bound_error,
2701 TrailPtr bound_trail,
2698 Heap::Space space) const; 2702 Heap::Space space) const;
2699 2703
2700 bool IsDispatcherOrImplicitAccessor() const { 2704 bool IsDispatcherOrImplicitAccessor() const {
2701 switch (kind()) { 2705 switch (kind()) {
2702 case RawFunction::kImplicitGetter: 2706 case RawFunction::kImplicitGetter:
2703 case RawFunction::kImplicitSetter: 2707 case RawFunction::kImplicitSetter:
2704 case RawFunction::kNoSuchMethodDispatcher: 2708 case RawFunction::kNoSuchMethodDispatcher:
2705 case RawFunction::kInvokeFieldDispatcher: 2709 case RawFunction::kInvokeFieldDispatcher:
2706 return true; 2710 return true;
2707 default: 2711 default:
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
3016 RawString* BuildSignature(NameVisibility name_visibility) const; 3020 RawString* BuildSignature(NameVisibility name_visibility) const;
3017 3021
3018 // Checks the type of the formal parameter at the given position for 3022 // Checks the type of the formal parameter at the given position for
3019 // subtyping or 'more specific' relationship between the type of this function 3023 // subtyping or 'more specific' relationship between the type of this function
3020 // and the type of the other function. 3024 // and the type of the other function.
3021 bool TestParameterType(TypeTestKind test_kind, 3025 bool TestParameterType(TypeTestKind test_kind,
3022 intptr_t parameter_position, 3026 intptr_t parameter_position,
3023 intptr_t other_parameter_position, 3027 intptr_t other_parameter_position,
3024 const Function& other, 3028 const Function& other,
3025 Error* bound_error, 3029 Error* bound_error,
3030 TrailPtr bound_trail,
3026 Heap::Space space) const; 3031 Heap::Space space) const;
3027 3032
3028 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object); 3033 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object);
3029 friend class Class; 3034 friend class Class;
3030 friend class SnapshotWriter; 3035 friend class SnapshotWriter;
3031 friend class Parser; // For set_eval_script. 3036 friend class Parser; // For set_eval_script.
3032 // RawFunction::VisitFunctionPointers accesses the private constructor of 3037 // RawFunction::VisitFunctionPointers accesses the private constructor of
3033 // Function. 3038 // Function.
3034 friend class RawFunction; 3039 friend class RawFunction;
3035 friend class ClassFinalizer; // To reset parent_function. 3040 friend class ClassFinalizer; // To reset parent_function.
(...skipping 5963 matching lines...) Expand 10 before | Expand all | Expand 10 after
8999 9004
9000 inline void TypeArguments::SetHash(intptr_t value) const { 9005 inline void TypeArguments::SetHash(intptr_t value) const {
9001 // This is only safe because we create a new Smi, which does not cause 9006 // This is only safe because we create a new Smi, which does not cause
9002 // heap allocation. 9007 // heap allocation.
9003 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 9008 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
9004 } 9009 }
9005 9010
9006 } // namespace dart 9011 } // namespace dart
9007 9012
9008 #endif // RUNTIME_VM_OBJECT_H_ 9013 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698