Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: vm/flow_graph_builder.cc

Issue 10693092: Remove unused code for StringConcatNode from the AST and the graph builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/flow_graph_builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « vm/flow_graph_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698