Skip to content

Commit e73776c

Browse files
bmeurerCommit Bot
authored andcommitted
[turbofan] Fixup wrong code comments.
Missed the feedback in https://chromium-review.googlesource.com/1611803 to address the code comments. Tbr: [email protected] Bug: chromium:961199, v8:8820 Change-Id: I1ff85c0a7554099b72461eb91de9ea4bb2a5bded Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617242 Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Cr-Commit-Position: refs/heads/master@{#61597}
1 parent 3000b89 commit e73776c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/builtins/builtins-call-gen.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void CallOrConstructBuiltinsAssembler::CallFunctionTemplate(
500500

501501
// For API callbacks the receiver is always a JSReceiver (since
502502
// they are treated like sloppy mode functions). We might need
503-
// to perform access checks int the current {context}, depending
503+
// to perform access checks in the current {context}, depending
504504
// on whether the "needs access check" bit is set on the receiver
505505
// _and_ the {function_template_info} doesn't have the "accepts
506506
// any receiver" bit set.

src/compiler/js-call-reducer.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,13 +2834,6 @@ Reduction JSCallReducer::ReduceCallApiFunction(
28342834
graph()->NewNode(simplified()->ConvertReceiver(p.convert_mode()),
28352835
receiver, global_proxy, effect, control);
28362836
} else {
2837-
// The CallFunctionTemplate builtin requires the {receiver} to be
2838-
// an actual JSReceiver, so make sure we do the proper conversion
2839-
// first if necessary.
2840-
receiver = holder = effect =
2841-
graph()->NewNode(simplified()->ConvertReceiver(p.convert_mode()),
2842-
receiver, global_proxy, effect, control);
2843-
28442837
// We don't have enough information to eliminate the access check
28452838
// and/or the compatible receiver check, so use the generic builtin
28462839
// that does those checks dynamically. This is still significantly
@@ -2852,6 +2845,14 @@ Reduction JSCallReducer::ReduceCallApiFunction(
28522845
: Builtins::
28532846
kCallFunctionTemplate_CheckAccessAndCompatibleReceiver)
28542847
: Builtins::kCallFunctionTemplate_CheckCompatibleReceiver;
2848+
2849+
// The CallFunctionTemplate builtin requires the {receiver} to be
2850+
// an actual JSReceiver, so make sure we do the proper conversion
2851+
// first if necessary.
2852+
receiver = holder = effect =
2853+
graph()->NewNode(simplified()->ConvertReceiver(p.convert_mode()),
2854+
receiver, global_proxy, effect, control);
2855+
28552856
Callable callable = Builtins::CallableFor(isolate(), builtin_name);
28562857
auto call_descriptor = Linkage::GetStubCallDescriptor(
28572858
graph()->zone(), callable.descriptor(),

0 commit comments

Comments
 (0)