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

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

Issue 2759393005: Cleanup change. (Closed)
Patch Set: Created 3 years, 9 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 | « runtime/vm/object.h ('k') | runtime/vm/object_test.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 #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 16702 matching lines...) Expand 10 before | Expand all | Expand 10 after
16713 16713
16714 RawType* Type::DartFunctionType() { 16714 RawType* Type::DartFunctionType() {
16715 return Isolate::Current()->object_store()->function_type(); 16715 return Isolate::Current()->object_store()->function_type();
16716 } 16716 }
16717 16717
16718 16718
16719 RawType* Type::NewNonParameterizedType(const Class& type_class) { 16719 RawType* Type::NewNonParameterizedType(const Class& type_class) {
16720 ASSERT(type_class.NumTypeArguments() == 0); 16720 ASSERT(type_class.NumTypeArguments() == 0);
16721 Type& type = Type::Handle(type_class.CanonicalType()); 16721 Type& type = Type::Handle(type_class.CanonicalType());
16722 if (type.IsNull()) { 16722 if (type.IsNull()) {
16723 const TypeArguments& no_type_arguments = TypeArguments::Handle(); 16723 type ^= Type::New(Object::Handle(type_class.raw()),
16724 type ^= Type::New(Object::Handle(type_class.raw()), no_type_arguments, 16724 Object::null_type_arguments(), TokenPosition::kNoSource);
16725 TokenPosition::kNoSource);
16726 type.SetIsFinalized(); 16725 type.SetIsFinalized();
16727 type ^= type.Canonicalize(); 16726 type ^= type.Canonicalize();
16728 } 16727 }
16729 ASSERT(type.IsFinalized()); 16728 ASSERT(type.IsFinalized());
16730 return type.raw(); 16729 return type.raw();
16731 } 16730 }
16732 16731
16733 16732
16734 void Type::SetIsFinalized() const { 16733 void Type::SetIsFinalized() const {
16735 ASSERT(!IsFinalized()); 16734 ASSERT(!IsFinalized());
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
17007 } else if (other_type_args.IsNull()) { 17006 } else if (other_type_args.IsNull()) {
17008 // Ignore from_index. 17007 // Ignore from_index.
17009 if (!type_args.IsRaw(0, num_type_args)) { 17008 if (!type_args.IsRaw(0, num_type_args)) {
17010 return false; 17009 return false;
17011 } 17010 }
17012 } else if (!type_args.IsSubvectorEquivalent(other_type_args, from_index, 17011 } else if (!type_args.IsSubvectorEquivalent(other_type_args, from_index,
17013 num_type_params, trail)) { 17012 num_type_params, trail)) {
17014 return false; 17013 return false;
17015 } 17014 }
17016 #ifdef DEBUG 17015 #ifdef DEBUG
17017 if (from_index > 0) { 17016 if ((from_index > 0) && !type_args.IsNull() &&
17017 !other_type_args.IsNull()) {
17018 // Verify that the type arguments of the super class match, since they 17018 // Verify that the type arguments of the super class match, since they
17019 // depend solely on the type parameters that were just verified to 17019 // depend solely on the type parameters that were just verified to
17020 // match. 17020 // match.
17021 ASSERT(type_args.Length() >= (from_index + num_type_params)); 17021 ASSERT(type_args.Length() >= (from_index + num_type_params));
17022 ASSERT(other_type_args.Length() >= (from_index + num_type_params)); 17022 ASSERT(other_type_args.Length() >= (from_index + num_type_params));
17023 AbstractType& type_arg = AbstractType::Handle(zone); 17023 AbstractType& type_arg = AbstractType::Handle(zone);
17024 AbstractType& other_type_arg = AbstractType::Handle(zone); 17024 AbstractType& other_type_arg = AbstractType::Handle(zone);
17025 for (intptr_t i = 0; i < from_index; i++) { 17025 for (intptr_t i = 0; i < from_index; i++) {
17026 type_arg = type_args.TypeAt(i); 17026 type_arg = type_args.TypeAt(i);
17027 other_type_arg = other_type_args.TypeAt(i); 17027 other_type_arg = other_type_args.TypeAt(i);
(...skipping 6058 matching lines...) Expand 10 before | Expand all | Expand 10 after
23086 return UserTag::null(); 23086 return UserTag::null();
23087 } 23087 }
23088 23088
23089 23089
23090 const char* UserTag::ToCString() const { 23090 const char* UserTag::ToCString() const {
23091 const String& tag_label = String::Handle(label()); 23091 const String& tag_label = String::Handle(label());
23092 return tag_label.ToCString(); 23092 return tag_label.ToCString();
23093 } 23093 }
23094 23094
23095 } // namespace dart 23095 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698