| Index: runtime/vm/intermediate_language.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.cc (revision 33643)
|
| +++ runtime/vm/intermediate_language.cc (working copy)
|
| @@ -3043,6 +3043,12 @@
|
| // StoreIndexed(v2, v3, v4) -- v3:constant index, v4: value.
|
| // ..
|
| // v8 <- StringInterpolate(v2)
|
| +
|
| + // Don't compile-time fold when optimizing the interpolation function itself.
|
| + if (flow_graph->parsed_function().function().raw() == CallFunction().raw()) {
|
| + return this;
|
| + }
|
| +
|
| CreateArrayInstr* create_array = value()->definition()->AsCreateArray();
|
| ASSERT(create_array != NULL);
|
| // Check if the string interpolation has only constant inputs.
|
| @@ -3087,13 +3093,14 @@
|
| const Array& interpolate_arg = Array::Handle(Array::New(1));
|
| interpolate_arg.SetAt(0, array_argument);
|
| // Call interpolation function.
|
| - String& concatenated = String::ZoneHandle();
|
| - concatenated ^=
|
| - DartEntry::InvokeFunction(CallFunction(), interpolate_arg);
|
| - if (concatenated.IsUnhandledException()) {
|
| + const Object& result = Object::Handle(
|
| + DartEntry::InvokeFunction(CallFunction(), interpolate_arg));
|
| + if (result.IsUnhandledException()) {
|
| return this;
|
| }
|
| - concatenated = Symbols::New(concatenated);
|
| + ASSERT(result.IsString());
|
| + const String& concatenated =
|
| + String::ZoneHandle(Symbols::New(String::Cast(result)));
|
| return flow_graph->GetConstant(concatenated);
|
| }
|
|
|
|
|