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

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

Issue 2567163002: Use kFunctionCid instead of kIllegalCid to indicate that a generic function (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/object.h ('k') | no next file » | 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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/become.h" 10 #include "vm/become.h"
(...skipping 17592 matching lines...) Expand 10 before | Expand all | Expand 10 after
17603 } 17603 }
17604 if (IsFinalized() == other_type_param.IsFinalized()) { 17604 if (IsFinalized() == other_type_param.IsFinalized()) {
17605 return index() == other_type_param.index(); 17605 return index() == other_type_param.index();
17606 } 17606 }
17607 return name() == other_type_param.name(); 17607 return name() == other_type_param.name();
17608 } 17608 }
17609 17609
17610 17610
17611 void TypeParameter::set_parameterized_class(const Class& value) const { 17611 void TypeParameter::set_parameterized_class(const Class& value) const {
17612 // Set value may be null. 17612 // Set value may be null.
17613 classid_t cid = kIllegalCid; 17613 classid_t cid = kFunctionCid; // Denotes a function type parameter.
17614 if (!value.IsNull()) { 17614 if (!value.IsNull()) {
17615 cid = value.id(); 17615 cid = value.id();
17616 } 17616 }
17617 StoreNonPointer(&raw_ptr()->parameterized_class_id_, cid); 17617 StoreNonPointer(&raw_ptr()->parameterized_class_id_, cid);
17618 } 17618 }
17619 17619
17620 17620
17621 classid_t TypeParameter::parameterized_class_id() const { 17621 classid_t TypeParameter::parameterized_class_id() const {
17622 return raw_ptr()->parameterized_class_id_; 17622 return raw_ptr()->parameterized_class_id_;
17623 } 17623 }
17624 17624
17625 17625
17626 RawClass* TypeParameter::parameterized_class() const { 17626 RawClass* TypeParameter::parameterized_class() const {
17627 classid_t cid = parameterized_class_id(); 17627 classid_t cid = parameterized_class_id();
17628 if (cid == kIllegalCid) { 17628 if (cid == kFunctionCid) {
17629 return Class::null(); 17629 return Class::null();
17630 } 17630 }
17631 return Isolate::Current()->class_table()->At(cid); 17631 return Isolate::Current()->class_table()->At(cid);
17632 } 17632 }
17633 17633
17634 17634
17635 void TypeParameter::set_parameterized_function(const Function& value) const { 17635 void TypeParameter::set_parameterized_function(const Function& value) const {
17636 StorePointer(&raw_ptr()->parameterized_function_, value.raw()); 17636 StorePointer(&raw_ptr()->parameterized_function_, value.raw());
17637 } 17637 }
17638 17638
(...skipping 5127 matching lines...) Expand 10 before | Expand all | Expand 10 after
22766 return UserTag::null(); 22766 return UserTag::null();
22767 } 22767 }
22768 22768
22769 22769
22770 const char* UserTag::ToCString() const { 22770 const char* UserTag::ToCString() const {
22771 const String& tag_label = String::Handle(label()); 22771 const String& tag_label = String::Handle(label());
22772 return tag_label.ToCString(); 22772 return tag_label.ToCString();
22773 } 22773 }
22774 22774
22775 } // namespace dart 22775 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698