| 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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3159 void EffectGraphVisitor::BuildStaticSetter(StaticSetterNode* node, | 3159 void EffectGraphVisitor::BuildStaticSetter(StaticSetterNode* node, |
| 3160 bool result_is_needed) { | 3160 bool result_is_needed) { |
| 3161 const String& setter_name = | 3161 const String& setter_name = |
| 3162 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); | 3162 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); |
| 3163 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 3163 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 3164 new(Z) ZoneGrowableArray<PushArgumentInstr*>(1); | 3164 new(Z) ZoneGrowableArray<PushArgumentInstr*>(1); |
| 3165 // A super setter is an instance setter whose setter function is | 3165 // A super setter is an instance setter whose setter function is |
| 3166 // resolved at compile time (in the caller instance getter's super class). | 3166 // resolved at compile time (in the caller instance getter's super class). |
| 3167 // Unlike a static getter, a super getter has a receiver parameter. | 3167 // Unlike a static getter, a super getter has a receiver parameter. |
| 3168 const bool is_super_setter = (node->receiver() != NULL); | 3168 const bool is_super_setter = (node->receiver() != NULL); |
| 3169 Function& setter_function = | 3169 const Function& setter_function = node->function(); |
| 3170 Function::ZoneHandle(Z, is_super_setter | |
| 3171 ? Resolver::ResolveDynamicAnyArgs(node->cls(), setter_name) | |
| 3172 : node->cls().LookupStaticFunction(setter_name)); | |
| 3173 StaticCallInstr* call; | 3170 StaticCallInstr* call; |
| 3174 if (setter_function.IsNull()) { | 3171 if (setter_function.IsNull()) { |
| 3175 if (is_super_setter) { | 3172 if (is_super_setter) { |
| 3176 ASSERT(node->receiver() != NULL); | 3173 ASSERT(node->receiver() != NULL); |
| 3177 // Resolve and call noSuchMethod. | 3174 // Resolve and call noSuchMethod. |
| 3178 ArgumentListNode* arguments = new(Z) ArgumentListNode(node->token_pos()); | 3175 ArgumentListNode* arguments = new(Z) ArgumentListNode(node->token_pos()); |
| 3179 arguments->Add(node->receiver()); | 3176 arguments->Add(node->receiver()); |
| 3180 arguments->Add(node->value()); | 3177 arguments->Add(node->value()); |
| 3181 call = BuildStaticNoSuchMethodCall( | 3178 call = BuildStaticNoSuchMethodCall( |
| 3182 node->cls(), | 3179 node->cls(), |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4379 Report::MessageF(Report::kBailout, | 4376 Report::MessageF(Report::kBailout, |
| 4380 Script::Handle(function.script()), | 4377 Script::Handle(function.script()), |
| 4381 function.token_pos(), | 4378 function.token_pos(), |
| 4382 "FlowGraphBuilder Bailout: %s %s", | 4379 "FlowGraphBuilder Bailout: %s %s", |
| 4383 String::Handle(function.name()).ToCString(), | 4380 String::Handle(function.name()).ToCString(), |
| 4384 reason); | 4381 reason); |
| 4385 UNREACHABLE(); | 4382 UNREACHABLE(); |
| 4386 } | 4383 } |
| 4387 | 4384 |
| 4388 } // namespace dart | 4385 } // namespace dart |
| OLD | NEW |