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,
GotoIf(TaggedIsSmi(target), &mark_megamorphic);
// Check if the {target} is a JSFunction or JSBoundFunction
// in the current native context.
VARIABLE(var_target, MachineRepresentation::kTagged, target);
Label loop(this, &var_target), done_loop(this);
VARIABLE(var_current, MachineRepresentation::kTagged, target);
Label loop(this, &var_current), done_loop(this);
Goto(&loop);
BIND(&loop);
{
Label if_boundfunction(this), if_function(this);
Node* target = var_target.value();
CSA_ASSERT(this, TaggedIsNotSmi(target));
Node* target_instance_type = LoadInstanceType(target);
GotoIf(InstanceTypeEqual(target_instance_type, JS_BOUND_FUNCTION_TYPE),
Node* current = var_current.value();
CSA_ASSERT(this, TaggedIsNotSmi(current));
Node* current_instance_type = LoadInstanceType(current);
GotoIf(InstanceTypeEqual(current_instance_type, JS_BOUND_FUNCTION_TYPE),
&if_boundfunction);
Branch(InstanceTypeEqual(target_instance_type, JS_FUNCTION_TYPE),
Branch(InstanceTypeEqual(current_instance_type, JS_FUNCTION_TYPE),
&if_function, &mark_megamorphic);
BIND(&if_function);
{
// Check that the JSFunction {target} is in the current native
// Check that the JSFunction {current} is in the current native
// context.
Node* target_context =
LoadObjectField(target, JSFunction::kContextOffset);
Node* target_native_context = LoadNativeContext(target_context);
Branch(WordEqual(LoadNativeContext(context), target_native_context),
Node* current_context =
LoadObjectField(current, JSFunction::kContextOffset);
Node* current_native_context = LoadNativeContext(current_context);
Branch(WordEqual(LoadNativeContext(context), current_native_context),
&done_loop, &mark_megamorphic);
}
BIND(&if_boundfunction);
{
// Continue with the [[BoundTargetFunction]] of {target}.
var_target.Bind(LoadObjectField(
target, JSBoundFunction::kBoundTargetFunctionOffset));
var_current.Bind(LoadObjectField(
current, JSBoundFunction::kBoundTargetFunctionOffset));
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