Chromium Code Reviews| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 eliminated); | 599 eliminated); |
| 600 } | 600 } |
| 601 return eliminated; | 601 return eliminated; |
| 602 } | 602 } |
| 603 | 603 |
| 604 | 604 |
| 605 // <Expression> :: Assignable { expr: <Expression> | 605 // <Expression> :: Assignable { expr: <Expression> |
| 606 // type: AbstractType | 606 // type: AbstractType |
| 607 // dst_name: String } | 607 // dst_name: String } |
| 608 void EffectGraphVisitor::VisitAssignableNode(AssignableNode* node) { | 608 void EffectGraphVisitor::VisitAssignableNode(AssignableNode* node) { |
| 609 UNREACHABLE(); | 609 ValueGraphVisitor for_value(owner(), temp_index(), loop_depth()); |
| 610 node->expr()->Visit(&for_value); | |
| 611 Append(for_value); | |
| 612 Definition* checked_value; | |
| 613 if (CanSkipTypeCheck(node->expr()->token_pos(), | |
| 614 for_value.value(), | |
| 615 node->type(), | |
| 616 node->dst_name())) { | |
| 617 checked_value = for_value.value()->definition(); // No check needed. | |
| 618 } else { | |
| 619 checked_value = BuildAssertAssignable(node->expr()->token_pos(), | |
| 620 for_value.value(), | |
| 621 node->type(), | |
| 622 node->dst_name()); | |
| 623 } | |
|
srdjan
2012/11/13 18:33:35
Why are you not using BuildAssignableValue as belo
regis
2012/11/13 18:38:53
I tried, but it does not get simpler. BuildAssertA
| |
| 624 ReturnDefinition(checked_value); | |
| 610 } | 625 } |
| 611 | 626 |
| 612 | 627 |
| 613 void ValueGraphVisitor::VisitAssignableNode(AssignableNode* node) { | 628 void ValueGraphVisitor::VisitAssignableNode(AssignableNode* node) { |
| 614 ValueGraphVisitor for_value(owner(), temp_index(), loop_depth()); | 629 ValueGraphVisitor for_value(owner(), temp_index(), loop_depth()); |
| 615 node->expr()->Visit(&for_value); | 630 node->expr()->Visit(&for_value); |
| 616 Append(for_value); | 631 Append(for_value); |
| 617 ReturnValue(BuildAssignableValue(node->expr()->token_pos(), | 632 ReturnValue(BuildAssignableValue(node->expr()->token_pos(), |
| 618 for_value.value(), | 633 for_value.value(), |
| 619 node->type(), | 634 node->type(), |
| (...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2947 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2962 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2948 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2963 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2949 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2964 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2950 const Error& error = Error::Handle( | 2965 const Error& error = Error::Handle( |
| 2951 LanguageError::New(String::Handle(String::New(chars)))); | 2966 LanguageError::New(String::Handle(String::New(chars)))); |
| 2952 Isolate::Current()->long_jump_base()->Jump(1, error); | 2967 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2953 } | 2968 } |
| 2954 | 2969 |
| 2955 | 2970 |
| 2956 } // namespace dart | 2971 } // namespace dart |
| OLD | NEW |