| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
| 8 #include "vm/code_descriptors.h" | 8 #include "vm/code_descriptors.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 } | 686 } |
| 687 | 687 |
| 688 | 688 |
| 689 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { | 689 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { |
| 690 InlineBailout("EffectGraphVisitor::BuildTypeCast"); | 690 InlineBailout("EffectGraphVisitor::BuildTypeCast"); |
| 691 ASSERT(Token::IsTypeCastOperator(node->kind())); | 691 ASSERT(Token::IsTypeCastOperator(node->kind())); |
| 692 const AbstractType& type = node->right()->AsTypeNode()->type(); | 692 const AbstractType& type = node->right()->AsTypeNode()->type(); |
| 693 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. | 693 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. |
| 694 ValueGraphVisitor for_value(owner(), temp_index()); | 694 ValueGraphVisitor for_value(owner(), temp_index()); |
| 695 node->left()->Visit(&for_value); | 695 node->left()->Visit(&for_value); |
| 696 Append(for_value); | |
| 697 const String& dst_name = String::ZoneHandle( | 696 const String& dst_name = String::ZoneHandle( |
| 698 Symbols::New(Exceptions::kCastExceptionDstName)); | 697 Symbols::New(Exceptions::kCastExceptionDstName)); |
| 699 if (!CanSkipTypeCheck(node->token_pos(), for_value.value(), type, dst_name)) { | 698 if (!CanSkipTypeCheck(node->token_pos(), for_value.value(), type, dst_name)) { |
| 699 Append(for_value); |
| 700 Do(BuildAssertAssignable( | 700 Do(BuildAssertAssignable( |
| 701 node->token_pos(), for_value.value(), type, dst_name)); | 701 node->token_pos(), for_value.value(), type, dst_name)); |
| 702 } | 702 } |
| 703 } | 703 } |
| 704 | 704 |
| 705 | 705 |
| 706 void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) { | 706 void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) { |
| 707 InlineBailout("ValueGraphVisitor::BuildTypeTest"); | 707 InlineBailout("ValueGraphVisitor::BuildTypeTest"); |
| 708 ASSERT(Token::IsTypeTestOperator(node->kind())); | 708 ASSERT(Token::IsTypeTestOperator(node->kind())); |
| 709 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); | 709 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2540 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2540 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2541 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2541 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2542 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2542 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2543 const Error& error = Error::Handle( | 2543 const Error& error = Error::Handle( |
| 2544 LanguageError::New(String::Handle(String::New(chars)))); | 2544 LanguageError::New(String::Handle(String::New(chars)))); |
| 2545 Isolate::Current()->long_jump_base()->Jump(1, error); | 2545 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2546 } | 2546 } |
| 2547 | 2547 |
| 2548 | 2548 |
| 2549 } // namespace dart | 2549 } // namespace dart |
| OLD | NEW |