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

Unified Diff: src/interpreter/interpreter-assembler.cc

Issue 2955063002: [ignition] Slightly improve code for Call/Construct bytecodes. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index dc71e559c429b122450f0b70fdc1746711d1c8e3..d5a7f59f2be4ba946333a79e7fe5517b2657aa0f 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -587,6 +587,9 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Label call_function(this), extra_checks(this, Label::kDeferred), call(this),
end(this);
+ // Increment the call count.
+ IncrementCallCount(feedback_vector, slot_id);
+
// The checks. First, does function match the recorded monomorphic target?
Node* feedback_element = LoadFixedArrayElement(feedback_vector, slot_id);
Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element);
@@ -600,9 +603,6 @@ Node* InterpreterAssembler::CallJSWithFeedback(
BIND(&call_function);
{
- // Increment the call count.
- IncrementCallCount(feedback_vector, slot_id);
-
// Call using call function builtin.
Callable callable = CodeFactory::InterpreterPushArgsThenCall(
isolate(), receiver_mode, tail_call_mode,
@@ -640,9 +640,6 @@ Node* InterpreterAssembler::CallJSWithFeedback(
Node* is_array_function = WordEqual(context_slot, function);
GotoIfNot(is_array_function, &mark_megamorphic);
- // It is a monomorphic Array function. Increment the call count.
- IncrementCallCount(feedback_vector, slot_id);
-
// Call ArrayConstructorStub.
Callable callable_call =
CodeFactory::InterpreterPushArgsThenConstructArray(isolate());
@@ -723,10 +720,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(
BIND(&call);
{
- Comment("Increment call count and call using Call builtin");
- // Increment the call count.
- IncrementCallCount(feedback_vector, slot_id);
-
+ Comment("invoke using Call builtin");
// Call using call builtin.
Callable callable_call = CodeFactory::InterpreterPushArgsThenCall(
isolate(), receiver_mode, tail_call_mode,
@@ -782,10 +776,8 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Label call_construct_function(this, &allocation_feedback),
extra_checks(this, Label::kDeferred), call_construct(this), end(this);
- // Slot id of 0 is used to indicate no type feedback is available.
- STATIC_ASSERT(FeedbackVector::kReservedIndexCount > 0);
- Node* is_feedback_unavailable = WordEqual(slot_id, IntPtrConstant(0));
- GotoIf(is_feedback_unavailable, &call_construct);
+ // Increment the call count.
+ IncrementCallCount(feedback_vector, slot_id);
// Check that the constructor is not a smi.
Node* is_smi = TaggedIsSmi(constructor);
@@ -806,8 +798,7 @@ Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
BIND(&call_construct_function);
{
- Comment("call using ConstructFunction");
- IncrementCallCount(feedback_vector, slot_id);
+ Comment("construct using ConstructFunction");
Callable callable_function = CodeFactory::InterpreterPushArgsThenConstruct(
isolate(), InterpreterPushArgsMode::kJSFunction);
return_value.Bind(CallStub(callable_function.descriptor(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698