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

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

Issue 27192005: Add new style of string interpolation optimization: new nodes, working constant folding. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 StoreIndexedInstr* store = new StoreIndexedInstr( 2025 StoreIndexedInstr* store = new StoreIndexedInstr(
2026 array, index, for_value.value(), 2026 array, index, for_value.value(),
2027 emit_store_barrier, index_scale, class_id, deopt_id); 2027 emit_store_barrier, index_scale, class_id, deopt_id);
2028 Do(store); 2028 Do(store);
2029 } 2029 }
2030 ReturnDefinition(ExitTempLocalScope(tmp_var)); 2030 ReturnDefinition(ExitTempLocalScope(tmp_var));
2031 } 2031 }
2032 } 2032 }
2033 2033
2034 2034
2035 void EffectGraphVisitor::VisitStringInterpolateNode(
2036 StringInterpolateNode* node) {
2037 ValueGraphVisitor for_argument(owner(), temp_index());
2038 node->value()->Visit(&for_argument);
2039 Append(for_argument);
2040 StringInterpolateInstr* instr =
2041 new StringInterpolateInstr(for_argument.value(), node->token_pos());
2042 ReturnDefinition(instr);
2043 }
2044
2045
2035 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) { 2046 void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
2036 const Function& function = node->function(); 2047 const Function& function = node->function();
2037 2048
2038 if (function.IsImplicitStaticClosureFunction()) { 2049 if (function.IsImplicitStaticClosureFunction()) {
2039 const Instance& closure = 2050 const Instance& closure =
2040 Instance::ZoneHandle(function.ImplicitStaticClosure()); 2051 Instance::ZoneHandle(function.ImplicitStaticClosure());
2041 ReturnDefinition(new ConstantInstr(closure)); 2052 ReturnDefinition(new ConstantInstr(closure));
2042 return; 2053 return;
2043 } 2054 }
2044 if (function.IsNonImplicitClosureFunction()) { 2055 if (function.IsNonImplicitClosureFunction()) {
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
3839 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3850 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3840 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3851 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3841 OS::SNPrint(chars, len, kFormat, function_name, reason); 3852 OS::SNPrint(chars, len, kFormat, function_name, reason);
3842 const Error& error = Error::Handle( 3853 const Error& error = Error::Handle(
3843 LanguageError::New(String::Handle(String::New(chars)))); 3854 LanguageError::New(String::Handle(String::New(chars))));
3844 Isolate::Current()->long_jump_base()->Jump(1, error); 3855 Isolate::Current()->long_jump_base()->Jump(1, error);
3845 } 3856 }
3846 3857
3847 3858
3848 } // namespace dart 3859 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698