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

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

Issue 24837002: Optimize string interpolation by running it at compile time if all inputs are constant. This is don… (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 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 type_arguments = BuildNullValue(); 2144 type_arguments = BuildNullValue();
2145 } 2145 }
2146 PushArgumentInstr* push_type_arguments = PushArgument(type_arguments); 2146 PushArgumentInstr* push_type_arguments = PushArgument(type_arguments);
2147 arguments->Add(push_type_arguments); 2147 arguments->Add(push_type_arguments);
2148 ReturnDefinition( 2148 ReturnDefinition(
2149 new CreateClosureInstr(node->function(), arguments, node->token_pos())); 2149 new CreateClosureInstr(node->function(), arguments, node->token_pos()));
2150 } 2150 }
2151 } 2151 }
2152 2152
2153 2153
2154 void EffectGraphVisitor::TranslateArgumentList(
2155 const ArgumentListNode& node,
2156 ZoneGrowableArray<Value*>* values) {
2157 for (intptr_t i = 0; i < node.length(); ++i) {
2158 ValueGraphVisitor for_argument(owner(), temp_index());
2159 node.NodeAt(i)->Visit(&for_argument);
2160 Append(for_argument);
2161 values->Add(for_argument.value());
2162 }
2163 }
2164
2165
2166 void EffectGraphVisitor::BuildPushArguments( 2154 void EffectGraphVisitor::BuildPushArguments(
2167 const ArgumentListNode& node, 2155 const ArgumentListNode& node,
2168 ZoneGrowableArray<PushArgumentInstr*>* values) { 2156 ZoneGrowableArray<PushArgumentInstr*>* values) {
2169 for (intptr_t i = 0; i < node.length(); ++i) { 2157 for (intptr_t i = 0; i < node.length(); ++i) {
2170 ValueGraphVisitor for_argument(owner(), temp_index()); 2158 ValueGraphVisitor for_argument(owner(), temp_index());
2171 node.NodeAt(i)->Visit(&for_argument); 2159 node.NodeAt(i)->Visit(&for_argument);
2172 Append(for_argument); 2160 Append(for_argument);
2173 PushArgumentInstr* push_arg = PushArgument(for_argument.value()); 2161 PushArgumentInstr* push_arg = PushArgument(for_argument.value());
2174 values->Add(push_arg); 2162 values->Add(push_arg);
2175 } 2163 }
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
3820 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3808 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3821 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3809 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3822 OS::SNPrint(chars, len, kFormat, function_name, reason); 3810 OS::SNPrint(chars, len, kFormat, function_name, reason);
3823 const Error& error = Error::Handle( 3811 const Error& error = Error::Handle(
3824 LanguageError::New(String::Handle(String::New(chars)))); 3812 LanguageError::New(String::Handle(String::New(chars))));
3825 Isolate::Current()->long_jump_base()->Jump(1, error); 3813 Isolate::Current()->long_jump_base()->Jump(1, error);
3826 } 3814 }
3827 3815
3828 3816
3829 } // namespace dart 3817 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698