| 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 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 } | 2380 } |
| 2381 ReturnDefinition(ExitTempLocalScope(tmp_var)); | 2381 ReturnDefinition(ExitTempLocalScope(tmp_var)); |
| 2382 } | 2382 } |
| 2383 } | 2383 } |
| 2384 | 2384 |
| 2385 | 2385 |
| 2386 void EffectGraphVisitor::VisitStringInterpolateNode( | 2386 void EffectGraphVisitor::VisitStringInterpolateNode( |
| 2387 StringInterpolateNode* node) { | 2387 StringInterpolateNode* node) { |
| 2388 ValueGraphVisitor for_argument(owner()); | 2388 ValueGraphVisitor for_argument(owner()); |
| 2389 ArrayNode* arguments = node->value(); | 2389 ArrayNode* arguments = node->value(); |
| 2390 bool is_singleton = false; |
| 2390 if (arguments->length() == 1) { | 2391 if (arguments->length() == 1) { |
| 2391 ZoneGrowableArray<PushArgumentInstr*>* values = | |
| 2392 new(I) ZoneGrowableArray<PushArgumentInstr*>(1); | |
| 2393 arguments->ElementAt(0)->Visit(&for_argument); | 2392 arguments->ElementAt(0)->Visit(&for_argument); |
| 2394 Append(for_argument); | 2393 is_singleton = true; |
| 2395 PushArgumentInstr* push_arg = PushArgument(for_argument.value()); | 2394 } else { |
| 2396 values->Add(push_arg); | 2395 arguments->Visit(&for_argument); |
| 2397 const int kNumberOfArguments = 1; | |
| 2398 const Array& kNoArgumentNames = Object::null_array(); | |
| 2399 const Class& cls = | |
| 2400 Class::Handle(Library::LookupCoreClass(Symbols::StringBase())); | |
| 2401 ASSERT(!cls.IsNull()); | |
| 2402 const Function& function = Function::Handle( | |
| 2403 Resolver::ResolveStatic( | |
| 2404 cls, | |
| 2405 Library::PrivateCoreLibName(Symbols::InterpolateSingle()), | |
| 2406 kNumberOfArguments, | |
| 2407 kNoArgumentNames)); | |
| 2408 StaticCallInstr* call = | |
| 2409 new(I) StaticCallInstr(node->token_pos(), | |
| 2410 function, | |
| 2411 kNoArgumentNames, | |
| 2412 values, | |
| 2413 owner()->ic_data_array()); | |
| 2414 ReturnDefinition(call); | |
| 2415 return; | |
| 2416 } | 2396 } |
| 2417 arguments->Visit(&for_argument); | |
| 2418 Append(for_argument); | 2397 Append(for_argument); |
| 2419 StringInterpolateInstr* instr = | 2398 StringInterpolateInstr* instr = |
| 2420 new(I) StringInterpolateInstr(for_argument.value(), node->token_pos()); | 2399 new(I) StringInterpolateInstr(for_argument.value(), node->token_pos(), |
| 2400 is_singleton); |
| 2421 ReturnDefinition(instr); | 2401 ReturnDefinition(instr); |
| 2422 } | 2402 } |
| 2423 | 2403 |
| 2424 | 2404 |
| 2425 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) { | 2405 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) { |
| 2426 const Function& function = node->function(); | 2406 const Function& function = node->function(); |
| 2427 | 2407 |
| 2428 if (function.IsImplicitStaticClosureFunction()) { | 2408 if (function.IsImplicitStaticClosureFunction()) { |
| 2429 const Instance& closure = | 2409 const Instance& closure = |
| 2430 Instance::ZoneHandle(I, function.ImplicitStaticClosure()); | 2410 Instance::ZoneHandle(I, function.ImplicitStaticClosure()); |
| (...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4286 Report::MessageF(Report::kBailout, | 4266 Report::MessageF(Report::kBailout, |
| 4287 Script::Handle(function.script()), | 4267 Script::Handle(function.script()), |
| 4288 function.token_pos(), | 4268 function.token_pos(), |
| 4289 "FlowGraphBuilder Bailout: %s %s", | 4269 "FlowGraphBuilder Bailout: %s %s", |
| 4290 String::Handle(function.name()).ToCString(), | 4270 String::Handle(function.name()).ToCString(), |
| 4291 reason); | 4271 reason); |
| 4292 UNREACHABLE(); | 4272 UNREACHABLE(); |
| 4293 } | 4273 } |
| 4294 | 4274 |
| 4295 } // namespace dart | 4275 } // namespace dart |
| OLD | NEW |