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

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

Issue 187763002: Mark compiler-internal fields of closure objects as final. (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 | « no previous file | no next file » | 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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 cls, 2276 cls,
2277 arguments); 2277 arguments);
2278 alloc->set_closure_function(function); 2278 alloc->set_closure_function(function);
2279 2279
2280 // Create fake fields for function and context. Only the context field is 2280 // Create fake fields for function and context. Only the context field is
2281 // stored at the allocation to be used later when inlining a closure call. 2281 // stored at the allocation to be used later when inlining a closure call.
2282 const Field& function_field = 2282 const Field& function_field =
2283 Field::ZoneHandle( 2283 Field::ZoneHandle(
2284 Field::New(Symbols::ClosureFunctionField(), 2284 Field::New(Symbols::ClosureFunctionField(),
2285 false, // !static 2285 false, // !static
2286 false, // !final 2286 true, // final
2287 false, // !const 2287 false, // !const
2288 alloc->cls(), 2288 alloc->cls(),
2289 0)); // No token position. 2289 0)); // No token position.
2290 function_field.SetOffset(Closure::function_offset()); 2290 function_field.SetOffset(Closure::function_offset());
2291 const Field& context_field = 2291 const Field& context_field =
2292 Field::ZoneHandle(Field::New( 2292 Field::ZoneHandle(Field::New(
2293 Symbols::ClosureContextField(), 2293 Symbols::ClosureContextField(),
2294 false, // !static 2294 false, // !static
2295 false, // !final 2295 true, // final
2296 false, // !const 2296 false, // !const
2297 alloc->cls(), 2297 alloc->cls(),
2298 0)); // No token position. 2298 0)); // No token position.
2299 context_field.SetOffset(Closure::context_offset()); 2299 context_field.SetOffset(Closure::context_offset());
2300 alloc->set_context_field(context_field); 2300 alloc->set_context_field(context_field);
2301 2301
2302 Value* closure_val = Bind(alloc); 2302 Value* closure_val = Bind(alloc);
2303 { LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val); 2303 { LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val);
2304 // Store function. 2304 // Store function.
2305 Value* closure_tmp_val = Bind(new LoadLocalInstr(*closure_tmp_var)); 2305 Value* closure_tmp_val = Bind(new LoadLocalInstr(*closure_tmp_var));
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
3925 LanguageError::kError, 3925 LanguageError::kError,
3926 Heap::kNew, 3926 Heap::kNew,
3927 "FlowGraphBuilder Bailout: %s %s", 3927 "FlowGraphBuilder Bailout: %s %s",
3928 String::Handle(function.name()).ToCString(), 3928 String::Handle(function.name()).ToCString(),
3929 reason)); 3929 reason));
3930 Isolate::Current()->long_jump_base()->Jump(1, error); 3930 Isolate::Current()->long_jump_base()->Jump(1, error);
3931 } 3931 }
3932 3932
3933 3933
3934 } // namespace dart 3934 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698