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

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

Issue 1024563004: Compile implicit closures as dispatchers instead of duplicating the original method's code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 6249 matching lines...) Expand 10 before | Expand all | Expand 10 after
6260 context_scope = LocalScope::CreateImplicitClosureScope(*this); 6260 context_scope = LocalScope::CreateImplicitClosureScope(*this);
6261 } 6261 }
6262 closure_function.set_context_scope(context_scope); 6262 closure_function.set_context_scope(context_scope);
6263 6263
6264 // Set closure function's result type to this result type. 6264 // Set closure function's result type to this result type.
6265 closure_function.set_result_type(AbstractType::Handle(result_type())); 6265 closure_function.set_result_type(AbstractType::Handle(result_type()));
6266 6266
6267 // Set closure function's end token to this end token. 6267 // Set closure function's end token to this end token.
6268 closure_function.set_end_token_pos(end_token_pos()); 6268 closure_function.set_end_token_pos(end_token_pos());
6269 6269
6270 closure_function.set_is_debuggable(false);
hausner 2015/03/23 17:44:48 Maybe add a comment that the non-closureized versi
Florian Schneider 2015/03/24 09:19:38 Done.
6271
6270 // Set closure function's formal parameters to this formal parameters, 6272 // Set closure function's formal parameters to this formal parameters,
6271 // removing the receiver if this is an instance method and adding the closure 6273 // removing the receiver if this is an instance method and adding the closure
6272 // object as first parameter. 6274 // object as first parameter.
6273 const int kClosure = 1; 6275 const int kClosure = 1;
6274 const int has_receiver = is_static() ? 0 : 1; 6276 const int has_receiver = is_static() ? 0 : 1;
6275 const int num_fixed_params = kClosure - has_receiver + num_fixed_parameters(); 6277 const int num_fixed_params = kClosure - has_receiver + num_fixed_parameters();
6276 const int num_opt_params = NumOptionalParameters(); 6278 const int num_opt_params = NumOptionalParameters();
6277 const bool has_opt_pos_params = HasOptionalPositionalParameters(); 6279 const bool has_opt_pos_params = HasOptionalPositionalParameters();
6278 const int num_params = num_fixed_params + num_opt_params; 6280 const int num_params = num_fixed_params + num_opt_params;
6279 closure_function.set_num_fixed_parameters(num_fixed_params); 6281 closure_function.set_num_fixed_parameters(num_fixed_params);
(...skipping 14474 matching lines...) Expand 10 before | Expand all | Expand 10 after
20754 return tag_label.ToCString(); 20756 return tag_label.ToCString();
20755 } 20757 }
20756 20758
20757 20759
20758 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20760 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20759 Instance::PrintJSONImpl(stream, ref); 20761 Instance::PrintJSONImpl(stream, ref);
20760 } 20762 }
20761 20763
20762 20764
20763 } // namespace dart 20765 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698