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

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

Issue 57133004: Complete latest spec changes regarding malformed types (see issue 14006). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 11421 matching lines...) Expand 10 before | Expand all | Expand 10 after
11432 return HasResolvedTypeClass() && 11432 return HasResolvedTypeClass() &&
11433 (type_class() == Type::Handle(Type::Function()).type_class()); 11433 (type_class() == Type::Handle(Type::Function()).type_class());
11434 } 11434 }
11435 11435
11436 11436
11437 bool AbstractType::TypeTest(TypeTestKind test_kind, 11437 bool AbstractType::TypeTest(TypeTestKind test_kind,
11438 const AbstractType& other, 11438 const AbstractType& other,
11439 Error* bound_error) const { 11439 Error* bound_error) const {
11440 ASSERT(IsResolved()); 11440 ASSERT(IsResolved());
11441 ASSERT(other.IsResolved()); 11441 ASSERT(other.IsResolved());
11442 ASSERT(!IsMalformed()); 11442 if (IsMalformed() || other.IsMalformed()) {
11443 ASSERT(!other.IsMalformed()); 11443 // Caller must handle malformed types and not call this kIsSubtypeOf test.
hausner 2013/11/05 17:45:17 the comment and the assertion mention different te
regis 2013/11/05 18:05:11 I rewrote the comment.
11444 ASSERT(test_kind == kIsMoreSpecificThan);
11445 return false;
11446 }
11444 // In case the type checked in a type test is malbounded, the code generator 11447 // In case the type checked in a type test is malbounded, the code generator
11445 // may compile a throw instead of a run time call performing the type check. 11448 // may compile a throw instead of a run time call performing the type check.
11446 // However, in checked mode, a function type may include malbounded result 11449 // However, in checked mode, a function type may include malbounded result
11447 // type and/or malbounded parameter types, which will then be encountered here 11450 // type and/or malbounded parameter types, which will then be encountered here
11448 // at run time. 11451 // at run time.
11449 if (IsMalbounded()) { 11452 if (IsMalbounded()) {
11450 ASSERT(FLAG_enable_type_checks); 11453 ASSERT(FLAG_enable_type_checks);
11451 if ((bound_error != NULL) && bound_error->IsNull()) { 11454 if ((bound_error != NULL) && bound_error->IsNull()) {
11452 const bool is_malbounded = IsMalboundedWithError(bound_error); 11455 const bool is_malbounded = IsMalboundedWithError(bound_error);
11453 ASSERT(is_malbounded); 11456 ASSERT(is_malbounded);
(...skipping 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after
15717 return "_MirrorReference"; 15720 return "_MirrorReference";
15718 } 15721 }
15719 15722
15720 15723
15721 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 15724 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
15722 JSONObject jsobj(stream); 15725 JSONObject jsobj(stream);
15723 } 15726 }
15724 15727
15725 15728
15726 } // namespace dart 15729 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698