| 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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 bool result_is_needed) { | 2713 bool result_is_needed) { |
| 2714 Function* super_function = NULL; | 2714 Function* super_function = NULL; |
| 2715 if (node->IsSuperStore()) { | 2715 if (node->IsSuperStore()) { |
| 2716 // Resolve the store indexed operator in the super class. | 2716 // Resolve the store indexed operator in the super class. |
| 2717 super_function = &Function::ZoneHandle( | 2717 super_function = &Function::ZoneHandle( |
| 2718 Resolver::ResolveDynamicAnyArgs(node->super_class(), | 2718 Resolver::ResolveDynamicAnyArgs(node->super_class(), |
| 2719 Symbols::AssignIndexToken())); | 2719 Symbols::AssignIndexToken())); |
| 2720 if (super_function->IsNull()) { | 2720 if (super_function->IsNull()) { |
| 2721 // Could not resolve super operator. Generate call noSuchMethod() of the | 2721 // Could not resolve super operator. Generate call noSuchMethod() of the |
| 2722 // super class instead. | 2722 // super class instead. |
| 2723 // Even though noSuchMethod most likely does not return, | |
| 2724 // we save the stored value if in case the result is needed. | |
| 2725 ValueGraphVisitor for_value(owner(), temp_index()); | |
| 2726 node->value()->Visit(&for_value); | |
| 2727 Append(for_value); | |
| 2728 Do(BuildStoreExprTemp(for_value.value())); | |
| 2729 | |
| 2730 const LocalVariable* temp = | |
| 2731 owner()->parsed_function().expression_temp_var(); | |
| 2732 AstNode* value = new LoadLocalNode(node->token_pos(), temp); | |
| 2733 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos()); | 2723 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos()); |
| 2734 arguments->Add(node->array()); | 2724 arguments->Add(node->array()); |
| 2735 arguments->Add(node->index_expr()); | 2725 arguments->Add(node->index_expr()); |
| 2736 arguments->Add(value); | 2726 |
| 2727 // Even though noSuchMethod most likely does not return, |
| 2728 // we save the stored value if the result is needed. |
| 2729 if (result_is_needed) { |
| 2730 ValueGraphVisitor for_value(owner(), temp_index()); |
| 2731 node->value()->Visit(&for_value); |
| 2732 Append(for_value); |
| 2733 Do(BuildStoreExprTemp(for_value.value())); |
| 2734 |
| 2735 const LocalVariable* temp = |
| 2736 owner()->parsed_function().expression_temp_var(); |
| 2737 AstNode* value = new LoadLocalNode(node->token_pos(), temp); |
| 2738 arguments->Add(value); |
| 2739 } else { |
| 2740 arguments->Add(node->value()); |
| 2741 } |
| 2737 StaticCallInstr* call = | 2742 StaticCallInstr* call = |
| 2738 BuildStaticNoSuchMethodCall(node->super_class(), | 2743 BuildStaticNoSuchMethodCall(node->super_class(), |
| 2739 node->array(), | 2744 node->array(), |
| 2740 Symbols::AssignIndexToken(), | 2745 Symbols::AssignIndexToken(), |
| 2741 arguments); | 2746 arguments); |
| 2742 if (result_is_needed) { | 2747 if (result_is_needed) { |
| 2743 Do(call); | 2748 Do(call); |
| 2744 return BuildLoadExprTemp(); | 2749 return BuildLoadExprTemp(); |
| 2745 } else { | 2750 } else { |
| 2746 return call; | 2751 return call; |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3292 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3297 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3293 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3298 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3294 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3299 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3295 const Error& error = Error::Handle( | 3300 const Error& error = Error::Handle( |
| 3296 LanguageError::New(String::Handle(String::New(chars)))); | 3301 LanguageError::New(String::Handle(String::New(chars)))); |
| 3297 Isolate::Current()->long_jump_base()->Jump(1, error); | 3302 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3298 } | 3303 } |
| 3299 | 3304 |
| 3300 | 3305 |
| 3301 } // namespace dart | 3306 } // namespace dart |
| OLD | NEW |