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

Side by Side Diff: src/compiler/js-call-reducer.cc

Issue 2743253002: [turbofan] Skip JSCallReducer and JSNativeContextSpecialization on asm.js. (Closed)
Patch Set: REBASE Created 3 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
« no previous file with comments | « src/compiler/js-call-reducer.h ('k') | src/compiler/js-native-context-specialization.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-call-reducer.h" 5 #include "src/compiler/js-call-reducer.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 jsgraph()->Constant(FeedbackVector::GetIndex(p.feedback().slot())); 610 jsgraph()->Constant(FeedbackVector::GetIndex(p.feedback().slot()));
611 Node* feedback_vector = jsgraph()->HeapConstant(p.feedback().vector()); 611 Node* feedback_vector = jsgraph()->HeapConstant(p.feedback().vector());
612 node->InsertInput(graph()->zone(), 0, stub_code); 612 node->InsertInput(graph()->zone(), 0, stub_code);
613 node->InsertInput(graph()->zone(), 2, stub_arity); 613 node->InsertInput(graph()->zone(), 2, stub_arity);
614 node->InsertInput(graph()->zone(), 3, slot_index); 614 node->InsertInput(graph()->zone(), 3, slot_index);
615 node->InsertInput(graph()->zone(), 4, feedback_vector); 615 node->InsertInput(graph()->zone(), 4, feedback_vector);
616 NodeProperties::ChangeOp(node, common()->Call(desc)); 616 NodeProperties::ChangeOp(node, common()->Call(desc));
617 return Changed(node); 617 return Changed(node);
618 } 618 }
619 619
620 // Not much we can do if deoptimization support is disabled.
621 if (!(flags() & kDeoptimizationEnabled)) return NoChange();
622
623 Handle<Object> feedback(nexus.GetFeedback(), isolate()); 620 Handle<Object> feedback(nexus.GetFeedback(), isolate());
624 if (feedback->IsAllocationSite()) { 621 if (feedback->IsAllocationSite()) {
625 // Retrieve the Array function from the {node}. 622 // Retrieve the Array function from the {node}.
626 Node* array_function = jsgraph()->HeapConstant( 623 Node* array_function = jsgraph()->HeapConstant(
627 handle(native_context()->array_function(), isolate())); 624 handle(native_context()->array_function(), isolate()));
628 625
629 // Check that the {target} is still the {array_function}. 626 // Check that the {target} is still the {array_function}.
630 Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target, 627 Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
631 array_function); 628 array_function);
632 effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control); 629 effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 NodeProperties::ChangeOp(node, javascript()->CreateArray(arity, site)); 717 NodeProperties::ChangeOp(node, javascript()->CreateArray(arity, site));
721 return Changed(node); 718 return Changed(node);
722 } 719 }
723 } 720 }
724 721
725 // Don't mess with other {node}s that have a constant {target}. 722 // Don't mess with other {node}s that have a constant {target}.
726 // TODO(bmeurer): Also support optimizing bound functions and proxies here. 723 // TODO(bmeurer): Also support optimizing bound functions and proxies here.
727 return NoChange(); 724 return NoChange();
728 } 725 }
729 726
730 // Not much we can do if deoptimization support is disabled.
731 if (!(flags() & kDeoptimizationEnabled)) return NoChange();
732
733 if (!p.feedback().IsValid()) return NoChange(); 727 if (!p.feedback().IsValid()) return NoChange();
734 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); 728 CallICNexus nexus(p.feedback().vector(), p.feedback().slot());
735 Handle<Object> feedback(nexus.GetFeedback(), isolate()); 729 Handle<Object> feedback(nexus.GetFeedback(), isolate());
736 if (feedback->IsAllocationSite()) { 730 if (feedback->IsAllocationSite()) {
737 // The feedback is an AllocationSite, which means we have called the 731 // The feedback is an AllocationSite, which means we have called the
738 // Array function and collected transition (and pretenuring) feedback 732 // Array function and collected transition (and pretenuring) feedback
739 // for the resulting arrays. This has to be kept in sync with the 733 // for the resulting arrays. This has to be kept in sync with the
740 // implementation of the CallConstructStub. 734 // implementation of the CallConstructStub.
741 Handle<AllocationSite> site = Handle<AllocationSite>::cast(feedback); 735 Handle<AllocationSite> site = Handle<AllocationSite>::cast(feedback);
742 736
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 return jsgraph()->javascript(); 806 return jsgraph()->javascript();
813 } 807 }
814 808
815 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { 809 SimplifiedOperatorBuilder* JSCallReducer::simplified() const {
816 return jsgraph()->simplified(); 810 return jsgraph()->simplified();
817 } 811 }
818 812
819 } // namespace compiler 813 } // namespace compiler
820 } // namespace internal 814 } // namespace internal
821 } // namespace v8 815 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-call-reducer.h ('k') | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698