| Index: vm/flow_graph_builder.cc
|
| ===================================================================
|
| --- vm/flow_graph_builder.cc (revision 9395)
|
| +++ vm/flow_graph_builder.cc (working copy)
|
| @@ -519,83 +519,6 @@
|
| }
|
|
|
|
|
| -void EffectGraphVisitor::CompiletimeStringInterpolation(
|
| - const Function& interpol_func, const Array& literals) {
|
| - // Do nothing.
|
| -}
|
| -
|
| -
|
| -void ValueGraphVisitor::CompiletimeStringInterpolation(
|
| - const Function& interpol_func, const Array& literals) {
|
| - // Build argument array to pass to the interpolation function.
|
| - GrowableArray<const Object*> interpolate_arg;
|
| - interpolate_arg.Add(&literals);
|
| - const Array& kNoArgumentNames = Array::Handle();
|
| - // Call the interpolation function.
|
| - String& concatenated = String::ZoneHandle();
|
| - concatenated ^= DartEntry::InvokeStatic(interpol_func,
|
| - interpolate_arg,
|
| - kNoArgumentNames);
|
| - if (concatenated.IsUnhandledException()) {
|
| - // TODO(srdjan): Remove this node and this UNREACHABLE.
|
| - UNREACHABLE();
|
| - }
|
| - ASSERT(!concatenated.IsNull());
|
| - concatenated = String::NewSymbol(concatenated);
|
| - ReturnComputation(new ConstantVal(concatenated));
|
| -}
|
| -
|
| -
|
| -
|
| -// TODO(srdjan): Remove this node once the "+" string operator has been
|
| -// eliminated.
|
| -void EffectGraphVisitor::VisitStringConcatNode(StringConcatNode* node) {
|
| - const String& cls_name = String::Handle(String::NewSymbol("StringBase"));
|
| - const Library& core_lib = Library::Handle(
|
| - Isolate::Current()->object_store()->core_library());
|
| - const Class& cls = Class::Handle(core_lib.LookupClass(cls_name));
|
| - ASSERT(!cls.IsNull());
|
| - const String& func_name = String::Handle(String::NewSymbol("_interpolate"));
|
| - const int number_of_parameters = 1;
|
| - const Function& interpol_func = Function::ZoneHandle(
|
| - Resolver::ResolveStatic(cls, func_name,
|
| - number_of_parameters,
|
| - Array::Handle(),
|
| - Resolver::kIsQualified));
|
| - ASSERT(!interpol_func.IsNull());
|
| -
|
| - // First try to concatenate and canonicalize the values at compile time.
|
| - bool compile_time_interpolation = true;
|
| - Array& literals = Array::Handle(Array::New(node->values()->length()));
|
| - for (int i = 0; i < node->values()->length(); i++) {
|
| - if (node->values()->ElementAt(i)->IsLiteralNode()) {
|
| - LiteralNode* lit = node->values()->ElementAt(i)->AsLiteralNode();
|
| - literals.SetAt(i, lit->literal());
|
| - } else {
|
| - compile_time_interpolation = false;
|
| - break;
|
| - }
|
| - }
|
| - if (compile_time_interpolation) {
|
| - // Not needed for effect, only for value
|
| - CompiletimeStringInterpolation(interpol_func, literals);
|
| - return;
|
| - }
|
| - // Runtime string interpolation.
|
| - ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>();
|
| - ArgumentListNode* interpol_arg = new ArgumentListNode(node->token_pos());
|
| - interpol_arg->Add(node->values());
|
| - TranslateArgumentList(*interpol_arg, values);
|
| - StaticCallComp* call =
|
| - new StaticCallComp(node->token_pos(),
|
| - owner()->try_index(),
|
| - interpol_func,
|
| - interpol_arg->names(),
|
| - values);
|
| - ReturnComputation(call);
|
| -}
|
| -
|
| -
|
| void EffectGraphVisitor::BuildTypecheckArguments(
|
| intptr_t token_pos,
|
| Value** instantiator_result,
|
|
|