Commit 7d77d3d6 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[interpreter|cleanup] Less variable shadowing.

This code was confusing, since "target" declared in one of the subscopes
shadowed a parameter with the same name.

Change-Id: Ibf694c94f0a26ca65609cb80d22c40a8fa98f4f3
Reviewed-on: https://chromium-review.googlesource.com/779261Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49518}
parent 184de6af
...@@ -634,36 +634,36 @@ void InterpreterAssembler::CollectCallableFeedback(Node* target, Node* context, ...@@ -634,36 +634,36 @@ void InterpreterAssembler::CollectCallableFeedback(Node* target, Node* context,
GotoIf(TaggedIsSmi(target), &mark_megamorphic); GotoIf(TaggedIsSmi(target), &mark_megamorphic);
// Check if the {target} is a JSFunction or JSBoundFunction // Check if the {target} is a JSFunction or JSBoundFunction
// in the current native context. // in the current native context.
VARIABLE(var_target, MachineRepresentation::kTagged, target); VARIABLE(var_current, MachineRepresentation::kTagged, target);
Label loop(this, &var_target), done_loop(this); Label loop(this, &var_current), done_loop(this);
Goto(&loop); Goto(&loop);
BIND(&loop); BIND(&loop);
{ {
Label if_boundfunction(this), if_function(this); Label if_boundfunction(this), if_function(this);
Node* target = var_target.value(); Node* current = var_current.value();
CSA_ASSERT(this, TaggedIsNotSmi(target)); CSA_ASSERT(this, TaggedIsNotSmi(current));
Node* target_instance_type = LoadInstanceType(target); Node* current_instance_type = LoadInstanceType(current);
GotoIf(InstanceTypeEqual(target_instance_type, JS_BOUND_FUNCTION_TYPE), GotoIf(InstanceTypeEqual(current_instance_type, JS_BOUND_FUNCTION_TYPE),
&if_boundfunction); &if_boundfunction);
Branch(InstanceTypeEqual(target_instance_type, JS_FUNCTION_TYPE), Branch(InstanceTypeEqual(current_instance_type, JS_FUNCTION_TYPE),
&if_function, &mark_megamorphic); &if_function, &mark_megamorphic);
BIND(&if_function); BIND(&if_function);
{ {
// Check that the JSFunction {target} is in the current native // Check that the JSFunction {current} is in the current native
// context. // context.
Node* target_context = Node* current_context =
LoadObjectField(target, JSFunction::kContextOffset); LoadObjectField(current, JSFunction::kContextOffset);
Node* target_native_context = LoadNativeContext(target_context); Node* current_native_context = LoadNativeContext(current_context);
Branch(WordEqual(LoadNativeContext(context), target_native_context), Branch(WordEqual(LoadNativeContext(context), current_native_context),
&done_loop, &mark_megamorphic); &done_loop, &mark_megamorphic);
} }
BIND(&if_boundfunction); BIND(&if_boundfunction);
{ {
// Continue with the [[BoundTargetFunction]] of {target}. // Continue with the [[BoundTargetFunction]] of {target}.
var_target.Bind(LoadObjectField( var_current.Bind(LoadObjectField(
target, JSBoundFunction::kBoundTargetFunctionOffset)); current, JSBoundFunction::kBoundTargetFunctionOffset));
Goto(&loop); Goto(&loop);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment