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

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

Issue 1312833009: Added {Zone}GrowableHandlePtrArray types: simplifies code, makes code safer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 void set_ident(const String& ident) const; 1521 void set_ident(const String& ident) const;
1522 void set_token_pos(intptr_t token_pos) const; 1522 void set_token_pos(intptr_t token_pos) const;
1523 1523
1524 static RawUnresolvedClass* New(); 1524 static RawUnresolvedClass* New();
1525 1525
1526 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass, Object); 1526 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass, Object);
1527 friend class Class; 1527 friend class Class;
1528 }; 1528 };
1529 1529
1530 1530
1531 typedef ZoneGrowableArray<const AbstractType*> Trail; 1531 typedef ZoneGrowableHandlePtrArray<const AbstractType> Trail;
1532 typedef ZoneGrowableArray<const AbstractType*>* TrailPtr; 1532 typedef ZoneGrowableHandlePtrArray<const AbstractType>* TrailPtr;
1533 1533
1534 // A TypeArguments is an array of AbstractType. 1534 // A TypeArguments is an array of AbstractType.
1535 class TypeArguments : public Object { 1535 class TypeArguments : public Object {
1536 public: 1536 public:
1537 intptr_t Length() const; 1537 intptr_t Length() const;
1538 RawAbstractType* TypeAt(intptr_t index) const; 1538 RawAbstractType* TypeAt(intptr_t index) const;
1539 static intptr_t type_at_offset(intptr_t index) { 1539 static intptr_t type_at_offset(intptr_t index) {
1540 return OFFSET_OF_RETURNED_VALUE( 1540 return OFFSET_OF_RETURNED_VALUE(
1541 RawTypeArguments, types) + index * kWordSize; 1541 RawTypeArguments, types) + index * kWordSize;
1542 } 1542 }
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 RawInstance* implicit_static_closure() const; 2692 RawInstance* implicit_static_closure() const;
2693 void set_implicit_static_closure(const Instance& closure) const; 2693 void set_implicit_static_closure(const Instance& closure) const;
2694 RawScript* eval_script() const; 2694 RawScript* eval_script() const;
2695 void set_eval_script(const Script& value) const; 2695 void set_eval_script(const Script& value) const;
2696 void set_num_optional_parameters(intptr_t value) const; // Encoded value. 2696 void set_num_optional_parameters(intptr_t value) const; // Encoded value.
2697 void set_kind_tag(intptr_t value) const; 2697 void set_kind_tag(intptr_t value) const;
2698 void set_data(const Object& value) const; 2698 void set_data(const Object& value) const;
2699 2699
2700 static RawFunction* New(); 2700 static RawFunction* New();
2701 2701
2702 void BuildSignatureParameters(bool instantiate, 2702 void BuildSignatureParameters(
2703 NameVisibility name_visibility, 2703 bool instantiate,
2704 const TypeArguments& instantiator, 2704 NameVisibility name_visibility,
2705 GrowableArray<const String*>* pieces) const; 2705 const TypeArguments& instantiator,
2706 GrowableHandlePtrArray<const String>* pieces) const;
2706 RawString* BuildSignature(bool instantiate, 2707 RawString* BuildSignature(bool instantiate,
2707 NameVisibility name_visibility, 2708 NameVisibility name_visibility,
2708 const TypeArguments& instantiator) const; 2709 const TypeArguments& instantiator) const;
2709 2710
2710 // Check the subtype or 'more specific' relationship. 2711 // Check the subtype or 'more specific' relationship.
2711 bool TypeTest(TypeTestKind test_kind, 2712 bool TypeTest(TypeTestKind test_kind,
2712 const TypeArguments& type_arguments, 2713 const TypeArguments& type_arguments,
2713 const Function& other, 2714 const Function& other,
2714 const TypeArguments& other_type_arguments, 2715 const TypeArguments& other_type_arguments,
2715 Error* bound_error) const; 2716 Error* bound_error) const;
(...skipping 5320 matching lines...) Expand 10 before | Expand all | Expand 10 after
8036 8037
8037 8038
8038 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8039 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8039 intptr_t index) { 8040 intptr_t index) {
8040 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8041 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8041 } 8042 }
8042 8043
8043 } // namespace dart 8044 } // namespace dart
8044 8045
8045 #endif // VM_OBJECT_H_ 8046 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698