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

Unified Diff: src/compiler/js-call-reducer.cc

Issue 2406803002: [turbofan] Enforce native context specialization. (Closed)
Patch Set: Remove unused variables Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-call-reducer.h ('k') | src/compiler/js-create-lowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-call-reducer.cc
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
index dd8f0643dd2ee0d66d73bca297319de991242362..95c1eb6fe27ec2a09de73ce9b3fb8dc26bd78aa1 100644
--- a/src/compiler/js-call-reducer.cc
+++ b/src/compiler/js-call-reducer.cc
@@ -194,7 +194,6 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
DCHECK_EQ(IrOpcode::kJSCallFunction, node->opcode());
CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
Node* target = NodeProperties::GetValueInput(node, 0);
- Node* context = NodeProperties::GetContextInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
@@ -298,19 +297,8 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
Handle<Object> feedback(nexus.GetFeedback(), isolate());
if (feedback->IsAllocationSite()) {
// Retrieve the Array function from the {node}.
- Node* array_function;
- Handle<Context> native_context;
- if (GetNativeContext(node).ToHandle(&native_context)) {
- array_function = jsgraph()->HeapConstant(
- handle(native_context->array_function(), isolate()));
- } else {
- Node* native_context = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true),
- context, context, effect);
- array_function = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::ARRAY_FUNCTION_INDEX, true),
- native_context, native_context, effect);
- }
+ Node* array_function = jsgraph()->HeapConstant(
+ handle(native_context()->array_function(), isolate()));
// Check that the {target} is still the {array_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
@@ -353,7 +341,6 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
int const arity = static_cast<int>(p.arity() - 2);
Node* target = NodeProperties::GetValueInput(node, 0);
Node* new_target = NodeProperties::GetValueInput(node, arity + 1);
- Node* context = NodeProperties::GetContextInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
@@ -413,19 +400,8 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
Handle<AllocationSite> site = Handle<AllocationSite>::cast(feedback);
// Retrieve the Array function from the {node}.
- Node* array_function;
- Handle<Context> native_context;
- if (GetNativeContext(node).ToHandle(&native_context)) {
- array_function = jsgraph()->HeapConstant(
- handle(native_context->array_function(), isolate()));
- } else {
- Node* native_context = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true),
- context, context, effect);
- array_function = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::ARRAY_FUNCTION_INDEX, true),
- native_context, native_context, effect);
- }
+ Node* array_function = jsgraph()->HeapConstant(
+ handle(native_context()->array_function(), isolate()));
// Check that the {target} is still the {array_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
@@ -469,25 +445,14 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
return NoChange();
}
-
-MaybeHandle<Context> JSCallReducer::GetNativeContext(Node* node) {
- Node* const context = NodeProperties::GetContextInput(node);
- return NodeProperties::GetSpecializationNativeContext(context,
- native_context());
-}
-
-
Graph* JSCallReducer::graph() const { return jsgraph()->graph(); }
-
Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); }
-
CommonOperatorBuilder* JSCallReducer::common() const {
return jsgraph()->common();
}
-
JSOperatorBuilder* JSCallReducer::javascript() const {
return jsgraph()->javascript();
}
« no previous file with comments | « src/compiler/js-call-reducer.h ('k') | src/compiler/js-create-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698