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

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

Issue 653073002: Fix bug with captured parameters and optimized try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 ASSERT(parameter.owner() == scope); 3748 ASSERT(parameter.owner() == scope);
3749 if (parameter.is_captured()) { 3749 if (parameter.is_captured()) {
3750 // Create a temporary local describing the original position. 3750 // Create a temporary local describing the original position.
3751 const String& temp_name = Symbols::TempParam(); 3751 const String& temp_name = Symbols::TempParam();
3752 LocalVariable* temp_local = new(I) LocalVariable( 3752 LocalVariable* temp_local = new(I) LocalVariable(
3753 0, // Token index. 3753 0, // Token index.
3754 temp_name, 3754 temp_name,
3755 Type::ZoneHandle(I, Type::DynamicType())); // Type. 3755 Type::ZoneHandle(I, Type::DynamicType())); // Type.
3756 temp_local->set_index(param_frame_index); 3756 temp_local->set_index(param_frame_index);
3757 3757
3758 // Mark this local as captured parameter so that the optimizer
3759 // correctly handles these when compiling try-catch: Captured
3760 // parameters are not in the stack environment, therefore they
3761 // must be skipped when emitting sync-code in try-blocks.
3762 temp_local->set_is_captured_parameter(true);
3763
3758 // Copy parameter from local frame to current context. 3764 // Copy parameter from local frame to current context.
3759 Value* load = Bind(BuildLoadLocal(*temp_local)); 3765 Value* load = Bind(BuildLoadLocal(*temp_local));
3760 Do(BuildStoreLocal(parameter, load)); 3766 Do(BuildStoreLocal(parameter, load));
3761 // Write NULL to the source location to detect buggy accesses and 3767 // Write NULL to the source location to detect buggy accesses and
3762 // allow GC of passed value if it gets overwritten by a new value in 3768 // allow GC of passed value if it gets overwritten by a new value in
3763 // the function. 3769 // the function.
3764 Value* null_constant = Bind(new(I) ConstantInstr( 3770 Value* null_constant = Bind(new(I) ConstantInstr(
3765 Object::ZoneHandle(I, Object::null()))); 3771 Object::ZoneHandle(I, Object::null())));
3766 Do(BuildStoreLocal(*temp_local, null_constant)); 3772 Do(BuildStoreLocal(*temp_local, null_constant));
3767 } 3773 }
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
4285 Report::MessageF(Report::kBailout, 4291 Report::MessageF(Report::kBailout,
4286 Script::Handle(function.script()), 4292 Script::Handle(function.script()),
4287 function.token_pos(), 4293 function.token_pos(),
4288 "FlowGraphBuilder Bailout: %s %s", 4294 "FlowGraphBuilder Bailout: %s %s",
4289 String::Handle(function.name()).ToCString(), 4295 String::Handle(function.name()).ToCString(),
4290 reason); 4296 reason);
4291 UNREACHABLE(); 4297 UNREACHABLE();
4292 } 4298 }
4293 4299
4294 } // namespace dart 4300 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698