mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
deps: backport 3297130 from upstream V8
This fixes a build failure on Windows.
Original commit message:
Rename TypeFeedbackVector to FeedbackVector.
... and TypeFeedbackMetadata to FeedbackMetadata.
BUG=
Change-Id: I2556d1c2a8f37b8cf3d532cc98d973b6dc7e9e6c
Reviewed-on: https://chromium-review.googlesource.com/439244
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#42999}
Refs: https://github.com/nodejs/v8/issues/4
PR-URL: https://github.com/nodejs/node/pull/11752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
1 parent
07088e6fc1
commit
9c9e2d7f4a
123 files changed
+846
-928
No files matched your search
Vendored
+3
-3
@@ -1377,6 +1377,9 @@ v8_source_set("v8_base") {
|
||||
"src/fast-accessor-assembler.h",
|
||||
"src/fast-dtoa.cc",
|
||||
"src/fast-dtoa.h",
|
||||
"src/feedback-vector-inl.h",
|
||||
"src/feedback-vector.cc",
|
||||
"src/feedback-vector.h",
|
||||
"src/field-index-inl.h",
|
||||
"src/field-index.h",
|
||||
"src/field-type.cc",
|
||||
@@ -1748,9 +1751,6 @@ v8_source_set("v8_base") {
|
||||
"src/transitions.cc",
|
||||
"src/transitions.h",
|
||||
"src/trap-handler/trap-handler.h",
|
||||
"src/type-feedback-vector-inl.h",
|
||||
"src/type-feedback-vector.cc",
|
||||
"src/type-feedback-vector.h",
|
||||
"src/type-hints.cc",
|
||||
"src/type-hints.h",
|
||||
"src/type-info.cc",
|
||||
|
||||
Vendored
+4
-4
@@ -1623,9 +1623,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// r3 : slot in feedback vector (Smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
// Load the cache state into r5.
|
||||
@@ -1635,7 +1635,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if r5 is a WeakCell or a Symbol, but it's harmless to read at
|
||||
// this position in a symbol (see static asserts in type-feedback-vector.h).
|
||||
// this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
Register feedback_map = r6;
|
||||
Register weak_value = r9;
|
||||
@@ -2925,7 +2925,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(r2);
|
||||
__ EmitLoadFeedbackVector(r2);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1429,8 +1429,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
ldr(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
ldr(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1385,7 +1385,7 @@ class MacroAssembler: public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type,
|
||||
|
||||
+4
-4
@@ -1826,9 +1826,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
|
||||
// index : slot in feedback vector (smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
// Load the cache state.
|
||||
@@ -1843,7 +1843,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
|
||||
// function without changing the state.
|
||||
// We don't know if feedback value is a WeakCell or a Symbol, but it's
|
||||
// harmless to read at this position in a symbol (see static asserts in
|
||||
// type-feedback-vector.h).
|
||||
// feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
__ Ldr(feedback_value, FieldMemOperand(feedback, WeakCell::kValueOffset));
|
||||
__ Cmp(function, feedback_value);
|
||||
@@ -2967,7 +2967,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(x2);
|
||||
__ EmitLoadFeedbackVector(x2);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -2634,8 +2634,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
Ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
Ldr(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
Ldr(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1541,7 +1541,7 @@ class MacroAssembler : public Assembler {
|
||||
// Frames.
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@
|
||||
// (disallowed) include: src/factory.h -> src/objects-inl.h
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
+4
-4
@@ -1019,12 +1019,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset));
|
||||
__ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ ldr(r9, FieldMemOperand(
|
||||
r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
r2, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ add(r9, r9, Operand(Smi::FromInt(1)));
|
||||
__ str(r9, FieldMemOperand(
|
||||
r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
r2, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+5
-5
@@ -1022,13 +1022,13 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
// Increment invocation count for the function.
|
||||
__ Ldr(x11, FieldMemOperand(x1, JSFunction::kLiteralsOffset));
|
||||
__ Ldr(x11, FieldMemOperand(x11, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ Ldr(x10, FieldMemOperand(x11, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ Ldr(x10, FieldMemOperand(x11, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Add(x10, x10, Operand(Smi::FromInt(1)));
|
||||
__ Str(x10, FieldMemOperand(x11, TypeFeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
__ Str(x10, FieldMemOperand(
|
||||
x11, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+5
-5
@@ -548,11 +548,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ j(not_equal, &switch_to_different_code_kind);
|
||||
|
||||
// Increment invocation count for the function.
|
||||
__ EmitLoadTypeFeedbackVector(ecx);
|
||||
__ add(FieldOperand(ecx,
|
||||
TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
__ EmitLoadFeedbackVector(ecx);
|
||||
__ add(
|
||||
FieldOperand(ecx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+4
-4
@@ -1021,12 +1021,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ lw(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset));
|
||||
__ lw(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ lw(t0, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Addu(t0, t0, Operand(Smi::FromInt(1)));
|
||||
__ sw(t0, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+4
-4
@@ -1012,12 +1012,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ ld(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset));
|
||||
__ ld(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ ld(a4, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Daddu(a4, a4, Operand(Smi::FromInt(1)));
|
||||
__ sd(a4, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+5
-5
@@ -1035,13 +1035,13 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
// Increment invocation count for the function.
|
||||
__ LoadP(r7, FieldMemOperand(r4, JSFunction::kLiteralsOffset));
|
||||
__ LoadP(r7, FieldMemOperand(r7, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ LoadP(r8, FieldMemOperand(r7, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ AddSmiLiteral(r8, r8, Smi::FromInt(1), r0);
|
||||
__ StoreP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
__ StoreP(r8, FieldMemOperand(
|
||||
r7, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
r0);
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
|
||||
+5
-5
@@ -1040,13 +1040,13 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
// Increment invocation count for the function.
|
||||
__ LoadP(r6, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
|
||||
__ LoadP(r6, FieldMemOperand(r6, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ LoadP(r1, FieldMemOperand(r6, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ LoadP(r1, FieldMemOperand(r6, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ AddSmiLiteral(r1, r1, Smi::FromInt(1), r0);
|
||||
__ StoreP(r1, FieldMemOperand(r6, TypeFeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
__ StoreP(r1, FieldMemOperand(
|
||||
r6, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
+2
-3
@@ -628,9 +628,8 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset));
|
||||
__ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ SmiAddConstant(
|
||||
FieldOperand(rcx,
|
||||
TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
FieldOperand(rcx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Smi::FromInt(1));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
|
||||
+5
-5
@@ -549,11 +549,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
||||
__ j(not_equal, &switch_to_different_code_kind);
|
||||
|
||||
// Increment invocation count for the function.
|
||||
__ EmitLoadTypeFeedbackVector(ecx);
|
||||
__ add(FieldOperand(ecx,
|
||||
TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
__ EmitLoadFeedbackVector(ecx);
|
||||
__ add(
|
||||
FieldOperand(ecx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
|
||||
// Check function data field is actually a BytecodeArray object.
|
||||
if (FLAG_debug_code) {
|
||||
|
||||
Vendored
+4
-6
@@ -5461,23 +5461,21 @@ Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
|
||||
return IntPtrAdd(IntPtrConstant(base_size), shifted_index);
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
|
||||
Node* CodeStubAssembler::LoadFeedbackVectorForStub() {
|
||||
Node* function =
|
||||
LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset);
|
||||
Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset);
|
||||
return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset);
|
||||
}
|
||||
|
||||
void CodeStubAssembler::UpdateFeedback(Node* feedback,
|
||||
Node* type_feedback_vector,
|
||||
void CodeStubAssembler::UpdateFeedback(Node* feedback, Node* feedback_vector,
|
||||
Node* slot_id) {
|
||||
// This method is used for binary op and compare feedback. These
|
||||
// vector nodes are initialized with a smi 0, so we can simply OR
|
||||
// our new feedback in place.
|
||||
Node* previous_feedback =
|
||||
LoadFixedArrayElement(type_feedback_vector, slot_id);
|
||||
Node* previous_feedback = LoadFixedArrayElement(feedback_vector, slot_id);
|
||||
Node* combined_feedback = SmiOr(previous_feedback, feedback);
|
||||
StoreFixedArrayElement(type_feedback_vector, slot_id, combined_feedback,
|
||||
StoreFixedArrayElement(feedback_vector, slot_id, combined_feedback,
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -988,11 +988,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
Node* OrdinaryHasInstance(Node* context, Node* callable, Node* object);
|
||||
|
||||
// Load type feedback vector from the stub caller's frame.
|
||||
Node* LoadTypeFeedbackVectorForStub();
|
||||
Node* LoadFeedbackVectorForStub();
|
||||
|
||||
// Update the type feedback vector.
|
||||
void UpdateFeedback(Node* feedback, Node* type_feedback_vector,
|
||||
Node* slot_id);
|
||||
void UpdateFeedback(Node* feedback, Node* feedback_vector, Node* slot_id);
|
||||
|
||||
Node* LoadReceiverMap(Node* receiver);
|
||||
|
||||
|
||||
Vendored
+15
-13
@@ -537,10 +537,12 @@ BINARY_OP_STUB(ModulusWithFeedbackStub)
|
||||
#undef BINARY_OP_STUB
|
||||
|
||||
// static
|
||||
compiler::Node* AddWithFeedbackStub::Generate(
|
||||
CodeStubAssembler* assembler, compiler::Node* lhs, compiler::Node* rhs,
|
||||
compiler::Node* slot_id, compiler::Node* type_feedback_vector,
|
||||
compiler::Node* context) {
|
||||
compiler::Node* AddWithFeedbackStub::Generate(CodeStubAssembler* assembler,
|
||||
compiler::Node* lhs,
|
||||
compiler::Node* rhs,
|
||||
compiler::Node* slot_id,
|
||||
compiler::Node* feedback_vector,
|
||||
compiler::Node* context) {
|
||||
typedef CodeStubAssembler::Label Label;
|
||||
typedef compiler::Node Node;
|
||||
typedef CodeStubAssembler::Variable Variable;
|
||||
@@ -738,7 +740,7 @@ compiler::Node* AddWithFeedbackStub::Generate(
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_id);
|
||||
return var_result.value();
|
||||
}
|
||||
@@ -746,7 +748,7 @@ compiler::Node* AddWithFeedbackStub::Generate(
|
||||
// static
|
||||
compiler::Node* SubtractWithFeedbackStub::Generate(
|
||||
CodeStubAssembler* assembler, compiler::Node* lhs, compiler::Node* rhs,
|
||||
compiler::Node* slot_id, compiler::Node* type_feedback_vector,
|
||||
compiler::Node* slot_id, compiler::Node* feedback_vector,
|
||||
compiler::Node* context) {
|
||||
typedef CodeStubAssembler::Label Label;
|
||||
typedef compiler::Node Node;
|
||||
@@ -931,7 +933,7 @@ compiler::Node* SubtractWithFeedbackStub::Generate(
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_id);
|
||||
return var_result.value();
|
||||
}
|
||||
@@ -940,7 +942,7 @@ compiler::Node* SubtractWithFeedbackStub::Generate(
|
||||
// static
|
||||
compiler::Node* MultiplyWithFeedbackStub::Generate(
|
||||
CodeStubAssembler* assembler, compiler::Node* lhs, compiler::Node* rhs,
|
||||
compiler::Node* slot_id, compiler::Node* type_feedback_vector,
|
||||
compiler::Node* slot_id, compiler::Node* feedback_vector,
|
||||
compiler::Node* context) {
|
||||
using compiler::Node;
|
||||
typedef CodeStubAssembler::Label Label;
|
||||
@@ -1092,7 +1094,7 @@ compiler::Node* MultiplyWithFeedbackStub::Generate(
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_id);
|
||||
return var_result.value();
|
||||
}
|
||||
@@ -1102,7 +1104,7 @@ compiler::Node* MultiplyWithFeedbackStub::Generate(
|
||||
compiler::Node* DivideWithFeedbackStub::Generate(
|
||||
CodeStubAssembler* assembler, compiler::Node* dividend,
|
||||
compiler::Node* divisor, compiler::Node* slot_id,
|
||||
compiler::Node* type_feedback_vector, compiler::Node* context) {
|
||||
compiler::Node* feedback_vector, compiler::Node* context) {
|
||||
using compiler::Node;
|
||||
typedef CodeStubAssembler::Label Label;
|
||||
typedef CodeStubAssembler::Variable Variable;
|
||||
@@ -1312,7 +1314,7 @@ compiler::Node* DivideWithFeedbackStub::Generate(
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_id);
|
||||
return var_result.value();
|
||||
}
|
||||
@@ -1321,7 +1323,7 @@ compiler::Node* DivideWithFeedbackStub::Generate(
|
||||
compiler::Node* ModulusWithFeedbackStub::Generate(
|
||||
CodeStubAssembler* assembler, compiler::Node* dividend,
|
||||
compiler::Node* divisor, compiler::Node* slot_id,
|
||||
compiler::Node* type_feedback_vector, compiler::Node* context) {
|
||||
compiler::Node* feedback_vector, compiler::Node* context) {
|
||||
using compiler::Node;
|
||||
typedef CodeStubAssembler::Label Label;
|
||||
typedef CodeStubAssembler::Variable Variable;
|
||||
@@ -1473,7 +1475,7 @@ compiler::Node* ModulusWithFeedbackStub::Generate(
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_id);
|
||||
return var_result.value();
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -365,7 +365,7 @@ class CodeStub BASE_EMBEDDED {
|
||||
static compiler::Node* Generate( \
|
||||
CodeStubAssembler* assembler, compiler::Node* left, \
|
||||
compiler::Node* right, compiler::Node* slot_id, \
|
||||
compiler::Node* type_feedback_vector, compiler::Node* context); \
|
||||
compiler::Node* feedback_vector, compiler::Node* context); \
|
||||
void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \
|
||||
DEFINE_CODE_STUB(NAME, SUPER)
|
||||
|
||||
@@ -373,7 +373,7 @@ class CodeStub BASE_EMBEDDED {
|
||||
public: \
|
||||
static compiler::Node* Generate( \
|
||||
CodeStubAssembler* assembler, compiler::Node* value, \
|
||||
compiler::Node* context, compiler::Node* type_feedback_vector, \
|
||||
compiler::Node* context, compiler::Node* feedback_vector, \
|
||||
compiler::Node* slot_id); \
|
||||
void GenerateAssembly(compiler::CodeAssemblerState* state) const override; \
|
||||
DEFINE_CODE_STUB(NAME, SUPER)
|
||||
|
||||
Vendored
+1
-1
@@ -301,7 +301,7 @@ void EnsureFeedbackMetadata(CompilationInfo* info) {
|
||||
// TODO(mvstanton): reintroduce is_empty() predicate to feedback_metadata().
|
||||
if (info->shared_info()->feedback_metadata()->length() == 0 ||
|
||||
!info->shared_info()->is_compiled()) {
|
||||
Handle<TypeFeedbackMetadata> feedback_metadata = TypeFeedbackMetadata::New(
|
||||
Handle<FeedbackMetadata> feedback_metadata = FeedbackMetadata::New(
|
||||
info->isolate(), info->literal()->feedback_vector_spec());
|
||||
info->shared_info()->set_feedback_metadata(*feedback_metadata);
|
||||
}
|
||||
|
||||
+4
-4
@@ -17,6 +17,7 @@
|
||||
#include "src/compiler/node-properties.h"
|
||||
#include "src/compiler/operator-properties.h"
|
||||
#include "src/compiler/state-values-utils.h"
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/objects-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
@@ -2202,8 +2203,7 @@ void AstGraphBuilder::VisitDeclarations(Declaration::List* declarations) {
|
||||
AstVisitor<AstGraphBuilder>::VisitDeclarations(declarations);
|
||||
if (globals()->empty()) return;
|
||||
int array_index = 0;
|
||||
Handle<TypeFeedbackVector> feedback_vector(
|
||||
info()->closure()->feedback_vector());
|
||||
Handle<FeedbackVector> feedback_vector(info()->closure()->feedback_vector());
|
||||
Handle<FixedArray> data = isolate()->factory()->NewFixedArray(
|
||||
static_cast<int>(globals()->size()), TENURED);
|
||||
for (Handle<Object> obj : *globals()) data->set(array_index++, *obj);
|
||||
@@ -2374,8 +2374,8 @@ void AstGraphBuilder::VisitRewritableExpression(RewritableExpression* node) {
|
||||
|
||||
float AstGraphBuilder::ComputeCallFrequency(FeedbackVectorSlot slot) const {
|
||||
if (slot.IsInvalid()) return 0.0f;
|
||||
Handle<TypeFeedbackVector> feedback_vector(
|
||||
info()->closure()->feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> feedback_vector(info()->closure()->feedback_vector(),
|
||||
isolate());
|
||||
CallICNexus nexus(feedback_vector, slot);
|
||||
return nexus.ComputeCallFrequency() * invocation_frequency_;
|
||||
}
|
||||
|
||||
+4
-4
@@ -445,7 +445,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint(
|
||||
|
||||
BytecodeGraphBuilder::BytecodeGraphBuilder(
|
||||
Zone* local_zone, Handle<SharedFunctionInfo> shared_info,
|
||||
Handle<TypeFeedbackVector> feedback_vector, BailoutId osr_ast_id,
|
||||
Handle<FeedbackVector> feedback_vector, BailoutId osr_ast_id,
|
||||
JSGraph* jsgraph, float invocation_frequency,
|
||||
SourcePositionTable* source_positions, int inlining_id)
|
||||
: local_zone_(local_zone),
|
||||
@@ -522,7 +522,7 @@ Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) {
|
||||
|
||||
VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
|
||||
FeedbackVectorSlot slot;
|
||||
if (slot_id >= TypeFeedbackVector::kReservedIndexCount) {
|
||||
if (slot_id >= FeedbackVector::kReservedIndexCount) {
|
||||
slot = feedback_vector()->ToSlot(slot_id);
|
||||
}
|
||||
return VectorSlotPair(feedback_vector(), slot);
|
||||
@@ -1258,7 +1258,7 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode,
|
||||
|
||||
// Slot index of 0 is used indicate no feedback slot is available. Assert
|
||||
// the assumption that slot index 0 is never a valid feedback slot.
|
||||
STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
|
||||
STATIC_ASSERT(FeedbackVector::kReservedIndexCount > 0);
|
||||
int const slot_id = bytecode_iterator().GetIndexOperand(3);
|
||||
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
|
||||
|
||||
@@ -1384,7 +1384,7 @@ void BytecodeGraphBuilder::VisitNew() {
|
||||
size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
|
||||
// Slot index of 0 is used indicate no feedback slot is available. Assert
|
||||
// the assumption that slot index 0 is never a valid feedback slot.
|
||||
STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
|
||||
STATIC_ASSERT(FeedbackVector::kReservedIndexCount > 0);
|
||||
int const slot_id = bytecode_iterator().GetIndexOperand(3);
|
||||
VectorSlotPair feedback = CreateVectorSlotPair(slot_id);
|
||||
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ class SourcePositionTable;
|
||||
class BytecodeGraphBuilder {
|
||||
public:
|
||||
BytecodeGraphBuilder(Zone* local_zone, Handle<SharedFunctionInfo> shared,
|
||||
Handle<TypeFeedbackVector> feedback_vector,
|
||||
Handle<FeedbackVector> feedback_vector,
|
||||
BailoutId osr_ast_id, JSGraph* jsgraph,
|
||||
float invocation_frequency,
|
||||
SourcePositionTable* source_positions,
|
||||
@@ -233,7 +233,7 @@ class BytecodeGraphBuilder {
|
||||
const Handle<HandlerTable>& exception_handler_table() const {
|
||||
return exception_handler_table_;
|
||||
}
|
||||
const Handle<TypeFeedbackVector>& feedback_vector() const {
|
||||
const Handle<FeedbackVector>& feedback_vector() const {
|
||||
return feedback_vector_;
|
||||
}
|
||||
const FrameStateFunctionInfo* frame_state_function_info() const {
|
||||
@@ -270,7 +270,7 @@ class BytecodeGraphBuilder {
|
||||
float const invocation_frequency_;
|
||||
Handle<BytecodeArray> bytecode_array_;
|
||||
Handle<HandlerTable> exception_handler_table_;
|
||||
Handle<TypeFeedbackVector> feedback_vector_;
|
||||
Handle<FeedbackVector> feedback_vector_;
|
||||
const FrameStateFunctionInfo* frame_state_function_info_;
|
||||
const interpreter::BytecodeArrayIterator* bytecode_iterator_;
|
||||
const BytecodeAnalysis* bytecode_analysis_;
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
#include "src/compiler/linkage.h"
|
||||
#include "src/compiler/node-matchers.h"
|
||||
#include "src/compiler/simplified-operator.h"
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "src/objects-inl.h"
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@@ -504,7 +504,7 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
|
||||
Node* stub_code = jsgraph()->HeapConstant(callable.code());
|
||||
Node* stub_arity = jsgraph()->Constant(arg_count);
|
||||
Node* slot_index =
|
||||
jsgraph()->Constant(TypeFeedbackVector::GetIndex(p.feedback().slot()));
|
||||
jsgraph()->Constant(FeedbackVector::GetIndex(p.feedback().slot()));
|
||||
Node* feedback_vector = jsgraph()->HeapConstant(p.feedback().vector());
|
||||
node->InsertInput(graph()->zone(), 0, stub_code);
|
||||
node->InsertInput(graph()->zone(), 2, stub_arity);
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
#include "src/compiler/linkage.h"
|
||||
#include "src/compiler/node-matchers.h"
|
||||
#include "src/compiler/type-cache.h"
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/field-index-inl.h"
|
||||
#include "src/isolate-inl.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@@ -221,7 +221,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadContext(Node* node) {
|
||||
Reduction JSNativeContextSpecialization::ReduceNamedAccess(
|
||||
Node* node, Node* value, MapHandleList const& receiver_maps,
|
||||
Handle<Name> name, AccessMode access_mode, LanguageMode language_mode,
|
||||
Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot, Node* index) {
|
||||
Handle<FeedbackVector> vector, FeedbackVectorSlot slot, Node* index) {
|
||||
DCHECK(node->opcode() == IrOpcode::kJSLoadNamed ||
|
||||
node->opcode() == IrOpcode::kJSStoreNamed ||
|
||||
node->opcode() == IrOpcode::kJSLoadProperty ||
|
||||
@@ -964,7 +964,7 @@ JSNativeContextSpecialization::BuildPropertyAccess(
|
||||
Node* receiver, Node* value, Node* context, Node* frame_state, Node* effect,
|
||||
Node* control, Handle<Name> name, PropertyAccessInfo const& access_info,
|
||||
AccessMode access_mode, LanguageMode language_mode,
|
||||
Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot) {
|
||||
Handle<FeedbackVector> vector, FeedbackVectorSlot slot) {
|
||||
// Determine actual holder and perform prototype chain checks.
|
||||
Handle<JSObject> holder;
|
||||
if (access_info.holder().ToHandle(&holder)) {
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
#include "src/base/flags.h"
|
||||
#include "src/compiler/graph-reducer.h"
|
||||
#include "src/deoptimize-reason.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
#include "src/feedback-vector.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@@ -81,7 +81,7 @@ class JSNativeContextSpecialization final : public AdvancedReducer {
|
||||
MapHandleList const& receiver_maps,
|
||||
Handle<Name> name, AccessMode access_mode,
|
||||
LanguageMode language_mode,
|
||||
Handle<TypeFeedbackVector> vector,
|
||||
Handle<FeedbackVector> vector,
|
||||
FeedbackVectorSlot slot, Node* index = nullptr);
|
||||
|
||||
Reduction ReduceSoftDeoptimize(Node* node, DeoptimizeReason reason);
|
||||
@@ -107,7 +107,7 @@ class JSNativeContextSpecialization final : public AdvancedReducer {
|
||||
Node* receiver, Node* value, Node* context, Node* frame_state,
|
||||
Node* effect, Node* control, Handle<Name> name,
|
||||
PropertyAccessInfo const& access_info, AccessMode access_mode,
|
||||
LanguageMode language_mode, Handle<TypeFeedbackVector> vector,
|
||||
LanguageMode language_mode, Handle<FeedbackVector> vector,
|
||||
FeedbackVectorSlot slot);
|
||||
|
||||
// Construct the appropriate subgraph for element access.
|
||||
|
||||
Vendored
+2
-2
@@ -9,9 +9,9 @@
|
||||
#include "src/base/lazy-instance.h"
|
||||
#include "src/compiler/opcodes.h"
|
||||
#include "src/compiler/operator.h"
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/handles-inl.h"
|
||||
#include "src/objects-inl.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
@@ -21,7 +21,7 @@ VectorSlotPair::VectorSlotPair() {}
|
||||
|
||||
|
||||
int VectorSlotPair::index() const {
|
||||
return vector_.is_null() ? -1 : TypeFeedbackVector::GetIndex(slot_);
|
||||
return vector_.is_null() ? -1 : FeedbackVector::GetIndex(slot_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+4
-5
@@ -18,24 +18,23 @@ namespace compiler {
|
||||
class Operator;
|
||||
struct JSOperatorGlobalCache;
|
||||
|
||||
|
||||
// Defines a pair of {TypeFeedbackVector} and {TypeFeedbackVectorSlot}, which
|
||||
// Defines a pair of {FeedbackVector} and {FeedbackVectorSlot}, which
|
||||
// is used to access the type feedback for a certain {Node}.
|
||||
class V8_EXPORT_PRIVATE VectorSlotPair {
|
||||
public:
|
||||
VectorSlotPair();
|
||||
VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
VectorSlotPair(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: vector_(vector), slot_(slot) {}
|
||||
|
||||
bool IsValid() const { return !vector_.is_null() && !slot_.IsInvalid(); }
|
||||
|
||||
Handle<TypeFeedbackVector> vector() const { return vector_; }
|
||||
Handle<FeedbackVector> vector() const { return vector_; }
|
||||
FeedbackVectorSlot slot() const { return slot_; }
|
||||
|
||||
int index() const;
|
||||
|
||||
private:
|
||||
const Handle<TypeFeedbackVector> vector_;
|
||||
const Handle<FeedbackVector> vector_;
|
||||
const FeedbackVectorSlot slot_;
|
||||
};
|
||||
|
||||
|
||||
+4
-6
@@ -1944,14 +1944,12 @@ class HDeclareGlobals final : public HUnaryOperation {
|
||||
public:
|
||||
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HDeclareGlobals,
|
||||
Handle<FixedArray>, int,
|
||||
Handle<TypeFeedbackVector>);
|
||||
Handle<FeedbackVector>);
|
||||
|
||||
HValue* context() { return OperandAt(0); }
|
||||
Handle<FixedArray> declarations() const { return declarations_; }
|
||||
int flags() const { return flags_; }
|
||||
Handle<TypeFeedbackVector> feedback_vector() const {
|
||||
return feedback_vector_;
|
||||
}
|
||||
Handle<FeedbackVector> feedback_vector() const { return feedback_vector_; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals)
|
||||
|
||||
@@ -1961,7 +1959,7 @@ class HDeclareGlobals final : public HUnaryOperation {
|
||||
|
||||
private:
|
||||
HDeclareGlobals(HValue* context, Handle<FixedArray> declarations, int flags,
|
||||
Handle<TypeFeedbackVector> feedback_vector)
|
||||
Handle<FeedbackVector> feedback_vector)
|
||||
: HUnaryOperation(context),
|
||||
declarations_(declarations),
|
||||
feedback_vector_(feedback_vector),
|
||||
@@ -1971,7 +1969,7 @@ class HDeclareGlobals final : public HUnaryOperation {
|
||||
}
|
||||
|
||||
Handle<FixedArray> declarations_;
|
||||
Handle<TypeFeedbackVector> feedback_vector_;
|
||||
Handle<FeedbackVector> feedback_vector_;
|
||||
int flags_;
|
||||
};
|
||||
|
||||
|
||||
Vendored
+9
-10
@@ -5054,9 +5054,9 @@ void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
|
||||
// space for nested functions that don't need pretenuring.
|
||||
HConstant* shared_info_value = Add<HConstant>(shared_info);
|
||||
HInstruction* instr;
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
HValue* vector_value = Add<HConstant>(vector);
|
||||
int index = TypeFeedbackVector::GetIndex(expr->LiteralFeedbackSlot());
|
||||
int index = FeedbackVector::GetIndex(expr->LiteralFeedbackSlot());
|
||||
HValue* index_value = Add<HConstant>(index);
|
||||
if (!expr->pretenure()) {
|
||||
Callable callable = CodeFactory::FastNewClosure(isolate());
|
||||
@@ -5286,7 +5286,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
|
||||
InlineGlobalPropertyLoad(&it, expr->id());
|
||||
return;
|
||||
} else {
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
|
||||
HValue* vector_value = Add<HConstant>(vector);
|
||||
HValue* slot_value =
|
||||
@@ -6518,7 +6518,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
|
||||
HValue* global_object = Add<HLoadNamedField>(
|
||||
BuildGetNativeContext(), nullptr,
|
||||
HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX));
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
Handle<FeedbackVector> vector =
|
||||
handle(current_feedback_vector(), isolate());
|
||||
HValue* name = Add<HConstant>(var->name());
|
||||
HValue* vector_value = Add<HConstant>(vector);
|
||||
@@ -6827,7 +6827,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
|
||||
DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess,
|
||||
Deoptimizer::SOFT);
|
||||
}
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
|
||||
HValue* key = Add<HConstant>(name);
|
||||
HValue* vector_value = Add<HConstant>(vector);
|
||||
@@ -6881,7 +6881,7 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
|
||||
HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
|
||||
PropertyAccessType access_type, Expression* expr, FeedbackVectorSlot slot,
|
||||
HValue* object, HValue* key, HValue* value) {
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
HValue* vector_value = Add<HConstant>(vector);
|
||||
HValue* slot_value = Add<HConstant>(vector->GetIndex(slot));
|
||||
|
||||
@@ -7215,8 +7215,7 @@ HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
|
||||
FeedbackVectorSlot slot, BailoutId ast_id, BailoutId return_id,
|
||||
PropertyAccessType access_type, bool* has_side_effects) {
|
||||
// A keyed name access with type feedback may contain the name.
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
handle(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector = handle(current_feedback_vector(), isolate());
|
||||
HValue* expected_key = key;
|
||||
if (!key->ActualValue()->IsConstant()) {
|
||||
Name* name = nullptr;
|
||||
@@ -7675,7 +7674,7 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunctionViaIC(
|
||||
DCHECK_EQ(TailCallMode::kDisallow, tail_call_mode);
|
||||
}
|
||||
int arity = argument_count - 1;
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
HValue* arity_val = Add<HConstant>(arity);
|
||||
HValue* index_val = Add<HConstant>(vector->GetIndex(slot));
|
||||
HValue* vector_val = Add<HConstant>(vector);
|
||||
@@ -11832,7 +11831,7 @@ void HOptimizedGraphBuilder::VisitDeclarations(
|
||||
isolate()->factory()->NewFixedArray(globals_.length(), TENURED);
|
||||
for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i));
|
||||
int flags = current_info()->GetDeclareGlobalsFlags();
|
||||
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Handle<FeedbackVector> vector(current_feedback_vector(), isolate());
|
||||
Add<HDeclareGlobals>(array, flags, vector);
|
||||
globals_.Rewind(0);
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2142,7 +2142,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder,
|
||||
Handle<SharedFunctionInfo> current_shared_info() const {
|
||||
return current_info()->shared_info();
|
||||
}
|
||||
TypeFeedbackVector* current_feedback_vector() const {
|
||||
FeedbackVector* current_feedback_vector() const {
|
||||
return current_closure()->feedback_vector();
|
||||
}
|
||||
void ClearInlinedTestContext() {
|
||||
|
||||
Vendored
+4
-4
@@ -838,13 +838,13 @@ class LiteralFixer {
|
||||
// collect all functions and fix their literal arrays.
|
||||
Handle<FixedArray> function_instances =
|
||||
CollectJSFunctions(shared_info, isolate);
|
||||
Handle<TypeFeedbackMetadata> feedback_metadata(
|
||||
Handle<FeedbackMetadata> feedback_metadata(
|
||||
shared_info->feedback_metadata());
|
||||
|
||||
for (int i = 0; i < function_instances->length(); i++) {
|
||||
Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i)));
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
TypeFeedbackVector::New(isolate, feedback_metadata);
|
||||
Handle<FeedbackVector> vector =
|
||||
FeedbackVector::New(isolate, feedback_metadata);
|
||||
Handle<LiteralsArray> new_literals =
|
||||
LiteralsArray::New(isolate, vector, new_literal_count);
|
||||
fun->set_literals(*new_literals);
|
||||
@@ -1017,7 +1017,7 @@ void LiveEdit::ReplaceFunctionCode(
|
||||
shared_info->set_outer_scope_info(new_shared_info->outer_scope_info());
|
||||
shared_info->DisableOptimization(kLiveEdit);
|
||||
// Update the type feedback vector, if needed.
|
||||
Handle<TypeFeedbackMetadata> new_feedback_metadata(
|
||||
Handle<FeedbackMetadata> new_feedback_metadata(
|
||||
new_shared_info->feedback_metadata());
|
||||
feedback_metadata_changed =
|
||||
new_feedback_metadata->DiffersFrom(shared_info->feedback_metadata());
|
||||
|
||||
Vendored
+2
-2
@@ -2350,8 +2350,8 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
|
||||
share->set_debug_info(DebugInfo::uninitialized(), SKIP_WRITE_BARRIER);
|
||||
share->set_function_identifier(*undefined_value(), SKIP_WRITE_BARRIER);
|
||||
StaticFeedbackVectorSpec empty_spec;
|
||||
Handle<TypeFeedbackMetadata> feedback_metadata =
|
||||
TypeFeedbackMetadata::New(isolate(), &empty_spec);
|
||||
Handle<FeedbackMetadata> feedback_metadata =
|
||||
FeedbackMetadata::New(isolate(), &empty_spec);
|
||||
share->set_feedback_metadata(*feedback_metadata, SKIP_WRITE_BARRIER);
|
||||
share->set_function_literal_id(FunctionLiteral::kIdTypeInvalid);
|
||||
#if TRACE_MAPS
|
||||
|
||||
Vendored
+1
-1
@@ -5,10 +5,10 @@
|
||||
#ifndef V8_FACTORY_H_
|
||||
#define V8_FACTORY_H_
|
||||
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/globals.h"
|
||||
#include "src/isolate.h"
|
||||
#include "src/messages.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
+40
-49
@@ -2,21 +2,21 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_
|
||||
#define V8_TYPE_FEEDBACK_VECTOR_INL_H_
|
||||
#ifndef V8_FEEDBACK_VECTOR_INL_H_
|
||||
#define V8_FEEDBACK_VECTOR_INL_H_
|
||||
|
||||
#include "src/factory.h"
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/globals.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
template <typename Derived>
|
||||
FeedbackVectorSlot FeedbackVectorSpecBase<Derived>::AddSlot(
|
||||
FeedbackVectorSlotKind kind) {
|
||||
int slot = This()->slots();
|
||||
int entries_per_slot = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int entries_per_slot = FeedbackMetadata::GetSlotSize(kind);
|
||||
This()->append(kind);
|
||||
for (int i = 1; i < entries_per_slot; i++) {
|
||||
This()->append(FeedbackVectorSlotKind::INVALID);
|
||||
@@ -24,33 +24,31 @@ FeedbackVectorSlot FeedbackVectorSpecBase<Derived>::AddSlot(
|
||||
return FeedbackVectorSlot(slot);
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
TypeFeedbackMetadata* TypeFeedbackMetadata::cast(Object* obj) {
|
||||
DCHECK(obj->IsTypeFeedbackMetadata());
|
||||
return reinterpret_cast<TypeFeedbackMetadata*>(obj);
|
||||
FeedbackMetadata* FeedbackMetadata::cast(Object* obj) {
|
||||
DCHECK(obj->IsFeedbackMetadata());
|
||||
return reinterpret_cast<FeedbackMetadata*>(obj);
|
||||
}
|
||||
|
||||
bool TypeFeedbackMetadata::is_empty() const {
|
||||
bool FeedbackMetadata::is_empty() const {
|
||||
if (length() == 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int TypeFeedbackMetadata::slot_count() const {
|
||||
int FeedbackMetadata::slot_count() const {
|
||||
if (length() == 0) return 0;
|
||||
DCHECK(length() > kReservedIndexCount);
|
||||
return Smi::cast(get(kSlotsCountIndex))->value();
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
TypeFeedbackVector* TypeFeedbackVector::cast(Object* obj) {
|
||||
DCHECK(obj->IsTypeFeedbackVector());
|
||||
return reinterpret_cast<TypeFeedbackVector*>(obj);
|
||||
FeedbackVector* FeedbackVector::cast(Object* obj) {
|
||||
DCHECK(obj->IsFeedbackVector());
|
||||
return reinterpret_cast<FeedbackVector*>(obj);
|
||||
}
|
||||
|
||||
|
||||
int TypeFeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) {
|
||||
int FeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) {
|
||||
DCHECK_NE(FeedbackVectorSlotKind::INVALID, kind);
|
||||
DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind);
|
||||
if (kind == FeedbackVectorSlotKind::GENERAL ||
|
||||
@@ -63,7 +61,7 @@ int TypeFeedbackMetadata::GetSlotSize(FeedbackVectorSlotKind kind) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool TypeFeedbackMetadata::SlotRequiresParameter(FeedbackVectorSlotKind kind) {
|
||||
bool FeedbackMetadata::SlotRequiresParameter(FeedbackVectorSlotKind kind) {
|
||||
switch (kind) {
|
||||
case FeedbackVectorSlotKind::CREATE_CLOSURE:
|
||||
return true;
|
||||
@@ -88,38 +86,35 @@ bool TypeFeedbackMetadata::SlotRequiresParameter(FeedbackVectorSlotKind kind) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TypeFeedbackVector::is_empty() const {
|
||||
bool FeedbackVector::is_empty() const {
|
||||
return length() == kReservedIndexCount;
|
||||
}
|
||||
|
||||
int TypeFeedbackVector::slot_count() const {
|
||||
int FeedbackVector::slot_count() const {
|
||||
return length() - kReservedIndexCount;
|
||||
}
|
||||
|
||||
|
||||
TypeFeedbackMetadata* TypeFeedbackVector::metadata() const {
|
||||
return TypeFeedbackMetadata::cast(get(kMetadataIndex));
|
||||
FeedbackMetadata* FeedbackVector::metadata() const {
|
||||
return FeedbackMetadata::cast(get(kMetadataIndex));
|
||||
}
|
||||
|
||||
int TypeFeedbackVector::invocation_count() const {
|
||||
int FeedbackVector::invocation_count() const {
|
||||
return Smi::cast(get(kInvocationCountIndex))->value();
|
||||
}
|
||||
|
||||
// Conversion from an integer index to either a slot or an ic slot.
|
||||
// static
|
||||
FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) {
|
||||
FeedbackVectorSlot FeedbackVector::ToSlot(int index) {
|
||||
DCHECK_GE(index, kReservedIndexCount);
|
||||
return FeedbackVectorSlot(index - kReservedIndexCount);
|
||||
}
|
||||
|
||||
|
||||
Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) const {
|
||||
Object* FeedbackVector::Get(FeedbackVectorSlot slot) const {
|
||||
return get(GetIndex(slot));
|
||||
}
|
||||
|
||||
|
||||
void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value,
|
||||
WriteBarrierMode mode) {
|
||||
void FeedbackVector::Set(FeedbackVectorSlot slot, Object* value,
|
||||
WriteBarrierMode mode) {
|
||||
set(GetIndex(slot), value, mode);
|
||||
}
|
||||
|
||||
@@ -165,15 +160,15 @@ CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) {
|
||||
return CompareOperationHint::kNone;
|
||||
}
|
||||
|
||||
void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
|
||||
int* vector_ic_count,
|
||||
bool code_is_interpreted) {
|
||||
void FeedbackVector::ComputeCounts(int* with_type_info, int* generic,
|
||||
int* vector_ic_count,
|
||||
bool code_is_interpreted) {
|
||||
Object* megamorphic_sentinel =
|
||||
*TypeFeedbackVector::MegamorphicSentinel(GetIsolate());
|
||||
*FeedbackVector::MegamorphicSentinel(GetIsolate());
|
||||
int with = 0;
|
||||
int gen = 0;
|
||||
int total = 0;
|
||||
TypeFeedbackMetadataIterator iter(metadata());
|
||||
FeedbackMetadataIterator iter(metadata());
|
||||
while (iter.HasNext()) {
|
||||
FeedbackVectorSlot slot = iter.Next();
|
||||
FeedbackVectorSlotKind kind = iter.kind();
|
||||
@@ -240,27 +235,27 @@ void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
|
||||
*vector_ic_count = total;
|
||||
}
|
||||
|
||||
Handle<Symbol> TypeFeedbackVector::UninitializedSentinel(Isolate* isolate) {
|
||||
Handle<Symbol> FeedbackVector::UninitializedSentinel(Isolate* isolate) {
|
||||
return isolate->factory()->uninitialized_symbol();
|
||||
}
|
||||
|
||||
Handle<Symbol> TypeFeedbackVector::MegamorphicSentinel(Isolate* isolate) {
|
||||
Handle<Symbol> FeedbackVector::MegamorphicSentinel(Isolate* isolate) {
|
||||
return isolate->factory()->megamorphic_symbol();
|
||||
}
|
||||
|
||||
Handle<Symbol> TypeFeedbackVector::PremonomorphicSentinel(Isolate* isolate) {
|
||||
Handle<Symbol> FeedbackVector::PremonomorphicSentinel(Isolate* isolate) {
|
||||
return isolate->factory()->premonomorphic_symbol();
|
||||
}
|
||||
|
||||
Symbol* TypeFeedbackVector::RawUninitializedSentinel(Isolate* isolate) {
|
||||
Symbol* FeedbackVector::RawUninitializedSentinel(Isolate* isolate) {
|
||||
return isolate->heap()->uninitialized_symbol();
|
||||
}
|
||||
|
||||
bool TypeFeedbackMetadataIterator::HasNext() const {
|
||||
bool FeedbackMetadataIterator::HasNext() const {
|
||||
return next_slot_.ToInt() < metadata()->slot_count();
|
||||
}
|
||||
|
||||
FeedbackVectorSlot TypeFeedbackMetadataIterator::Next() {
|
||||
FeedbackVectorSlot FeedbackMetadataIterator::Next() {
|
||||
DCHECK(HasNext());
|
||||
cur_slot_ = next_slot_;
|
||||
slot_kind_ = metadata()->GetKind(cur_slot_);
|
||||
@@ -268,41 +263,37 @@ FeedbackVectorSlot TypeFeedbackMetadataIterator::Next() {
|
||||
return cur_slot_;
|
||||
}
|
||||
|
||||
int TypeFeedbackMetadataIterator::entry_size() const {
|
||||
return TypeFeedbackMetadata::GetSlotSize(kind());
|
||||
int FeedbackMetadataIterator::entry_size() const {
|
||||
return FeedbackMetadata::GetSlotSize(kind());
|
||||
}
|
||||
|
||||
Object* FeedbackNexus::GetFeedback() const { return vector()->Get(slot()); }
|
||||
|
||||
|
||||
Object* FeedbackNexus::GetFeedbackExtra() const {
|
||||
#ifdef DEBUG
|
||||
FeedbackVectorSlotKind kind = vector()->GetKind(slot());
|
||||
DCHECK_LT(1, TypeFeedbackMetadata::GetSlotSize(kind));
|
||||
DCHECK_LT(1, FeedbackMetadata::GetSlotSize(kind));
|
||||
#endif
|
||||
int extra_index = vector()->GetIndex(slot()) + 1;
|
||||
return vector()->get(extra_index);
|
||||
}
|
||||
|
||||
|
||||
void FeedbackNexus::SetFeedback(Object* feedback, WriteBarrierMode mode) {
|
||||
vector()->Set(slot(), feedback, mode);
|
||||
}
|
||||
|
||||
|
||||
void FeedbackNexus::SetFeedbackExtra(Object* feedback_extra,
|
||||
WriteBarrierMode mode) {
|
||||
#ifdef DEBUG
|
||||
FeedbackVectorSlotKind kind = vector()->GetKind(slot());
|
||||
DCHECK_LT(1, TypeFeedbackMetadata::GetSlotSize(kind));
|
||||
DCHECK_LT(1, FeedbackMetadata::GetSlotSize(kind));
|
||||
#endif
|
||||
int index = vector()->GetIndex(slot()) + 1;
|
||||
vector()->set(index, feedback_extra, mode);
|
||||
}
|
||||
|
||||
|
||||
Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); }
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_
|
||||
#endif // V8_FEEDBACK_VECTOR_INL_H_
|
||||
@@ -2,18 +2,16 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "src/type-feedback-vector.h"
|
||||
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/code-stubs.h"
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "src/ic/ic-inl.h"
|
||||
#include "src/ic/ic-state.h"
|
||||
#include "src/objects.h"
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
static bool IsPropertyNameFeedback(Object* feedback) {
|
||||
if (feedback->IsString()) return true;
|
||||
if (!feedback->IsSymbol()) return false;
|
||||
@@ -24,55 +22,51 @@ static bool IsPropertyNameFeedback(Object* feedback) {
|
||||
symbol != heap->megamorphic_symbol();
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind) {
|
||||
return os << TypeFeedbackMetadata::Kind2String(kind);
|
||||
return os << FeedbackMetadata::Kind2String(kind);
|
||||
}
|
||||
|
||||
|
||||
FeedbackVectorSlotKind TypeFeedbackMetadata::GetKind(
|
||||
FeedbackVectorSlotKind FeedbackMetadata::GetKind(
|
||||
FeedbackVectorSlot slot) const {
|
||||
int index = VectorICComputer::index(kReservedIndexCount, slot.ToInt());
|
||||
int data = Smi::cast(get(index))->value();
|
||||
return VectorICComputer::decode(data, slot.ToInt());
|
||||
}
|
||||
|
||||
int TypeFeedbackMetadata::GetParameter(int parameter_index) const {
|
||||
int FeedbackMetadata::GetParameter(int parameter_index) const {
|
||||
FixedArray* parameters = FixedArray::cast(get(kParametersTableIndex));
|
||||
return Smi::cast(parameters->get(parameter_index))->value();
|
||||
}
|
||||
|
||||
void TypeFeedbackMetadata::SetKind(FeedbackVectorSlot slot,
|
||||
FeedbackVectorSlotKind kind) {
|
||||
void FeedbackMetadata::SetKind(FeedbackVectorSlot slot,
|
||||
FeedbackVectorSlotKind kind) {
|
||||
int index = VectorICComputer::index(kReservedIndexCount, slot.ToInt());
|
||||
int data = Smi::cast(get(index))->value();
|
||||
int new_data = VectorICComputer::encode(data, slot.ToInt(), kind);
|
||||
set(index, Smi::FromInt(new_data));
|
||||
}
|
||||
|
||||
|
||||
template Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(
|
||||
template Handle<FeedbackMetadata> FeedbackMetadata::New(
|
||||
Isolate* isolate, const StaticFeedbackVectorSpec* spec);
|
||||
template Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(
|
||||
template Handle<FeedbackMetadata> FeedbackMetadata::New(
|
||||
Isolate* isolate, const FeedbackVectorSpec* spec);
|
||||
|
||||
|
||||
// static
|
||||
template <typename Spec>
|
||||
Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
|
||||
const Spec* spec) {
|
||||
Handle<FeedbackMetadata> FeedbackMetadata::New(Isolate* isolate,
|
||||
const Spec* spec) {
|
||||
Factory* factory = isolate->factory();
|
||||
|
||||
const int slot_count = spec->slots();
|
||||
const int slot_kinds_length = VectorICComputer::word_count(slot_count);
|
||||
const int length = slot_kinds_length + kReservedIndexCount;
|
||||
if (length == kReservedIndexCount) {
|
||||
return Handle<TypeFeedbackMetadata>::cast(factory->empty_fixed_array());
|
||||
return Handle<FeedbackMetadata>::cast(factory->empty_fixed_array());
|
||||
}
|
||||
#ifdef DEBUG
|
||||
for (int i = 0; i < slot_count;) {
|
||||
FeedbackVectorSlotKind kind = spec->GetKind(i);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
for (int j = 1; j < entry_size; j++) {
|
||||
FeedbackVectorSlotKind kind = spec->GetKind(i + j);
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::INVALID, kind);
|
||||
@@ -88,8 +82,7 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
|
||||
array->set(kReservedIndexCount + i, Smi::kZero);
|
||||
}
|
||||
|
||||
Handle<TypeFeedbackMetadata> metadata =
|
||||
Handle<TypeFeedbackMetadata>::cast(array);
|
||||
Handle<FeedbackMetadata> metadata = Handle<FeedbackMetadata>::cast(array);
|
||||
|
||||
for (int i = 0; i < slot_count; i++) {
|
||||
FeedbackVectorSlotKind kind = spec->GetKind(i);
|
||||
@@ -108,9 +101,9 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
|
||||
metadata->set(kParametersTableIndex, *factory->empty_fixed_array());
|
||||
}
|
||||
|
||||
// It's important that the TypeFeedbackMetadata have a COW map, since it's
|
||||
// It's important that the FeedbackMetadata have a COW map, since it's
|
||||
// pointed to by both a SharedFunctionInfo and indirectly by closures through
|
||||
// the TypeFeedbackVector. The serializer uses the COW map type to decide
|
||||
// the FeedbackVector. The serializer uses the COW map type to decide
|
||||
// this object belongs in the startup snapshot and not the partial
|
||||
// snapshot(s).
|
||||
metadata->set_map(isolate->heap()->fixed_cow_array_map());
|
||||
@@ -118,7 +111,7 @@ Handle<TypeFeedbackMetadata> TypeFeedbackMetadata::New(Isolate* isolate,
|
||||
return metadata;
|
||||
}
|
||||
|
||||
bool TypeFeedbackMetadata::SpecDiffersFrom(
|
||||
bool FeedbackMetadata::SpecDiffersFrom(
|
||||
const FeedbackVectorSpec* other_spec) const {
|
||||
if (other_spec->slots() != slot_count()) {
|
||||
return true;
|
||||
@@ -129,7 +122,7 @@ bool TypeFeedbackMetadata::SpecDiffersFrom(
|
||||
for (int i = 0; i < slots;) {
|
||||
FeedbackVectorSlot slot(i);
|
||||
FeedbackVectorSlotKind kind = GetKind(slot);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
|
||||
if (kind != other_spec->GetKind(i)) {
|
||||
return true;
|
||||
@@ -147,8 +140,8 @@ bool TypeFeedbackMetadata::SpecDiffersFrom(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TypeFeedbackMetadata::DiffersFrom(
|
||||
const TypeFeedbackMetadata* other_metadata) const {
|
||||
bool FeedbackMetadata::DiffersFrom(
|
||||
const FeedbackMetadata* other_metadata) const {
|
||||
if (other_metadata->slot_count() != slot_count()) {
|
||||
return true;
|
||||
}
|
||||
@@ -158,7 +151,7 @@ bool TypeFeedbackMetadata::DiffersFrom(
|
||||
for (int i = 0; i < slots;) {
|
||||
FeedbackVectorSlot slot(i);
|
||||
FeedbackVectorSlotKind kind = GetKind(slot);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
if (GetKind(slot) != other_metadata->GetKind(slot)) {
|
||||
return true;
|
||||
}
|
||||
@@ -174,7 +167,7 @@ bool TypeFeedbackMetadata::DiffersFrom(
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
|
||||
const char* FeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
|
||||
switch (kind) {
|
||||
case FeedbackVectorSlotKind::INVALID:
|
||||
return "INVALID";
|
||||
@@ -207,41 +200,39 @@ const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
|
||||
return "?";
|
||||
}
|
||||
|
||||
FeedbackVectorSlotKind TypeFeedbackVector::GetKind(
|
||||
FeedbackVectorSlot slot) const {
|
||||
FeedbackVectorSlotKind FeedbackVector::GetKind(FeedbackVectorSlot slot) const {
|
||||
DCHECK(!is_empty());
|
||||
return metadata()->GetKind(slot);
|
||||
}
|
||||
|
||||
int TypeFeedbackVector::GetParameter(FeedbackVectorSlot slot) const {
|
||||
int FeedbackVector::GetParameter(FeedbackVectorSlot slot) const {
|
||||
DCHECK(!is_empty());
|
||||
DCHECK(
|
||||
TypeFeedbackMetadata::SlotRequiresParameter(metadata()->GetKind(slot)));
|
||||
FeedbackMetadata::SlotRequiresParameter(metadata()->GetKind(slot)));
|
||||
return FixedArray::cast(Get(slot))->length();
|
||||
}
|
||||
|
||||
// static
|
||||
Handle<TypeFeedbackVector> TypeFeedbackVector::New(
|
||||
Isolate* isolate, Handle<TypeFeedbackMetadata> metadata) {
|
||||
Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate,
|
||||
Handle<FeedbackMetadata> metadata) {
|
||||
Factory* factory = isolate->factory();
|
||||
|
||||
const int slot_count = metadata->slot_count();
|
||||
const int length = slot_count + kReservedIndexCount;
|
||||
if (length == kReservedIndexCount) {
|
||||
return Handle<TypeFeedbackVector>::cast(
|
||||
factory->empty_type_feedback_vector());
|
||||
return Handle<FeedbackVector>::cast(factory->empty_feedback_vector());
|
||||
}
|
||||
|
||||
Handle<FixedArray> array = factory->NewFixedArray(length, TENURED);
|
||||
array->set_map_no_write_barrier(isolate->heap()->type_feedback_vector_map());
|
||||
array->set_map_no_write_barrier(isolate->heap()->feedback_vector_map());
|
||||
array->set(kMetadataIndex, *metadata);
|
||||
array->set(kInvocationCountIndex, Smi::kZero);
|
||||
int parameter_index = 0;
|
||||
for (int i = 0; i < slot_count;) {
|
||||
FeedbackVectorSlot slot(i);
|
||||
FeedbackVectorSlotKind kind = metadata->GetKind(slot);
|
||||
int index = TypeFeedbackVector::GetIndex(slot);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int index = FeedbackVector::GetIndex(slot);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
|
||||
if (kind == FeedbackVectorSlotKind::CREATE_CLOSURE) {
|
||||
// This fixed array is filled with undefined.
|
||||
@@ -268,8 +259,8 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
|
||||
for (int i = 0; i < slot_count;) {
|
||||
FeedbackVectorSlot slot(i);
|
||||
FeedbackVectorSlotKind kind = metadata->GetKind(slot);
|
||||
int index = TypeFeedbackVector::GetIndex(slot);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int index = FeedbackVector::GetIndex(slot);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
|
||||
Object* value;
|
||||
if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) {
|
||||
@@ -291,22 +282,22 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
|
||||
}
|
||||
i += entry_size;
|
||||
}
|
||||
return Handle<TypeFeedbackVector>::cast(array);
|
||||
return Handle<FeedbackVector>::cast(array);
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
int TypeFeedbackVector::GetIndexFromSpec(const FeedbackVectorSpec* spec,
|
||||
FeedbackVectorSlot slot) {
|
||||
int FeedbackVector::GetIndexFromSpec(const FeedbackVectorSpec* spec,
|
||||
FeedbackVectorSlot slot) {
|
||||
return kReservedIndexCount + slot.ToInt();
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
Handle<TypeFeedbackVector> TypeFeedbackVector::Copy(
|
||||
Isolate* isolate, Handle<TypeFeedbackVector> vector) {
|
||||
Handle<TypeFeedbackVector> result;
|
||||
result = Handle<TypeFeedbackVector>::cast(
|
||||
Handle<FeedbackVector> FeedbackVector::Copy(Isolate* isolate,
|
||||
Handle<FeedbackVector> vector) {
|
||||
Handle<FeedbackVector> result;
|
||||
result = Handle<FeedbackVector>::cast(
|
||||
isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector)));
|
||||
return result;
|
||||
}
|
||||
@@ -319,17 +310,17 @@ static bool ClearLogic(Isolate* isolate) {
|
||||
}
|
||||
|
||||
|
||||
void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
|
||||
bool force_clear) {
|
||||
void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
|
||||
bool force_clear) {
|
||||
Isolate* isolate = GetIsolate();
|
||||
if (!force_clear && !ClearLogic(isolate)) return;
|
||||
|
||||
if (this == isolate->heap()->empty_type_feedback_vector()) return;
|
||||
if (this == isolate->heap()->empty_feedback_vector()) return;
|
||||
|
||||
Object* uninitialized_sentinel =
|
||||
TypeFeedbackVector::RawUninitializedSentinel(isolate);
|
||||
FeedbackVector::RawUninitializedSentinel(isolate);
|
||||
|
||||
TypeFeedbackMetadataIterator iter(metadata());
|
||||
FeedbackMetadataIterator iter(metadata());
|
||||
while (iter.HasNext()) {
|
||||
FeedbackVectorSlot slot = iter.Next();
|
||||
FeedbackVectorSlotKind kind = iter.kind();
|
||||
@@ -411,7 +402,7 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
|
||||
|
||||
|
||||
// static
|
||||
Handle<TypeFeedbackVector> TypeFeedbackVector::DummyVector(Isolate* isolate) {
|
||||
Handle<FeedbackVector> FeedbackVector::DummyVector(Isolate* isolate) {
|
||||
return isolate->factory()->dummy_vector();
|
||||
}
|
||||
|
||||
@@ -428,7 +419,6 @@ Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) {
|
||||
return Handle<FixedArray>::cast(feedback);
|
||||
}
|
||||
|
||||
|
||||
Handle<FixedArray> FeedbackNexus::EnsureExtraArrayOfSize(int length) {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Handle<Object> feedback_extra = handle(GetFeedbackExtra(), isolate);
|
||||
@@ -453,38 +443,35 @@ void FeedbackNexus::InstallHandlers(Handle<FixedArray> array,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FeedbackNexus::ConfigureUninitialized() {
|
||||
SetFeedback(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedback(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
|
||||
void FeedbackNexus::ConfigurePremonomorphic() {
|
||||
SetFeedback(*TypeFeedbackVector::PremonomorphicSentinel(GetIsolate()),
|
||||
SetFeedback(*FeedbackVector::PremonomorphicSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
|
||||
void FeedbackNexus::ConfigureMegamorphic() {
|
||||
// Keyed ICs must use ConfigureMegamorphicKeyed.
|
||||
DCHECK_NE(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector()->GetKind(slot()));
|
||||
DCHECK_NE(FeedbackVectorSlotKind::KEYED_STORE_IC, vector()->GetKind(slot()));
|
||||
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
|
||||
SetFeedback(*FeedbackVector::MegamorphicSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
void KeyedLoadICNexus::ConfigureMegamorphicKeyed(IcCheckType property_type) {
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
|
||||
SetFeedback(*FeedbackVector::MegamorphicSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(Smi::FromInt(static_cast<int>(property_type)),
|
||||
SKIP_WRITE_BARRIER);
|
||||
@@ -492,7 +479,7 @@ void KeyedLoadICNexus::ConfigureMegamorphicKeyed(IcCheckType property_type) {
|
||||
|
||||
void KeyedStoreICNexus::ConfigureMegamorphicKeyed(IcCheckType property_type) {
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
|
||||
SetFeedback(*FeedbackVector::MegamorphicSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(Smi::FromInt(static_cast<int>(property_type)),
|
||||
SKIP_WRITE_BARRIER);
|
||||
@@ -502,11 +489,11 @@ InlineCacheState LoadICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
|
||||
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return UNINITIALIZED;
|
||||
} else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
return MEGAMORPHIC;
|
||||
} else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
return PREMONOMORPHIC;
|
||||
} else if (feedback->IsFixedArray()) {
|
||||
// Determine state purely by our structure, don't check if the maps are
|
||||
@@ -526,7 +513,7 @@ InlineCacheState LoadGlobalICNexus::StateFromFeedback() const {
|
||||
|
||||
Object* extra = GetFeedbackExtra();
|
||||
if (!WeakCell::cast(feedback)->cleared() ||
|
||||
extra != *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
extra != *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return MONOMORPHIC;
|
||||
}
|
||||
return UNINITIALIZED;
|
||||
@@ -536,11 +523,11 @@ InlineCacheState KeyedLoadICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
|
||||
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return UNINITIALIZED;
|
||||
} else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
return PREMONOMORPHIC;
|
||||
} else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
return MEGAMORPHIC;
|
||||
} else if (feedback->IsFixedArray()) {
|
||||
// Determine state purely by our structure, don't check if the maps are
|
||||
@@ -558,16 +545,15 @@ InlineCacheState KeyedLoadICNexus::StateFromFeedback() const {
|
||||
return UNINITIALIZED;
|
||||
}
|
||||
|
||||
|
||||
InlineCacheState StoreICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
|
||||
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return UNINITIALIZED;
|
||||
} else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
return MEGAMORPHIC;
|
||||
} else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
return PREMONOMORPHIC;
|
||||
} else if (feedback->IsFixedArray()) {
|
||||
// Determine state purely by our structure, don't check if the maps are
|
||||
@@ -581,16 +567,15 @@ InlineCacheState StoreICNexus::StateFromFeedback() const {
|
||||
return UNINITIALIZED;
|
||||
}
|
||||
|
||||
|
||||
InlineCacheState KeyedStoreICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
|
||||
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return UNINITIALIZED;
|
||||
} else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::PremonomorphicSentinel(isolate)) {
|
||||
return PREMONOMORPHIC;
|
||||
} else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
} else if (feedback == *FeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
return MEGAMORPHIC;
|
||||
} else if (feedback->IsFixedArray()) {
|
||||
// Determine state purely by our structure, don't check if the maps are
|
||||
@@ -608,25 +593,23 @@ InlineCacheState KeyedStoreICNexus::StateFromFeedback() const {
|
||||
return UNINITIALIZED;
|
||||
}
|
||||
|
||||
|
||||
InlineCacheState CallICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
DCHECK(GetFeedbackExtra() ==
|
||||
*TypeFeedbackVector::UninitializedSentinel(isolate) ||
|
||||
*FeedbackVector::UninitializedSentinel(isolate) ||
|
||||
GetFeedbackExtra()->IsSmi());
|
||||
|
||||
if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::MegamorphicSentinel(isolate)) {
|
||||
return GENERIC;
|
||||
} else if (feedback->IsAllocationSite() || feedback->IsWeakCell()) {
|
||||
return MONOMORPHIC;
|
||||
}
|
||||
|
||||
CHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate));
|
||||
CHECK(feedback == *FeedbackVector::UninitializedSentinel(isolate));
|
||||
return UNINITIALIZED;
|
||||
}
|
||||
|
||||
|
||||
int CallICNexus::ExtractCallCount() {
|
||||
Object* call_count = GetFeedbackExtra();
|
||||
CHECK(call_count->IsSmi());
|
||||
@@ -644,7 +627,7 @@ void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); }
|
||||
|
||||
void CallICNexus::ConfigureUninitialized() {
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedback(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(Smi::kZero, SKIP_WRITE_BARRIER);
|
||||
}
|
||||
@@ -659,16 +642,14 @@ void CallICNexus::ConfigureMonomorphicArray() {
|
||||
SetFeedbackExtra(Smi::FromInt(1), SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
|
||||
void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) {
|
||||
Handle<WeakCell> new_cell = GetIsolate()->factory()->NewWeakCell(function);
|
||||
SetFeedback(*new_cell);
|
||||
SetFeedbackExtra(Smi::FromInt(1), SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
|
||||
void CallICNexus::ConfigureMegamorphic() {
|
||||
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
|
||||
SetFeedback(*FeedbackVector::MegamorphicSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
Smi* count = Smi::cast(GetFeedbackExtra());
|
||||
int new_count = count->value() + 1;
|
||||
@@ -676,7 +657,7 @@ void CallICNexus::ConfigureMegamorphic() {
|
||||
}
|
||||
|
||||
void CallICNexus::ConfigureMegamorphic(int call_count) {
|
||||
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
|
||||
SetFeedback(*FeedbackVector::MegamorphicSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(Smi::FromInt(call_count), SKIP_WRITE_BARRIER);
|
||||
}
|
||||
@@ -691,14 +672,14 @@ void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
|
||||
void LoadGlobalICNexus::ConfigureUninitialized() {
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(isolate->heap()->empty_weak_cell(), SKIP_WRITE_BARRIER);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
void LoadGlobalICNexus::ConfigurePropertyCellMode(Handle<PropertyCell> cell) {
|
||||
Isolate* isolate = GetIsolate();
|
||||
SetFeedback(*isolate->factory()->NewWeakCell(cell));
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
@@ -750,7 +731,7 @@ void LoadICNexus::ConfigurePolymorphic(MapHandleList* maps,
|
||||
int receiver_count = maps->length();
|
||||
Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2);
|
||||
InstallHandlers(array, maps, handlers);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
@@ -762,7 +743,7 @@ void KeyedLoadICNexus::ConfigurePolymorphic(Handle<Name> name,
|
||||
Handle<FixedArray> array;
|
||||
if (name.is_null()) {
|
||||
array = EnsureArrayOfSize(receiver_count * 2);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
} else {
|
||||
array = EnsureExtraArrayOfSize(receiver_count * 2);
|
||||
@@ -778,7 +759,7 @@ void StoreICNexus::ConfigurePolymorphic(MapHandleList* maps,
|
||||
int receiver_count = maps->length();
|
||||
Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2);
|
||||
InstallHandlers(array, maps, handlers);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(isolate),
|
||||
SKIP_WRITE_BARRIER);
|
||||
}
|
||||
|
||||
@@ -790,7 +771,7 @@ void KeyedStoreICNexus::ConfigurePolymorphic(Handle<Name> name,
|
||||
Handle<FixedArray> array;
|
||||
if (name.is_null()) {
|
||||
array = EnsureArrayOfSize(receiver_count * 2);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
} else {
|
||||
array = EnsureExtraArrayOfSize(receiver_count * 2);
|
||||
@@ -806,7 +787,7 @@ void KeyedStoreICNexus::ConfigurePolymorphic(MapHandleList* maps,
|
||||
int receiver_count = maps->length();
|
||||
DCHECK(receiver_count > 1);
|
||||
Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 3);
|
||||
SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SetFeedbackExtra(*FeedbackVector::UninitializedSentinel(GetIsolate()),
|
||||
SKIP_WRITE_BARRIER);
|
||||
|
||||
Handle<Oddball> undefined_value = GetIsolate()->factory()->undefined_value();
|
||||
@@ -948,7 +929,6 @@ bool FeedbackNexus::FindHandlers(List<Handle<Object>>* code_list,
|
||||
return count == length;
|
||||
}
|
||||
|
||||
|
||||
void LoadICNexus::Clear(Code* host) { LoadIC::Clear(GetIsolate(), host, this); }
|
||||
|
||||
void LoadGlobalICNexus::Clear(Code* host) {
|
||||
@@ -959,7 +939,6 @@ void KeyedLoadICNexus::Clear(Code* host) {
|
||||
KeyedLoadIC::Clear(GetIsolate(), host, this);
|
||||
}
|
||||
|
||||
|
||||
Name* KeyedLoadICNexus::FindFirstName() const {
|
||||
Object* feedback = GetFeedback();
|
||||
if (IsPropertyNameFeedback(feedback)) {
|
||||
@@ -968,7 +947,6 @@ Name* KeyedLoadICNexus::FindFirstName() const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Name* KeyedStoreICNexus::FindFirstName() const {
|
||||
Object* feedback = GetFeedback();
|
||||
if (IsPropertyNameFeedback(feedback)) {
|
||||
@@ -977,17 +955,14 @@ Name* KeyedStoreICNexus::FindFirstName() const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void StoreICNexus::Clear(Code* host) {
|
||||
StoreIC::Clear(GetIsolate(), host, this);
|
||||
}
|
||||
|
||||
|
||||
void KeyedStoreICNexus::Clear(Code* host) {
|
||||
KeyedStoreIC::Clear(GetIsolate(), host, this);
|
||||
}
|
||||
|
||||
|
||||
KeyedAccessStoreMode KeyedStoreICNexus::GetKeyedAccessStoreMode() const {
|
||||
KeyedAccessStoreMode mode = STANDARD_STORE;
|
||||
MapHandleList maps;
|
||||
@@ -1025,7 +1000,7 @@ KeyedAccessStoreMode KeyedStoreICNexus::GetKeyedAccessStoreMode() const {
|
||||
|
||||
IcCheckType KeyedLoadICNexus::GetKeyType() const {
|
||||
Object* feedback = GetFeedback();
|
||||
if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) {
|
||||
if (feedback == *FeedbackVector::MegamorphicSentinel(GetIsolate())) {
|
||||
return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value());
|
||||
}
|
||||
return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
|
||||
@@ -1033,7 +1008,7 @@ IcCheckType KeyedLoadICNexus::GetKeyType() const {
|
||||
|
||||
IcCheckType KeyedStoreICNexus::GetKeyType() const {
|
||||
Object* feedback = GetFeedback();
|
||||
if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) {
|
||||
if (feedback == *FeedbackVector::MegamorphicSentinel(GetIsolate())) {
|
||||
return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value());
|
||||
}
|
||||
return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
|
||||
@@ -1075,7 +1050,7 @@ InlineCacheState StoreDataPropertyInLiteralICNexus::StateFromFeedback() const {
|
||||
Isolate* isolate = GetIsolate();
|
||||
Object* feedback = GetFeedback();
|
||||
|
||||
if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
|
||||
if (feedback == *FeedbackVector::UninitializedSentinel(isolate)) {
|
||||
return UNINITIALIZED;
|
||||
} else if (feedback->IsWeakCell()) {
|
||||
// Don't check if the map is cleared.
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_TYPE_FEEDBACK_VECTOR_H_
|
||||
#define V8_TYPE_FEEDBACK_VECTOR_H_
|
||||
#ifndef V8_FEEDBACK_VECTOR_H_
|
||||
#define V8_FEEDBACK_VECTOR_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -42,7 +42,6 @@ enum class FeedbackVectorSlotKind {
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind);
|
||||
|
||||
|
||||
template <typename Derived>
|
||||
class FeedbackVectorSpecBase {
|
||||
public:
|
||||
@@ -104,7 +103,6 @@ class FeedbackVectorSpecBase {
|
||||
Derived* This() { return static_cast<Derived*>(this); }
|
||||
};
|
||||
|
||||
|
||||
class StaticFeedbackVectorSpec
|
||||
: public FeedbackVectorSpecBase<StaticFeedbackVectorSpec> {
|
||||
public:
|
||||
@@ -145,7 +143,6 @@ class StaticFeedbackVectorSpec
|
||||
int parameters_[kMaxLength];
|
||||
};
|
||||
|
||||
|
||||
class FeedbackVectorSpec : public FeedbackVectorSpecBase<FeedbackVectorSpec> {
|
||||
public:
|
||||
explicit FeedbackVectorSpec(Zone* zone)
|
||||
@@ -177,17 +174,16 @@ class FeedbackVectorSpec : public FeedbackVectorSpecBase<FeedbackVectorSpec> {
|
||||
ZoneVector<int> parameters_;
|
||||
};
|
||||
|
||||
|
||||
// The shape of the TypeFeedbackMetadata is an array with:
|
||||
// The shape of the FeedbackMetadata is an array with:
|
||||
// 0: slot_count
|
||||
// 1: names table
|
||||
// 2: parameters table
|
||||
// 3..N: slot kinds packed into a bit vector
|
||||
//
|
||||
class TypeFeedbackMetadata : public FixedArray {
|
||||
class FeedbackMetadata : public FixedArray {
|
||||
public:
|
||||
// Casting.
|
||||
static inline TypeFeedbackMetadata* cast(Object* obj);
|
||||
static inline FeedbackMetadata* cast(Object* obj);
|
||||
|
||||
static const int kSlotsCountIndex = 0;
|
||||
static const int kParametersTableIndex = 1;
|
||||
@@ -201,7 +197,7 @@ class TypeFeedbackMetadata : public FixedArray {
|
||||
|
||||
bool SpecDiffersFrom(const FeedbackVectorSpec* other_spec) const;
|
||||
|
||||
bool DiffersFrom(const TypeFeedbackMetadata* other_metadata) const;
|
||||
bool DiffersFrom(const FeedbackMetadata* other_metadata) const;
|
||||
|
||||
inline bool is_empty() const;
|
||||
|
||||
@@ -215,14 +211,14 @@ class TypeFeedbackMetadata : public FixedArray {
|
||||
int GetParameter(int parameter_index) const;
|
||||
|
||||
template <typename Spec>
|
||||
static Handle<TypeFeedbackMetadata> New(Isolate* isolate, const Spec* spec);
|
||||
static Handle<FeedbackMetadata> New(Isolate* isolate, const Spec* spec);
|
||||
|
||||
#ifdef OBJECT_PRINT
|
||||
// For gdb debugging.
|
||||
void Print();
|
||||
#endif // OBJECT_PRINT
|
||||
|
||||
DECLARE_PRINTER(TypeFeedbackMetadata)
|
||||
DECLARE_PRINTER(FeedbackMetadata)
|
||||
|
||||
static const char* Kind2String(FeedbackVectorSlotKind kind);
|
||||
|
||||
@@ -234,23 +230,23 @@ class TypeFeedbackMetadata : public FixedArray {
|
||||
void SetKind(FeedbackVectorSlot slot, FeedbackVectorSlotKind kind);
|
||||
|
||||
typedef BitSetComputer<FeedbackVectorSlotKind, kFeedbackVectorSlotKindBits,
|
||||
kSmiValueSize, uint32_t> VectorICComputer;
|
||||
kSmiValueSize, uint32_t>
|
||||
VectorICComputer;
|
||||
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackMetadata);
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackMetadata);
|
||||
};
|
||||
|
||||
|
||||
// The shape of the TypeFeedbackVector is an array with:
|
||||
// The shape of the FeedbackVector is an array with:
|
||||
// 0: feedback metadata
|
||||
// 1: invocation count
|
||||
// 2: feedback slot #0
|
||||
// ...
|
||||
// 2 + slot_count - 1: feedback slot #(slot_count-1)
|
||||
//
|
||||
class TypeFeedbackVector : public FixedArray {
|
||||
class FeedbackVector : public FixedArray {
|
||||
public:
|
||||
// Casting.
|
||||
static inline TypeFeedbackVector* cast(Object* obj);
|
||||
static inline FeedbackVector* cast(Object* obj);
|
||||
|
||||
static const int kMetadataIndex = 0;
|
||||
static const int kInvocationCountIndex = 1;
|
||||
@@ -264,7 +260,7 @@ class TypeFeedbackVector : public FixedArray {
|
||||
// Returns number of slots in the vector.
|
||||
inline int slot_count() const;
|
||||
|
||||
inline TypeFeedbackMetadata* metadata() const;
|
||||
inline FeedbackMetadata* metadata() const;
|
||||
inline int invocation_count() const;
|
||||
|
||||
// Conversion from a slot to an integer index to the underlying array.
|
||||
@@ -285,18 +281,18 @@ class TypeFeedbackVector : public FixedArray {
|
||||
// Returns parameter corresponding to given slot or -1.
|
||||
int GetParameter(FeedbackVectorSlot slot) const;
|
||||
|
||||
static Handle<TypeFeedbackVector> New(Isolate* isolate,
|
||||
Handle<TypeFeedbackMetadata> metadata);
|
||||
static Handle<FeedbackVector> New(Isolate* isolate,
|
||||
Handle<FeedbackMetadata> metadata);
|
||||
|
||||
static Handle<TypeFeedbackVector> Copy(Isolate* isolate,
|
||||
Handle<TypeFeedbackVector> vector);
|
||||
static Handle<FeedbackVector> Copy(Isolate* isolate,
|
||||
Handle<FeedbackVector> vector);
|
||||
|
||||
#ifdef OBJECT_PRINT
|
||||
// For gdb debugging.
|
||||
void Print();
|
||||
#endif // OBJECT_PRINT
|
||||
|
||||
DECLARE_PRINTER(TypeFeedbackVector)
|
||||
DECLARE_PRINTER(FeedbackVector)
|
||||
|
||||
// Clears the vector slots.
|
||||
void ClearSlots(SharedFunctionInfo* shared) { ClearSlotsImpl(shared, true); }
|
||||
@@ -323,15 +319,14 @@ class TypeFeedbackVector : public FixedArray {
|
||||
static const int kDummyStoreICSlot = 4;
|
||||
static const int kDummyKeyedStoreICSlot = 6;
|
||||
|
||||
static Handle<TypeFeedbackVector> DummyVector(Isolate* isolate);
|
||||
static Handle<FeedbackVector> DummyVector(Isolate* isolate);
|
||||
|
||||
private:
|
||||
void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear);
|
||||
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector);
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackVector);
|
||||
};
|
||||
|
||||
|
||||
// The following asserts protect an optimization in type feedback vector
|
||||
// code that looks into the contents of a slot assuming to find a String,
|
||||
// a Symbol, an AllocationSite, a WeakCell, or a FixedArray.
|
||||
@@ -346,15 +341,14 @@ STATIC_ASSERT(Name::kEmptyHashField == 0x3);
|
||||
// Verify that a set hash field will not look like a tagged object.
|
||||
STATIC_ASSERT(Name::kHashNotComputedMask == kHeapObjectTag);
|
||||
|
||||
|
||||
class TypeFeedbackMetadataIterator {
|
||||
class FeedbackMetadataIterator {
|
||||
public:
|
||||
explicit TypeFeedbackMetadataIterator(Handle<TypeFeedbackMetadata> metadata)
|
||||
explicit FeedbackMetadataIterator(Handle<FeedbackMetadata> metadata)
|
||||
: metadata_handle_(metadata),
|
||||
next_slot_(FeedbackVectorSlot(0)),
|
||||
slot_kind_(FeedbackVectorSlotKind::INVALID) {}
|
||||
|
||||
explicit TypeFeedbackMetadataIterator(TypeFeedbackMetadata* metadata)
|
||||
explicit FeedbackMetadataIterator(FeedbackMetadata* metadata)
|
||||
: metadata_(metadata),
|
||||
next_slot_(FeedbackVectorSlot(0)),
|
||||
slot_kind_(FeedbackVectorSlotKind::INVALID) {}
|
||||
@@ -374,36 +368,35 @@ class TypeFeedbackMetadataIterator {
|
||||
inline int entry_size() const;
|
||||
|
||||
private:
|
||||
TypeFeedbackMetadata* metadata() const {
|
||||
FeedbackMetadata* metadata() const {
|
||||
return !metadata_handle_.is_null() ? *metadata_handle_ : metadata_;
|
||||
}
|
||||
|
||||
// The reason for having a handle and a raw pointer to the meta data is
|
||||
// to have a single iterator implementation for both "handlified" and raw
|
||||
// pointer use cases.
|
||||
Handle<TypeFeedbackMetadata> metadata_handle_;
|
||||
TypeFeedbackMetadata* metadata_;
|
||||
Handle<FeedbackMetadata> metadata_handle_;
|
||||
FeedbackMetadata* metadata_;
|
||||
FeedbackVectorSlot cur_slot_;
|
||||
FeedbackVectorSlot next_slot_;
|
||||
FeedbackVectorSlotKind slot_kind_;
|
||||
};
|
||||
|
||||
|
||||
// A FeedbackNexus is the combination of a TypeFeedbackVector and a slot.
|
||||
// A FeedbackNexus is the combination of a FeedbackVector and a slot.
|
||||
// Derived classes customize the update and retrieval of feedback.
|
||||
class FeedbackNexus {
|
||||
public:
|
||||
FeedbackNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
FeedbackNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: vector_handle_(vector), vector_(NULL), slot_(slot) {}
|
||||
FeedbackNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
FeedbackNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: vector_(vector), slot_(slot) {}
|
||||
virtual ~FeedbackNexus() {}
|
||||
|
||||
Handle<TypeFeedbackVector> vector_handle() const {
|
||||
Handle<FeedbackVector> vector_handle() const {
|
||||
DCHECK(vector_ == NULL);
|
||||
return vector_handle_;
|
||||
}
|
||||
TypeFeedbackVector* vector() const {
|
||||
FeedbackVector* vector() const {
|
||||
return vector_handle_.is_null() ? vector_ : *vector_handle_;
|
||||
}
|
||||
FeedbackVectorSlot slot() const { return slot_; }
|
||||
@@ -452,19 +445,18 @@ class FeedbackNexus {
|
||||
// should use handles during IC miss, but not during GC when we clear ICs. If
|
||||
// you have a handle to the vector that is better because more operations can
|
||||
// be done, like allocation.
|
||||
Handle<TypeFeedbackVector> vector_handle_;
|
||||
TypeFeedbackVector* vector_;
|
||||
Handle<FeedbackVector> vector_handle_;
|
||||
FeedbackVector* vector_;
|
||||
FeedbackVectorSlot slot_;
|
||||
};
|
||||
|
||||
|
||||
class CallICNexus final : public FeedbackNexus {
|
||||
public:
|
||||
CallICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
CallICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::CALL_IC, vector->GetKind(slot));
|
||||
}
|
||||
CallICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
CallICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::CALL_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -498,18 +490,17 @@ class CallICNexus final : public FeedbackNexus {
|
||||
float ComputeCallFrequency();
|
||||
};
|
||||
|
||||
|
||||
class LoadICNexus : public FeedbackNexus {
|
||||
public:
|
||||
LoadICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
LoadICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::LOAD_IC, vector->GetKind(slot));
|
||||
}
|
||||
explicit LoadICNexus(Isolate* isolate)
|
||||
: FeedbackNexus(
|
||||
TypeFeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot)) {}
|
||||
LoadICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
FeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyLoadICSlot)) {}
|
||||
LoadICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::LOAD_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -526,11 +517,11 @@ class LoadICNexus : public FeedbackNexus {
|
||||
|
||||
class LoadGlobalICNexus : public FeedbackNexus {
|
||||
public:
|
||||
LoadGlobalICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
LoadGlobalICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC, vector->GetKind(slot));
|
||||
}
|
||||
LoadGlobalICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
LoadGlobalICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -559,15 +550,15 @@ class LoadGlobalICNexus : public FeedbackNexus {
|
||||
|
||||
class KeyedLoadICNexus : public FeedbackNexus {
|
||||
public:
|
||||
KeyedLoadICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
KeyedLoadICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector->GetKind(slot));
|
||||
}
|
||||
explicit KeyedLoadICNexus(Isolate* isolate)
|
||||
: FeedbackNexus(
|
||||
TypeFeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)) {}
|
||||
KeyedLoadICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
FeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyKeyedLoadICSlot)) {}
|
||||
KeyedLoadICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -588,18 +579,17 @@ class KeyedLoadICNexus : public FeedbackNexus {
|
||||
Name* FindFirstName() const override;
|
||||
};
|
||||
|
||||
|
||||
class StoreICNexus : public FeedbackNexus {
|
||||
public:
|
||||
StoreICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
StoreICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::STORE_IC, vector->GetKind(slot));
|
||||
}
|
||||
explicit StoreICNexus(Isolate* isolate)
|
||||
: FeedbackNexus(
|
||||
TypeFeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot)) {}
|
||||
StoreICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
FeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyStoreICSlot)) {}
|
||||
StoreICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::STORE_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -614,18 +604,17 @@ class StoreICNexus : public FeedbackNexus {
|
||||
InlineCacheState StateFromFeedback() const override;
|
||||
};
|
||||
|
||||
|
||||
class KeyedStoreICNexus : public FeedbackNexus {
|
||||
public:
|
||||
KeyedStoreICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
KeyedStoreICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, vector->GetKind(slot));
|
||||
}
|
||||
explicit KeyedStoreICNexus(Isolate* isolate)
|
||||
: FeedbackNexus(
|
||||
TypeFeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)) {}
|
||||
KeyedStoreICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
FeedbackVector::DummyVector(isolate),
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyKeyedStoreICSlot)) {}
|
||||
KeyedStoreICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, vector->GetKind(slot));
|
||||
}
|
||||
@@ -652,12 +641,12 @@ class KeyedStoreICNexus : public FeedbackNexus {
|
||||
|
||||
class BinaryOpICNexus final : public FeedbackNexus {
|
||||
public:
|
||||
BinaryOpICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
BinaryOpICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
|
||||
vector->GetKind(slot));
|
||||
}
|
||||
BinaryOpICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
BinaryOpICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
|
||||
vector->GetKind(slot));
|
||||
@@ -683,12 +672,12 @@ class BinaryOpICNexus final : public FeedbackNexus {
|
||||
|
||||
class CompareICNexus final : public FeedbackNexus {
|
||||
public:
|
||||
CompareICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
CompareICNexus(Handle<FeedbackVector> vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
|
||||
vector->GetKind(slot));
|
||||
}
|
||||
CompareICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
CompareICNexus(FeedbackVector* vector, FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
|
||||
vector->GetKind(slot));
|
||||
@@ -714,13 +703,13 @@ class CompareICNexus final : public FeedbackNexus {
|
||||
|
||||
class StoreDataPropertyInLiteralICNexus : public FeedbackNexus {
|
||||
public:
|
||||
StoreDataPropertyInLiteralICNexus(Handle<TypeFeedbackVector> vector,
|
||||
StoreDataPropertyInLiteralICNexus(Handle<FeedbackVector> vector,
|
||||
FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC,
|
||||
vector->GetKind(slot));
|
||||
}
|
||||
StoreDataPropertyInLiteralICNexus(TypeFeedbackVector* vector,
|
||||
StoreDataPropertyInLiteralICNexus(FeedbackVector* vector,
|
||||
FeedbackVectorSlot slot)
|
||||
: FeedbackNexus(vector, slot) {
|
||||
DCHECK_EQ(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC,
|
||||
@@ -740,4 +729,4 @@ inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback);
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // V8_TRANSITIONS_H_
|
||||
#endif // V8_FEEDBACK_VECTOR_H_
|
||||
+9
-9
@@ -134,13 +134,13 @@ void FullCodeGenerator::Generate() {
|
||||
Comment cmnt(masm_, "[ Increment invocation count");
|
||||
__ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset));
|
||||
__ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ ldr(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ ldr(r9, FieldMemOperand(r2, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ add(r9, r9, Operand(Smi::FromInt(1)));
|
||||
__ str(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
__ str(r9, FieldMemOperand(
|
||||
r2, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
}
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
@@ -846,7 +846,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ mov(r1, Operand(pairs));
|
||||
__ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
|
||||
__ EmitLoadTypeFeedbackVector(r2);
|
||||
__ EmitLoadFeedbackVector(r2);
|
||||
__ Push(r1, r0, r2);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1069,8 +1069,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(r3);
|
||||
__ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(r3);
|
||||
__ mov(r2, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ str(r2, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)));
|
||||
|
||||
// r0 contains the key. The receiver in r1 is the second argument to the
|
||||
@@ -1924,7 +1924,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(r2);
|
||||
__ EmitLoadFeedbackVector(r2);
|
||||
__ mov(r3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+9
-9
@@ -138,13 +138,13 @@ void FullCodeGenerator::Generate() {
|
||||
Comment cmnt(masm_, "[ Increment invocation count");
|
||||
__ Ldr(x11, FieldMemOperand(x1, JSFunction::kLiteralsOffset));
|
||||
__ Ldr(x11, FieldMemOperand(x11, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ Ldr(x10, FieldMemOperand(x11, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ Ldr(x10, FieldMemOperand(x11, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Add(x10, x10, Operand(Smi::FromInt(1)));
|
||||
__ Str(x10, FieldMemOperand(x11, TypeFeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
__ Str(x10, FieldMemOperand(
|
||||
x11, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
}
|
||||
|
||||
// Reserve space on the stack for locals.
|
||||
@@ -845,7 +845,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
flags = x10;
|
||||
__ Mov(flags, Smi::FromInt(DeclareGlobalsFlags()));
|
||||
}
|
||||
__ EmitLoadTypeFeedbackVector(x12);
|
||||
__ EmitLoadFeedbackVector(x12);
|
||||
__ Push(x11, flags, x12);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1058,8 +1058,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(x3);
|
||||
__ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(x3);
|
||||
__ Mov(x10, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ Str(x10, FieldMemOperand(x3, FixedArray::OffsetOfElementAt(vector_index)));
|
||||
|
||||
// x0 contains the key. The receiver in x1 is the second argument to the
|
||||
@@ -1876,7 +1876,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ Peek(x1, arg_count * kXRegSize);
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(x2);
|
||||
__ EmitLoadFeedbackVector(x2);
|
||||
__ Mov(x3, SmiFromSlot(expr->CallNewFeedbackSlot()));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+2
-3
@@ -1029,13 +1029,12 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
|
||||
scope()->is_function_scope()) {
|
||||
Callable callable = CodeFactory::FastNewClosure(isolate());
|
||||
__ Move(callable.descriptor().GetRegisterParameter(0), info);
|
||||
__ EmitLoadTypeFeedbackVector(
|
||||
callable.descriptor().GetRegisterParameter(1));
|
||||
__ EmitLoadFeedbackVector(callable.descriptor().GetRegisterParameter(1));
|
||||
__ Move(callable.descriptor().GetRegisterParameter(2), SmiFromSlot(slot));
|
||||
__ Call(callable.code(), RelocInfo::CODE_TARGET);
|
||||
} else {
|
||||
__ Push(info);
|
||||
__ EmitLoadTypeFeedbackVector(result_register());
|
||||
__ EmitLoadFeedbackVector(result_register());
|
||||
__ Push(result_register());
|
||||
__ Push(SmiFromSlot(slot));
|
||||
__ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured
|
||||
|
||||
+1
-1
@@ -344,7 +344,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
|
||||
// Returns a smi for the index into the FixedArray that backs the feedback
|
||||
// vector
|
||||
Smi* SmiFromSlot(FeedbackVectorSlot slot) const {
|
||||
return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec(
|
||||
return Smi::FromInt(FeedbackVector::GetIndexFromSpec(
|
||||
literal()->feedback_vector_spec(), slot));
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -124,8 +124,8 @@ void FullCodeGenerator::Generate() {
|
||||
__ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset));
|
||||
__ mov(ecx, FieldOperand(ecx, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ add(FieldOperand(
|
||||
ecx, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
ecx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ Push(pairs);
|
||||
__ Push(Smi::FromInt(DeclareGlobalsFlags()));
|
||||
__ EmitLoadTypeFeedbackVector(eax);
|
||||
__ EmitLoadFeedbackVector(eax);
|
||||
__ Push(eax);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1002,9 +1002,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(edx);
|
||||
__ EmitLoadFeedbackVector(edx);
|
||||
__ mov(FieldOperand(edx, FixedArray::OffsetOfElementAt(vector_index)),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
|
||||
// eax contains the key. The receiver in ebx is the second argument to the
|
||||
// ForInFilter. ForInFilter returns undefined if the receiver doesn't
|
||||
@@ -1848,7 +1848,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ mov(edi, Operand(esp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(ebx);
|
||||
__ EmitLoadFeedbackVector(ebx);
|
||||
__ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+8
-8
@@ -144,12 +144,12 @@ void FullCodeGenerator::Generate() {
|
||||
__ lw(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset));
|
||||
__ lw(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ lw(t0, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Addu(t0, t0, Operand(Smi::FromInt(1)));
|
||||
__ sw(t0, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
}
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
@@ -845,7 +845,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ li(a1, Operand(pairs));
|
||||
__ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
__ Push(a1, a0, a2);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1067,8 +1067,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(a3);
|
||||
__ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(a3);
|
||||
__ li(a2, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ sw(a2, FieldMemOperand(a3, FixedArray::OffsetOfElementAt(vector_index)));
|
||||
|
||||
__ mov(a0, result_register());
|
||||
@@ -1946,7 +1946,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ lw(a1, MemOperand(sp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
__ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+8
-8
@@ -143,12 +143,12 @@ void FullCodeGenerator::Generate() {
|
||||
__ ld(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset));
|
||||
__ ld(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ ld(a4, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ Daddu(a4, a4, Operand(Smi::FromInt(1)));
|
||||
__ sd(a4, FieldMemOperand(
|
||||
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
a0, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
}
|
||||
|
||||
{ Comment cmnt(masm_, "[ Allocate locals");
|
||||
@@ -845,7 +845,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ li(a1, Operand(pairs));
|
||||
__ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
__ Push(a1, a0, a2);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1069,8 +1069,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(a3);
|
||||
__ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(a3);
|
||||
__ li(a2, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ sd(a2, FieldMemOperand(a3, FixedArray::OffsetOfElementAt(vector_index)));
|
||||
|
||||
__ mov(a0, result_register());
|
||||
@@ -1947,7 +1947,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ ld(a1, MemOperand(sp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
__ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+9
-10
@@ -139,14 +139,13 @@ void FullCodeGenerator::Generate() {
|
||||
Comment cmnt(masm_, "[ Increment invocation count");
|
||||
__ LoadP(r7, FieldMemOperand(r4, JSFunction::kLiteralsOffset));
|
||||
__ LoadP(r7, FieldMemOperand(r7, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ LoadP(r8, FieldMemOperand(r7, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ AddSmiLiteral(r8, r8, Smi::FromInt(1), r0);
|
||||
__ StoreP(r8,
|
||||
FieldMemOperand(
|
||||
r7, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
__ StoreP(r8, FieldMemOperand(
|
||||
r7, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
r0);
|
||||
}
|
||||
|
||||
@@ -810,7 +809,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ mov(r4, Operand(pairs));
|
||||
__ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags()));
|
||||
__ EmitLoadTypeFeedbackVector(r5);
|
||||
__ EmitLoadFeedbackVector(r5);
|
||||
__ Push(r4, r3, r5);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1036,8 +1035,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(r3);
|
||||
__ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(r3);
|
||||
__ mov(r5, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ StoreP(
|
||||
r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0);
|
||||
|
||||
@@ -1937,7 +1936,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0);
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(r5);
|
||||
__ EmitLoadFeedbackVector(r5);
|
||||
__ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot()));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+9
-10
@@ -139,14 +139,13 @@ void FullCodeGenerator::Generate() {
|
||||
Comment cmnt(masm_, "[ Increment invocation count");
|
||||
__ LoadP(r6, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
|
||||
__ LoadP(r6, FieldMemOperand(r6, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ LoadP(r1, FieldMemOperand(r6, TypeFeedbackVector::kInvocationCountIndex *
|
||||
__ LoadP(r1, FieldMemOperand(r6, FeedbackVector::kInvocationCountIndex *
|
||||
kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
FeedbackVector::kHeaderSize));
|
||||
__ AddSmiLiteral(r1, r1, Smi::FromInt(1), r0);
|
||||
__ StoreP(r1,
|
||||
FieldMemOperand(
|
||||
r6, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize));
|
||||
__ StoreP(r1, FieldMemOperand(
|
||||
r6, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -780,7 +779,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ mov(r3, Operand(pairs));
|
||||
__ LoadSmiLiteral(r2, Smi::FromInt(DeclareGlobalsFlags()));
|
||||
__ EmitLoadTypeFeedbackVector(r4);
|
||||
__ EmitLoadFeedbackVector(r4);
|
||||
__ Push(r3, r2, r4);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1003,8 +1002,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(r2);
|
||||
__ mov(r4, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ EmitLoadFeedbackVector(r2);
|
||||
__ mov(r4, Operand(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
__ StoreP(
|
||||
r4, FieldMemOperand(r2, FixedArray::OffsetOfElementAt(vector_index)), r0);
|
||||
|
||||
@@ -1900,7 +1899,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ LoadP(r3, MemOperand(sp, arg_count * kPointerSize), r0);
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(r4);
|
||||
__ EmitLoadFeedbackVector(r4);
|
||||
__ LoadSmiLiteral(r5, SmiFromSlot(expr->CallNewFeedbackSlot()));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+6
-7
@@ -124,9 +124,8 @@ void FullCodeGenerator::Generate() {
|
||||
__ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset));
|
||||
__ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ SmiAddConstant(
|
||||
FieldOperand(rcx,
|
||||
TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
FieldOperand(rcx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Smi::FromInt(1));
|
||||
}
|
||||
|
||||
@@ -807,7 +806,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ Push(pairs);
|
||||
__ Push(Smi::FromInt(DeclareGlobalsFlags()));
|
||||
__ EmitLoadTypeFeedbackVector(rax);
|
||||
__ EmitLoadFeedbackVector(rax);
|
||||
__ Push(rax);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -1029,9 +1028,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(rdx);
|
||||
__ EmitLoadFeedbackVector(rdx);
|
||||
__ Move(FieldOperand(rdx, FixedArray::OffsetOfElementAt(vector_index)),
|
||||
TypeFeedbackVector::MegamorphicSentinel(isolate()));
|
||||
FeedbackVector::MegamorphicSentinel(isolate()));
|
||||
|
||||
// rax contains the key. The receiver in rbx is the second argument to
|
||||
// ForInFilter. ForInFilter returns undefined if the receiver doesn't
|
||||
@@ -1835,7 +1834,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ movp(rdi, Operand(rsp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code, but not in the snapshot.
|
||||
__ EmitLoadTypeFeedbackVector(rbx);
|
||||
__ EmitLoadFeedbackVector(rbx);
|
||||
__ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot()));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
+6
-6
@@ -124,8 +124,8 @@ void FullCodeGenerator::Generate() {
|
||||
__ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset));
|
||||
__ mov(ecx, FieldOperand(ecx, LiteralsArray::kFeedbackVectorOffset));
|
||||
__ add(FieldOperand(
|
||||
ecx, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
TypeFeedbackVector::kHeaderSize),
|
||||
ecx, FeedbackVector::kInvocationCountIndex * kPointerSize +
|
||||
FeedbackVector::kHeaderSize),
|
||||
Immediate(Smi::FromInt(1)));
|
||||
}
|
||||
|
||||
@@ -784,7 +784,7 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
|
||||
// Call the runtime to declare the globals.
|
||||
__ Push(pairs);
|
||||
__ Push(Smi::FromInt(DeclareGlobalsFlags()));
|
||||
__ EmitLoadTypeFeedbackVector(eax);
|
||||
__ EmitLoadFeedbackVector(eax);
|
||||
__ Push(eax);
|
||||
__ CallRuntime(Runtime::kDeclareGlobals);
|
||||
// Return value is ignored.
|
||||
@@ -994,9 +994,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
|
||||
// We need to filter the key, record slow-path here.
|
||||
int const vector_index = SmiFromSlot(slot)->value();
|
||||
__ EmitLoadTypeFeedbackVector(edx);
|
||||
__ EmitLoadFeedbackVector(edx);
|
||||
__ mov(FieldOperand(edx, FixedArray::OffsetOfElementAt(vector_index)),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate())));
|
||||
|
||||
// eax contains the key. The receiver in ebx is the second argument to the
|
||||
// ForInFilter. ForInFilter returns undefined if the receiver doesn't
|
||||
@@ -1840,7 +1840,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
__ mov(edi, Operand(esp, arg_count * kPointerSize));
|
||||
|
||||
// Record call targets in unoptimized code.
|
||||
__ EmitLoadTypeFeedbackVector(ebx);
|
||||
__ EmitLoadFeedbackVector(ebx);
|
||||
__ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
|
||||
|
||||
CallConstructStub stub(isolate());
|
||||
|
||||
Vendored
+1
-1
@@ -469,7 +469,7 @@ class String;
|
||||
class Symbol;
|
||||
class Name;
|
||||
class Struct;
|
||||
class TypeFeedbackVector;
|
||||
class FeedbackVector;
|
||||
class Variable;
|
||||
class RelocInfo;
|
||||
class Deserializer;
|
||||
|
||||
Vendored
+1
-1
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "src/base/platform/platform.h"
|
||||
#include "src/counters-inl.h"
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "src/heap/heap.h"
|
||||
#include "src/heap/incremental-marking-inl.h"
|
||||
#include "src/heap/mark-compact.h"
|
||||
@@ -22,7 +23,6 @@
|
||||
#include "src/msan.h"
|
||||
#include "src/objects-inl.h"
|
||||
#include "src/objects/scope-info.h"
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
Vendored
+19
-19
@@ -17,6 +17,7 @@
|
||||
#include "src/conversions.h"
|
||||
#include "src/debug/debug.h"
|
||||
#include "src/deoptimizer.h"
|
||||
#include "src/feedback-vector.h"
|
||||
#include "src/global-handles.h"
|
||||
#include "src/heap/array-buffer-tracker-inl.h"
|
||||
#include "src/heap/code-stats.h"
|
||||
@@ -41,7 +42,6 @@
|
||||
#include "src/snapshot/serializer-common.h"
|
||||
#include "src/snapshot/snapshot.h"
|
||||
#include "src/tracing/trace-event.h"
|
||||
#include "src/type-feedback-vector.h"
|
||||
#include "src/utils.h"
|
||||
#include "src/v8.h"
|
||||
#include "src/v8threads.h"
|
||||
@@ -2269,7 +2269,7 @@ bool Heap::CreateInitialMaps() {
|
||||
|
||||
ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, scope_info)
|
||||
ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, module_info)
|
||||
ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, type_feedback_vector)
|
||||
ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, feedback_vector)
|
||||
ALLOCATE_PRIMITIVE_MAP(HEAP_NUMBER_TYPE, HeapNumber::kSize, heap_number,
|
||||
Context::NUMBER_FUNCTION_INDEX)
|
||||
ALLOCATE_MAP(MUTABLE_HEAP_NUMBER_TYPE, HeapNumber::kSize,
|
||||
@@ -2766,23 +2766,23 @@ void Heap::CreateInitialObjects() {
|
||||
{
|
||||
StaticFeedbackVectorSpec spec;
|
||||
FeedbackVectorSlot slot = spec.AddLoadICSlot();
|
||||
DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot));
|
||||
DCHECK_EQ(slot, FeedbackVectorSlot(FeedbackVector::kDummyLoadICSlot));
|
||||
|
||||
slot = spec.AddKeyedLoadICSlot();
|
||||
DCHECK_EQ(slot,
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot));
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyKeyedLoadICSlot));
|
||||
|
||||
slot = spec.AddStoreICSlot();
|
||||
DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot));
|
||||
DCHECK_EQ(slot, FeedbackVectorSlot(FeedbackVector::kDummyStoreICSlot));
|
||||
|
||||
slot = spec.AddKeyedStoreICSlot();
|
||||
DCHECK_EQ(slot,
|
||||
FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot));
|
||||
FeedbackVectorSlot(FeedbackVector::kDummyKeyedStoreICSlot));
|
||||
|
||||
Handle<TypeFeedbackMetadata> dummy_metadata =
|
||||
TypeFeedbackMetadata::New(isolate(), &spec);
|
||||
Handle<TypeFeedbackVector> dummy_vector =
|
||||
TypeFeedbackVector::New(isolate(), dummy_metadata);
|
||||
Handle<FeedbackMetadata> dummy_metadata =
|
||||
FeedbackMetadata::New(isolate(), &spec);
|
||||
Handle<FeedbackVector> dummy_vector =
|
||||
FeedbackVector::New(isolate(), dummy_metadata);
|
||||
|
||||
set_dummy_vector(*dummy_vector);
|
||||
|
||||
@@ -2794,27 +2794,27 @@ void Heap::CreateInitialObjects() {
|
||||
}
|
||||
|
||||
{
|
||||
// Create a canonical empty TypeFeedbackVector, which is shared by all
|
||||
// Create a canonical empty FeedbackVector, which is shared by all
|
||||
// functions that don't need actual type feedback slots. Note however
|
||||
// that all these functions will share the same invocation count, but
|
||||
// that shouldn't matter since we only use the invocation count to
|
||||
// relativize the absolute call counts, but we can only have call counts
|
||||
// if we have actual feedback slots.
|
||||
Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray(
|
||||
TypeFeedbackVector::kReservedIndexCount, TENURED);
|
||||
empty_type_feedback_vector->set(TypeFeedbackVector::kMetadataIndex,
|
||||
Handle<FixedArray> empty_feedback_vector = factory->NewFixedArray(
|
||||
FeedbackVector::kReservedIndexCount, TENURED);
|
||||
empty_feedback_vector->set(FeedbackVector::kMetadataIndex,
|
||||
empty_fixed_array());
|
||||
empty_type_feedback_vector->set(TypeFeedbackVector::kInvocationCountIndex,
|
||||
empty_feedback_vector->set(FeedbackVector::kInvocationCountIndex,
|
||||
Smi::kZero);
|
||||
empty_type_feedback_vector->set_map(type_feedback_vector_map());
|
||||
set_empty_type_feedback_vector(*empty_type_feedback_vector);
|
||||
empty_feedback_vector->set_map(feedback_vector_map());
|
||||
set_empty_feedback_vector(*empty_feedback_vector);
|
||||
|
||||
// We use a canonical empty LiteralsArray for all functions that neither
|
||||
// have literals nor need a TypeFeedbackVector (besides the invocation
|
||||
// have literals nor need a FeedbackVector (besides the invocation
|
||||
// count special slot).
|
||||
Handle<FixedArray> empty_literals_array =
|
||||
factory->NewFixedArray(1, TENURED);
|
||||
empty_literals_array->set(0, *empty_type_feedback_vector);
|
||||
empty_literals_array->set(0, *empty_feedback_vector);
|
||||
set_empty_literals_array(*empty_literals_array);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -59,7 +59,7 @@ using v8::MemoryPressureLevel;
|
||||
V(Map, heap_number_map, HeapNumberMap) \
|
||||
V(Map, transition_array_map, TransitionArrayMap) \
|
||||
V(FixedArray, empty_literals_array, EmptyLiteralsArray) \
|
||||
V(FixedArray, empty_type_feedback_vector, EmptyTypeFeedbackVector) \
|
||||
V(FixedArray, empty_feedback_vector, EmptyFeedbackVector) \
|
||||
V(FixedArray, empty_fixed_array, EmptyFixedArray) \
|
||||
V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
|
||||
/* Entries beyond the first 32 */ \
|
||||
@@ -95,7 +95,7 @@ using v8::MemoryPressureLevel;
|
||||
V(Map, external_map, ExternalMap) \
|
||||
V(Map, bytecode_array_map, BytecodeArrayMap) \
|
||||
V(Map, module_info_map, ModuleInfoMap) \
|
||||
V(Map, type_feedback_vector_map, TypeFeedbackVectorMap) \
|
||||
V(Map, feedback_vector_map, FeedbackVectorMap) \
|
||||
/* String maps */ \
|
||||
V(Map, native_source_string_map, NativeSourceStringMap) \
|
||||
V(Map, string_map, StringMap) \
|
||||
@@ -160,7 +160,7 @@ using v8::MemoryPressureLevel;
|
||||
V(FixedArray, empty_sloppy_arguments_elements, EmptySloppyArgumentsElements) \
|
||||
V(SeededNumberDictionary, empty_slow_element_dictionary, \
|
||||
EmptySlowElementDictionary) \
|
||||
V(TypeFeedbackVector, dummy_vector, DummyVector) \
|
||||
V(FeedbackVector, dummy_vector, DummyVector) \
|
||||
V(PropertyCell, empty_property_cell, EmptyPropertyCell) \
|
||||
V(WeakCell, empty_weak_cell, EmptyWeakCell) \
|
||||
/* Protectors */ \
|
||||
|
||||
Vendored
+5
-5
@@ -540,10 +540,10 @@ void ObjectStatsCollector::RecordSharedFunctionInfoDetails(
|
||||
SharedFunctionInfo* sfi) {
|
||||
FixedArray* scope_info = sfi->scope_info();
|
||||
RecordFixedArrayHelper(sfi, scope_info, SCOPE_INFO_SUB_TYPE, 0);
|
||||
TypeFeedbackMetadata* feedback_metadata = sfi->feedback_metadata();
|
||||
FeedbackMetadata* feedback_metadata = sfi->feedback_metadata();
|
||||
if (!feedback_metadata->is_empty()) {
|
||||
RecordFixedArrayHelper(sfi, feedback_metadata,
|
||||
TYPE_FEEDBACK_METADATA_SUB_TYPE, 0);
|
||||
RecordFixedArrayHelper(sfi, feedback_metadata, FEEDBACK_METADATA_SUB_TYPE,
|
||||
0);
|
||||
}
|
||||
|
||||
if (!sfi->OptimizedCodeMapIsCleared()) {
|
||||
@@ -568,7 +568,7 @@ void ObjectStatsCollector::RecordSharedFunctionInfoDetails(
|
||||
if (literals != nullptr) {
|
||||
RecordFixedArrayHelper(sfi, literals, LITERALS_ARRAY_SUB_TYPE, 0);
|
||||
RecordFixedArrayHelper(sfi, literals->feedback_vector(),
|
||||
TYPE_FEEDBACK_VECTOR_SUB_TYPE, 0);
|
||||
FEEDBACK_VECTOR_SUB_TYPE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ void ObjectStatsCollector::RecordJSFunctionDetails(JSFunction* function) {
|
||||
LiteralsArray* literals = function->literals();
|
||||
RecordFixedArrayHelper(function, literals, LITERALS_ARRAY_SUB_TYPE, 0);
|
||||
RecordFixedArrayHelper(function, literals->feedback_vector(),
|
||||
TYPE_FEEDBACK_VECTOR_SUB_TYPE, 0);
|
||||
FEEDBACK_VECTOR_SUB_TYPE, 0);
|
||||
}
|
||||
|
||||
void ObjectStatsCollector::RecordFixedArrayDetails(FixedArray* array) {
|
||||
|
||||
Vendored
+6
-7
@@ -1288,8 +1288,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if ecx is a WeakCell or a Symbol, but it's harmless to read
|
||||
// at this position in a symbol (see static asserts in
|
||||
// type-feedback-vector.h).
|
||||
// at this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
__ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset));
|
||||
__ j(equal, &done, Label::kFar);
|
||||
@@ -1328,7 +1327,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
__ bind(&megamorphic);
|
||||
__ mov(
|
||||
FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ jmp(&done, Label::kFar);
|
||||
|
||||
// An uninitialized cache is patched with the function or sentinel to
|
||||
@@ -1477,7 +1476,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ bind(&extra_checks_or_miss);
|
||||
Label uninitialized, miss, not_allocation_site;
|
||||
|
||||
__ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ cmp(ecx, Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ j(equal, &call);
|
||||
|
||||
// Check if we have an allocation site.
|
||||
@@ -1496,7 +1495,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ jmp(&miss);
|
||||
}
|
||||
|
||||
__ cmp(ecx, Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
|
||||
__ cmp(ecx, Immediate(FeedbackVector::UninitializedSentinel(isolate)));
|
||||
__ j(equal, &uninitialized);
|
||||
|
||||
// We are going megamorphic. If the feedback is a JSFunction, it is fine
|
||||
@@ -1506,7 +1505,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ j(not_equal, &miss);
|
||||
__ mov(
|
||||
FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
|
||||
__ bind(&call);
|
||||
|
||||
@@ -2912,7 +2911,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(ebx);
|
||||
__ EmitLoadFeedbackVector(ebx);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1016,8 +1016,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
mov(vector, FieldOperand(vector, JSFunction::kLiteralsOffset));
|
||||
mov(vector, FieldOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -860,7 +860,7 @@ class MacroAssembler: public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
Vendored
+5
-5
@@ -1730,7 +1730,7 @@ void AccessorAssemblerImpl::GenerateLoadICTrampoline() {
|
||||
Node* name = Parameter(Descriptor::kName);
|
||||
Node* slot = Parameter(Descriptor::kSlot);
|
||||
Node* context = Parameter(Descriptor::kContext);
|
||||
Node* vector = LoadTypeFeedbackVectorForStub();
|
||||
Node* vector = LoadFeedbackVectorForStub();
|
||||
|
||||
LoadICParameters p(context, receiver, name, slot, vector);
|
||||
LoadIC(&p);
|
||||
@@ -1784,7 +1784,7 @@ void AccessorAssemblerImpl::GenerateLoadGlobalICTrampoline(
|
||||
Node* name = Parameter(Descriptor::kName);
|
||||
Node* slot = Parameter(Descriptor::kSlot);
|
||||
Node* context = Parameter(Descriptor::kContext);
|
||||
Node* vector = LoadTypeFeedbackVectorForStub();
|
||||
Node* vector = LoadFeedbackVectorForStub();
|
||||
|
||||
LoadICParameters p(context, nullptr, name, slot, vector);
|
||||
LoadGlobalIC(&p, typeof_mode);
|
||||
@@ -1810,7 +1810,7 @@ void AccessorAssemblerImpl::GenerateKeyedLoadICTrampolineTF() {
|
||||
Node* name = Parameter(Descriptor::kName);
|
||||
Node* slot = Parameter(Descriptor::kSlot);
|
||||
Node* context = Parameter(Descriptor::kContext);
|
||||
Node* vector = LoadTypeFeedbackVectorForStub();
|
||||
Node* vector = LoadFeedbackVectorForStub();
|
||||
|
||||
LoadICParameters p(context, receiver, name, slot, vector);
|
||||
KeyedLoadIC(&p);
|
||||
@@ -1851,7 +1851,7 @@ void AccessorAssemblerImpl::GenerateStoreICTrampoline() {
|
||||
Node* value = Parameter(Descriptor::kValue);
|
||||
Node* slot = Parameter(Descriptor::kSlot);
|
||||
Node* context = Parameter(Descriptor::kContext);
|
||||
Node* vector = LoadTypeFeedbackVectorForStub();
|
||||
Node* vector = LoadFeedbackVectorForStub();
|
||||
|
||||
StoreICParameters p(context, receiver, name, value, slot, vector);
|
||||
StoreIC(&p);
|
||||
@@ -1880,7 +1880,7 @@ void AccessorAssemblerImpl::GenerateKeyedStoreICTrampolineTF(
|
||||
Node* value = Parameter(Descriptor::kValue);
|
||||
Node* slot = Parameter(Descriptor::kSlot);
|
||||
Node* context = Parameter(Descriptor::kContext);
|
||||
Node* vector = LoadTypeFeedbackVectorForStub();
|
||||
Node* vector = LoadFeedbackVectorForStub();
|
||||
|
||||
StoreICParameters p(context, receiver, name, value, slot, vector);
|
||||
KeyedStoreIC(&p, language_mode);
|
||||
|
||||
Vendored
+9
-9
@@ -2493,7 +2493,7 @@ void CallIC::HandleMiss(Handle<Object> function) {
|
||||
// We are going generic.
|
||||
nexus->ConfigureMegamorphic();
|
||||
} else {
|
||||
DCHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate()));
|
||||
DCHECK(feedback == *FeedbackVector::UninitializedSentinel(isolate()));
|
||||
Handle<JSFunction> js_function = Handle<JSFunction>::cast(function);
|
||||
|
||||
Handle<JSFunction> array_function =
|
||||
@@ -2535,7 +2535,7 @@ RUNTIME_FUNCTION(Runtime_CallIC_Miss) {
|
||||
DCHECK_EQ(3, args.length());
|
||||
// Runtime functions don't follow the IC's calling convention.
|
||||
Handle<Object> function = args.at(0);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(1);
|
||||
Handle<Smi> slot = args.at<Smi>(2);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
CallICNexus nexus(vector, vector_slot);
|
||||
@@ -2553,7 +2553,7 @@ RUNTIME_FUNCTION(Runtime_LoadIC_Miss) {
|
||||
Handle<Object> receiver = args.at(0);
|
||||
Handle<Name> key = args.at<Name>(1);
|
||||
Handle<Smi> slot = args.at<Smi>(2);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(3);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
// A monomorphic or polymorphic KeyedLoadIC with a string key can call the
|
||||
// LoadIC miss handler if the handler misses. Since the vector Nexus is
|
||||
@@ -2589,7 +2589,7 @@ RUNTIME_FUNCTION(Runtime_LoadGlobalIC_Miss) {
|
||||
Handle<JSGlobalObject> global = isolate->global_object();
|
||||
Handle<String> name = args.at<String>(0);
|
||||
Handle<Smi> slot = args.at<Smi>(1);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(2);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
|
||||
LoadGlobalICNexus nexus(vector, vector_slot);
|
||||
@@ -2650,7 +2650,7 @@ RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) {
|
||||
Handle<Object> receiver = args.at(0);
|
||||
Handle<Object> key = args.at(1);
|
||||
Handle<Smi> slot = args.at<Smi>(2);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(3);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
KeyedLoadICNexus nexus(vector, vector_slot);
|
||||
KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
|
||||
@@ -2666,8 +2666,8 @@ RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) {
|
||||
Handle<Object> receiver = args.at(Descriptor::kReceiver);
|
||||
Handle<Object> key = args.at(Descriptor::kName);
|
||||
Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot);
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
args.at<TypeFeedbackVector>(Descriptor::kVector);
|
||||
Handle<FeedbackVector> vector =
|
||||
args.at<FeedbackVector>(Descriptor::kVector);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
KeyedLoadICNexus nexus(vector, vector_slot);
|
||||
KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
|
||||
@@ -2683,7 +2683,7 @@ RUNTIME_FUNCTION(Runtime_StoreIC_Miss) {
|
||||
// Runtime functions don't follow the IC's calling convention.
|
||||
Handle<Object> value = args.at(0);
|
||||
Handle<Smi> slot = args.at<Smi>(1);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(2);
|
||||
Handle<Object> receiver = args.at(3);
|
||||
Handle<Name> key = args.at<Name>(4);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
@@ -2710,7 +2710,7 @@ RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) {
|
||||
// Runtime functions don't follow the IC's calling convention.
|
||||
Handle<Object> value = args.at(0);
|
||||
Handle<Smi> slot = args.at<Smi>(1);
|
||||
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
|
||||
Handle<FeedbackVector> vector = args.at<FeedbackVector>(2);
|
||||
Handle<Object> receiver = args.at(3);
|
||||
Handle<Object> key = args.at(4);
|
||||
FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
|
||||
|
||||
Vendored
+1
-1
@@ -200,7 +200,7 @@ class IC {
|
||||
return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL;
|
||||
}
|
||||
|
||||
Handle<TypeFeedbackVector> vector() const { return nexus()->vector_handle(); }
|
||||
Handle<FeedbackVector> vector() const { return nexus()->vector_handle(); }
|
||||
FeedbackVectorSlot slot() const { return nexus()->slot(); }
|
||||
State saved_state() const {
|
||||
return state() == RECOMPUTE_HANDLER ? old_state_ : state();
|
||||
|
||||
+1
-1
@@ -3383,7 +3383,7 @@ LanguageMode BytecodeGenerator::language_mode() const {
|
||||
}
|
||||
|
||||
int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
|
||||
return TypeFeedbackVector::GetIndex(slot);
|
||||
return FeedbackVector::GetIndex(slot);
|
||||
}
|
||||
|
||||
Runtime::FunctionId BytecodeGenerator::StoreToSuperRuntimeId() {
|
||||
|
||||
+29
-31
@@ -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);
|
||||
}
|
||||
|
||||
+5
-5
@@ -102,12 +102,12 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
|
||||
// Load and untag constant at |index| in the constant pool.
|
||||
compiler::Node* LoadAndUntagConstantPoolEntry(compiler::Node* index);
|
||||
|
||||
// Load the TypeFeedbackVector for the current function.
|
||||
compiler::Node* LoadTypeFeedbackVector();
|
||||
// Load the FeedbackVector for the current function.
|
||||
compiler::Node* LoadFeedbackVector();
|
||||
|
||||
// Increment the call count for a CALL_IC or construct call.
|
||||
// The call count is located at feedback_vector[slot_id + 1].
|
||||
compiler::Node* IncrementCallCount(compiler::Node* type_feedback_vector,
|
||||
compiler::Node* IncrementCallCount(compiler::Node* feedback_vector,
|
||||
compiler::Node* slot_id);
|
||||
|
||||
// Call JSFunction or Callable |function| with |arg_count|
|
||||
@@ -119,7 +119,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
|
||||
compiler::Node* first_arg,
|
||||
compiler::Node* arg_count,
|
||||
compiler::Node* slot_id,
|
||||
compiler::Node* type_feedback_vector,
|
||||
compiler::Node* feedback_vector,
|
||||
TailCallMode tail_call_mode);
|
||||
|
||||
// Call JSFunction or Callable |function| with |arg_count|
|
||||
@@ -140,7 +140,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
|
||||
compiler::Node* first_arg,
|
||||
compiler::Node* arg_count,
|
||||
compiler::Node* slot_id,
|
||||
compiler::Node* type_feedback_vector);
|
||||
compiler::Node* feedback_vector);
|
||||
|
||||
// Call runtime function with |arg_count| arguments and the first argument
|
||||
// located at |first_arg|.
|
||||
|
||||
+52
-53
@@ -464,9 +464,9 @@ Node* Interpreter::BuildLoadGlobal(Callable ic, Node* context, Node* name_index,
|
||||
Node* code_target = __ HeapConstant(ic.code());
|
||||
Node* name = __ LoadConstantPoolEntry(name_index);
|
||||
Node* smi_slot = __ SmiTag(feedback_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
return __ CallStub(ic.descriptor(), code_target, context, name, smi_slot,
|
||||
type_feedback_vector);
|
||||
feedback_vector);
|
||||
}
|
||||
|
||||
// LdaGlobal <name_index> <slot>
|
||||
@@ -517,9 +517,9 @@ void Interpreter::DoStaGlobal(Callable ic, InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* raw_slot = __ BytecodeOperandIdx(1);
|
||||
Node* smi_slot = __ SmiTag(raw_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
__ CallStub(ic.descriptor(), code_target, context, global, name, value,
|
||||
smi_slot, type_feedback_vector);
|
||||
smi_slot, feedback_vector);
|
||||
__ Dispatch();
|
||||
}
|
||||
|
||||
@@ -761,10 +761,10 @@ void Interpreter::DoLdaNamedProperty(InterpreterAssembler* assembler) {
|
||||
Node* name = __ LoadConstantPoolEntry(constant_index);
|
||||
Node* raw_slot = __ BytecodeOperandIdx(2);
|
||||
Node* smi_slot = __ SmiTag(raw_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
Node* result = __ CallStub(ic.descriptor(), code_target, context, object,
|
||||
name, smi_slot, type_feedback_vector);
|
||||
name, smi_slot, feedback_vector);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -781,10 +781,10 @@ void Interpreter::DoLdaKeyedProperty(InterpreterAssembler* assembler) {
|
||||
Node* name = __ GetAccumulator();
|
||||
Node* raw_slot = __ BytecodeOperandIdx(1);
|
||||
Node* smi_slot = __ SmiTag(raw_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
Node* result = __ CallStub(ic.descriptor(), code_target, context, object,
|
||||
name, smi_slot, type_feedback_vector);
|
||||
name, smi_slot, feedback_vector);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -798,10 +798,10 @@ void Interpreter::DoStoreIC(Callable ic, InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* raw_slot = __ BytecodeOperandIdx(2);
|
||||
Node* smi_slot = __ SmiTag(raw_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
__ CallStub(ic.descriptor(), code_target, context, object, name, value,
|
||||
smi_slot, type_feedback_vector);
|
||||
smi_slot, feedback_vector);
|
||||
__ Dispatch();
|
||||
}
|
||||
|
||||
@@ -834,10 +834,10 @@ void Interpreter::DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* raw_slot = __ BytecodeOperandIdx(2);
|
||||
Node* smi_slot = __ SmiTag(raw_slot);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
__ CallStub(ic.descriptor(), code_target, context, object, name, value,
|
||||
smi_slot, type_feedback_vector);
|
||||
smi_slot, feedback_vector);
|
||||
__ Dispatch();
|
||||
}
|
||||
|
||||
@@ -874,11 +874,11 @@ void Interpreter::DoStaDataPropertyInLiteral(InterpreterAssembler* assembler) {
|
||||
Node* flags = __ SmiFromWord32(__ BytecodeOperandFlag(2));
|
||||
Node* vector_index = __ SmiTag(__ BytecodeOperandIdx(3));
|
||||
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
|
||||
__ CallRuntime(Runtime::kDefineDataPropertyInLiteral, context, object, name,
|
||||
value, flags, type_feedback_vector, vector_index);
|
||||
value, flags, feedback_vector, vector_index);
|
||||
__ Dispatch();
|
||||
}
|
||||
|
||||
@@ -1016,9 +1016,9 @@ void Interpreter::DoBinaryOpWithFeedback(InterpreterAssembler* assembler) {
|
||||
Node* rhs = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(1);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* result = Generator::Generate(assembler, lhs, rhs, slot_index,
|
||||
type_feedback_vector, context);
|
||||
feedback_vector, context);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1030,7 +1030,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
|
||||
Node* rhs = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(1);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
// TODO(interpreter): the only reason this check is here is because we
|
||||
// sometimes emit comparisons that shouldn't collect feedback (e.g.
|
||||
@@ -1170,8 +1170,7 @@ void Interpreter::DoCompareOpWithFeedback(Token::Value compare_op,
|
||||
|
||||
__ Bind(&update_feedback);
|
||||
{
|
||||
__ UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
slot_index);
|
||||
__ UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index);
|
||||
__ Goto(&do_compare);
|
||||
}
|
||||
}
|
||||
@@ -1256,7 +1255,7 @@ void Interpreter::DoBitwiseBinaryOp(Token::Value bitwise_op,
|
||||
Node* rhs = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(1);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
Variable var_lhs_type_feedback(assembler,
|
||||
MachineRepresentation::kTaggedSigned),
|
||||
@@ -1315,7 +1314,7 @@ void Interpreter::DoBitwiseBinaryOp(Token::Value bitwise_op,
|
||||
|
||||
Node* input_feedback =
|
||||
__ SmiOr(var_lhs_type_feedback.value(), var_rhs_type_feedback.value());
|
||||
__ UpdateFeedback(__ SmiOr(result_type, input_feedback), type_feedback_vector,
|
||||
__ UpdateFeedback(__ SmiOr(result_type, input_feedback), feedback_vector,
|
||||
slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
@@ -1385,7 +1384,7 @@ void Interpreter::DoAddSmi(InterpreterAssembler* assembler) {
|
||||
Node* left = __ LoadRegister(reg_index);
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
// {right} is known to be a Smi.
|
||||
// Check if the {left} is a Smi take the fast path.
|
||||
@@ -1403,7 +1402,7 @@ void Interpreter::DoAddSmi(InterpreterAssembler* assembler) {
|
||||
__ Bind(&if_notoverflow);
|
||||
{
|
||||
__ UpdateFeedback(__ SmiConstant(BinaryOperationFeedback::kSignedSmall),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
var_result.Bind(__ BitcastWordToTaggedSigned(__ Projection(0, pair)));
|
||||
__ Goto(&end);
|
||||
}
|
||||
@@ -1416,7 +1415,7 @@ void Interpreter::DoAddSmi(InterpreterAssembler* assembler) {
|
||||
Callable(stub.GetCode(), AddWithFeedbackStub::Descriptor(__ isolate()));
|
||||
var_result.Bind(__ CallStub(callable, context, left, right,
|
||||
__ TruncateWordToWord32(slot_index),
|
||||
type_feedback_vector));
|
||||
feedback_vector));
|
||||
__ Goto(&end);
|
||||
}
|
||||
__ Bind(&end);
|
||||
@@ -1439,7 +1438,7 @@ void Interpreter::DoSubSmi(InterpreterAssembler* assembler) {
|
||||
Node* left = __ LoadRegister(reg_index);
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
// {right} is known to be a Smi.
|
||||
// Check if the {left} is a Smi take the fast path.
|
||||
@@ -1457,7 +1456,7 @@ void Interpreter::DoSubSmi(InterpreterAssembler* assembler) {
|
||||
__ Bind(&if_notoverflow);
|
||||
{
|
||||
__ UpdateFeedback(__ SmiConstant(BinaryOperationFeedback::kSignedSmall),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
var_result.Bind(__ BitcastWordToTaggedSigned(__ Projection(0, pair)));
|
||||
__ Goto(&end);
|
||||
}
|
||||
@@ -1470,7 +1469,7 @@ void Interpreter::DoSubSmi(InterpreterAssembler* assembler) {
|
||||
stub.GetCode(), SubtractWithFeedbackStub::Descriptor(__ isolate()));
|
||||
var_result.Bind(__ CallStub(callable, context, left, right,
|
||||
__ TruncateWordToWord32(slot_index),
|
||||
type_feedback_vector));
|
||||
feedback_vector));
|
||||
__ Goto(&end);
|
||||
}
|
||||
__ Bind(&end);
|
||||
@@ -1490,7 +1489,7 @@ void Interpreter::DoBitwiseOrSmi(InterpreterAssembler* assembler) {
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Variable var_lhs_type_feedback(assembler,
|
||||
MachineRepresentation::kTaggedSigned);
|
||||
Node* lhs_value = __ TruncateTaggedToWord32WithFeedback(
|
||||
@@ -1502,7 +1501,7 @@ void Interpreter::DoBitwiseOrSmi(InterpreterAssembler* assembler) {
|
||||
__ TaggedIsSmi(result), BinaryOperationFeedback::kSignedSmall,
|
||||
BinaryOperationFeedback::kNumber);
|
||||
__ UpdateFeedback(__ SmiOr(result_type, var_lhs_type_feedback.value()),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1517,7 +1516,7 @@ void Interpreter::DoBitwiseAndSmi(InterpreterAssembler* assembler) {
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Variable var_lhs_type_feedback(assembler,
|
||||
MachineRepresentation::kTaggedSigned);
|
||||
Node* lhs_value = __ TruncateTaggedToWord32WithFeedback(
|
||||
@@ -1529,7 +1528,7 @@ void Interpreter::DoBitwiseAndSmi(InterpreterAssembler* assembler) {
|
||||
__ TaggedIsSmi(result), BinaryOperationFeedback::kSignedSmall,
|
||||
BinaryOperationFeedback::kNumber);
|
||||
__ UpdateFeedback(__ SmiOr(result_type, var_lhs_type_feedback.value()),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1545,7 +1544,7 @@ void Interpreter::DoShiftLeftSmi(InterpreterAssembler* assembler) {
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Variable var_lhs_type_feedback(assembler,
|
||||
MachineRepresentation::kTaggedSigned);
|
||||
Node* lhs_value = __ TruncateTaggedToWord32WithFeedback(
|
||||
@@ -1558,7 +1557,7 @@ void Interpreter::DoShiftLeftSmi(InterpreterAssembler* assembler) {
|
||||
__ TaggedIsSmi(result), BinaryOperationFeedback::kSignedSmall,
|
||||
BinaryOperationFeedback::kNumber);
|
||||
__ UpdateFeedback(__ SmiOr(result_type, var_lhs_type_feedback.value()),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1574,7 +1573,7 @@ void Interpreter::DoShiftRightSmi(InterpreterAssembler* assembler) {
|
||||
Node* right = __ BytecodeOperandImmSmi(0);
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(2);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Variable var_lhs_type_feedback(assembler,
|
||||
MachineRepresentation::kTaggedSigned);
|
||||
Node* lhs_value = __ TruncateTaggedToWord32WithFeedback(
|
||||
@@ -1587,7 +1586,7 @@ void Interpreter::DoShiftRightSmi(InterpreterAssembler* assembler) {
|
||||
__ TaggedIsSmi(result), BinaryOperationFeedback::kSignedSmall,
|
||||
BinaryOperationFeedback::kNumber);
|
||||
__ UpdateFeedback(__ SmiOr(result_type, var_lhs_type_feedback.value()),
|
||||
type_feedback_vector, slot_index);
|
||||
feedback_vector, slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1605,9 +1604,9 @@ void Interpreter::DoUnaryOpWithFeedback(InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(0);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* result = Generator::Generate(assembler, value, context,
|
||||
type_feedback_vector, slot_index);
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* result = Generator::Generate(assembler, value, context, feedback_vector,
|
||||
slot_index);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -1654,7 +1653,7 @@ void Interpreter::DoInc(InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(0);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
// Shared entry for floating point increment.
|
||||
Label do_finc(assembler), end(assembler);
|
||||
@@ -1774,7 +1773,7 @@ void Interpreter::DoInc(InterpreterAssembler* assembler) {
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_index);
|
||||
|
||||
__ SetAccumulator(result_var.value());
|
||||
@@ -1792,7 +1791,7 @@ void Interpreter::DoDec(InterpreterAssembler* assembler) {
|
||||
Node* value = __ GetAccumulator();
|
||||
Node* context = __ GetContext();
|
||||
Node* slot_index = __ BytecodeOperandIdx(0);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
|
||||
// Shared entry for floating point decrement.
|
||||
Label do_fdec(assembler), end(assembler);
|
||||
@@ -1912,7 +1911,7 @@ void Interpreter::DoDec(InterpreterAssembler* assembler) {
|
||||
}
|
||||
|
||||
assembler->Bind(&end);
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), type_feedback_vector,
|
||||
assembler->UpdateFeedback(var_type_feedback.value(), feedback_vector,
|
||||
slot_index);
|
||||
|
||||
__ SetAccumulator(result_var.value());
|
||||
@@ -2038,11 +2037,11 @@ void Interpreter::DoJSCall(InterpreterAssembler* assembler,
|
||||
Node* receiver_count = __ Int32Constant(1);
|
||||
Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
|
||||
Node* slot_id = __ BytecodeOperandIdx(3);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
Node* result =
|
||||
__ CallJSWithFeedback(function, context, receiver_arg, args_count,
|
||||
slot_id, type_feedback_vector, tail_call_mode);
|
||||
slot_id, feedback_vector, tail_call_mode);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -2193,10 +2192,10 @@ void Interpreter::DoNew(InterpreterAssembler* assembler) {
|
||||
Node* first_arg = __ RegisterLocation(first_arg_reg);
|
||||
Node* args_count = __ BytecodeOperandCount(2);
|
||||
Node* slot_id = __ BytecodeOperandIdx(3);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* context = __ GetContext();
|
||||
Node* result = __ CallConstruct(constructor, context, new_target, first_arg,
|
||||
args_count, slot_id, type_feedback_vector);
|
||||
args_count, slot_id, feedback_vector);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -2744,9 +2743,9 @@ void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
|
||||
ConstructorBuiltinsAssembler constructor_assembler(assembler->state());
|
||||
Node* vector_index = __ BytecodeOperandIdx(1);
|
||||
vector_index = __ SmiTag(vector_index);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
__ SetAccumulator(constructor_assembler.EmitFastNewClosure(
|
||||
shared, type_feedback_vector, vector_index, context));
|
||||
shared, feedback_vector, vector_index, context));
|
||||
__ Dispatch();
|
||||
|
||||
__ Bind(&call_runtime);
|
||||
@@ -2754,12 +2753,12 @@ void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
|
||||
Node* tenured_raw =
|
||||
__ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags);
|
||||
Node* tenured = __ SmiTag(tenured_raw);
|
||||
type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
feedback_vector = __ LoadFeedbackVector();
|
||||
vector_index = __ BytecodeOperandIdx(1);
|
||||
vector_index = __ SmiTag(vector_index);
|
||||
Node* result =
|
||||
__ CallRuntime(Runtime::kInterpreterNewClosure, context, shared,
|
||||
type_feedback_vector, vector_index, tenured);
|
||||
feedback_vector, vector_index, tenured);
|
||||
__ SetAccumulator(result);
|
||||
__ Dispatch();
|
||||
}
|
||||
@@ -3118,10 +3117,10 @@ void Interpreter::DoForInNext(InterpreterAssembler* assembler) {
|
||||
{
|
||||
// Record the fact that we hit the for-in slow path.
|
||||
Node* vector_index = __ BytecodeOperandIdx(3);
|
||||
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
||||
Node* feedback_vector = __ LoadFeedbackVector();
|
||||
Node* megamorphic_sentinel =
|
||||
__ HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate_));
|
||||
__ StoreFixedArrayElement(type_feedback_vector, vector_index,
|
||||
__ HeapConstant(FeedbackVector::MegamorphicSentinel(isolate_));
|
||||
__ StoreFixedArrayElement(feedback_vector, vector_index,
|
||||
megamorphic_sentinel, SKIP_WRITE_BARRIER);
|
||||
|
||||
// Need to filter the {key} for the {receiver}.
|
||||
|
||||
Vendored
+4
-4
@@ -1762,9 +1762,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// a3 : slot in feedback vector (Smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
// Load the cache state into t2.
|
||||
@@ -1774,7 +1774,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if t2 is a WeakCell or a Symbol, but it's harmless to read at
|
||||
// this position in a symbol (see static asserts in type-feedback-vector.h).
|
||||
// this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
Register feedback_map = t1;
|
||||
Register weak_value = t4;
|
||||
@@ -3128,7 +3128,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -5340,8 +5340,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
lw(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
lw(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1668,7 +1668,7 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
|
||||
void Prologue(bool code_pre_aging);
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
+4
-4
@@ -1763,9 +1763,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// a3 : slot in feedback vector (Smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
// Load the cache state into a5.
|
||||
@@ -1776,7 +1776,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if a5 is a WeakCell or a Symbol, but it's harmless to read at
|
||||
// this position in a symbol (see static asserts in type-feedback-vector.h).
|
||||
// this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
Register feedback_map = a6;
|
||||
Register weak_value = t0;
|
||||
@@ -3132,7 +3132,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(a2);
|
||||
__ EmitLoadFeedbackVector(a2);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-1
@@ -5684,7 +5684,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
ld(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
ld(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
ld(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1802,7 +1802,7 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
|
||||
void Prologue(bool code_pre_aging);
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
Vendored
+10
-10
@@ -18,6 +18,7 @@
|
||||
#include "src/contexts-inl.h"
|
||||
#include "src/conversions-inl.h"
|
||||
#include "src/factory.h"
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "src/field-index-inl.h"
|
||||
#include "src/field-type.h"
|
||||
#include "src/handles-inl.h"
|
||||
@@ -35,7 +36,6 @@
|
||||
#include "src/property.h"
|
||||
#include "src/prototype.h"
|
||||
#include "src/transitions-inl.h"
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
#include "src/v8memory.h"
|
||||
|
||||
namespace v8 {
|
||||
@@ -363,11 +363,11 @@ bool Object::IsLayoutDescriptor() const {
|
||||
return IsSmi() || IsFixedTypedArrayBase();
|
||||
}
|
||||
|
||||
bool HeapObject::IsTypeFeedbackVector() const {
|
||||
return map() == GetHeap()->type_feedback_vector_map();
|
||||
bool HeapObject::IsFeedbackVector() const {
|
||||
return map() == GetHeap()->feedback_vector_map();
|
||||
}
|
||||
|
||||
bool HeapObject::IsTypeFeedbackMetadata() const { return IsFixedArray(); }
|
||||
bool HeapObject::IsFeedbackMetadata() const { return IsFixedArray(); }
|
||||
|
||||
bool HeapObject::IsLiteralsArray() const { return IsFixedArray(); }
|
||||
|
||||
@@ -3454,16 +3454,16 @@ LiteralsArray* LiteralsArray::cast(Object* object) {
|
||||
}
|
||||
|
||||
|
||||
TypeFeedbackVector* LiteralsArray::feedback_vector() const {
|
||||
FeedbackVector* LiteralsArray::feedback_vector() const {
|
||||
if (length() == 0) {
|
||||
return TypeFeedbackVector::cast(
|
||||
return FeedbackVector::cast(
|
||||
const_cast<FixedArray*>(FixedArray::cast(this)));
|
||||
}
|
||||
return TypeFeedbackVector::cast(get(kVectorIndex));
|
||||
return FeedbackVector::cast(get(kVectorIndex));
|
||||
}
|
||||
|
||||
|
||||
void LiteralsArray::set_feedback_vector(TypeFeedbackVector* vector) {
|
||||
void LiteralsArray::set_feedback_vector(FeedbackVector* vector) {
|
||||
if (length() <= kVectorIndex) {
|
||||
DCHECK(vector->length() == 0);
|
||||
return;
|
||||
@@ -5983,7 +5983,7 @@ ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset)
|
||||
ACCESSORS(SharedFunctionInfo, optimized_code_map, FixedArray,
|
||||
kOptimizedCodeMapOffset)
|
||||
ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
|
||||
ACCESSORS(SharedFunctionInfo, feedback_metadata, TypeFeedbackMetadata,
|
||||
ACCESSORS(SharedFunctionInfo, feedback_metadata, FeedbackMetadata,
|
||||
kFeedbackMetadataOffset)
|
||||
SMI_ACCESSORS(SharedFunctionInfo, function_literal_id, kFunctionLiteralIdOffset)
|
||||
#if TRACE_MAPS
|
||||
@@ -6670,7 +6670,7 @@ bool JSFunction::is_compiled() {
|
||||
code() != builtins->builtin(Builtins::kCompileOptimizedConcurrent);
|
||||
}
|
||||
|
||||
TypeFeedbackVector* JSFunction::feedback_vector() {
|
||||
FeedbackVector* JSFunction::feedback_vector() {
|
||||
LiteralsArray* array = literals();
|
||||
return array->feedback_vector();
|
||||
}
|
||||
|
||||
Vendored
+15
-19
@@ -694,7 +694,7 @@ void FeedbackVectorSpecBase<Derived>::FeedbackVectorSpecPrint(
|
||||
|
||||
for (int slot = 0; slot < slot_count;) {
|
||||
FeedbackVectorSlotKind kind = This()->GetKind(slot);
|
||||
int entry_size = TypeFeedbackMetadata::GetSlotSize(kind);
|
||||
int entry_size = FeedbackMetadata::GetSlotSize(kind);
|
||||
DCHECK_LT(0, entry_size);
|
||||
os << "\n Slot #" << slot << " " << kind;
|
||||
slot += entry_size;
|
||||
@@ -702,16 +702,14 @@ void FeedbackVectorSpecBase<Derived>::FeedbackVectorSpecPrint(
|
||||
os << "\n";
|
||||
}
|
||||
|
||||
void TypeFeedbackMetadata::Print() {
|
||||
void FeedbackMetadata::Print() {
|
||||
OFStream os(stdout);
|
||||
TypeFeedbackMetadataPrint(os);
|
||||
FeedbackMetadataPrint(os);
|
||||
os << std::flush;
|
||||
}
|
||||
|
||||
|
||||
void TypeFeedbackMetadata::TypeFeedbackMetadataPrint(
|
||||
std::ostream& os) { // NOLINT
|
||||
HeapObject::PrintHeader(os, "TypeFeedbackMetadata");
|
||||
void FeedbackMetadata::FeedbackMetadataPrint(std::ostream& os) { // NOLINT
|
||||
HeapObject::PrintHeader(os, "FeedbackMetadata");
|
||||
os << "\n - length: " << length();
|
||||
if (length() == 0) {
|
||||
os << " (empty)\n";
|
||||
@@ -719,13 +717,13 @@ void TypeFeedbackMetadata::TypeFeedbackMetadataPrint(
|
||||
}
|
||||
os << "\n - slot_count: " << slot_count();
|
||||
|
||||
TypeFeedbackMetadataIterator iter(this);
|
||||
FeedbackMetadataIterator iter(this);
|
||||
int parameter_index = 0;
|
||||
while (iter.HasNext()) {
|
||||
FeedbackVectorSlot slot = iter.Next();
|
||||
FeedbackVectorSlotKind kind = iter.kind();
|
||||
os << "\n Slot " << slot << " " << kind;
|
||||
if (TypeFeedbackMetadata::SlotRequiresParameter(kind)) {
|
||||
if (FeedbackMetadata::SlotRequiresParameter(kind)) {
|
||||
int parameter_value = this->GetParameter(parameter_index++);
|
||||
os << " [" << parameter_value << "]";
|
||||
}
|
||||
@@ -733,16 +731,14 @@ void TypeFeedbackMetadata::TypeFeedbackMetadataPrint(
|
||||
os << "\n";
|
||||
}
|
||||
|
||||
|
||||
void TypeFeedbackVector::Print() {
|
||||
void FeedbackVector::Print() {
|
||||
OFStream os(stdout);
|
||||
TypeFeedbackVectorPrint(os);
|
||||
FeedbackVectorPrint(os);
|
||||
os << std::flush;
|
||||
}
|
||||
|
||||
|
||||
void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT
|
||||
HeapObject::PrintHeader(os, "TypeFeedbackVector");
|
||||
void FeedbackVector::FeedbackVectorPrint(std::ostream& os) { // NOLINT
|
||||
HeapObject::PrintHeader(os, "FeedbackVector");
|
||||
os << "\n - length: " << length();
|
||||
if (length() == 0) {
|
||||
os << " (empty)\n";
|
||||
@@ -750,7 +746,7 @@ void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT
|
||||
}
|
||||
|
||||
int parameter_index = 0;
|
||||
TypeFeedbackMetadataIterator iter(metadata());
|
||||
FeedbackMetadataIterator iter(metadata());
|
||||
while (iter.HasNext()) {
|
||||
FeedbackVectorSlot slot = iter.Next();
|
||||
FeedbackVectorSlotKind kind = iter.kind();
|
||||
@@ -1098,7 +1094,7 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT
|
||||
os << "\n - num_literals = " << num_literals();
|
||||
os << "\n - optimized_code_map = " << Brief(optimized_code_map());
|
||||
os << "\n - feedback_metadata = ";
|
||||
feedback_metadata()->TypeFeedbackMetadataPrint(os);
|
||||
feedback_metadata()->FeedbackMetadataPrint(os);
|
||||
if (HasBytecodeArray()) {
|
||||
os << "\n - bytecode_array = " << bytecode_array();
|
||||
}
|
||||
@@ -1686,11 +1682,11 @@ extern void _v8_internal_Print_Code(void* object) {
|
||||
isolate->FindCodeObject(reinterpret_cast<i::Address>(object))->Print();
|
||||
}
|
||||
|
||||
extern void _v8_internal_Print_TypeFeedbackVector(void* object) {
|
||||
extern void _v8_internal_Print_FeedbackVector(void* object) {
|
||||
if (reinterpret_cast<i::Object*>(object)->IsSmi()) {
|
||||
printf("Not a type feedback vector\n");
|
||||
} else {
|
||||
reinterpret_cast<i::TypeFeedbackVector*>(object)->Print();
|
||||
reinterpret_cast<i::FeedbackVector*>(object)->Print();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -10245,7 +10245,7 @@ const int LiteralsArray::kOffsetToFirstLiteral =
|
||||
|
||||
// static
|
||||
Handle<LiteralsArray> LiteralsArray::New(Isolate* isolate,
|
||||
Handle<TypeFeedbackVector> vector,
|
||||
Handle<FeedbackVector> vector,
|
||||
int number_of_literals,
|
||||
PretenureFlag pretenure) {
|
||||
if (vector->is_empty() && number_of_literals == 0) {
|
||||
@@ -11966,8 +11966,8 @@ Handle<LiteralsArray> SharedFunctionInfo::FindOrCreateLiterals(
|
||||
return handle(result.literals, isolate);
|
||||
}
|
||||
|
||||
Handle<TypeFeedbackVector> feedback_vector =
|
||||
TypeFeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<FeedbackVector> feedback_vector =
|
||||
FeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<LiteralsArray> literals =
|
||||
LiteralsArray::New(isolate, feedback_vector, shared->num_literals());
|
||||
Handle<Code> code;
|
||||
|
||||
Vendored
+13
-13
@@ -93,8 +93,8 @@
|
||||
// - OrderedHashSet
|
||||
// - OrderedHashMap
|
||||
// - Context
|
||||
// - TypeFeedbackMetadata
|
||||
// - TypeFeedbackVector
|
||||
// - FeedbackMetadata
|
||||
// - FeedbackVector
|
||||
// - TemplateList
|
||||
// - TransitionArray
|
||||
// - ScopeInfo
|
||||
@@ -910,8 +910,8 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
|
||||
V(STRING_SPLIT_CACHE_SUB_TYPE) \
|
||||
V(STRING_TABLE_SUB_TYPE) \
|
||||
V(TEMPLATE_INFO_SUB_TYPE) \
|
||||
V(TYPE_FEEDBACK_VECTOR_SUB_TYPE) \
|
||||
V(TYPE_FEEDBACK_METADATA_SUB_TYPE) \
|
||||
V(FEEDBACK_VECTOR_SUB_TYPE) \
|
||||
V(FEEDBACK_METADATA_SUB_TYPE) \
|
||||
V(WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE)
|
||||
|
||||
enum FixedArraySubInstanceType {
|
||||
@@ -970,8 +970,8 @@ class SafepointEntry;
|
||||
class SharedFunctionInfo;
|
||||
class StringStream;
|
||||
class TypeFeedbackInfo;
|
||||
class TypeFeedbackMetadata;
|
||||
class TypeFeedbackVector;
|
||||
class FeedbackMetadata;
|
||||
class FeedbackVector;
|
||||
class WeakCell;
|
||||
class TransitionArray;
|
||||
class TemplateList;
|
||||
@@ -1044,8 +1044,8 @@ template <class C> inline bool Is(Object* obj);
|
||||
V(FrameArray) \
|
||||
V(TransitionArray) \
|
||||
V(LiteralsArray) \
|
||||
V(TypeFeedbackMetadata) \
|
||||
V(TypeFeedbackVector) \
|
||||
V(FeedbackMetadata) \
|
||||
V(FeedbackVector) \
|
||||
V(DeoptimizationInputData) \
|
||||
V(DeoptimizationOutputData) \
|
||||
V(DependentCode) \
|
||||
@@ -4991,15 +4991,15 @@ class LiteralsArray : public FixedArray {
|
||||
return OffsetOfElementAt(index + kFirstLiteralIndex);
|
||||
}
|
||||
|
||||
inline TypeFeedbackVector* feedback_vector() const;
|
||||
inline void set_feedback_vector(TypeFeedbackVector* vector);
|
||||
inline FeedbackVector* feedback_vector() const;
|
||||
inline void set_feedback_vector(FeedbackVector* vector);
|
||||
inline Object* literal(int literal_index) const;
|
||||
inline void set_literal(int literal_index, Object* literal);
|
||||
inline void set_literal_undefined(int literal_index);
|
||||
inline int literals_count() const;
|
||||
|
||||
static Handle<LiteralsArray> New(Isolate* isolate,
|
||||
Handle<TypeFeedbackVector> vector,
|
||||
Handle<FeedbackVector> vector,
|
||||
int number_of_literals,
|
||||
PretenureFlag pretenure = TENURED);
|
||||
|
||||
@@ -7263,7 +7263,7 @@ class SharedFunctionInfo: public HeapObject {
|
||||
// [feedback_metadata] - describes ast node feedback from full-codegen and
|
||||
// (increasingly) from crankshafted code where sufficient feedback isn't
|
||||
// available.
|
||||
DECL_ACCESSORS(feedback_metadata, TypeFeedbackMetadata)
|
||||
DECL_ACCESSORS(feedback_metadata, FeedbackMetadata)
|
||||
|
||||
// [function_literal_id] - uniquely identifies the FunctionLiteral this
|
||||
// SharedFunctionInfo represents within its script, or -1 if this
|
||||
@@ -8173,7 +8173,7 @@ class JSFunction: public JSObject {
|
||||
DECL_ACCESSORS(literals, LiteralsArray)
|
||||
|
||||
static void EnsureLiterals(Handle<JSFunction> function);
|
||||
inline TypeFeedbackVector* feedback_vector();
|
||||
inline FeedbackVector* feedback_vector();
|
||||
|
||||
// Unconditionally clear the type feedback vector (including vector ICs).
|
||||
void ClearTypeFeedbackInfo();
|
||||
|
||||
Vendored
+4
-4
@@ -1710,9 +1710,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// r6 : slot in feedback vector (Smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
const int count_offset = FixedArray::kHeaderSize + kPointerSize;
|
||||
@@ -1725,7 +1725,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if r8 is a WeakCell or a Symbol, but it's harmless to read at
|
||||
// this position in a symbol (see static asserts in type-feedback-vector.h).
|
||||
// this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
Register feedback_map = r9;
|
||||
Register weak_value = r10;
|
||||
@@ -3071,7 +3071,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(r5);
|
||||
__ EmitLoadFeedbackVector(r5);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1020,8 +1020,7 @@ void MacroAssembler::Prologue(bool code_pre_aging, Register base,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
LoadP(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
LoadP(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1449,7 +1449,7 @@ class MacroAssembler : public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type,
|
||||
|
||||
+1
-1
@@ -1819,7 +1819,7 @@ bool V8HeapExplorer::IsEssentialObject(Object* object) {
|
||||
object != heap_->empty_byte_array() &&
|
||||
object != heap_->empty_fixed_array() &&
|
||||
object != heap_->empty_descriptor_array() &&
|
||||
object != heap_->empty_type_feedback_vector() &&
|
||||
object != heap_->empty_feedback_vector() &&
|
||||
object != heap_->fixed_array_map() && object != heap_->cell_map() &&
|
||||
object != heap_->global_property_cell_map() &&
|
||||
object != heap_->shared_function_info_map() &&
|
||||
|
||||
Vendored
+1
-1
@@ -114,7 +114,7 @@ static void GetICCounts(JSFunction* function, int* ic_with_type_info_count,
|
||||
}
|
||||
|
||||
// Harvest vector-ics as well
|
||||
TypeFeedbackVector* vector = function->feedback_vector();
|
||||
FeedbackVector* vector = function->feedback_vector();
|
||||
int with = 0, gen = 0, type_vector_ic_count = 0;
|
||||
const bool is_interpreted = function->shared()->IsInterpreted();
|
||||
|
||||
|
||||
+1
-1
@@ -631,7 +631,7 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) {
|
||||
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
|
||||
CONVERT_SMI_ARG_CHECKED(flag, 3);
|
||||
CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 4);
|
||||
CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 4);
|
||||
CONVERT_SMI_ARG_CHECKED(index, 5);
|
||||
|
||||
StoreDataPropertyInLiteralICNexus nexus(vector, vector->ToSlot(index));
|
||||
|
||||
+4
-5
@@ -45,7 +45,7 @@ Object* DeclareGlobal(
|
||||
Isolate* isolate, Handle<JSGlobalObject> global, Handle<String> name,
|
||||
Handle<Object> value, PropertyAttributes attr, bool is_var,
|
||||
bool is_function_declaration, RedeclarationType redeclaration_type,
|
||||
Handle<TypeFeedbackVector> feedback_vector = Handle<TypeFeedbackVector>(),
|
||||
Handle<FeedbackVector> feedback_vector = Handle<FeedbackVector>(),
|
||||
FeedbackVectorSlot slot = FeedbackVectorSlot::Invalid()) {
|
||||
Handle<ScriptContextTable> script_contexts(
|
||||
global->native_context()->script_context_table());
|
||||
@@ -130,7 +130,7 @@ Object* DeclareGlobal(
|
||||
}
|
||||
|
||||
Object* DeclareGlobals(Isolate* isolate, Handle<FixedArray> declarations,
|
||||
int flags, Handle<TypeFeedbackVector> feedback_vector) {
|
||||
int flags, Handle<FeedbackVector> feedback_vector) {
|
||||
HandleScope scope(isolate);
|
||||
Handle<JSGlobalObject> global(isolate->global_object());
|
||||
Handle<Context> context(isolate->context());
|
||||
@@ -187,7 +187,7 @@ RUNTIME_FUNCTION(Runtime_DeclareGlobals) {
|
||||
|
||||
CONVERT_ARG_HANDLE_CHECKED(FixedArray, declarations, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(flags, 1);
|
||||
CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, feedback_vector, 2);
|
||||
CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, feedback_vector, 2);
|
||||
|
||||
return DeclareGlobals(isolate, declarations, flags, feedback_vector);
|
||||
}
|
||||
@@ -202,8 +202,7 @@ RUNTIME_FUNCTION(Runtime_DeclareGlobalsForInterpreter) {
|
||||
CONVERT_SMI_ARG_CHECKED(flags, 1);
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 2);
|
||||
|
||||
Handle<TypeFeedbackVector> feedback_vector(closure->feedback_vector(),
|
||||
isolate);
|
||||
Handle<FeedbackVector> feedback_vector(closure->feedback_vector(), isolate);
|
||||
return DeclareGlobals(isolate, declarations, flags, feedback_vector);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -1717,9 +1717,9 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// r5 : slot in feedback vector (Smi)
|
||||
Label initialize, done, miss, megamorphic, not_array_function;
|
||||
|
||||
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::MegamorphicSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->megamorphic_symbol());
|
||||
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
DCHECK_EQ(*FeedbackVector::UninitializedSentinel(masm->isolate()),
|
||||
masm->isolate()->heap()->uninitialized_symbol());
|
||||
|
||||
const int count_offset = FixedArray::kHeaderSize + kPointerSize;
|
||||
@@ -1732,7 +1732,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if r7 is a WeakCell or a Symbol, but it's harmless to read at
|
||||
// this position in a symbol (see static asserts in type-feedback-vector.h).
|
||||
// this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
Register feedback_map = r8;
|
||||
Register weak_value = r9;
|
||||
@@ -3016,7 +3016,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(r4);
|
||||
__ EmitLoadFeedbackVector(r4);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-1
@@ -969,7 +969,7 @@ void MacroAssembler::Prologue(bool code_pre_aging, Register base,
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
LoadP(vector, FieldMemOperand(vector, JSFunction::kLiteralsOffset));
|
||||
LoadP(vector, FieldMemOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1714,7 +1714,7 @@ class MacroAssembler : public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type,
|
||||
|
||||
Vendored
+7
-8
@@ -13,10 +13,10 @@
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
TypeFeedbackOracle::TypeFeedbackOracle(
|
||||
Isolate* isolate, Zone* zone, Handle<Code> code,
|
||||
Handle<TypeFeedbackVector> feedback_vector, Handle<Context> native_context)
|
||||
TypeFeedbackOracle::TypeFeedbackOracle(Isolate* isolate, Zone* zone,
|
||||
Handle<Code> code,
|
||||
Handle<FeedbackVector> feedback_vector,
|
||||
Handle<Context> native_context)
|
||||
: native_context_(native_context), isolate_(isolate), zone_(zone) {
|
||||
BuildDictionary(code);
|
||||
DCHECK(dictionary_->IsUnseededNumberDictionary());
|
||||
@@ -24,7 +24,7 @@ TypeFeedbackOracle::TypeFeedbackOracle(
|
||||
// the type feedback info contained therein.
|
||||
// TODO(mvstanton): revisit the decision to copy when we weakly
|
||||
// traverse the feedback vector at GC time.
|
||||
feedback_vector_ = TypeFeedbackVector::Copy(isolate, feedback_vector);
|
||||
feedback_vector_ = FeedbackVector::Copy(isolate, feedback_vector);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ bool TypeFeedbackOracle::CallIsUninitialized(FeedbackVectorSlot slot) {
|
||||
Handle<Object> value = GetInfo(slot);
|
||||
return value->IsUndefined(isolate()) ||
|
||||
value.is_identical_to(
|
||||
TypeFeedbackVector::UninitializedSentinel(isolate()));
|
||||
FeedbackVector::UninitializedSentinel(isolate()));
|
||||
}
|
||||
|
||||
|
||||
@@ -127,8 +127,7 @@ bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) {
|
||||
|
||||
byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) {
|
||||
Handle<Object> value = GetInfo(feedback_vector_slot);
|
||||
return value.is_identical_to(
|
||||
TypeFeedbackVector::UninitializedSentinel(isolate()))
|
||||
return value.is_identical_to(FeedbackVector::UninitializedSentinel(isolate()))
|
||||
? ForInStatement::FAST_FOR_IN
|
||||
: ForInStatement::SLOW_FOR_IN;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -23,7 +23,7 @@ class StubCache;
|
||||
class TypeFeedbackOracle: public ZoneObject {
|
||||
public:
|
||||
TypeFeedbackOracle(Isolate* isolate, Zone* zone, Handle<Code> code,
|
||||
Handle<TypeFeedbackVector> feedback_vector,
|
||||
Handle<FeedbackVector> feedback_vector,
|
||||
Handle<Context> native_context);
|
||||
|
||||
InlineCacheState LoadInlineCacheState(FeedbackVectorSlot slot);
|
||||
@@ -124,7 +124,7 @@ class TypeFeedbackOracle: public ZoneObject {
|
||||
Isolate* isolate_;
|
||||
Zone* zone_;
|
||||
Handle<UnseededNumberDictionary> dictionary_;
|
||||
Handle<TypeFeedbackVector> feedback_vector_;
|
||||
Handle<FeedbackVector> feedback_vector_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
|
||||
};
|
||||
|
||||
Vendored
+3
-3
@@ -888,6 +888,9 @@
|
||||
'fast-accessor-assembler.h',
|
||||
'fast-dtoa.cc',
|
||||
'fast-dtoa.h',
|
||||
'feedback-vector-inl.h',
|
||||
'feedback-vector.cc',
|
||||
'feedback-vector.h',
|
||||
'field-index.h',
|
||||
'field-index-inl.h',
|
||||
'field-type.cc',
|
||||
@@ -1259,9 +1262,6 @@
|
||||
'transitions.cc',
|
||||
'transitions.h',
|
||||
'trap-handler/trap-handler.h',
|
||||
'type-feedback-vector-inl.h',
|
||||
'type-feedback-vector.cc',
|
||||
'type-feedback-vector.h',
|
||||
'type-hints.cc',
|
||||
'type-hints.h',
|
||||
'type-info.cc',
|
||||
|
||||
Vendored
+6
-7
@@ -1179,8 +1179,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if r11 is a WeakCell or a Symbol, but it's harmless to read
|
||||
// at this position in a symbol (see static asserts in
|
||||
// type-feedback-vector.h).
|
||||
// at this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
__ cmpp(rdi, FieldOperand(r11, WeakCell::kValueOffset));
|
||||
__ j(equal, &done, Label::kFar);
|
||||
@@ -1219,7 +1218,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// write-barrier is needed.
|
||||
__ bind(&megamorphic);
|
||||
__ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize),
|
||||
TypeFeedbackVector::MegamorphicSentinel(isolate));
|
||||
FeedbackVector::MegamorphicSentinel(isolate));
|
||||
__ jmp(&done);
|
||||
|
||||
// An uninitialized cache is patched with the function or sentinel to
|
||||
@@ -1361,7 +1360,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ bind(&extra_checks_or_miss);
|
||||
Label uninitialized, miss, not_allocation_site;
|
||||
|
||||
__ Cmp(rcx, TypeFeedbackVector::MegamorphicSentinel(isolate));
|
||||
__ Cmp(rcx, FeedbackVector::MegamorphicSentinel(isolate));
|
||||
__ j(equal, &call);
|
||||
|
||||
// Check if we have an allocation site.
|
||||
@@ -1380,7 +1379,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ jmp(&miss);
|
||||
}
|
||||
|
||||
__ Cmp(rcx, TypeFeedbackVector::UninitializedSentinel(isolate));
|
||||
__ Cmp(rcx, FeedbackVector::UninitializedSentinel(isolate));
|
||||
__ j(equal, &uninitialized);
|
||||
|
||||
// We are going megamorphic. If the feedback is a JSFunction, it is fine
|
||||
@@ -1389,7 +1388,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ CmpObjectType(rcx, JS_FUNCTION_TYPE, rcx);
|
||||
__ j(not_equal, &miss);
|
||||
__ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize),
|
||||
TypeFeedbackVector::MegamorphicSentinel(isolate));
|
||||
FeedbackVector::MegamorphicSentinel(isolate));
|
||||
|
||||
__ bind(&call);
|
||||
|
||||
@@ -2855,7 +2854,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(rbx);
|
||||
__ EmitLoadFeedbackVector(rbx);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -4374,8 +4374,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
movp(vector, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
movp(vector, FieldOperand(vector, JSFunction::kLiteralsOffset));
|
||||
movp(vector, FieldOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -1506,7 +1506,7 @@ class MacroAssembler: public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
Vendored
+6
-7
@@ -1123,8 +1123,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
// A monomorphic cache hit or an already megamorphic state: invoke the
|
||||
// function without changing the state.
|
||||
// We don't know if ecx is a WeakCell or a Symbol, but it's harmless to read
|
||||
// at this position in a symbol (see static asserts in
|
||||
// type-feedback-vector.h).
|
||||
// at this position in a symbol (see static asserts in feedback-vector.h).
|
||||
Label check_allocation_site;
|
||||
__ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset));
|
||||
__ j(equal, &done, Label::kFar);
|
||||
@@ -1163,7 +1162,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
||||
__ bind(&megamorphic);
|
||||
__ mov(
|
||||
FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ jmp(&done, Label::kFar);
|
||||
|
||||
// An uninitialized cache is patched with the function or sentinel to
|
||||
@@ -1312,7 +1311,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ bind(&extra_checks_or_miss);
|
||||
Label uninitialized, miss, not_allocation_site;
|
||||
|
||||
__ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ cmp(ecx, Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
__ j(equal, &call);
|
||||
|
||||
// Check if we have an allocation site.
|
||||
@@ -1331,7 +1330,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ jmp(&miss);
|
||||
}
|
||||
|
||||
__ cmp(ecx, Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
|
||||
__ cmp(ecx, Immediate(FeedbackVector::UninitializedSentinel(isolate)));
|
||||
__ j(equal, &uninitialized);
|
||||
|
||||
// We are going megamorphic. If the feedback is a JSFunction, it is fine
|
||||
@@ -1341,7 +1340,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
||||
__ j(not_equal, &miss);
|
||||
__ mov(
|
||||
FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize),
|
||||
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
|
||||
Immediate(FeedbackVector::MegamorphicSentinel(isolate)));
|
||||
|
||||
__ bind(&call);
|
||||
|
||||
@@ -2730,7 +2729,7 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
|
||||
__ EmitLoadTypeFeedbackVector(ebx);
|
||||
__ EmitLoadFeedbackVector(ebx);
|
||||
CallICStub stub(isolate(), state());
|
||||
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
+1
-2
@@ -966,8 +966,7 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
|
||||
void MacroAssembler::EmitLoadFeedbackVector(Register vector) {
|
||||
mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
mov(vector, FieldOperand(vector, JSFunction::kLiteralsOffset));
|
||||
mov(vector, FieldOperand(vector, LiteralsArray::kFeedbackVectorOffset));
|
||||
|
||||
+1
-1
@@ -840,7 +840,7 @@ class MacroAssembler: public Assembler {
|
||||
}
|
||||
|
||||
// Load the type feedback vector from a JavaScript frame.
|
||||
void EmitLoadTypeFeedbackVector(Register vector);
|
||||
void EmitLoadFeedbackVector(Register vector);
|
||||
|
||||
// Activation support.
|
||||
void EnterFrame(StackFrame::Type type);
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
// (disallowed) include: src/factory.h -> src/objects-inl.h
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "test/cctest/cctest.h"
|
||||
#include "test/cctest/compiler/value-helper.h"
|
||||
|
||||
|
||||
+3
-3
@@ -15,9 +15,9 @@
|
||||
#include "src/isolate.h"
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "test/cctest/cctest.h"
|
||||
|
||||
namespace v8 {
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@
|
||||
// (disallowed) include: src/factory.h -> src/objects-inl.h
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "test/cctest/compiler/function-tester.h"
|
||||
|
||||
namespace v8 {
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@
|
||||
// (disallowed) include: src/factory.h -> src/objects-inl.h
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "test/cctest/cctest.h"
|
||||
#include "test/cctest/heap/heap-tester.h"
|
||||
#include "test/cctest/heap/heap-utils.h"
|
||||
|
||||
+10
-11
@@ -3701,7 +3701,7 @@ TEST(IncrementalMarkingPreservesMonomorphicCallIC) {
|
||||
v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
|
||||
CcTest::global()->Get(ctx, v8_str("f")).ToLocalChecked())));
|
||||
|
||||
Handle<TypeFeedbackVector> feedback_vector(f->feedback_vector());
|
||||
Handle<FeedbackVector> feedback_vector(f->feedback_vector());
|
||||
FeedbackVectorHelper feedback_helper(feedback_vector);
|
||||
|
||||
int expected_slots = 2;
|
||||
@@ -3737,8 +3737,7 @@ static Code* FindFirstIC(Code* code, Code::Kind kind) {
|
||||
|
||||
static void CheckVectorIC(Handle<JSFunction> f, int slot_index,
|
||||
InlineCacheState desired_state) {
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
Handle<TypeFeedbackVector>(f->feedback_vector());
|
||||
Handle<FeedbackVector> vector = Handle<FeedbackVector>(f->feedback_vector());
|
||||
FeedbackVectorHelper helper(vector);
|
||||
FeedbackVectorSlot slot = helper.slot(slot_index);
|
||||
if (vector->GetKind(slot) == FeedbackVectorSlotKind::LOAD_IC) {
|
||||
@@ -3766,7 +3765,7 @@ TEST(IncrementalMarkingPreservesMonomorphicConstructor) {
|
||||
v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
|
||||
CcTest::global()->Get(ctx, v8_str("f")).ToLocalChecked())));
|
||||
|
||||
Handle<TypeFeedbackVector> vector(f->feedback_vector());
|
||||
Handle<FeedbackVector> vector(f->feedback_vector());
|
||||
CHECK(vector->Get(FeedbackVectorSlot(0))->IsWeakCell());
|
||||
|
||||
heap::SimulateIncrementalMarking(CcTest::heap());
|
||||
@@ -4297,8 +4296,8 @@ TEST(Regress513507) {
|
||||
if (!code->is_optimized_code()) return;
|
||||
}
|
||||
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
TypeFeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<FeedbackVector> vector =
|
||||
FeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<LiteralsArray> lit =
|
||||
LiteralsArray::New(isolate, vector, shared->num_literals());
|
||||
Handle<Context> context(isolate->context());
|
||||
@@ -4356,8 +4355,8 @@ TEST(Regress514122) {
|
||||
if (!code->is_optimized_code()) return;
|
||||
}
|
||||
|
||||
Handle<TypeFeedbackVector> vector =
|
||||
TypeFeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<FeedbackVector> vector =
|
||||
FeedbackVector::New(isolate, handle(shared->feedback_metadata()));
|
||||
Handle<LiteralsArray> lit =
|
||||
LiteralsArray::New(isolate, vector, shared->num_literals(), TENURED);
|
||||
Handle<Context> context(isolate->context());
|
||||
@@ -5132,8 +5131,8 @@ TEST(WeakFunctionInConstructor) {
|
||||
// We've determined the constructor in createObj has had it's weak cell
|
||||
// cleared. Now, verify that one additional call with a new function
|
||||
// allows monomorphicity.
|
||||
Handle<TypeFeedbackVector> feedback_vector = Handle<TypeFeedbackVector>(
|
||||
createObj->feedback_vector(), CcTest::i_isolate());
|
||||
Handle<FeedbackVector> feedback_vector =
|
||||
Handle<FeedbackVector>(createObj->feedback_vector(), CcTest::i_isolate());
|
||||
for (int i = 0; i < 20; i++) {
|
||||
Object* slot_value = feedback_vector->Get(FeedbackVectorSlot(0));
|
||||
CHECK(slot_value->IsWeakCell());
|
||||
@@ -5337,7 +5336,7 @@ void CheckIC(Handle<JSFunction> function, Code::Kind kind, int slot_index,
|
||||
InlineCacheState state) {
|
||||
if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC ||
|
||||
kind == Code::CALL_IC) {
|
||||
TypeFeedbackVector* vector = function->feedback_vector();
|
||||
FeedbackVector* vector = function->feedback_vector();
|
||||
FeedbackVectorSlot slot(slot_index);
|
||||
if (kind == Code::LOAD_IC) {
|
||||
LoadICNexus nexus(vector, slot);
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
// (disallowed) include: src/factory.h -> src/objects-inl.h
|
||||
#include "src/objects-inl.h"
|
||||
// FIXME(mstarzinger, marja): This is weird, but required because of the missing
|
||||
// (disallowed) include: src/type-feedback-vector.h ->
|
||||
// src/type-feedback-vector-inl.h
|
||||
#include "src/type-feedback-vector-inl.h"
|
||||
// (disallowed) include: src/feedback-vector.h ->
|
||||
// src/feedback-vector-inl.h
|
||||
#include "src/feedback-vector-inl.h"
|
||||
#include "test/cctest/cctest.h"
|
||||
#include "test/cctest/heap/heap-tester.h"
|
||||
#include "test/cctest/heap/heap-utils.h"
|
||||
|
||||
Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user