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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 563973004: Call special VM interpolate for single element interpolation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 Do(store); 2379 Do(store);
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 node->value()->Visit(&for_argument); 2389 ArrayNode* arguments = node->value();
2390 intptr_t length = arguments->length();
2391 bool singleton = false;
2392 if (length == 1) {
Florian Schneider 2014/09/12 10:33:37 Drop length and replace with just arguments->lengt
Lasse Reichstein Nielsen 2014/09/12 12:49:39 Done.
2393 arguments->ElementAt(0)->Visit(&for_argument);
2394 singleton = true;
2395 } else {
2396 arguments->Visit(&for_argument);
2397 }
2390 Append(for_argument); 2398 Append(for_argument);
2391 StringInterpolateInstr* instr = 2399 StringInterpolateInstr* instr =
2392 new(I) StringInterpolateInstr(for_argument.value(), node->token_pos()); 2400 new(I) StringInterpolateInstr(for_argument.value(), node->token_pos(),
2401 singleton);
2393 ReturnDefinition(instr); 2402 ReturnDefinition(instr);
2394 } 2403 }
2395 2404
2396 2405
2397 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) { 2406 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
2398 const Function& function = node->function(); 2407 const Function& function = node->function();
2399 2408
2400 if (function.IsImplicitStaticClosureFunction()) { 2409 if (function.IsImplicitStaticClosureFunction()) {
2401 const Instance& closure = 2410 const Instance& closure =
2402 Instance::ZoneHandle(I, function.ImplicitStaticClosure()); 2411 Instance::ZoneHandle(I, function.ImplicitStaticClosure());
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
4223 Report::MessageF(Report::kBailout, 4232 Report::MessageF(Report::kBailout,
4224 Script::Handle(function.script()), 4233 Script::Handle(function.script()),
4225 function.token_pos(), 4234 function.token_pos(),
4226 "FlowGraphBuilder Bailout: %s %s", 4235 "FlowGraphBuilder Bailout: %s %s",
4227 String::Handle(function.name()).ToCString(), 4236 String::Handle(function.name()).ToCString(),
4228 reason); 4237 reason);
4229 UNREACHABLE(); 4238 UNREACHABLE();
4230 } 4239 }
4231 4240
4232 } // namespace dart 4241 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698