[cleanup][interpreter] Fix kPointerSize usages in src/interpreter/
Bug: v8:8477, v8:8562 Change-Id: Id97f5b53fe6e6a696d8955acc1ab1bc5ac2f4052 Reviewed-on: https://chromium-review.googlesource.com/c/1388527 Commit-Queue: Igor Sheludko <ishell@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#58474}
This commit is contained in:
parent
4a44cf83b0
commit
2a6b9fe2da
@ -1890,18 +1890,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
|
||||
Variable* var_numeric,
|
||||
Variable* var_feedback);
|
||||
|
||||
// TODO(ishell): drop this version once all usages are fixed.
|
||||
TNode<WordT> TimesPointerSize(SloppyTNode<WordT> value) {
|
||||
STATIC_ASSERT(kTaggedSize == kSystemPointerSize);
|
||||
return TimesSystemPointerSize(value);
|
||||
}
|
||||
TNode<IntPtrT> TimesPointerSize(TNode<IntPtrT> value) {
|
||||
return Signed(TimesPointerSize(implicit_cast<TNode<WordT>>(value)));
|
||||
}
|
||||
TNode<UintPtrT> TimesPointerSize(TNode<UintPtrT> value) {
|
||||
return Unsigned(TimesPointerSize(implicit_cast<TNode<WordT>>(value)));
|
||||
}
|
||||
|
||||
TNode<WordT> TimesSystemPointerSize(SloppyTNode<WordT> value);
|
||||
TNode<IntPtrT> TimesSystemPointerSize(TNode<IntPtrT> value) {
|
||||
return Signed(TimesSystemPointerSize(implicit_cast<TNode<WordT>>(value)));
|
||||
|
@ -42,7 +42,7 @@ Handle<BytecodeArray> BytecodeArrayWriter::ToBytecodeArray(
|
||||
DCHECK_EQ(0, unbound_jumps_);
|
||||
|
||||
int bytecode_size = static_cast<int>(bytecodes()->size());
|
||||
int frame_size = register_count * kPointerSize;
|
||||
int frame_size = register_count * kSystemPointerSize;
|
||||
Handle<FixedArray> constant_pool =
|
||||
constant_array_builder()->ToFixedArray(isolate);
|
||||
Handle<ByteArray> source_position_table =
|
||||
|
@ -11,27 +11,27 @@ namespace interpreter {
|
||||
static const int kLastParamRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
InterpreterFrameConstants::kLastParamFromFp) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
static const int kFunctionClosureRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
StandardFrameConstants::kFunctionOffset) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
static const int kCurrentContextRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
StandardFrameConstants::kContextOffset) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
static const int kBytecodeArrayRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
InterpreterFrameConstants::kBytecodeArrayFromFp) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
static const int kBytecodeOffsetRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
InterpreterFrameConstants::kBytecodeOffsetFromFp) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
static const int kCallerPCOffsetRegisterIndex =
|
||||
(InterpreterFrameConstants::kRegisterFileFromFp -
|
||||
InterpreterFrameConstants::kCallerPCOffsetFromFp) /
|
||||
kPointerSize;
|
||||
kSystemPointerSize;
|
||||
|
||||
Register Register::FromParameterIndex(int index, int parameter_count) {
|
||||
DCHECK_GE(index, 0);
|
||||
|
@ -91,7 +91,7 @@ class V8_EXPORT_PRIVATE Register final {
|
||||
|
||||
static const int kInvalidIndex = kMaxInt;
|
||||
static const int kRegisterFileStartOffset =
|
||||
InterpreterFrameConstants::kRegisterFileFromFp / kPointerSize;
|
||||
InterpreterFrameConstants::kRegisterFileFromFp / kSystemPointerSize;
|
||||
|
||||
int index_;
|
||||
};
|
||||
|
@ -232,7 +232,7 @@ Node* InterpreterAssembler::RegisterLocation(Register reg) {
|
||||
}
|
||||
|
||||
Node* InterpreterAssembler::RegisterFrameOffset(Node* index) {
|
||||
return TimesPointerSize(index);
|
||||
return TimesSystemPointerSize(index);
|
||||
}
|
||||
|
||||
Node* InterpreterAssembler::LoadRegister(Node* reg_index) {
|
||||
@ -242,12 +242,12 @@ Node* InterpreterAssembler::LoadRegister(Node* reg_index) {
|
||||
|
||||
Node* InterpreterAssembler::LoadRegister(Register reg) {
|
||||
return Load(MachineType::AnyTagged(), GetInterpretedFramePointer(),
|
||||
IntPtrConstant(reg.ToOperand() << kPointerSizeLog2));
|
||||
IntPtrConstant(reg.ToOperand() << kSystemPointerSizeLog2));
|
||||
}
|
||||
|
||||
Node* InterpreterAssembler::LoadAndUntagRegister(Register reg) {
|
||||
return LoadAndUntagSmi(GetInterpretedFramePointer(), reg.ToOperand()
|
||||
<< kPointerSizeLog2);
|
||||
return LoadAndUntagSmi(GetInterpretedFramePointer(),
|
||||
reg.ToOperand() << kSystemPointerSizeLog2);
|
||||
}
|
||||
|
||||
Node* InterpreterAssembler::LoadRegisterAtOperandIndex(int operand_index) {
|
||||
@ -298,7 +298,7 @@ Node* InterpreterAssembler::RegisterLocationInRegisterList(
|
||||
void InterpreterAssembler::StoreRegister(Node* value, Register reg) {
|
||||
StoreNoWriteBarrier(
|
||||
MachineRepresentation::kTagged, GetInterpretedFramePointer(),
|
||||
IntPtrConstant(reg.ToOperand() << kPointerSizeLog2), value);
|
||||
IntPtrConstant(reg.ToOperand() << kSystemPointerSizeLog2), value);
|
||||
}
|
||||
|
||||
void InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
|
||||
@ -308,7 +308,7 @@ void InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
|
||||
}
|
||||
|
||||
void InterpreterAssembler::StoreAndTagRegister(Node* value, Register reg) {
|
||||
int offset = reg.ToOperand() << kPointerSizeLog2;
|
||||
int offset = reg.ToOperand() << kSystemPointerSizeLog2;
|
||||
StoreAndTagSmi(GetInterpretedFramePointer(), offset, value);
|
||||
}
|
||||
|
||||
@ -710,7 +710,7 @@ void InterpreterAssembler::IncrementCallCount(Node* feedback_vector,
|
||||
Node* slot_id) {
|
||||
Comment("increment call count");
|
||||
TNode<Smi> call_count =
|
||||
CAST(LoadFeedbackVectorSlot(feedback_vector, slot_id, kPointerSize));
|
||||
CAST(LoadFeedbackVectorSlot(feedback_vector, slot_id, kTaggedSize));
|
||||
// The lowest {FeedbackNexus::CallCountField::kShift} bits of the call
|
||||
// count are used as flags. To increment the call count by 1 we hence
|
||||
// have to increment by 1 << {FeedbackNexus::CallCountField::kShift}.
|
||||
@ -718,7 +718,7 @@ void InterpreterAssembler::IncrementCallCount(Node* feedback_vector,
|
||||
call_count, SmiConstant(1 << FeedbackNexus::CallCountField::kShift));
|
||||
// Count is Smi, so we don't need a write barrier.
|
||||
StoreFeedbackVectorSlot(feedback_vector, slot_id, new_count,
|
||||
SKIP_WRITE_BARRIER, kPointerSize);
|
||||
SKIP_WRITE_BARRIER, kTaggedSize);
|
||||
}
|
||||
|
||||
void InterpreterAssembler::CollectCallableFeedback(Node* target, Node* context,
|
||||
@ -1419,7 +1419,7 @@ Node* InterpreterAssembler::DispatchToBytecode(Node* target_bytecode,
|
||||
|
||||
Node* target_code_entry =
|
||||
Load(MachineType::Pointer(), DispatchTableRawPointer(),
|
||||
TimesPointerSize(target_bytecode));
|
||||
TimesSystemPointerSize(target_bytecode));
|
||||
|
||||
return DispatchToBytecodeHandlerEntry(target_code_entry, new_bytecode_offset,
|
||||
target_bytecode);
|
||||
@ -1476,7 +1476,7 @@ void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {
|
||||
Node* target_index = IntPtrAdd(base_index, next_bytecode);
|
||||
Node* target_code_entry =
|
||||
Load(MachineType::Pointer(), DispatchTableRawPointer(),
|
||||
TimesPointerSize(target_index));
|
||||
TimesSystemPointerSize(target_index));
|
||||
|
||||
DispatchToBytecodeHandlerEntry(target_code_entry, next_bytecode_offset,
|
||||
next_bytecode);
|
||||
@ -1563,8 +1563,8 @@ void InterpreterAssembler::TraceBytecodeDispatch(Node* target_bytecode) {
|
||||
Node* source_bytecode_table_index = IntPtrConstant(
|
||||
static_cast<int>(bytecode_) * (static_cast<int>(Bytecode::kLast) + 1));
|
||||
|
||||
Node* counter_offset =
|
||||
TimesPointerSize(IntPtrAdd(source_bytecode_table_index, target_bytecode));
|
||||
Node* counter_offset = TimesSystemPointerSize(
|
||||
IntPtrAdd(source_bytecode_table_index, target_bytecode));
|
||||
Node* old_counter =
|
||||
Load(MachineType::IntPtr(), counters_table, counter_offset);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user