Skip to content

Commit

Permalink
deps: backport 3297130 from upstream V8
Browse files Browse the repository at this point in the history
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 <[email protected]>
    Reviewed-by: Michael Starzinger <[email protected]>
    Reviewed-by: Michael Stanton <[email protected]>
    Reviewed-by: Jaroslav Sevcik <[email protected]>
    Reviewed-by: Yang Guo <[email protected]>
    Reviewed-by: Hannes Payer <[email protected]>
    Cr-Commit-Position: refs/heads/master@{nodejs#42999}

Refs: nodejs/v8#4
PR-URL: nodejs#11752
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
  • Loading branch information
targos committed Mar 25, 2017
1 parent 07088e6 commit 9c9e2d7
Show file tree
Hide file tree
Showing 123 changed files with 846 additions and 928 deletions.
6 changes: 3 additions & 3 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/arm/code-stubs-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions deps/v8/src/arm/macro-assembler-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/arm/macro-assembler-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/arm64/code-stubs-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions deps/v8/src/arm64/macro-assembler-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/arm64/macro-assembler-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/ast/context-slot-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/builtins/arm/builtins-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/arm64/builtins-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/ia32/builtins-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/builtins/mips/builtins-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/builtins/mips64/builtins-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/ppc/builtins-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/s390/builtins-s390.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions deps/v8/src/builtins/x64/builtins-x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/x87/builtins-x87.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 4 additions & 6 deletions deps/v8/src/code-stub-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
5 changes: 2 additions & 3 deletions deps/v8/src/code-stub-assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 9c9e2d7

Please sign in to comment.