| OLD | NEW |
| 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 6400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6411 TypeTestKind test_kind, | 6411 TypeTestKind test_kind, |
| 6412 intptr_t parameter_position, | 6412 intptr_t parameter_position, |
| 6413 intptr_t other_parameter_position, | 6413 intptr_t other_parameter_position, |
| 6414 const TypeArguments& type_arguments, | 6414 const TypeArguments& type_arguments, |
| 6415 const Function& other, | 6415 const Function& other, |
| 6416 const TypeArguments& other_type_arguments, | 6416 const TypeArguments& other_type_arguments, |
| 6417 Error* bound_error, | 6417 Error* bound_error, |
| 6418 Heap::Space space) const { | 6418 Heap::Space space) const { |
| 6419 AbstractType& other_param_type = | 6419 AbstractType& other_param_type = |
| 6420 AbstractType::Handle(other.ParameterTypeAt(other_parameter_position)); | 6420 AbstractType::Handle(other.ParameterTypeAt(other_parameter_position)); |
| 6421 | |
| 6422 // TODO(regis): Remove this debugging code. | |
| 6423 if (other_param_type.IsNull()) { | |
| 6424 const Class& owner = Class::Handle(Owner()); | |
| 6425 const Class& other_owner = Class::Handle(other.Owner()); | |
| 6426 THR_Print("*** null other_param_type ***\n"); | |
| 6427 THR_Print("parameter_position: %" Pd "\n", parameter_position); | |
| 6428 THR_Print("other_parameter_position: %" Pd "\n", other_parameter_position); | |
| 6429 THR_Print("function: %s\n", ToCString()); | |
| 6430 THR_Print("function owner: %s\n", owner.ToCString()); | |
| 6431 THR_Print("other function: %s\n", other.ToCString()); | |
| 6432 THR_Print("other function owner: %s\n", other_owner.ToCString()); | |
| 6433 AbstractType& param_type = | |
| 6434 AbstractType::Handle(ParameterTypeAt(parameter_position)); | |
| 6435 THR_Print("param_type: %s\n", param_type.ToCString()); | |
| 6436 } | |
| 6437 | |
| 6438 if (!other_param_type.IsInstantiated()) { | 6421 if (!other_param_type.IsInstantiated()) { |
| 6439 other_param_type = | 6422 other_param_type = |
| 6440 other_param_type.InstantiateFrom(other_type_arguments, | 6423 other_param_type.InstantiateFrom(other_type_arguments, |
| 6441 bound_error, | 6424 bound_error, |
| 6442 NULL, // instantiation_trail | 6425 NULL, // instantiation_trail |
| 6443 NULL, // bound_trail | 6426 NULL, // bound_trail |
| 6444 space); | 6427 space); |
| 6445 ASSERT((bound_error == NULL) || bound_error->IsNull()); | 6428 ASSERT((bound_error == NULL) || bound_error->IsNull()); |
| 6446 } | 6429 } |
| 6447 if (other_param_type.IsDynamicType()) { | 6430 if (other_param_type.IsDynamicType()) { |
| 6448 return true; | 6431 return true; |
| 6449 } | 6432 } |
| 6450 AbstractType& param_type = | 6433 AbstractType& param_type = |
| 6451 AbstractType::Handle(ParameterTypeAt(parameter_position)); | 6434 AbstractType::Handle(ParameterTypeAt(parameter_position)); |
| 6452 | 6435 |
| 6453 // TODO(regis): Remove this debugging code. | 6436 // TODO(regis): Remove this debugging code. |
| 6454 if (param_type.IsNull()) { | 6437 if (param_type.IsNull()) { |
| 6455 const Class& owner = Class::Handle(Owner()); | |
| 6456 const Class& other_owner = Class::Handle(other.Owner()); | |
| 6457 THR_Print("*** null param_type ***\n"); | 6438 THR_Print("*** null param_type ***\n"); |
| 6458 THR_Print("parameter_position: %" Pd "\n", parameter_position); | 6439 THR_Print("parameter_position: %" Pd "\n", parameter_position); |
| 6459 THR_Print("other_parameter_position: %" Pd "\n", other_parameter_position); | 6440 THR_Print("other_parameter_position: %" Pd "\n", other_parameter_position); |
| 6460 THR_Print("function: %s\n", ToCString()); | 6441 String& str = String::Handle(); |
| 6442 str = QualifiedScrubbedName(); |
| 6443 THR_Print("function name: %s\n", str.ToCString()); |
| 6444 str = other.QualifiedScrubbedName(); |
| 6445 THR_Print("other function name: %s\n", str.ToCString()); |
| 6446 Class& owner = Class::Handle(); |
| 6447 owner = Owner(); |
| 6461 THR_Print("function owner: %s\n", owner.ToCString()); | 6448 THR_Print("function owner: %s\n", owner.ToCString()); |
| 6462 THR_Print("other function: %s\n", other.ToCString()); | 6449 owner = other.Owner(); |
| 6463 THR_Print("other function owner: %s\n", other_owner.ToCString()); | 6450 THR_Print("other function owner: %s\n", owner.ToCString()); |
| 6464 THR_Print("other_param_type: %s\n", other_param_type.ToCString()); | 6451 THR_Print("other_param_type: %s\n", other_param_type.ToCString()); |
| 6452 AbstractType& type = AbstractType::Handle(); |
| 6453 if (parameter_position > 0) { |
| 6454 type = ParameterTypeAt(0); |
| 6455 THR_Print("receiver type: %s\n", |
| 6456 type.IsNull()? "null" : type.ToCString()); |
| 6457 } |
| 6458 THR_Print("has code: %s\n", HasCode() ? "yes" : "no"); |
| 6459 str = Report::PrependSnippet(Report::kWarning, |
| 6460 Script::Handle(script()), |
| 6461 token_pos(), |
| 6462 Report::AtLocation, |
| 6463 Symbols::Empty()); |
| 6464 THR_Print("function source: %s\n", str.ToCString()); |
| 6465 for (intptr_t i = 0; i < NumParameters(); i++) { |
| 6466 THR_Print("function param %" Pd "\n", i); |
| 6467 str = ParameterNameAt(i); |
| 6468 THR_Print(" name: %s\n", str.IsNull() ? "null" : str.ToCString()); |
| 6469 type = ParameterTypeAt(i); |
| 6470 THR_Print(" type: %s\n", type.IsNull() ? "null" : type.ToCString()); |
| 6471 } |
| 6465 } | 6472 } |
| 6466 | 6473 |
| 6467 if (!param_type.IsInstantiated()) { | 6474 if (!param_type.IsInstantiated()) { |
| 6468 param_type = param_type.InstantiateFrom(type_arguments, | 6475 param_type = param_type.InstantiateFrom(type_arguments, |
| 6469 bound_error, | 6476 bound_error, |
| 6470 NULL, // instantiation_trail | 6477 NULL, // instantiation_trail |
| 6471 NULL, // bound_trail | 6478 NULL, // bound_trail |
| 6472 space); | 6479 space); |
| 6473 ASSERT((bound_error == NULL) || bound_error->IsNull()); | 6480 ASSERT((bound_error == NULL) || bound_error->IsNull()); |
| 6474 } | 6481 } |
| (...skipping 15922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22397 return UserTag::null(); | 22404 return UserTag::null(); |
| 22398 } | 22405 } |
| 22399 | 22406 |
| 22400 | 22407 |
| 22401 const char* UserTag::ToCString() const { | 22408 const char* UserTag::ToCString() const { |
| 22402 const String& tag_label = String::Handle(label()); | 22409 const String& tag_label = String::Handle(label()); |
| 22403 return tag_label.ToCString(); | 22410 return tag_label.ToCString(); |
| 22404 } | 22411 } |
| 22405 | 22412 |
| 22406 } // namespace dart | 22413 } // namespace dart |
| OLD | NEW |