Commit e838e75e authored by Creddy's avatar Creddy Committed by Commit Bot

[CSA] Typing LoadFeedbackVector

Bug: v8:7796
Change-Id: If5e40fa943798cdc0d7dbdc640750c7b7ad4439b
Reviewed-on: https://chromium-review.googlesource.com/1087957
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53579}
parent c5ba2a60
...@@ -17,6 +17,8 @@ namespace internal { ...@@ -17,6 +17,8 @@ namespace internal {
using compiler::Node; using compiler::Node;
template <class T> template <class T>
using TNode = compiler::TNode<T>; using TNode = compiler::TNode<T>;
template <class T>
using SloppyTNode = compiler::SloppyTNode<T>;
CodeStubAssembler::CodeStubAssembler(compiler::CodeAssemblerState* state) CodeStubAssembler::CodeStubAssembler(compiler::CodeAssemblerState* state)
: compiler::CodeAssembler(state) { : compiler::CodeAssembler(state) {
...@@ -8505,16 +8507,16 @@ TNode<BoolT> CodeStubAssembler::IsOffsetInBounds(SloppyTNode<IntPtrT> offset, ...@@ -8505,16 +8507,16 @@ TNode<BoolT> CodeStubAssembler::IsOffsetInBounds(SloppyTNode<IntPtrT> offset,
return IntPtrLessThanOrEqual(offset, last_offset); return IntPtrLessThanOrEqual(offset, last_offset);
} }
Node* CodeStubAssembler::LoadFeedbackVector(Node* closure) { TNode<FeedbackVector> CodeStubAssembler::LoadFeedbackVector(
Node* feedback_cell = SloppyTNode<JSFunction> closure) {
LoadObjectField(closure, JSFunction::kFeedbackCellOffset); TNode<FeedbackCell> feedback_cell =
CSA_ASSERT(this, IsFeedbackCell(feedback_cell)); CAST(LoadObjectField(closure, JSFunction::kFeedbackCellOffset));
return LoadObjectField(feedback_cell, FeedbackCell::kValueOffset); return CAST(LoadObjectField(feedback_cell, FeedbackCell::kValueOffset));
} }
Node* CodeStubAssembler::LoadFeedbackVectorForStub() { TNode<FeedbackVector> CodeStubAssembler::LoadFeedbackVectorForStub() {
Node* function = TNode<JSFunction> function =
LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset); CAST(LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset));
return LoadFeedbackVector(function); return LoadFeedbackVector(function);
} }
......
...@@ -2209,10 +2209,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -2209,10 +2209,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* OrdinaryHasInstance(Node* context, Node* callable, Node* object); Node* OrdinaryHasInstance(Node* context, Node* callable, Node* object);
// Load type feedback vector from the stub caller's frame. // Load type feedback vector from the stub caller's frame.
Node* LoadFeedbackVectorForStub(); TNode<FeedbackVector> LoadFeedbackVectorForStub();
// Load type feedback vector for the given closure. // Load type feedback vector for the given closure.
Node* LoadFeedbackVector(Node* closure); TNode<FeedbackVector> LoadFeedbackVector(SloppyTNode<JSFunction> closure);
// Update the type feedback vector. // Update the type feedback vector.
void UpdateFeedback(Node* feedback, Node* feedback_vector, Node* slot_id); void UpdateFeedback(Node* feedback, Node* feedback_vector, Node* slot_id);
...@@ -2717,8 +2717,9 @@ class CodeStubArguments { ...@@ -2717,8 +2717,9 @@ class CodeStubArguments {
// Iteration doesn't include the receiver. |first| and |last| are zero-based. // Iteration doesn't include the receiver. |first| and |last| are zero-based.
void ForEach(const ForEachBodyFunction& body, Node* first = nullptr, void ForEach(const ForEachBodyFunction& body, Node* first = nullptr,
Node* last = nullptr, CodeStubAssembler::ParameterMode mode = Node* last = nullptr,
CodeStubAssembler::INTPTR_PARAMETERS) { CodeStubAssembler::ParameterMode mode =
CodeStubAssembler::INTPTR_PARAMETERS) {
CodeStubAssembler::VariableList list(0, assembler_->zone()); CodeStubAssembler::VariableList list(0, assembler_->zone());
ForEach(list, body, first, last); ForEach(list, body, first, last);
} }
...@@ -2726,8 +2727,9 @@ class CodeStubArguments { ...@@ -2726,8 +2727,9 @@ class CodeStubArguments {
// Iteration doesn't include the receiver. |first| and |last| are zero-based. // Iteration doesn't include the receiver. |first| and |last| are zero-based.
void ForEach(const CodeStubAssembler::VariableList& vars, void ForEach(const CodeStubAssembler::VariableList& vars,
const ForEachBodyFunction& body, Node* first = nullptr, const ForEachBodyFunction& body, Node* first = nullptr,
Node* last = nullptr, CodeStubAssembler::ParameterMode mode = Node* last = nullptr,
CodeStubAssembler::INTPTR_PARAMETERS); CodeStubAssembler::ParameterMode mode =
CodeStubAssembler::INTPTR_PARAMETERS);
void PopAndReturn(Node* value); void PopAndReturn(Node* value);
......
...@@ -23,6 +23,8 @@ namespace interpreter { ...@@ -23,6 +23,8 @@ namespace interpreter {
using compiler::CodeAssemblerState; using compiler::CodeAssemblerState;
using compiler::Node; using compiler::Node;
template <class T>
using TNode = compiler::TNode<T>;
InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state, InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
Bytecode bytecode, Bytecode bytecode,
...@@ -667,8 +669,8 @@ Node* InterpreterAssembler::LoadAndUntagConstantPoolEntryAtOperandIndex( ...@@ -667,8 +669,8 @@ Node* InterpreterAssembler::LoadAndUntagConstantPoolEntryAtOperandIndex(
return SmiUntag(LoadConstantPoolEntryAtOperandIndex(operand_index)); return SmiUntag(LoadConstantPoolEntryAtOperandIndex(operand_index));
} }
Node* InterpreterAssembler::LoadFeedbackVector() { TNode<FeedbackVector> InterpreterAssembler::LoadFeedbackVector() {
Node* function = LoadRegister(Register::function_closure()); TNode<JSFunction> function = CAST(LoadRegister(Register::function_closure()));
return CodeStubAssembler::LoadFeedbackVector(function); return CodeStubAssembler::LoadFeedbackVector(function);
} }
......
...@@ -145,7 +145,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { ...@@ -145,7 +145,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
compiler::Node* LoadAndUntagConstantPoolEntry(compiler::Node* index); compiler::Node* LoadAndUntagConstantPoolEntry(compiler::Node* index);
// Load the FeedbackVector for the current function. // Load the FeedbackVector for the current function.
compiler::Node* LoadFeedbackVector(); compiler::TNode<FeedbackVector> LoadFeedbackVector();
// Increment the call count for a CALL_IC or construct call. // Increment the call count for a CALL_IC or construct call.
// The call count is located at feedback_vector[slot_id + 1]. // The call count is located at feedback_vector[slot_id + 1].
......
...@@ -154,7 +154,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -154,7 +154,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
void LdaGlobal(int slot_operand_index, int name_operand_index, void LdaGlobal(int slot_operand_index, int name_operand_index,
TypeofMode typeof_mode) { TypeofMode typeof_mode) {
TNode<FeedbackVector> feedback_vector = CAST(LoadFeedbackVector()); TNode<FeedbackVector> feedback_vector = LoadFeedbackVector();
Node* feedback_slot = BytecodeOperandIdx(slot_operand_index); Node* feedback_slot = BytecodeOperandIdx(slot_operand_index);
AccessorAssembler accessor_asm(state()); AccessorAssembler accessor_asm(state());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment