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 "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 if (result_is_needed) { | |
| 2724 // Even though noSuchMethod most likely does not return, | 2723 // Even though noSuchMethod most likely does not return, |
| 2725 // we save the stored value if the result is needed. | 2724 // we save the stored value if the result is needed. |
|
hausner
2013/03/07 21:53:59
Can you adjust the comment to match the removed if
srdjan
2013/03/07 21:58:08
Done.
| |
| 2726 ValueGraphVisitor for_value(owner(), temp_index()); | 2725 ValueGraphVisitor for_value(owner(), temp_index()); |
| 2727 node->value()->Visit(&for_value); | 2726 node->value()->Visit(&for_value); |
| 2728 Append(for_value); | 2727 Append(for_value); |
| 2729 Bind(BuildStoreExprTemp(for_value.value())); | 2728 Do(BuildStoreExprTemp(for_value.value())); |
| 2730 } | 2729 |
| 2730 const LocalVariable* temp = | |
| 2731 owner()->parsed_function().expression_temp_var(); | |
| 2732 AstNode* value = new LoadLocalNode(node->token_pos(), temp); | |
| 2731 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos()); | 2733 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos()); |
| 2732 arguments->Add(node->array()); | 2734 arguments->Add(node->array()); |
| 2733 arguments->Add(node->index_expr()); | 2735 arguments->Add(node->index_expr()); |
| 2734 arguments->Add(node->value()); | 2736 arguments->Add(value); |
| 2735 StaticCallInstr* call = | 2737 StaticCallInstr* call = |
| 2736 BuildStaticNoSuchMethodCall(node->super_class(), | 2738 BuildStaticNoSuchMethodCall(node->super_class(), |
| 2737 node->array(), | 2739 node->array(), |
| 2738 Symbols::AssignIndexToken(), | 2740 Symbols::AssignIndexToken(), |
| 2739 arguments); | 2741 arguments); |
| 2740 if (result_is_needed) { | 2742 if (result_is_needed) { |
| 2741 Do(call); | 2743 Do(call); |
| 2742 return BuildLoadExprTemp(); | 2744 return BuildLoadExprTemp(); |
| 2743 } else { | 2745 } else { |
| 2744 return call; | 2746 return call; |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3290 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3292 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3291 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3293 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3292 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3294 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3293 const Error& error = Error::Handle( | 3295 const Error& error = Error::Handle( |
| 3294 LanguageError::New(String::Handle(String::New(chars)))); | 3296 LanguageError::New(String::Handle(String::New(chars)))); |
| 3295 Isolate::Current()->long_jump_base()->Jump(1, error); | 3297 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3296 } | 3298 } |
| 3297 | 3299 |
| 3298 | 3300 |
| 3299 } // namespace dart | 3301 } // namespace dart |
| OLD | NEW |