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

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

Issue 1404163002: VM: Precompile method extractors for implicit and explicit closurization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix hash-closurization Created 5 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
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/resolver.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/precompiler.h" 5 #include "vm/precompiler.h"
6 6
7 #include "vm/code_patcher.h" 7 #include "vm/code_patcher.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/log.h" 10 #include "vm/log.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 } 584 }
585 selector3 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(), 585 selector3 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
586 selector2); 586 selector2);
587 if (IsSent(selector3)) { 587 if (IsSent(selector3)) {
588 // Hash-closurization. 588 // Hash-closurization.
589 // Function is get:foo and somewhere get:#foo is called. 589 // Function is get:foo and somewhere get:#foo is called.
590 AddFunction(function); 590 AddFunction(function);
591 591
592 function2 = function.ImplicitClosureFunction(); 592 function2 = function.ImplicitClosureFunction();
593 AddFunction(function2); 593 AddFunction(function2);
594
595 // Add corresponding method extractor get:#foo.
596 function2 = function.GetMethodExtractor(selector3);
597 AddFunction(function2);
594 } 598 }
595 } else if (Field::IsSetterName(selector)) { 599 } else if (Field::IsSetterName(selector)) {
596 selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(), 600 selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
597 selector); 601 selector);
598 if (IsSent(selector2)) { 602 if (IsSent(selector2)) {
599 // Hash-closurization. 603 // Hash-closurization.
600 // Function is set:foo and somewhere get:#set:foo is called. 604 // Function is set:foo and somewhere get:#set:foo is called.
601 AddFunction(function); 605 AddFunction(function);
602 606
603 function2 = function.ImplicitClosureFunction(); 607 function2 = function.ImplicitClosureFunction();
604 AddFunction(function2); 608 AddFunction(function2);
609
610 // Add corresponding method extractor get:#set:foo.
611 function2 = function.GetMethodExtractor(selector2);
612 AddFunction(function2);
605 } 613 }
606 } else if (function.kind() == RawFunction::kRegularFunction) { 614 } else if (function.kind() == RawFunction::kRegularFunction) {
607 selector2 = Field::LookupGetterSymbol(selector); 615 selector2 = Field::LookupGetterSymbol(selector);
608 if (IsSent(selector2)) { 616 if (IsSent(selector2)) {
609 // Closurization. 617 // Closurization.
610 // Function is foo and somewhere get:foo is called. 618 // Function is foo and somewhere get:foo is called.
611 function2 = function.ImplicitClosureFunction(); 619 function2 = function.ImplicitClosureFunction();
612 AddFunction(function2); 620 AddFunction(function2);
621
622 // Add corresponding method extractor.
623 function2 = function.GetMethodExtractor(selector2);
624 AddFunction(function2);
613 } 625 }
614 selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(), 626 selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
615 selector); 627 selector);
616 if (IsSent(selector2)) { 628 if (IsSent(selector2)) {
617 // Hash-closurization. 629 // Hash-closurization.
618 // Function is foo and somewhere get:#foo is called. 630 // Function is foo and somewhere get:#foo is called.
619 function2 = function.ImplicitClosureFunction(); 631 function2 = function.ImplicitClosureFunction();
620 AddFunction(function2); 632 AddFunction(function2);
633
634 // Add corresponding method extractor get:#foo
635 function2 = function.GetMethodExtractor(selector2);
636 AddFunction(function2);
621 } 637 }
622 } 638 }
623 } 639 }
624 } 640 }
625 } 641 }
626 } 642 }
627 643
628 644
629 void Precompiler::DropUncompiledFunctions() { 645 void Precompiler::DropUncompiledFunctions() {
630 Library& lib = Library::Handle(Z); 646 Library& lib = Library::Handle(Z);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 for (intptr_t j = 0; j < closures.Length(); j++) { 834 for (intptr_t j = 0; j < closures.Length(); j++) {
819 function ^= closures.At(j); 835 function ^= closures.At(j);
820 visitor->VisitFunction(function); 836 visitor->VisitFunction(function);
821 } 837 }
822 } 838 }
823 } 839 }
824 } 840 }
825 } 841 }
826 842
827 } // namespace dart 843 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698