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

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

Issue 190753004: - Ensure that all names in local scopes are symbols. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3462 ASSERT(scope->context_level() == 1); 3462 ASSERT(scope->context_level() == 1);
3463 const Function& function = owner()->parsed_function()->function(); 3463 const Function& function = owner()->parsed_function()->function();
3464 const int num_params = function.NumParameters(); 3464 const int num_params = function.NumParameters();
3465 int param_frame_index = (num_params == function.num_fixed_parameters()) ? 3465 int param_frame_index = (num_params == function.num_fixed_parameters()) ?
3466 (kParamEndSlotFromFp + num_params) : kFirstLocalSlotFromFp; 3466 (kParamEndSlotFromFp + num_params) : kFirstLocalSlotFromFp;
3467 for (int pos = 0; pos < num_params; param_frame_index--, pos++) { 3467 for (int pos = 0; pos < num_params; param_frame_index--, pos++) {
3468 const LocalVariable& parameter = *scope->VariableAt(pos); 3468 const LocalVariable& parameter = *scope->VariableAt(pos);
3469 ASSERT(parameter.owner() == scope); 3469 ASSERT(parameter.owner() == scope);
3470 if (parameter.is_captured()) { 3470 if (parameter.is_captured()) {
3471 // Create a temporary local describing the original position. 3471 // Create a temporary local describing the original position.
3472 const String& temp_name = String::ZoneHandle(String::Concat( 3472 const String& temp_name = Symbols::TempParam();
3473 parameter.name(), String::Handle(Symbols::New("-orig"))));
3474 LocalVariable* temp_local = new LocalVariable( 3473 LocalVariable* temp_local = new LocalVariable(
3475 0, // Token index. 3474 0, // Token index.
3476 temp_name, 3475 temp_name,
3477 Type::ZoneHandle(Type::DynamicType())); // Type. 3476 Type::ZoneHandle(Type::DynamicType())); // Type.
3478 temp_local->set_index(param_frame_index); 3477 temp_local->set_index(param_frame_index);
3479 3478
3480 // Copy parameter from local frame to current context. 3479 // Copy parameter from local frame to current context.
3481 Value* load = Bind(BuildLoadLocal(*temp_local)); 3480 Value* load = Bind(BuildLoadLocal(*temp_local));
3482 Do(BuildStoreLocal(parameter, load)); 3481 Do(BuildStoreLocal(parameter, load));
3483 // Write NULL to the source location to detect buggy accesses and 3482 // Write NULL to the source location to detect buggy accesses and
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
3925 LanguageError::kError, 3924 LanguageError::kError,
3926 Heap::kNew, 3925 Heap::kNew,
3927 "FlowGraphBuilder Bailout: %s %s", 3926 "FlowGraphBuilder Bailout: %s %s",
3928 String::Handle(function.name()).ToCString(), 3927 String::Handle(function.name()).ToCString(),
3929 reason)); 3928 reason));
3930 Isolate::Current()->long_jump_base()->Jump(1, error); 3929 Isolate::Current()->long_jump_base()->Jump(1, error);
3931 } 3930 }
3932 3931
3933 3932
3934 } // namespace dart 3933 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698