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

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

Issue 8393033: Fix type tests involving an implicit closure of a non-parameterized class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/code_generator_ia32.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // we are trying to create an implicit closure of an instance function. 542 // we are trying to create an implicit closure of an instance function.
543 arguments.SetReturn(closure); 543 arguments.SetReturn(closure);
544 return; 544 return;
545 } 545 }
546 Function& implicit_closure_function = 546 Function& implicit_closure_function =
547 Function::Handle(function.ImplicitClosureFunction()); 547 Function::Handle(function.ImplicitClosureFunction());
548 // Create a closure object for the implicit closure function. 548 // Create a closure object for the implicit closure function.
549 const Context& context = Context::Handle(Context::New(1)); 549 const Context& context = Context::Handle(Context::New(1));
550 context.SetAt(0, receiver); 550 context.SetAt(0, receiver);
551 closure = Closure::New(implicit_closure_function, context); 551 closure = Closure::New(implicit_closure_function, context);
552 if (receiver_class.HasTypeArguments()) {
553 const TypeArguments& type_arguments =
554 TypeArguments::Handle(receiver.GetTypeArguments());
555 closure.SetTypeArguments(type_arguments);
556 }
552 arguments.SetReturn(closure); 557 arguments.SetReturn(closure);
553 } 558 }
554 559
555 560
556 // Resolve an implicit closure by invoking getter and checking if the return 561 // Resolve an implicit closure by invoking getter and checking if the return
557 // value from getter is a closure. 562 // value from getter is a closure.
558 // Arg0: receiver object. 563 // Arg0: receiver object.
559 // Arg1: ic-data array. 564 // Arg1: ic-data array.
560 // Returns: Closure object or NULL (closure not found). 565 // Returns: Closure object or NULL (closure not found).
561 // This is called by the megamorphic stub when it is unable to resolve an 566 // This is called by the megamorphic stub when it is unable to resolve an
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 948 }
944 } 949 }
945 } 950 }
946 // The cache is null terminated, therefore the loop above should never 951 // The cache is null terminated, therefore the loop above should never
947 // terminate by itself. 952 // terminate by itself.
948 UNREACHABLE(); 953 UNREACHABLE();
949 return Code::null(); 954 return Code::null();
950 } 955 }
951 956
952 } // namespace dart 957 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698