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

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

Issue 10050034: Do not require type class to be finalized when performing a type test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/utils/utils.status » ('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 "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 return raw() == Type::Handle(Type::ObjectType()).type_class(); 1483 return raw() == Type::Handle(Type::ObjectType()).type_class();
1484 } 1484 }
1485 1485
1486 1486
1487 bool Class::IsCanonicalSignatureClass() const { 1487 bool Class::IsCanonicalSignatureClass() const {
1488 const Function& function = Function::Handle(signature_function()); 1488 const Function& function = Function::Handle(signature_function());
1489 return (!function.IsNull() && (function.signature_class() == raw())); 1489 return (!function.IsNull() && (function.signature_class() == raw()));
1490 } 1490 }
1491 1491
1492 1492
1493 // Checks if the type S is a subtype of type T.
1494 // Type S is specified by this class parameterized with 'type_arguments', and
1495 // type T by class 'other' parameterized with 'other_type_arguments'.
1496 // This class and class 'other' do not need to be finalized, however, they must
1497 // be resolved as well as their interfaces.
1493 bool Class::IsSubtypeOf( 1498 bool Class::IsSubtypeOf(
1494 const AbstractTypeArguments& type_arguments, 1499 const AbstractTypeArguments& type_arguments,
1495 const Class& other, 1500 const Class& other,
1496 const AbstractTypeArguments& other_type_arguments, 1501 const AbstractTypeArguments& other_type_arguments,
1497 Error* malformed_error) const { 1502 Error* malformed_error) const {
1498 ASSERT(is_finalized());
1499 ASSERT(other.is_finalized());
1500 // Check for DynamicType. 1503 // Check for DynamicType.
1501 // The DynamicType on the lefthand side is replaced by the bottom type, which 1504 // The DynamicType on the lefthand side is replaced by the bottom type, which
1502 // is more specific than any type. 1505 // is more specific than any type.
1503 // Any type is more specific than the DynamicType on the righthand side. 1506 // Any type is more specific than the DynamicType on the righthand side.
1504 if (IsDynamicClass() || other.IsDynamicClass()) { 1507 if (IsDynamicClass() || other.IsDynamicClass()) {
1505 return true; 1508 return true;
1506 } 1509 }
1507 // Check for reflexivity. 1510 // Check for reflexivity.
1508 if (raw() == other.raw()) { 1511 if (raw() == other.raw()) {
1509 const intptr_t len = NumTypeArguments(); 1512 const intptr_t len = NumTypeArguments();
(...skipping 7627 matching lines...) Expand 10 before | Expand all | Expand 10 after
9137 const String& str = String::Handle(pattern()); 9140 const String& str = String::Handle(pattern());
9138 const char* format = "JSRegExp: pattern=%s flags=%s"; 9141 const char* format = "JSRegExp: pattern=%s flags=%s";
9139 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 9142 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
9140 char* chars = reinterpret_cast<char*>( 9143 char* chars = reinterpret_cast<char*>(
9141 Isolate::Current()->current_zone()->Allocate(len + 1)); 9144 Isolate::Current()->current_zone()->Allocate(len + 1));
9142 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 9145 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
9143 return chars; 9146 return chars;
9144 } 9147 }
9145 9148
9146 } // namespace dart 9149 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/utils/utils.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698