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

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 1451273002: [turbofan] Move JSCallFunction specialization to JSCallReducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 failures. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index d2483c3384e7f7f5dd161baaa11ce23d8dd46ebb..60a88be8649a14b3fb43e6b3661c6a081840216a 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -38,8 +38,6 @@ JSNativeContextSpecialization::JSNativeContextSpecialization(
Reduction JSNativeContextSpecialization::Reduce(Node* node) {
switch (node->opcode()) {
- case IrOpcode::kJSCallFunction:
- return ReduceJSCallFunction(node);
case IrOpcode::kJSLoadNamed:
return ReduceJSLoadNamed(node);
case IrOpcode::kJSStoreNamed:
@@ -55,56 +53,6 @@ Reduction JSNativeContextSpecialization::Reduce(Node* node) {
}
-Reduction JSNativeContextSpecialization::ReduceJSCallFunction(Node* node) {
- DCHECK_EQ(IrOpcode::kJSCallFunction, node->opcode());
- CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
- Node* target = NodeProperties::GetValueInput(node, 0);
- Node* frame_state = NodeProperties::GetFrameStateInput(node, 1);
- Node* control = NodeProperties::GetControlInput(node);
- Node* effect = NodeProperties::GetEffectInput(node);
-
- // Not much we can do if deoptimization support is disabled.
- if (!(flags() & kDeoptimizationEnabled)) return NoChange();
-
- // Don't mess with JSCallFunction nodes that have a constant {target}.
- if (HeapObjectMatcher(target).HasValue()) return NoChange();
- if (!p.feedback().IsValid()) return NoChange();
- CallICNexus nexus(p.feedback().vector(), p.feedback().slot());
- Handle<Object> feedback(nexus.GetFeedback(), isolate());
- if (feedback->IsWeakCell()) {
- Handle<WeakCell> cell = Handle<WeakCell>::cast(feedback);
- if (cell->value()->IsJSFunction()) {
- // Avoid cross-context leaks, meaning don't embed references to functions
- // in other native contexts.
- Handle<JSFunction> function(JSFunction::cast(cell->value()), isolate());
- if (function->context()->native_context() != *native_context()) {
- return NoChange();
- }
-
- // Check that the {target} is still the {target_function}.
- Node* target_function = jsgraph()->HeapConstant(function);
- Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
- target, target_function);
- Node* branch =
- graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
- Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
- Node* deoptimize = graph()->NewNode(common()->Deoptimize(), frame_state,
- effect, if_false);
- // TODO(bmeurer): This should be on the AdvancedReducer somehow.
- NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
- control = graph()->NewNode(common()->IfTrue(), branch);
-
- // Specialize the JSCallFunction node to the {target_function}.
- NodeProperties::ReplaceValueInput(node, target_function, 0);
- NodeProperties::ReplaceControlInput(node, control);
- return Changed(node);
- }
- // TODO(bmeurer): Also support optimizing bound functions and proxies here.
- }
- return NoChange();
-}
-
-
Reduction JSNativeContextSpecialization::ReduceNamedAccess(
Node* node, Node* value, MapHandleList const& receiver_maps,
Handle<Name> name, AccessMode access_mode, LanguageMode language_mode,
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698