summaryrefslogtreecommitdiff
path: root/deps/v8/src/interpreter/interpreter-assembler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/interpreter/interpreter-assembler.cc')
-rw-r--r--deps/v8/src/interpreter/interpreter-assembler.cc60
1 files changed, 29 insertions, 31 deletions
diff --git a/deps/v8/src/interpreter/interpreter-assembler.cc b/deps/v8/src/interpreter/interpreter-assembler.cc
index 1ccd342f06..5eb992c1da 100644
--- a/deps/v8/src/interpreter/interpreter-assembler.cc
+++ b/deps/v8/src/interpreter/interpreter-assembler.cc
@@ -461,7 +461,7 @@ Node* InterpreterAssembler::LoadAndUntagConstantPoolEntry(Node* index) {
return SmiUntag(LoadConstantPoolEntry(index));
}
-Node* InterpreterAssembler::LoadTypeFeedbackVector() {
+Node* InterpreterAssembler::LoadFeedbackVector() {
Node* function = LoadRegister(Register::function_closure());
Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset);
Node* vector =
@@ -489,22 +489,21 @@ void InterpreterAssembler::CallEpilogue() {
}
}
-Node* InterpreterAssembler::IncrementCallCount(Node* type_feedback_vector,
+Node* InterpreterAssembler::IncrementCallCount(Node* feedback_vector,
Node* slot_id) {
Comment("increment call count");
Node* call_count_slot = IntPtrAdd(slot_id, IntPtrConstant(1));
- Node* call_count =
- LoadFixedArrayElement(type_feedback_vector, call_count_slot);
+ Node* call_count = LoadFixedArrayElement(feedback_vector, call_count_slot);
Node* new_count = SmiAdd(call_count, SmiConstant(1));
// Count is Smi, so we don't need a write barrier.
- return StoreFixedArrayElement(type_feedback_vector, call_count_slot,
- new_count, SKIP_WRITE_BARRIER);
+ return StoreFixedArrayElement(feedback_vector, call_count_slot, new_count,
+ SKIP_WRITE_BARRIER);
}
Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Node* first_arg, Node* arg_count,
Node* slot_id,
- Node* type_feedback_vector,
+ Node* feedback_vector,
TailCallMode tail_call_mode) {
// Static checks to assert it is safe to examine the type feedback element.
// We don't know that we have a weak cell. We might have a private symbol
@@ -526,7 +525,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
end(this);
// The checks. First, does function match the recorded monomorphic target?
- Node* feedback_element = LoadFixedArrayElement(type_feedback_vector, slot_id);
+ Node* feedback_element = LoadFixedArrayElement(feedback_vector, slot_id);
Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element);
Node* is_monomorphic = WordEqual(function, feedback_value);
GotoUnless(is_monomorphic, &extra_checks);
@@ -539,7 +538,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Bind(&call_function);
{
// Increment the call count.
- IncrementCallCount(type_feedback_vector, slot_id);
+ IncrementCallCount(feedback_vector, slot_id);
// Call using call function builtin.
Callable callable = CodeFactory::InterpreterPushArgsAndCall(
@@ -558,9 +557,9 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Comment("check if megamorphic");
// Check if it is a megamorphic target.
- Node* is_megamorphic = WordEqual(
- feedback_element,
- HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())));
+ Node* is_megamorphic =
+ WordEqual(feedback_element,
+ HeapConstant(FeedbackVector::MegamorphicSentinel(isolate())));
GotoIf(is_megamorphic, &call);
Comment("check if it is an allocation site");
@@ -574,7 +573,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
GotoUnless(is_array_function, &mark_megamorphic);
// It is a monomorphic Array function. Increment the call count.
- IncrementCallCount(type_feedback_vector, slot_id);
+ IncrementCallCount(feedback_vector, slot_id);
// Call ArrayConstructorStub.
Callable callable_call =
@@ -592,7 +591,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
// Check if it is uninitialized target first.
Node* is_uninitialized = WordEqual(
feedback_element,
- HeapConstant(TypeFeedbackVector::UninitializedSentinel(isolate())));
+ HeapConstant(FeedbackVector::UninitializedSentinel(isolate())));
GotoUnless(is_uninitialized, &mark_megamorphic);
Comment("handle_unitinitialized");
@@ -619,7 +618,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
WordEqual(native_context, LoadNativeContext(context));
GotoUnless(is_same_native_context, &mark_megamorphic);
- CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id),
+ CreateWeakCellInFeedbackVector(feedback_vector, SmiTag(slot_id),
function);
// Call using call function builtin.
@@ -628,8 +627,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
Bind(&create_allocation_site);
{
- CreateAllocationSiteInFeedbackVector(type_feedback_vector,
- SmiTag(slot_id));
+ CreateAllocationSiteInFeedbackVector(feedback_vector, SmiTag(slot_id));
// Call using CallFunction builtin. CallICs have a PREMONOMORPHIC state.
// They start collecting feedback only when a call is executed the second
@@ -644,8 +642,8 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
// and will not move during a GC. So it is safe to skip write barrier.
DCHECK(Heap::RootIsImmortalImmovable(Heap::kmegamorphic_symbolRootIndex));
StoreFixedArrayElement(
- type_feedback_vector, slot_id,
- HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())),
+ feedback_vector, slot_id,
+ HeapConstant(FeedbackVector::MegamorphicSentinel(isolate())),
SKIP_WRITE_BARRIER);
Goto(&call);
}
@@ -655,7 +653,7 @@ Node* InterpreterAssembler::CallJSWithFeedback(Node* function, Node* context,
{
Comment("Increment call count and call using Call builtin");
// Increment the call count.
- IncrementCallCount(type_feedback_vector, slot_id);
+ IncrementCallCount(feedback_vector, slot_id);
// Call using call builtin.
Callable callable_call = CodeFactory::InterpreterPushArgsAndCall(
@@ -685,14 +683,14 @@ Node* InterpreterAssembler::CallJS(Node* function, Node* context,
Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Node* new_target, Node* first_arg,
Node* arg_count, Node* slot_id,
- Node* type_feedback_vector) {
+ Node* feedback_vector) {
Variable return_value(this, MachineRepresentation::kTagged);
Variable allocation_feedback(this, MachineRepresentation::kTagged);
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(TypeFeedbackVector::kReservedIndexCount > 0);
+ STATIC_ASSERT(FeedbackVector::kReservedIndexCount > 0);
Node* is_feedback_unavailable = WordEqual(slot_id, IntPtrConstant(0));
GotoIf(is_feedback_unavailable, &call_construct);
@@ -707,7 +705,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
GotoUnless(is_js_function, &call_construct);
// Check if it is a monomorphic constructor.
- Node* feedback_element = LoadFixedArrayElement(type_feedback_vector, slot_id);
+ Node* feedback_element = LoadFixedArrayElement(feedback_vector, slot_id);
Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element);
Node* is_monomorphic = WordEqual(constructor, feedback_value);
allocation_feedback.Bind(UndefinedConstant());
@@ -716,7 +714,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Bind(&call_construct_function);
{
Comment("call using callConstructFunction");
- IncrementCallCount(type_feedback_vector, slot_id);
+ IncrementCallCount(feedback_vector, slot_id);
Callable callable_function = CodeFactory::InterpreterPushArgsAndConstruct(
isolate(), CallableType::kJSFunction);
return_value.Bind(CallStub(callable_function.descriptor(),
@@ -733,9 +731,9 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
// Check if it is a megamorphic target.
Comment("check if megamorphic");
- Node* is_megamorphic = WordEqual(
- feedback_element,
- HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())));
+ Node* is_megamorphic =
+ WordEqual(feedback_element,
+ HeapConstant(FeedbackVector::MegamorphicSentinel(isolate())));
GotoIf(is_megamorphic, &call_construct_function);
Comment("check if weak cell");
@@ -789,7 +787,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Bind(&create_allocation_site);
{
- Node* site = CreateAllocationSiteInFeedbackVector(type_feedback_vector,
+ Node* site = CreateAllocationSiteInFeedbackVector(feedback_vector,
SmiTag(slot_id));
allocation_feedback.Bind(site);
Goto(&call_construct_function);
@@ -797,7 +795,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Bind(&create_weak_cell);
{
- CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id),
+ CreateWeakCellInFeedbackVector(feedback_vector, SmiTag(slot_id),
constructor);
Goto(&call_construct_function);
}
@@ -810,8 +808,8 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Comment("transition to megamorphic");
DCHECK(Heap::RootIsImmortalImmovable(Heap::kmegamorphic_symbolRootIndex));
StoreFixedArrayElement(
- type_feedback_vector, slot_id,
- HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())),
+ feedback_vector, slot_id,
+ HeapConstant(FeedbackVector::MegamorphicSentinel(isolate())),
SKIP_WRITE_BARRIER);
Goto(&call_construct_function);
}