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

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

Issue 10829270: Continue work on type propagation in optimizing compiler (still WIP). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/intermediate_language.cc ('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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 Error* malformed_error) const { 1746 Error* malformed_error) const {
1747 ASSERT(!IsVoidClass()); 1747 ASSERT(!IsVoidClass());
1748 // Check for DynamicType. 1748 // Check for DynamicType.
1749 // Each occurrence of DynamicType in type T is interpreted as the Dynamic 1749 // Each occurrence of DynamicType in type T is interpreted as the Dynamic
1750 // type, a supertype of all types. 1750 // type, a supertype of all types.
1751 if (other.IsDynamicClass()) { 1751 if (other.IsDynamicClass()) {
1752 return true; 1752 return true;
1753 } 1753 }
1754 // In the case of a subtype test, each occurrence of DynamicType in type S is 1754 // In the case of a subtype test, each occurrence of DynamicType in type S is
1755 // interpreted as the bottom type, a subtype of all types. 1755 // interpreted as the bottom type, a subtype of all types.
1756 // However, DynamicType is not more specific than any type.
1756 if (IsDynamicClass()) { 1757 if (IsDynamicClass()) {
1757 return test_kind == kIsSubtypeOf; 1758 return test_kind == kIsSubtypeOf;
1758 } 1759 }
1760 // Check for NullType, which is not a subtype of any type, but is more
1761 // specific than any type.
1762 if (IsNullClass()) {
1763 return test_kind == kIsMoreSpecificThan;
1764 }
1759 // Check for reflexivity. 1765 // Check for reflexivity.
1760 if (raw() == other.raw()) { 1766 if (raw() == other.raw()) {
1761 const intptr_t len = NumTypeArguments(); 1767 const intptr_t len = NumTypeArguments();
1762 if (len == 0) { 1768 if (len == 0) {
1763 return true; 1769 return true;
1764 } 1770 }
1765 // Since we do not truncate the type argument vector of a subclass (see 1771 // Since we do not truncate the type argument vector of a subclass (see
1766 // below), we only check a prefix of the proper length. 1772 // below), we only check a prefix of the proper length.
1767 // Check for covariance. 1773 // Check for covariance.
1768 if (other_type_arguments.IsNull() || 1774 if (other_type_arguments.IsNull() ||
(...skipping 9216 matching lines...) Expand 10 before | Expand all | Expand 10 after
10985 const char* JSRegExp::ToCString() const { 10991 const char* JSRegExp::ToCString() const {
10986 const String& str = String::Handle(pattern()); 10992 const String& str = String::Handle(pattern());
10987 const char* format = "JSRegExp: pattern=%s flags=%s"; 10993 const char* format = "JSRegExp: pattern=%s flags=%s";
10988 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 10994 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
10989 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); 10995 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
10990 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 10996 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
10991 return chars; 10997 return chars;
10992 } 10998 }
10993 10999
10994 } // namespace dart 11000 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698